Method, device and equipment for quickly positioning multiple targets before mounting and medium
By clustering and fitting the theoretical position information of the target, the camera's motion trajectory is planned, and the position error is compensated in real time. This solves the problems of insufficient efficiency and accuracy in existing multi-target localization methods, and achieves efficient and accurate multi-target localization.
Patent Information
- Application Number
- CN202511728025.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-21
- Publication Date
- 2026-02-24
AI Technical Summary
Existing multi-target localization methods struggle to balance efficiency and accuracy, especially as the number of targets increases, leading to decreased efficiency. Furthermore, they impose strict requirements on the arrangement of targets, making them unsuitable for complex application scenarios.
By clustering and fitting the theoretical position information of the target, the camera's motion trajectory is planned, the target is identified using the image information acquired by the camera, and the position error is compensated in real time to achieve a non-reversible motion path.
While ensuring positioning accuracy, it significantly improves positioning efficiency, adapts to any target distribution, shortens movement distance, and meets the needs of high-speed production.
Smart Images

Figure CN121564084A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of visual positioning technology, specifically to a method, apparatus, equipment, and medium for rapid positioning of multiple targets before mounting. Background Technology
[0002] With the rapid development of industrial automation technology, machine vision positioning technology has been widely used in various industrial production scenarios due to its advantages such as non-contact operation, high precision, and high degree of automation. As an important means of machine vision positioning technology, multi-target positioning has the core requirement of quickly and accurately acquiring the actual position information of multiple discrete targets within the same working area, providing reference position information for subsequent automated operations (such as placement, assembly, sorting, etc.).
[0003] Currently, the mainstream multi-target positioning method in the industrial field is the point-by-point stop-and-photograph positioning method. Based on the point-by-point stop-and-photograph positioning method, various other multi-target positioning methods have been derived, such as the area scanning positioning method and the parallel multi-camera positioning method.
[0004] However, current multi-target positioning methods before mounting are limited by point-to-point movement and stationary photography modes, making them difficult to meet the demands of high-speed production. Furthermore, the efficiency of point-to-point positioning decreases linearly with the number of targets; the more targets there are, the more pronounced the efficiency disadvantage becomes. Simultaneously, there are strict requirements for the coordinate arrangement of the targets, typically requiring them to be distributed in straight lines or a regular grid. Otherwise, the movement path increases significantly, further reducing efficiency. This results in the current multi-target positioning methods having weak adaptability and being unable to cope with complex application scenarios.
[0005] Therefore, how to improve a multi-target localization method that is both efficient and accurate is an important issue that the industry urgently needs to address. Summary of the Invention
[0006] In view of this, embodiments of the present invention provide a method, apparatus, device and medium for rapid positioning of multiple targets before mounting, in order to solve the problem that current multi-target positioning methods are difficult to balance high efficiency and high accuracy.
[0007] According to a first aspect, embodiments of the present invention provide a method for rapid positioning of multiple targets before mounting, the method comprising: Obtain the theoretical location information of all targets; The theoretical position information is sorted according to a preset sorting direction. The absolute value of the gradient between two adjacent theoretical position information is obtained in the preset sorting direction. The sorted theoretical position information is then clustered and grouped according to the absolute value of the gradient to obtain several target groups. Each target group contains the theoretical position information of at least one target. Based on the theoretical location information of all target groups, straight line fitting is performed to obtain the path straight line for each target group. Substitute the theoretical position information of each target into the path line of the corresponding target group to obtain the trigger position information of each target. The coordinate difference between the trigger position information and the theoretical position information is used to obtain the theoretical difference of each target. The trigger position information is the physical position information of the target triggered to take pictures during the camera movement. The camera's motion trajectory is planned according to the straight path of each target group, the camera is controlled to move along the motion trajectory, and the camera is used to collect image information of each trigger position. Target recognition is performed on all image information to determine the image difference of each target in the image. The theoretical difference and image difference of each target are superimposed on the theoretical location information to obtain the actual location information of each target.
[0008] In conjunction with the first aspect, in the first embodiment of the first aspect, the step of sorting the theoretical position information according to a preset sorting direction, obtaining the absolute value of the gradient between two adjacent theoretical position information in the preset sorting direction, and clustering the sorted theoretical position information according to the absolute value of the gradient to obtain several target groups specifically includes: Determine the preset sorting direction; Sort all theoretical position information in ascending order according to the preset sorting direction; When it is determined that there are multiple theoretical position information with equal coordinate values in a preset sorting direction, the multiple theoretical position information with equal coordinate values are sorted in ascending order according to the direction perpendicular to the preset sorting direction; Determine the absolute value of the gradient of two adjacent theoretical positions in the preset sorting direction after sorting; The grouping boundaries are determined based on the preset clustering threshold and the absolute value of the gradient, and the sorted theoretical location information is divided into several target groups according to the grouping boundaries.
[0009] In conjunction with the first embodiment of the first aspect, in the second embodiment of the first aspect, if the preset sorting direction is the X-axis direction, the formula for calculating the absolute value of the gradient is: in, Represents the absolute value of the gradient; Indicates the sorted order of the first... X-axis coordinates of a theoretical location; Indicates the sorted order of the first... The X-axis coordinates of the theoretical position information.
[0010] In conjunction with the first embodiment of the first aspect, in the third embodiment of the first aspect, the step of determining the grouping boundary based on a preset clustering threshold and the absolute value of the gradient, and dividing the sorted theoretical position information into several target groups based on the grouping boundary, specifically includes: Iterate through the absolute values of gradients and use the two adjacent theoretical positions where the absolute value of the gradient exceeds the preset clustering threshold as the grouping boundary. Based on the grouping boundaries, the sorted theoretical location information will be divided into several target groups.
[0011] In conjunction with the first aspect, in the fourth embodiment of the first aspect, the step of performing straight line fitting based on all theoretical position information within the target group to obtain the path straight line for each target group specifically includes: Sort all theoretical position information within each target group in ascending order according to the vertical direction of the preset sorting direction; Determine the starting and ending positions of each sorted target group; Determine the target group number, and swap the start and end positions of the even-numbered target groups; Based on all theoretical position information within the target group, a straight line is fitted to obtain the path straight line for each target group. Determine the distance error from each theoretical location within the target group to the corresponding straight line of the target group. Collect all distances to obtain the total distance error. Determine the average distance error of the target group based on the total distance. Adjust the straight line of the path based on the average distance error.
[0012] In conjunction with the first aspect, in the fifth embodiment of the first aspect, the step of substituting the theoretical position information of each target into the path line of the corresponding target group to obtain the trigger position information of each target, and obtaining the coordinate difference between the trigger position information and the theoretical position information to obtain the theoretical difference of each target, specifically includes: Based on the preset sorting direction, determine the trigger position information of each theoretical position information in the target group on the corresponding straight path of the target group; Calculate the coordinate difference between the trigger location information and the theoretical location information of each target to obtain the theoretical difference for each target.
[0013] In conjunction with the fourth embodiment of the first aspect, in the sixth embodiment of the first aspect, the step of planning the camera's motion trajectory according to the path straight line of each target group, controlling the camera to move along the motion trajectory, and using the camera to collect image information of each trigger position, performing target recognition on all image information, and determining the image difference of each target in the image, specifically includes: The starting and ending positions of the target group are used as path nodes, and the node order between path nodes is determined according to the numbering order of the target group. By connecting each path node in sequence according to the node order and using straight lines, the motion trajectory of the camera can be obtained. Control the camera to move along the motion trajectory, and trigger the camera to take a picture when the camera reaches each trigger position information to obtain image information of each target; All image information is preprocessed to identify the actual center position of the target corresponding to the image information, and the coordinate difference between the actual center position and the image center position of the image information is determined to obtain the image difference of each target.
[0014] According to a second aspect, embodiments of the present invention also provide a rapid positioning device for multiple targets before mounting, the device comprising: The location acquisition module is used to acquire the theoretical location information of all targets; The location grouping module is used to sort the theoretical location information according to a preset sorting direction, obtain the absolute value of the gradient between two adjacent theoretical location information in the preset sorting direction, and cluster the sorted theoretical location information according to the absolute value of the gradient to obtain several target groups; each target group contains the theoretical location information of at least one target. The line fitting module is used to perform line fitting based on all theoretical position information within the target group, and to obtain the path line for each target group. The trigger determination module is used to substitute the theoretical position information of each target into the path line of the corresponding target group to obtain the trigger position information of each target. The coordinate difference between the trigger position information and the theoretical position information is used to obtain the theoretical difference of each target. The trigger position information is the physical position information of the target triggered to take pictures during the camera movement. The image acquisition module is used to plan the camera's motion trajectory based on the straight path of each target group, control the camera to move along the motion trajectory, and use the camera to acquire image information of each trigger position. Target recognition is performed on all image information to determine the image difference of each target in the image. The target localization module is used to superimpose the theoretical difference and image difference of each target onto the theoretical position information to obtain the actual position information of each target.
[0015] According to a third aspect, embodiments of the present invention also provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the rapid positioning method for multiple targets before mounting as described above.
[0016] According to a fourth aspect, embodiments of the present invention also provide a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the rapid positioning method for multiple targets before mounting as described above.
[0017] The present invention provides a method, apparatus, device, and medium for rapid multi-target positioning before mounting. By clustering and grouping the theoretical position information of targets and fitting straight lines, it eliminates the need for multiple targets to be arranged according to rules. Regardless of whether the targets are irregularly discrete, densely distributed, or sparsely distributed, clustering can form approximately linear target groups, thereby planning the camera's motion path. This adapts to targets with arbitrary distributions, overcoming the strict limitations of existing multi-target positioning methods on target arrangement and significantly expanding the applicable scenarios. The theoretical position information is sorted according to a preset sorting direction, and the absolute value of the gradient between two adjacent theoretical position information points along the preset sorting direction is obtained. The sorted theoretical position information is then clustered based on the absolute value of the gradient to obtain several target groups. A path straight line is then fitted based on the theoretical position information within each target group, ensuring that the fitted line accurately represents the target distribution trend and that the theoretical difference calculation is accurate. The camera's motion trajectory is planned based on the path straight line of each target group, and the camera is controlled along the path. The system moves along a trajectory and uses a camera to capture images of each triggered location. Target identification is performed on all images to determine the image difference of each target, forming a non-reversible motion trajectory. Adjacent path nodes are connected by straight lines, and the motion platform moves in a linear motion. Unlike current point-to-point positioning methods that require sequentially taking pictures according to the theoretical position information of each target, this significantly shortens the total running distance of the motion platform and improves positioning efficiency. The theoretical difference and image difference of each target are superimposed on the theoretical position information to obtain the actual position information of each target. This effectively compensates for various error sources without the need for additional hardware. Rapid multi-target positioning can be achieved solely through software algorithm optimization. Through clustering, linear fitting, trajectory planning, and real-time position compensation, positioning efficiency is greatly improved while maintaining positioning accuracy, ensuring both efficiency and accuracy, and meeting the positioning requirements before mounting microelectronic components. Attached Figure Description
[0018] The features and advantages of the invention will be more clearly understood by referring to the accompanying drawings, which are schematic and should not be construed as limiting the invention in any way. In the drawings: Figure 1 A flowchart illustrating the rapid positioning method for multiple targets before mounting provided by the present invention is shown. Figure 2 This diagram illustrates the theoretical position information of multiple irregular targets in the rapid positioning method for multiple targets before mounting provided by the present invention. Figure 3 The diagram illustrates the rapid multi-target localization method before mounting provided by the present invention after clustering and grouping multiple targets; Figure 4This diagram illustrates the path straight lines fitted to each target group in the rapid positioning method for multiple targets before mounting provided by the present invention. Figure 5 This diagram illustrates the calculation of the coordinate difference of each target in the rapid positioning method for multiple targets before mounting provided by the present invention. Figure 6 This diagram illustrates the planned camera motion trajectory in the rapid positioning method for multiple targets before mounting provided by the present invention. Figure 7 A schematic diagram of the structure of the rapid positioning device for multiple targets before mounting provided by the present invention is shown; Figure 8 A schematic diagram of the hardware structure of the electronic device provided by the present invention is shown. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0020] With the rapid development of industrial automation technology, machine vision positioning technology has been widely used in various industrial production scenarios due to its advantages such as non-contact operation, high precision, and high degree of automation. As an important means of machine vision positioning technology, multi-target positioning has the core requirement of quickly and accurately acquiring the actual position information of multiple discrete targets within the same working area, providing reference position information for subsequent automated operations (such as placement, assembly, sorting, etc.).
[0021] Currently, the mainstream multi-target localization method in the industrial field is the point-by-point stopping and photographing localization method, and its specific implementation is as follows: 1) Obtain the theoretical coordinates of all targets, and number and sort the targets according to a preset order (such as from left to right, from top to bottom) to form a coordinate sequence for point-by-point visits; 2) The motion control platform (such as a multi-axis linear motor platform) drives the camera to move to the theoretical coordinate position of the first target. During the movement, the camera is in standby mode. 3) When the camera reaches the theoretical coordinates of the first target, the motion platform stops moving, the camera stays for a preset time to achieve stable shooting, and then the camera's shooting function is triggered to collect image information of the first target. 4) Perform various preprocessing steps on the acquired image information (such as template matching, edge detection, etc.), identify the coordinate difference between the actual center position of the target and the center of the image, and calculate the coordinate difference between the actual position of the target and the theoretical coordinates in combination with the camera calibration parameters. 5) Overlay the deviation value onto the theoretical coordinate position to obtain the actual position information of the first target, and store this actual position information; 6) Repeat the above steps to move to the theoretical coordinates of each target in turn, and complete the positioning of all targets.
[0022] Based on the point-to-point stop-and-shoot positioning method, various multi-target positioning methods have been derived, such as the area scanning positioning method and the parallel multi-camera positioning method. The area scanning positioning method controls the camera to perform at least one large-scale area scan of the entire target area, acquiring panoramic images containing all targets. Then, through image segmentation, target recognition, etc., the position information of all targets is identified from the panoramic image. The parallel multi-camera positioning method involves multiple cameras acquiring images in parallel, with each camera responsible for the target positioning of a region or a target.
[0023] However, current multi-target positioning methods before mounting are limited by point-to-point movement and stop-and-shoot modes. The camera needs to move back and forth between targets, and when the number of targets is large, the dwell time increases the total time, making it difficult to meet the demands of high-speed production. Furthermore, the efficiency of point-to-point positioning decreases linearly with the number of targets; the more targets there are, the more pronounced the efficiency disadvantage becomes. Simultaneously, there are strict requirements for the coordinate arrangement of the targets, which typically need to be distributed in straight lines or a regular grid. Otherwise, the movement path will increase significantly, further reducing efficiency. This results in the current multi-target positioning methods having weak adaptability and being unable to cope with complex application scenarios. Currently, industrial production has increasingly higher requirements for multi-target positioning. Increased production line capacity demands further improvements in positioning efficiency. In addition, product miniaturization and precision require higher positioning accuracy and the ability to adapt to target coordinate distributions. The aforementioned multi-target positioning methods can no longer meet the needs of industrial production.
[0024] In conclusion, how to provide a multi-target localization method that is both efficient and accurate is an important issue that the industry urgently needs to address.
[0025] To address the aforementioned issues, this specification provides a rapid multi-target positioning method before mounting. This method aims to significantly improve positioning efficiency while maintaining positioning accuracy through clustering, linear fitting, trajectory planning, and real-time position compensation. The rapid multi-target positioning method provided in this specification can be applied to electronic devices, including laptops, desktop computers, smartphones, smart wearable devices, and tablets. Furthermore, the rapid multi-target positioning method provided in this specification can also be applied to applications running on the aforementioned electronic devices. Figure 1 This is a flowchart illustrating a rapid multi-target positioning method before mounting according to an embodiment of the present invention, as shown below. Figure 1 As shown, the method may include the following steps: S101. Obtain the theoretical location information of all targets.
[0026] Theoretical location information can be pre-stored in the electronic device or acquired by the electronic device from external sources. For example, it can be acquired by the electronic device from external acquisition devices or extracted from external video, etc.
[0027] There are no restrictions on the specific form of obtaining the theoretical location information, as long as the electronic device can obtain the theoretical location information.
[0028] S102. Sort the theoretical position information according to a preset sorting direction, obtain the absolute value of the gradient between two adjacent theoretical position information in the preset sorting direction, and cluster the sorted theoretical position information according to the absolute value of the gradient to obtain several target groups. Each target group contains the theoretical position information of at least one target.
[0029] The theoretical location information of a large number of discrete targets is divided into several target groups according to the spatial distribution density, so that the theoretical location information in each target group has the characteristics of an approximately linear distribution, which provides a basis for subsequent line fitting.
[0030] S103. Perform straight line fitting based on all theoretical position information within the target group to obtain the path straight line for each target group.
[0031] Linear fitting based on target groups can fit a straight path for each target group. This straight path can characterize the spatial distribution trend of all targets within the group, providing a benchmark for camera motion path planning and trigger position calculation.
[0032] S104. Substitute the theoretical position information of each target into the path line of the corresponding target group to obtain the trigger position information of each target. The coordinate difference between the trigger position information and the theoretical position information is used to obtain the theoretical difference of each target.
[0033] In this embodiment, the trigger position information is the physical position information of the target triggered during camera movement, and the theoretical difference is the coordinate difference between the trigger position information and the theoretical position information of the target. Both the trigger position information and the theoretical position information participate in the subsequent position compensation.
[0034] In this embodiment, the theoretical location information, trigger location information, and theoretical difference of each target can also be stored in a preset database to form a list of theoretical location information, trigger location information, and theoretical difference, providing data support for subsequent camera-triggered photography and position compensation.
[0035] S105. Plan the camera's motion trajectory according to the straight path of each target group, control the camera to move along the motion trajectory, and use the camera to collect image information of each trigger position. Perform target recognition on all image information and determine the image difference of each target in the image.
[0036] By planning the camera's motion trajectory, continuous motion and trigger-to-take-a-shot mode can be achieved during multi-target localization. This allows the camera to traverse the trigger position information of all target groups along the shortest path, avoiding backtracking. Furthermore, the camera accurately triggers a shot at each trigger position information during the motion without stopping, significantly improving localization efficiency.
[0037] In this embodiment, the image difference of each target can also be stored in a preset database and associated with the corresponding theoretical location information and theoretical difference to provide data support for subsequent location compensation.
[0038] S106. The theoretical difference and image difference of each target are superimposed on the theoretical position information to obtain the actual position information of each target.
[0039] Assuming the image difference of a target is (0.1, -0.3), the theoretical difference is (2, 0), and the theoretical location information is (1, 30), then the actual location information of the target is (1+2+0.1, 30+0-0.3), which is (3.1, 29.7). By analogy, the actual location information of all targets can be obtained.
[0040] By superimposing the theoretical difference and the image difference into the theoretical position information of the target, the positioning accuracy of the actual position information is ensured.
[0041] This invention provides a rapid multi-target localization method before mounting. By clustering and fitting the theoretical position information of targets, it eliminates the need for multiple targets to be arranged according to rules. Regardless of whether the targets are irregularly discrete, densely distributed, or sparsely distributed, clustering can form approximately linear target groups, thereby planning the camera's motion path. This adapts to targets with arbitrary distributions, overcoming the strict limitations of existing multi-target localization methods on target arrangement and significantly expanding the applicable scenarios. The method sorts the theoretical position information according to a preset sorting direction, obtains the absolute value of the gradient between two adjacent theoretical position information points along the preset sorting direction, and clusters the sorted theoretical position information based on the absolute value of the gradient to obtain several target groups. Then, a path line is fitted based on the theoretical position information within each target group, ensuring that the fitted line accurately represents the target distribution trend and the theoretical difference is accurately calculated. The camera's motion trajectory is planned based on the path line of each target group, and the camera is controlled to move along the motion trajectory. The system moves along a path and uses a camera to capture images of each triggered location. Target recognition is performed on all images to determine the image difference of each target, forming a non-reversible motion trajectory. Adjacent path nodes are connected by straight lines, and the motion platform moves in a linear motion. Unlike current point-to-point photo positioning methods that require sequentially taking pictures according to the theoretical position information of each target, this significantly shortens the total running distance of the motion platform and improves positioning efficiency. The theoretical difference and image difference of each target are superimposed on the theoretical position information to obtain the actual position information of each target. Without adding additional hardware, various error sources can be effectively compensated. Rapid positioning of multiple targets can be achieved solely through software algorithm optimization. Through clustering, linear fitting, trajectory planning, and real-time position compensation, positioning efficiency is greatly improved while ensuring positioning accuracy, meeting the positioning requirements before mounting microelectronic components.
[0042] In this embodiment, step S102 specifically includes: S1021. Determine the preset sorting direction. Users can set the preset sorting direction according to the actual scenario, selecting either the X-axis or Y-axis direction as the preset sorting direction.
[0043] S1022. Sort all theoretical position information in ascending order according to the preset sorting direction. Assume that the user selects the X-axis direction as the preset sorting direction, that is, sort all theoretical position information from largest to smallest according to the X-axis coordinate.
[0044] S1023. When it is determined that there are multiple theoretical position information with equal coordinate values in a preset sorting direction, sort the multiple theoretical position information with equal coordinate values in ascending order according to the vertical direction of the preset sorting direction.
[0045] In a two-dimensional coordinate system, the theoretical position information includes the X-axis coordinate and the Y-axis coordinate. All theoretical position information is scanned and sorted in ascending order according to the preset sorting direction as the main direction. When there are multiple theoretical position information with the same coordinate value in the main sorting direction, they are then sorted in ascending order in the secondary sorting direction (Y-axis or X-axis) perpendicular to the preset sorting direction to ensure the uniqueness of the sorting result.
[0046] Assume that each target corresponds to a theoretical position information, and the set of theoretical position information for these targets is: [(0,0), (21,40), (1,10), (24,22), (1,20), (-1,30), (10,1), (11,10), (9,20), (10,30), (22,2), (23,12)]. The user selects the X-axis as the preset sorting direction. After sorting all the theoretical position information in ascending order according to the preset sorting direction, the new set is: [(-1,30), (0,0), (1,10), (1,20), (9,20), (10,30), (10,1), (11,10), (21,40), (22,2), (23,12), (24,22)].
[0047] It should be noted that descending order can also be used, that is, sorting all theoretical position information according to the X-axis coordinate from smallest to largest.
[0048] S1024. Determine the absolute value of the gradient between two adjacent theoretical positions after sorting, along the preset sorting direction. The formula for calculating the absolute value of the gradient is: in, Represents the absolute value of the gradient; Indicates the sorted order of the first... X-axis coordinates of a theoretical location; Indicates the sorted order of the first... The X-axis coordinates of the theoretical position information. This can be understood as the index number of the sorted theoretical position information. If the preset sorting direction is the Y-axis direction, then the absolute value of the gradient is calculated as the absolute value of the coordinate difference between two adjacent theoretical position information in the Y-axis direction.
[0049] The set of absolute gradient values is: [1, 1, 0, 8, 1, 0, 1, 10, 1, 1, 1].
[0050] S1025. Determine the grouping boundaries based on the preset clustering threshold and the absolute value of the gradient, and divide the sorted theoretical position information into several target groups according to the grouping boundaries. By dividing into several target groups, the coordinate values of a large number of discrete targets can be transformed into several spatially related target groups. The coordinates within each target group are densely distributed and have the characteristics of an approximately linear distribution, providing a good foundation for subsequent line fitting. At the same time, the camera's motion path can be significantly shortened by planning the access order of the target groups.
[0051] More specifically, step S1025 includes: S10251. Traverse the absolute values of gradients, and cluster the groups whose absolute values exceed the preset clustering threshold. The two adjacent theoretical position information are used as the grouping boundary.
[0052] S10252. Based on the grouping boundaries, the sorted theoretical location information is divided into several target groups. Specifically, a current target group is created, and the first sorted theoretical location information is assigned to the current target group. Then, the absolute gradient value is iterated. If the absolute gradient value does not exceed the preset clustering threshold... If the next theoretical location information is assigned to the current target group, and the absolute value of the gradient exceeds the preset clustering threshold, then... Then, a new target group will be created, which will become the current target group, and the next theoretical location information will be assigned to the current target group.
[0053] For example, if a clustering threshold is preset If set to 5, then 8 and 10 will be used as grouping boundaries. Based on these two grouping boundaries, all theoretical location information can be divided into three target groups, namely: Group 1: [(-1, 30), (0, 0), (1, 10), (1, 20)] Group 2: [(9, 20), (10, 30), (10, 1), (11, 10)] Group 3: [(21, 40), (22, 2), (23, 12), (24, 22)] This completes the data splitting.
[0054] In this embodiment, step S103 specifically includes: S1031. According to the vertical direction of the preset sorting direction, sort all theoretical position information in each target group in ascending order, so that the theoretical position information in the target group is arranged in sequence, which facilitates the determination of the start and end positions during the fitting of the straight line.
[0055] For example, the result of sorting the above three target groups according to the vertical direction (i.e., the Y-axis direction) of the preset sorting direction is as follows: Group 1: [(0,0), (1,10), (1,20), (-1,30)] (Y-axis coordinates: 0→10→20→30) Second group: [(10, 1), (11, 10), (9, 20), (10, 30)] (Y-axis coordinates: 1→10→20→30) The third group: [(22, 2), (23, 12), (24, 22), (21, 40)] (Y-axis coordinates: 2→12→22→40) S1032. Determine the starting and ending positions of each sorted target group.
[0056] For example, the starting and ending positions of the three target groups mentioned above are: Group 1: [(0, 0), (-1, 30)], starting position is (0, 0), ending position is (-1, 30) The second group: [(10, 1), (10, 30)], starting position is (10, 1), ending position is (10, 30) The third group: [(22, 2), (21, 40)], starting position is (22, 2), ending position is (21, 40). S1033. Determine the target group number, and swap the starting and ending positions in the even-numbered target groups to complete the swap of starting and ending positions. The first group is numbered 1, the second group is numbered 2, and so on, with the Nth group numbered N.
[0057] In order to shorten the camera's movement distance between adjacent target groups, in this embodiment, the starting and ending positions of each target group are optimized according to the principle of shortest movement distance, so that the camera's movement path between adjacent target groups is the shortest straight distance, avoiding backtracking, and further shortening the camera's total movement distance and movement time.
[0058] The second group mentioned above is the target group with even numbers. The starting and ending positions of this group are swapped. After the swap, the starting and ending positions of the second group are (10, 30) and the ending position is (10, 1).
[0059] S1034. Based on all theoretical position information within the target group, perform straight line fitting to obtain the path straight line for each target group.
[0060] In this embodiment, the least squares method or the Ransac robust fitting algorithm is used for in-group linear fitting.
[0061] S1035. Determine the distance error from each theoretical location information in the target group to the corresponding straight line of the target group, collect all distances to obtain the total distance error, determine the average distance error of the target group based on the total distance, the average distance error is the total distance error divided by the number of theoretical location information in the target group, and adjust the straight line of the path based on the average distance error.
[0062] In this embodiment, to ensure that the fitted straight line can accurately represent the distribution trend of coordinates within the group, it is necessary to verify the fitting accuracy. When the average distance error does not exceed the preset error threshold, it is considered that the fitting is qualified and the path straight line is retained. Conversely, when the average distance error exceeds the preset error threshold, it is considered that the linear distribution characteristics of the coordinates based on the path straight line are not obvious, and the straight line fitting needs to be repeated until the average distance error is less than or equal to the preset error threshold.
[0063] In this embodiment, step S104 specifically includes: S1041. Based on the preset sorting direction, determine the trigger position information of each theoretical position information in the target group on the corresponding straight path of the target group.
[0064] Specifically, based on the path straight line fitted by the target group, for each theoretical position information, the corresponding trigger position information on the path straight line is calculated by substituting it into the corresponding straight line equation. The calculation of the trigger position information is related to the preset sorting direction. If the preset sorting direction is the X-axis direction, the Y-axis position remains unchanged when substituting it into the straight line equation, and the X-axis position is calculated, that is, the point mapped onto the path straight line when the Y-axis coordinates are the same. If the preset sorting direction is the Y-axis direction, the X-axis position remains unchanged when substituting it into the straight line equation, and the Y-axis position is calculated, that is, the point mapped onto the path straight line when the X-axis coordinates are the same.
[0065] For example, the equation of the straight line obtained from the first set of fitting is: The equations of the straight lines obtained from the fitting of other groups are: in, Indicates the first The equations of the straight lines along the paths of each target group; Indicates the first Y-axis coordinates of the theoretical position information of each target group; Indicates the first X-axis coordinates of the theoretical position information of each target group; Indicates the slope of the straight line along the path; It represents the intercept of the straight line along the path.
[0066] Substituting the theoretical location information (1, 10) from the first group into... Then, the trigger position information of the theoretical position information (1, 10) is obtained as (-1 / 3, 10).
[0067] S1042. Calculate the coordinate difference between the trigger position information and the theoretical position information of each target to obtain the theoretical difference for each target. The theoretical difference for a target in the first group is the coordinate difference between (-1 / 3, 10) and (1, 10), and the theoretical difference is (-4 / 3, 0).
[0068] In this embodiment, step S105 specifically includes: S1051. Use the start and end positions of the target group as path nodes. Specifically, use the optimized start and end positions as path nodes, and determine the node order between path nodes according to the target group's numbering order.
[0069] S1052. Connect each path node in sequence according to the node order and use straight lines to obtain the camera's motion trajectory.
[0070] By connecting each path node sequentially according to the node order, a non-returning motion trajectory can be formed. At the same time, adjacent path nodes are connected by straight lines, and the motion platform moves in a linear motion mode. Unlike the current point-by-point stopping and taking pictures for positioning, which requires taking pictures sequentially according to the theoretical position information of each target, this method can significantly shorten the total running distance of the motion platform and improve positioning efficiency.
[0071] In this embodiment, the motion at the path nodes adopts a smooth transition to avoid vibration of the motion platform. The entire motion trajectory is without backtracking or intersection, ensuring the continuity and efficiency of camera motion.
[0072] S1053. Control the camera to move along the motion trajectory, and trigger the camera to take pictures when the camera reaches each trigger position information to obtain image information of each target.
[0073] In this embodiment, the trigger position information of each target is loaded into the controller of the motion platform. When the controller controls the motion platform and the camera mounted on the motion platform to move along the motion trajectory, it can calculate the current position information of the camera and whether it has reached the trigger position information corresponding to each target in real time. In order to ensure that the camera takes pictures at the trigger position information, when the distance between the current position information of the camera and a certain trigger position information is less than a preset trigger threshold, the motion controller outputs a trigger signal (such as a TTL level signal). This setting enables the camera to accurately trigger the taking of pictures when it reaches the trigger position during the movement.
[0074] In this embodiment, the camera's frame rate is matched to the motion platform's speed to ensure that the camera can acquire images at the trigger position after receiving a trigger signal without pausing. For example, if the camera's frame rate is 100fps, the motion platform's speed is set to v = trigger position spacing / 10ms, ensuring that the image capture interval between adjacent trigger positions meets the frame rate requirement.
[0075] S1054. Preprocess all image information, identify the actual center position of the target corresponding to the image information, determine the coordinate difference between the actual center position and the image center position of the image information, and obtain the image difference of each target.
[0076] The images captured by the camera undergo preprocessing, which may include grayscale conversion, noise reduction, and contrast enhancement to facilitate subsequent target recognition. Template matching algorithms and neural network models are used to identify the actual center position of the target in the image information.
[0077] It should be noted that if multiple targets are close to each other, when the camera reaches a certain trigger position and takes a picture, the captured image information may contain multiple targets. During target recognition, only the target corresponding to the trigger position information will be recognized. For example, if an image contains target A, target B, and target C, the trigger position information corresponding to this image information is the trigger position information of target A. In subsequent target recognition, only the actual center position of target A will be recognized, and the actual center positions of other targets will not be recognized.
[0078] Please see Figures 2 to 6 , Figure 2 The image shows the theoretical location information of multiple irregular targets. Figure 3 The diagram shows a clustering of targets with the preset sorting direction being the X-axis. Figure 3 Each red box in the figure represents a target group. Figure 4 shows a schematic diagram of the straight line fitting obtained by fitting the target group. Figure 4 Each green line represents the path to the corresponding target group. Figure 5 The blue lines represent the coordinate differences between the theoretical and trigger positions of each target. Figure 6 The diagram shows the planned camera motion trajectory. Figure 6 The S-shaped lines represent the trajectory of the motion.
[0079] In this embodiment, the method may further include the following steps: S201. Obtain the theoretical location information of all targets. The specific details are shown in step S101.
[0080] S202. Preprocess the theoretical location information, including deleting duplicate values, deleting outliers, and standardizing the format.
[0081] By traversing the theoretical position information corresponding to all targets, if there are completely identical coordinate values, i.e. duplicate coordinate values, only one theoretical position information is retained and the rest are deleted to avoid duplicate positioning; if there are theoretical position information that deviates significantly from other theoretical position information, these theoretical position information can be marked as abnormal coordinates and deleted; the unified format will convert all theoretical position information to a unified physical coordinate system.
[0082] It is understandable that the preprocessed theoretical location information will participate in the subsequent grouping process. By preprocessing the theoretical location information, we can ensure the data quality of the theoretical location information and avoid the impact of duplicate data and abnormal data on subsequent grouping and fitting.
[0083] S203. Sort the theoretical position information according to a preset sorting direction, obtain the absolute value of the gradient between two adjacent theoretical position information in the preset sorting direction, and cluster the sorted theoretical position information according to the absolute value of the gradient to obtain several target groups. The specific content is shown in step S102.
[0084] S204. Based on the theoretical position information of all targets, perform straight line fitting to obtain the path straight line for each target group. The specific details are shown in step S103.
[0085] S205. Substitute the theoretical position information of each target into the path line of the corresponding target group to obtain the trigger position information of each target. The coordinate difference between the trigger position information and the theoretical position information is used to obtain the theoretical difference for each target. The specific content is shown in step S104.
[0086] S206. Plan the camera's motion trajectory according to the straight line of each target group's path, control the camera to move along the motion trajectory, and use the camera to collect image information of each trigger position. Perform target recognition on all image information and determine the image difference of each target in the image. The specific content is as shown in step S105.
[0087] S207. The theoretical difference and image difference of each target are superimposed on the theoretical position information to obtain the actual position information of each target. The specific content is shown in step S106.
[0088] The rapid positioning device for multiple targets before mounting provided in the embodiments of the present invention will be described below. The rapid positioning device for multiple targets before mounting described below can be referred to in correspondence with the rapid positioning method for multiple targets before mounting described above.
[0089] To address the aforementioned issues, this specification provides a rapid positioning device for multiple targets before mounting, which aims to significantly improve positioning efficiency while ensuring positioning accuracy through clustering, linear fitting, trajectory planning, and real-time position compensation. Figure 7 This is a structural schematic diagram of a rapid positioning device for multiple targets before mounting according to an embodiment of the present invention, as shown below. Figure 7 As shown, the device may include: The location acquisition module 10 is used to acquire the theoretical location information of all targets.
[0090] Theoretical location information can be pre-stored in the electronic device or acquired by the electronic device from external sources. For example, it can be acquired by the electronic device from external acquisition devices or extracted from external video, etc.
[0091] There are no restrictions on the specific form of obtaining the theoretical location information, as long as the electronic device can obtain the theoretical location information.
[0092] The location grouping module 20 is used to sort the theoretical location information according to a preset sorting direction, obtain the absolute value of the gradient between two adjacent theoretical location information in the preset sorting direction, and cluster the sorted theoretical location information according to the absolute value of the gradient to obtain several target groups. Each target group contains the theoretical location information of at least one target.
[0093] The theoretical location information of a large number of discrete targets is divided into several target groups according to the spatial distribution density, so that the theoretical location information in each target group has the characteristics of an approximately linear distribution, which provides a basis for subsequent line fitting.
[0094] The line fitting module 30 is used to perform line fitting based on all theoretical position information within the target group, and to fit the path line of each target group.
[0095] Linear fitting based on target groups can fit a straight path for each target group. This straight path can characterize the spatial distribution trend of all targets within the group, providing a benchmark for camera motion path planning and trigger position calculation.
[0096] The trigger determination module 40 is used to substitute the theoretical position information of each target into the path line of the corresponding target group to obtain the trigger position information of each target, and the coordinate difference between the trigger position information and the theoretical position information to obtain the theoretical difference of each target.
[0097] In this embodiment, the trigger position information is the physical position information of the target triggered during camera movement, and the theoretical difference is the coordinate difference between the trigger position information and the theoretical position information of the target. Both the trigger position information and the theoretical position information participate in the subsequent position compensation.
[0098] In this embodiment, the theoretical location information, trigger location information, and theoretical difference of each target can also be stored in a preset database to form a list of theoretical location information, trigger location information, and theoretical difference, providing data support for subsequent camera-triggered photography and position compensation.
[0099] The image acquisition module 50 is used to plan the camera's motion trajectory according to the straight path of each target group, control the camera to move along the motion trajectory, and use the camera to acquire image information of each trigger position information. Target recognition is performed on all image information to determine the image difference of each target in the image.
[0100] By planning the camera's motion trajectory, continuous motion and trigger-to-take-a-shot mode can be achieved during multi-target localization. This allows the camera to traverse the trigger position information of all target groups along the shortest path, avoiding backtracking. Furthermore, the camera accurately triggers a shot at each trigger position information during the motion without stopping, significantly improving localization efficiency.
[0101] In this embodiment, the image difference of each target can also be stored in a preset database and associated with the corresponding theoretical location information and theoretical difference to provide data support for subsequent location compensation.
[0102] The target localization module 60 is used to superimpose the theoretical difference and image difference of each target into the theoretical position information to locate the actual position information of each target.
[0103] The present invention provides a rapid multi-target positioning device before mounting. By clustering and grouping the theoretical position information of targets and fitting straight lines, it eliminates the need for multiple targets to be arranged according to rules. Regardless of whether the targets are irregularly discrete, densely distributed, or sparsely distributed, clustering can form approximately linear target groups, thereby planning the camera's motion path. This adapts to targets with arbitrary distributions, overcoming the strict limitations of existing multi-target positioning methods on target arrangement and significantly expanding the applicable scenarios. The device sorts the theoretical position information according to a preset sorting direction, obtains the absolute value of the gradient between two adjacent theoretical position information points along the preset sorting direction, and clusters the sorted theoretical position information based on the absolute value of the gradient to obtain several target groups. Then, it fits a straight line based on the theoretical position information within each target group, ensuring that the fitted line accurately represents the target distribution trend and that the theoretical difference calculation is accurate. Based on the path of each target group... The camera's motion trajectory is planned using a linear path, controlling the camera to move along the trajectory and acquiring image information at each trigger position. Target identification is performed on all images, determining the image difference of each target in the image, thus forming a non-reversible motion trajectory. Adjacent path nodes are connected by straight lines, and the motion platform moves in a linear manner. Unlike current point-to-point image positioning methods that require sequentially taking pictures according to the theoretical position information of each target, this significantly shortens the total running distance of the motion platform and improves positioning efficiency. The theoretical difference and image difference of each target are superimposed on the theoretical position information to obtain the actual position information of each target. This effectively compensates for various error sources without the need for additional hardware. Rapid multi-target positioning can be achieved solely through software algorithm optimization, ensuring positioning efficiency and accuracy, and meeting the positioning requirements before mounting microelectronic components.
[0104] To address the aforementioned issues, this specification provides a vehicle that includes the aforementioned rapid positioning device for multiple targets before mounting.
[0105] Figure 8 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 8 As shown, the electronic device may include: a processor 810, a communication interface 420, a memory 830, and a communication bus 840, wherein the processor 810, the communication interface 820, and the memory 830 communicate with each other via the communication bus 840. The processor 810 can call logical commands in the memory 830 to execute a rapid positioning method for multiple targets before mounting, the method including: Obtain the theoretical location information of all targets; The theoretical position information is sorted according to a preset sorting direction. The absolute value of the gradient between two adjacent theoretical position information is obtained in the preset sorting direction. The sorted theoretical position information is then clustered and grouped according to the absolute value of the gradient to obtain several target groups. Each target group contains the theoretical position information of at least one target. Based on the theoretical location information of all target groups, straight line fitting is performed to obtain the path straight line for each target group. Substitute the theoretical position information of each target into the path line of the corresponding target group to obtain the trigger position information of each target. The coordinate difference between the trigger position information and the theoretical position information is used to obtain the theoretical difference of each target. The trigger position information is the physical position information of the target triggered to take pictures during the camera movement. The camera's motion trajectory is planned according to the straight path of each target group, the camera is controlled to move along the motion trajectory, and the camera is used to collect image information of each trigger position. Target recognition is performed on all image information to determine the image difference of each target in the image. The theoretical difference and image difference of each target are superimposed on the theoretical location information to obtain the actual location information of each target.
[0106] Furthermore, the logical instructions in the aforementioned memory 830 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0107] On the other hand, the present invention also provides a computer program product, the computer program product comprising a computer program that can be stored on a non-transitory computer-readable storage medium, wherein when the computer program is executed by a processor, the computer is able to execute the rapid positioning method for multiple targets before mounting provided by the above methods, the method comprising: Obtain the theoretical location information of all targets; The theoretical position information is sorted according to a preset sorting direction. The absolute value of the gradient between two adjacent theoretical position information is obtained in the preset sorting direction. The sorted theoretical position information is then clustered and grouped according to the absolute value of the gradient to obtain several target groups. Each target group contains the theoretical position information of at least one target. Based on the theoretical location information of all target groups, straight line fitting is performed to obtain the path straight line for each target group. Substitute the theoretical position information of each target into the path line of the corresponding target group to obtain the trigger position information of each target. The coordinate difference between the trigger position information and the theoretical position information is used to obtain the theoretical difference of each target. The trigger position information is the physical position information of the target triggered to take pictures during the camera movement. The camera's motion trajectory is planned according to the straight path of each target group, the camera is controlled to move along the motion trajectory, and the camera is used to collect image information of each trigger position. Target recognition is performed on all image information to determine the image difference of each target in the image. The theoretical difference and image difference of each target are superimposed on the theoretical location information to obtain the actual location information of each target.
[0108] On the other hand, the present invention also provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, wherein when the program instructions are executed by a computer, the computer is able to execute the rapid positioning method for multiple targets before mounting provided by the above methods, the method comprising: Obtain the theoretical location information of all targets; The theoretical position information is sorted according to a preset sorting direction. The absolute value of the gradient between two adjacent theoretical position information is obtained in the preset sorting direction. The sorted theoretical position information is then clustered and grouped according to the absolute value of the gradient to obtain several target groups. Each target group contains the theoretical position information of at least one target. Based on the theoretical location information of all target groups, straight line fitting is performed to obtain the path straight line for each target group. Substitute the theoretical position information of each target into the path line of the corresponding target group to obtain the trigger position information of each target. The coordinate difference between the trigger position information and the theoretical position information is used to obtain the theoretical difference of each target. The trigger position information is the physical position information of the target triggered to take pictures during the camera movement. The camera's motion trajectory is planned according to the straight path of each target group, the camera is controlled to move along the motion trajectory, and the camera is used to collect image information of each trigger position. Target recognition is performed on all image information to determine the image difference of each target in the image. The theoretical difference and image difference of each target are superimposed on the theoretical location information to obtain the actual location information of each target.
[0109] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0110] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0111] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A rapid positioning method for multiple targets before mounting, characterized in that, The method includes: Obtain the theoretical location information of all targets; The theoretical position information is sorted according to a preset sorting direction. The absolute value of the gradient between two adjacent theoretical position information is obtained in the preset sorting direction. The sorted theoretical position information is then clustered and grouped according to the absolute value of the gradient to obtain several target groups. Each target group contains the theoretical position information of at least one target. Based on the theoretical location information of all target groups, straight line fitting is performed to obtain the path straight line for each target group. Substitute the theoretical position information of each target into the path line of the corresponding target group to obtain the trigger position information of each target. The coordinate difference between the trigger position information and the theoretical position information is used to obtain the theoretical difference of each target. The trigger position information is the physical position information of the target triggered to take pictures during the camera movement. The camera's motion trajectory is planned according to the straight path of each target group, the camera is controlled to move along the motion trajectory, and the camera is used to collect image information of each trigger position. Target recognition is performed on all image information to determine the image difference of each target in the image. The theoretical difference and image difference of each target are superimposed on the theoretical location information to obtain the actual location information of each target.
2. The rapid positioning method for multiple targets before mounting according to claim 1, characterized in that, The theoretical position information is sorted according to a preset sorting direction, the absolute value of the gradient between two adjacent theoretical position information pieces in the preset sorting direction is obtained, and the sorted theoretical position information is clustered and grouped according to the absolute value of the gradient to obtain several target groups, specifically including: Determine the preset sorting direction; Sort all theoretical position information in ascending order according to the preset sorting direction; When it is determined that there are multiple theoretical position information with equal coordinate values in a preset sorting direction, the multiple theoretical position information with equal coordinate values are sorted in ascending order according to the direction perpendicular to the preset sorting direction; Determine the absolute value of the gradient of two adjacent theoretical positions in the preset sorting direction after sorting; The grouping boundaries are determined based on the preset clustering threshold and the absolute value of the gradient, and the sorted theoretical location information is divided into several target groups according to the grouping boundaries.
3. The rapid positioning method for multiple targets before mounting according to claim 2, characterized in that, If the preset sorting direction is the X-axis direction, the formula for calculating the absolute value of the gradient is: in, Represents the absolute value of the gradient; Indicates the sorted order of the first... X-axis coordinates of a theoretical location; Indicates the sorted order of the first... The X-axis coordinates of the theoretical position information.
4. The rapid positioning method for multiple targets before mounting according to claim 2, characterized in that, The step of determining the grouping boundary based on a preset clustering threshold and the absolute value of the gradient, and dividing the sorted theoretical position information into several target groups according to the grouping boundary, specifically includes: Iterate through the absolute values of gradients and use the two adjacent theoretical positions where the absolute value of the gradient exceeds the preset clustering threshold as the grouping boundary. Based on the grouping boundaries, the sorted theoretical location information will be divided into several target groups.
5. The rapid positioning method for multiple targets before mounting according to claim 1, characterized in that, The step of fitting a straight line based on all theoretical position information within the target group to obtain the path straight line for each target group specifically includes: Sort all theoretical position information within each target group in ascending order according to the vertical direction of the preset sorting direction; Determine the starting and ending positions of each sorted target group; Determine the target group number, and swap the start and end positions of the even-numbered target groups; Based on all theoretical position information within the target group, a straight line is fitted to obtain the path straight line for each target group. Determine the distance error from each theoretical location within the target group to the corresponding straight line of the target group. Collect all distances to obtain the total distance error. Determine the average distance error of the target group based on the total distance. Adjust the straight line of the path based on the average distance error.
6. The rapid positioning method for multiple targets before mounting according to claim 1, characterized in that, The step of substituting the theoretical position information of each target into the path line of the corresponding target group to obtain the trigger position information of each target, and the coordinate difference between the trigger position information and the theoretical position information to obtain the theoretical difference of each target, specifically includes: Based on the preset sorting direction, determine the trigger position information of each theoretical position information in the target group on the corresponding straight path of the target group; Calculate the coordinate difference between the trigger location information and the theoretical location information of each target to obtain the theoretical difference for each target.
7. The rapid positioning method for multiple targets before mounting according to claim 5, characterized in that, The process involves planning the camera's trajectory based on the straight path of each target group, controlling the camera to move along the trajectory, and using the camera to acquire image information at each trigger position. Target recognition is then performed on all image information to determine the image difference for each target. Specifically, this includes: The starting and ending positions of the target group are used as path nodes, and the node order between path nodes is determined according to the numbering order of the target group. By connecting each path node in sequence according to the node order and using straight lines, the motion trajectory of the camera can be obtained. Control the camera to move along the motion trajectory, and trigger the camera to take a picture when the camera reaches each trigger position information to obtain image information of each target; All image information is preprocessed to identify the actual center position of the target corresponding to the image information, and the coordinate difference between the actual center position and the image center position of the image information is determined to obtain the image difference of each target.
8. A rapid positioning device for multiple targets before mounting, characterized in that, The device includes: The location acquisition module is used to acquire the theoretical location information of all targets; The location grouping module is used to sort the theoretical location information according to a preset sorting direction, obtain the absolute value of the gradient between two adjacent theoretical location information in the preset sorting direction, and cluster the sorted theoretical location information according to the absolute value of the gradient to obtain several target groups; each target group contains the theoretical location information of at least one target. The line fitting module is used to perform line fitting based on all theoretical position information within the target group, and to obtain the path line for each target group. The trigger determination module is used to substitute the theoretical position information of each target into the path line of the corresponding target group to obtain the trigger position information of each target. The coordinate difference between the trigger position information and the theoretical position information is used to obtain the theoretical difference of each target. The trigger position information is the physical position information of the target triggered to take pictures during the camera movement. The image acquisition module is used to plan the camera's motion trajectory based on the straight path of each target group, control the camera to move along the motion trajectory, and use the camera to acquire image information of each trigger position. Target recognition is performed on all image information to determine the image difference of each target in the image. The target localization module is used to superimpose the theoretical difference and image difference of each target onto the theoretical position information to obtain the actual position information of each target.
9. An electronic 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 program, it implements the steps of the rapid positioning method for multiple targets before mounting as described in any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the rapid positioning method for multiple targets before mounting as described in any one of claims 1 to 7.