A method and device for spatial positioning of a strip-shaped target and a medium

CN122694994BActive Publication Date: 2026-10-16CHINESE PEOPLES LIBERATION ARMY INFORMATION SUPPORT CORPS ENGINEERING UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611162861.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-08-03
Publication Date
2026-10-16
Estimated Expiration
2046-08-03

AI Technical Summary

Technical Problem

[0002]在复杂场景下,对天基空间中的条状目标进行高精度定位面临严峻挑战

Benefits of technology

首先,通过目标区域提取与多尺度窗口构建,相比传统单一固定窗口的质心计算方法,本发明采用多个不同尺度的质心定位窗口,有效克服了因天基平台振动及相机曝光时间内相对运动导致的条状目标边缘模糊、轮廓不确定的问题,显著提升了算法对复杂场景下目标形态变化的适应性和抗干扰能力。其次,在每个质心定位窗口内执行迭代式亚像元质心计算与收敛判断,突破了传统质心算法仅能达到像素级精度的局限。通过迭代计算机制,使质心位置逐步逼近目标的真实灰度分布中心,配合收敛判断确保了计算过程的稳定性和精度可控性;同时对多个窗口的收敛结果进行融合,进一步平滑了单一窗口可能存在的局部误差,从而获得了更高精度的最终质心位置,为后续目标运动状态描述和姿轨参数确定提供了可靠基础。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122694994B_ABST
    Figure CN122694994B_ABST
Patent Text Reader

Abstract

The application provides a strip target spatial positioning method, device and medium, the method comprises the following steps: firstly, through target region extraction and multi-scale window construction, the adaptability of the algorithm to the target form change in the complex scene and the anti-interference ability are significantly improved. Secondly, through the iterative calculation mechanism, the centroid position gradually approaches the real gray distribution center of the target, and the stability and controllability of the accuracy of the calculation process are ensured by convergence judgment; at the same time, the convergence results of multiple windows are fused, and the local error of a single window is further smoothed, so that a higher precision final centroid position is obtained. Then the initial endpoint position is obtained by executing endpoint detection, and then the square weighted centroid calculation is iteratively executed in multiple scaling windows based on the initial position until convergence, the multi-window iterative strategy and coordinate average fusion of the application effectively suppress the influence of noise, and the endpoint positioning precision is significantly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image data processing technology, and in particular to a spatial positioning method, apparatus and medium for strip-shaped targets. Background Technology

[0002] High-precision positioning of strip-shaped targets in space-based environments presents significant challenges in complex scenarios. While existing grayscale centroid methods and their derivatives offer high accuracy, they struggle to accurately describe the position and attitude of targets exhibiting short arc-shaped features due to space-based platform vibrations and camera exposure times. Gaussian surface fitting methods and their derivatives, though suitable for centroid positioning of strip-shaped targets, suffer from excessive computational complexity, making them unsuitable for time-sensitive on-orbit processing. Furthermore, edge-based algorithms and their derivatives generate substantial errors when processing target images with blurred edges.

[0003] Furthermore, for strip-shaped targets, not only is high-precision centroid positioning required, but also high-precision endpoint positioning is needed. However, most existing endpoint positioning algorithms are based on the ideal assumption that the trajectory is a straight line, which is not suitable for aircraft with short arc segment features.

[0004] Therefore, how to achieve comprehensive positioning of the centroid and endpoints for strip-shaped targets in complex scenarios, while taking into account high accuracy, high timeliness, and strong anti-interference ability, is a technical problem that urgently needs to be solved. Summary of the Invention

[0005] This invention provides a spatial positioning method, device, and medium for strip-shaped targets, which addresses the shortcomings of existing technologies. By combining robust initial detection, refined sub-pixel processing, and a multi-window averaging strategy, it achieves high-precision and robust centroid and endpoint integrated positioning of strip-shaped targets in complex scenes, effectively overcoming the limitations of existing technologies in handling short arcs, blurred edges, and high timeliness requirements.

[0006] In a first aspect, the present invention provides a spatial positioning method for a strip-shaped target, comprising: S102. Acquire the original image, wherein the original image includes the strip-shaped target; S104. Based on the original image, target region extraction and multi-scale window construction are performed to obtain multiple centroid positioning windows; S106. Perform iterative sub-pixel centroid calculation and convergence judgment within each centroid positioning window, and fuse the convergence results of multiple windows to obtain the final centroid position of the strip target. S108. Perform endpoint detection on the strip-shaped targets in the original image to obtain the initial endpoint positions; S110. Based on the initial endpoint position, iteratively perform square-weighted centroid calculation within multiple scaling windows until convergence, and perform coordinate averaging on the convergence results of each window to obtain the final endpoint position.

[0007] Furthermore, the step of extracting the target region and constructing multi-scale windows based on the original image to obtain multiple centroid localization windows includes: The original image is subjected to threshold segmentation to extract the connected components of the strip-shaped target, and the minimum bounding rectangle of the connected components is calculated. The minimum bounding rectangle is expanded outward by a first unit pixel, a second unit pixel, and a third unit pixel in four directions, respectively, to generate three centroid positioning windows.

[0008] Furthermore, the step of performing iterative sub-pixel centroid calculation and convergence judgment within each centroid positioning window, and fusing the convergence results of multiple windows to obtain the final centroid position of the strip-shaped target, includes: Within each centroid positioning window, a trilinear interpolation algorithm is used to interpolate the pixels within the window to obtain sub-pixel level grayscale value distribution data. Based on the grayscale value distribution data, the initial centroid position is calculated using the square-weighted centroid algorithm. Move the geometric center of the current centroid positioning window to the initial centroid position to form a new centroid positioning window, and repeat the interpolation process and square-weighted centroid calculation process until the distance difference between the centroid positions calculated in two adjacent iterations is less than a preset threshold. Stop the iteration and take the centroid position obtained in the last iteration as the convergence centroid of the centroid positioning window. The final centroid position of the strip-shaped target is obtained by averaging the coordinates of the three convergent centroids corresponding to the three centroid positioning windows.

[0009] Furthermore, the step of performing endpoint detection on the strip-shaped targets in the original image to obtain the initial endpoint positions includes: The SUSAN algorithm is used to detect the endpoints of the strip-shaped targets in the original image to obtain the initial endpoint positions of the strip-shaped targets.

[0010] Furthermore, based on the initial endpoint position, the square-weighted centroid calculation is iteratively performed within multiple scaling windows until convergence, and the convergence results of each window are averaged to obtain the final endpoint position, including: The minimum bounding rectangle of the connected domain is shrunk inward by a first unit pixel, a second unit pixel, and expanded outward by a first unit pixel and a second unit pixel in four directions, respectively, to generate five endpoint positioning windows. The geometric center of each endpoint positioning window is moved to the initial endpoint position, and the endpoint correction position is calculated within each endpoint positioning window using the square-weighted centroid algorithm. Move the geometric center of the current endpoint positioning window to the endpoint correction position, and repeat the square weighted centroid calculation process until the difference between the endpoint positions calculated in two adjacent iterations is less than a preset threshold. Stop the iteration and take the endpoint position obtained in the last iteration as the convergence endpoint of the endpoint positioning window. The final endpoint position of the strip target is obtained by averaging the coordinates of the five convergent endpoints corresponding to the five endpoint positioning windows.

[0011] Furthermore, the step of expanding the minimum bounding rectangle outward by a first unit pixel, a second unit pixel, and a third unit pixel in four directions respectively, thereby generating three centroid positioning windows, includes: The upper and lower boundaries of the minimum bounding rectangle are expanded vertically, and the left and right boundaries are expanded horizontally, with the expansion dimensions in all four directions being the same, thereby generating a first centroid positioning window, a second centroid positioning window, and a third centroid positioning window.

[0012] Furthermore, the minimum bounding rectangle of the connected component is shrunk inward by a first unit pixel, a second unit pixel, and expanded outward by a first unit pixel and a second unit pixel in four directions, respectively, to generate five endpoint positioning windows, including: The upper and lower boundaries of the minimum bounding rectangle are shrunk inward and expanded outward in the vertical direction, respectively, and the left and right boundaries are shrunk inward and expanded outward in the horizontal direction, respectively, with the shrunk or expanded dimensions being the same in all four directions, thereby generating the first endpoint positioning window, the second endpoint positioning window, the third endpoint positioning window, the fourth endpoint positioning window, and the fifth endpoint positioning window.

[0013] Furthermore, after obtaining the final centroid position and final endpoint position of the strip-shaped target, the process also includes: S104-S110 is repeated in each frame of the image sequence to obtain the centroid coordinates and endpoint coordinates of the strip-shaped target in each frame; The pointing angle of the strip-shaped target in the corresponding frame is calculated based on the centroid coordinates and endpoint coordinates in the single-frame image. Based on the pointing angle change information and centroid coordinate displacement information in multiple consecutive images, the attitude change parameters and motion trajectory parameters of the strip-shaped target are calculated to achieve spatial target situational awareness.

[0014] Secondly, the present invention also provides a spatial positioning device for a strip-shaped target, comprising: a data acquisition module for acquiring an original image, wherein the original image includes the strip-shaped target; a positioning window construction module for extracting the target region and constructing a multi-scale window based on the original image to obtain multiple centroid positioning windows; a centroid judgment module for performing iterative sub-pixel centroid calculation and convergence judgment within each centroid positioning window, and fusing the convergence results of multiple windows to obtain the final centroid position of the strip-shaped target; an endpoint detection module for performing endpoint detection on the strip-shaped target in the original image to obtain an initial endpoint position; and an endpoint judgment module for iteratively performing square-weighted centroid calculation within multiple scaling windows based on the initial endpoint position until convergence, and averaging the convergence results of each window to obtain the final endpoint position.

[0015] Thirdly, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the spatial positioning method for any of the strip-shaped targets described above.

[0016] The spatial positioning method, apparatus, and medium for strip-shaped targets provided by this invention can produce the following beneficial technical effects compared with the prior art: First, by extracting the target region and constructing multi-scale windows, compared to the traditional single fixed-window centroid calculation method, this invention employs multiple centroid positioning windows of different scales. This effectively overcomes the problems of blurred edges and uncertain contours of strip-shaped targets caused by vibration of the space-based platform and relative motion during camera exposure, significantly improving the algorithm's adaptability and anti-interference ability to target morphology changes in complex scenes. Second, iterative sub-pixel centroid calculation and convergence judgment are performed within each centroid positioning window, breaking through the limitation of traditional centroid algorithms that can only achieve pixel-level accuracy. Through iterative calculation mechanisms, the centroid position gradually approaches the true grayscale distribution center of the target, and the convergence judgment ensures the stability and controllable accuracy of the calculation process. At the same time, the convergence results of multiple windows are fused, further smoothing out the local errors that may exist in a single window, thereby obtaining a more accurate final centroid position, providing a reliable foundation for subsequent target motion state description and attitude parameter determination.

[0017] Then, by performing endpoint detection to obtain the initial endpoint position, and then iteratively performing square-weighted centroid calculation within multiple scaling windows based on the initial position until convergence, this invention not only solves the limitation of traditional endpoint localization algorithms that are only applicable to the assumption of straight-line trajectories, but also can adapt to space-based targets exhibiting short arc segment characteristics. The multi-window iterative strategy and coordinate averaging fusion effectively suppress the influence of noise and significantly improve the endpoint localization accuracy. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a flowchart illustrating the spatial positioning method for strip-shaped targets provided by the present invention. Detailed Implementation

[0020] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0021] It should be noted that, in the description of the embodiments of the present invention, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0022] The terms "first," "second," etc., used in this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more.

[0023] Figure 1 This is one of the flowcharts illustrating the spatial positioning method for strip-shaped targets provided by the present invention, such as... Figure 1 As shown, including but not limited to the following steps: S102. Acquire the original image, which includes the strip-shaped target.

[0024] S104. Based on the original image, target region extraction and multi-scale window construction are performed to obtain multiple centroid positioning windows.

[0025] S106. Perform iterative sub-pixel centroid calculation and convergence judgment within each centroid positioning window, and fuse the convergence results of multiple windows to obtain the final centroid position of the strip target. S108. Perform endpoint detection on the strip-shaped targets in the original image to obtain the initial endpoint positions; S110. Based on the initial endpoint position, iteratively perform square-weighted centroid calculation within multiple scaling windows until convergence, and perform coordinate averaging on the convergence results of each window to obtain the final endpoint position.

[0026] In this embodiment, a space-based optical image containing the strip-shaped target is acquired as the original image. The following example, using a space-based optical observation satellite to perform real-time positioning of a strip-shaped target formed from space debris, illustrates the implementation process of the comprehensive positioning method for the centroid and endpoints of a space-based strip-shaped target in complex scenarios.

[0027] First, a raw image containing the strip-shaped target is acquired using a high-resolution optical sensor mounted on the space-based platform. This raw image is a 200×200 pixel grayscale image, in which the strip-shaped target exhibits short arc-shaped features due to the vibration of the space-based platform and the relative motion during the camera's exposure time.

[0028] For centroid localization, target region extraction and multi-scale window construction are performed on the original image. Threshold segmentation is applied to the original image to separate the target from the background, extracting the connected component contour of the strip-shaped target and calculating its minimum bounding rectangle. Based on this, the rectangle is expanded in four directions at multiple scales to form three centroid localization windows of different sizes to address target edge blurring and local noise interference.

[0029] Iterative sub-pixel centroid calculation is performed within each centroid localization window. For example, a trilinear interpolation algorithm is used to interpolate the discrete pixel grid within the window to obtain continuous grayscale value distribution data at the sub-pixel level. Based on this continuous grayscale value distribution data, the initial centroid coordinates are calculated using a square-weighted centroid algorithm. By using the squared pixel grayscale values ​​as weights, the target signal is enhanced while background noise is suppressed.

[0030] Subsequently, the geometric center of the window is moved to the initial centroid position to form a new calculation window, and the interpolation and square-weighted centroid calculation process is repeated. Iteration continues until the distance difference between two adjacent calculated centroid positions is less than a preset threshold; at this point, convergence is determined, and the result of the last iteration is taken as the convergent centroid of the window. The above iterative process is performed on each of the three windows to obtain three convergent centroid coordinates. An arithmetic mean is then calculated to obtain the final centroid position with sub-pixel precision.

[0031] For endpoint localization, a corner detection algorithm with excellent noise resistance is used to process the original image. By setting a gray-level difference threshold and a geometric threshold, a circular template is used to scan the image. The number of pixels within the template whose gray-level difference from the center point is less than the threshold is counted. When this number is lower than the geometric threshold, it is determined to be a corner response, thereby extracting the initial endpoint position coordinates of both ends of the strip target.

[0032] To achieve sub-pixel endpoint correction, a multi-layered endpoint positioning window is constructed. Based on the aforementioned minimum bounding rectangle, inward and outward expansion operations are performed in four directions to form a set of five windows of different sizes. The geometric center of each window is moved to the corresponding initial endpoint position obtained by the aforementioned corner detection algorithm, and the endpoint correction is performed using the same iterative squared weighted centroid algorithm as the centroid calculation.

[0033] Calculate the corrected endpoint coordinates within the current window, move the window center to these corrected coordinates, and repeat the calculation until convergence. The convergence criterion is also set to the distance difference between two adjacent iterations being less than a preset threshold. After five windows have completed independent iterations, five converged endpoint coordinates are obtained. The arithmetic mean of these coordinates is then used to obtain the final high-precision endpoint position.

[0034] In an optional embodiment, the spatial positioning method for a strip-shaped target provided by the present invention, after obtaining the final centroid position and the final endpoint position of the strip-shaped target, further includes: S104-S110 is repeated in each frame of the image sequence to obtain the centroid coordinates and endpoint coordinates of the strip-shaped target in each frame; The pointing angle of the strip-shaped target in the corresponding frame is calculated based on the centroid coordinates and endpoint coordinates in the single-frame image. Based on the pointing angle change information and centroid coordinate displacement information in multiple consecutive images, the attitude change parameters and motion trajectory parameters of the strip-shaped target are calculated to achieve spatial target situational awareness.

[0035] In this embodiment, in the application of sequential images, the above-mentioned centroid and endpoint localization process is repeatedly executed on multiple consecutive frames of images. The precise centroid coordinates and endpoint coordinates of the target can be obtained frame by frame. Then, the pointing angle of each frame can be calculated. By comprehensively analyzing the changes in pointing angle and centroid displacement of multiple frames, the attitude change parameters and motion trajectory of the space debris can be calculated, thereby realizing the situational awareness of the space target.

[0036] In an optional embodiment, the spatial localization method for a strip-shaped target provided by the present invention includes extracting the target region and constructing multiple centroid localization windows based on the original image, which results in multiple centroid localization windows, including: The original image is subjected to threshold segmentation to extract the connected components of the strip-shaped target, and the minimum bounding rectangle of the connected components is calculated. The minimum bounding rectangle is expanded outward by a first unit pixel, a second unit pixel, and a third unit pixel in four directions, respectively, to generate three centroid positioning windows.

[0037] In this embodiment, when locating the centroid of a strip-shaped target, a threshold segmentation method can first be used to extract the connected components of the strip-shaped target and calculate the minimum bounding rectangle of the connected components. Then, the upper and lower boundaries of the minimum bounding rectangle are expanded outward in the vertical direction, and the left and right boundaries are expanded outward in the horizontal direction, with the expansion dimensions in all four directions being the same, thereby generating a first centroid positioning window, a second centroid positioning window, and a third centroid positioning window.

[0038] It should be noted that, to overcome the problem of single fixed windows being susceptible to noise interference, this embodiment addresses the issue of inaccurate connected component mapping caused by noise at the edge of the striped target in the original image. It expands the minimum bounding rectangle of the connected component outward by a first unit pixel (e.g., 0.5), a second unit pixel (e.g., 1), and a third unit pixel (e.g., 2) in four directions, creating a total of three rectangles as the window for subsequent centroid localization. This invention employs a multi-window strategy that effectively addresses situations where target edges are blurred or there is localized uneven grayscale, improving the robustness of subsequent calculations.

[0039] Based on the content disclosed in the above embodiments, in an optional embodiment, the spatial positioning method for a strip-shaped target provided by the present invention includes performing iterative sub-pixel centroid calculation and convergence judgment within each centroid positioning window, and fusing the convergence results of multiple windows to obtain the final centroid position of the strip-shaped target, comprising: Within each centroid positioning window, a trilinear interpolation algorithm is used to interpolate the pixels within the window to obtain sub-pixel level grayscale value distribution data. Based on the grayscale value distribution data, the initial centroid position is calculated using the square-weighted centroid algorithm. Move the geometric center of the current centroid positioning window to the initial centroid position to form a new centroid positioning window, and repeat the interpolation process and square-weighted centroid calculation process until the distance difference between the centroid positions calculated in two adjacent iterations is less than a preset threshold. Stop the iteration and take the centroid position obtained in the last iteration as the convergence centroid of the centroid positioning window. The final centroid position of the strip-shaped target is obtained by averaging the coordinates of the three convergent centroids corresponding to the three centroid positioning windows.

[0040] In this embodiment, to address the problem that traditional centroid localization algorithms assume the grayscale value of any pixel is the grayscale value corresponding to the geometric center of the pixel, an interpolation algorithm is introduced to obtain the position and grayscale value of several points. It is worth noting that this process requires comprehensive consideration of the impact of the interpolation algorithm and the number of interpolation points on the results. This invention conducts experimental comparative analysis on multiple interpolation algorithms, such as bilinear interpolation and trilinear interpolation, to determine the optimal interpolation algorithm and the number of interpolation points.

[0041] Then, addressing the problem that traditional centroid localization algorithms mistakenly identify the geometric center of the window as the centroid of the strip-shaped target, a square-weighted centroid localization algorithm is used to first calculate the geometric center position M of the rectangular window and the centroid position N under this window. The theoretical description of the square-weighted centroid localization algorithm is as follows:

[0042] in, Image coordinates grayscale value at that location Using the centroid coordinates, and Given a rectangular window of size, move the geometric center of the rectangular window to the calculated centroid position, and then recalculate the centroid position under the moved window using the square-weighted centroid localization algorithm. The geometric center of the rectangle is located at... Solve for the distance between the centroid and the position of the centroid. And so on, the position of the centroid can be calculated. The geometric center of the rectangle Distance of the centroid position ,when and The loop breaks when the difference is less than a given threshold. As the final center of mass position.

[0043] Based on the content disclosed in the above embodiments, in an optional embodiment, the method for spatial localization of strip-shaped targets provided by the present invention, which involves performing endpoint detection on the strip-shaped targets in the original image to obtain initial endpoint positions, includes: The SUSAN algorithm is used to detect the endpoints of the strip-shaped targets in the original image to obtain the initial endpoint positions of the strip-shaped targets.

[0044] In this embodiment, due to the noise in the image, when performing endpoint detection on strip-shaped targets in the original image, it is essential to ensure high geometric accuracy in endpoint localization. Simultaneously, the noise resistance and timeliness of the algorithm used for endpoint detection are also crucial. It is worth noting that corner point families are known for their high geometric accuracy. Among corner point families, the SUSAN algorithm exhibits good noise resistance, requires no differential calculations, and is easily automated. Although it is not effective at extracting checkerboard centers and T-shaped points, it is highly accurate for strip-shaped targets. Therefore, this embodiment introduces the SUSAN algorithm to extract the endpoints of strip-shaped targets. The discriminant function of the SUSAN algorithm can be described as follows:

[0045] in, As the center point of the template, Points inside the template This is the grayscale difference threshold. The number of pixels in the template with similar brightness values ​​to the core point is counted, using the following corner response function:

[0046] Where g is the geometric threshold. Points inside the template This represents the grayscale difference.

[0047] In this embodiment, the SUSAN corner detection algorithm is used to process the original image during the endpoint localization stage. A grayscale difference threshold of 30 and a geometric threshold of 18 are set. The image is scanned using a 37-pixel circular template, and the number of pixels within the template whose grayscale difference from the center point is less than the threshold is counted. When this number is lower than the geometric threshold, it is determined to be a corner response, thereby extracting the initial endpoint coordinates of the two ends of the strip-shaped target.

[0048] Based on the content disclosed in the above embodiments, in an optional embodiment, the spatial positioning method for a strip-shaped target provided by the present invention iteratively performs square-weighted centroid calculation within multiple scaling windows until convergence based on the initial endpoint position, and performs coordinate averaging on the convergence results of each window to obtain the final endpoint position, including: The minimum bounding rectangle of the connected domain is shrunk inward by a first unit pixel, a second unit pixel, and expanded outward by a first unit pixel and a second unit pixel in four directions, respectively, to generate five endpoint positioning windows. The geometric center of each endpoint positioning window is moved to the initial endpoint position, and the endpoint correction position is calculated within each endpoint positioning window using the square-weighted centroid algorithm. Move the geometric center of the current endpoint positioning window to the endpoint correction position, and repeat the square weighted centroid calculation process until the difference between the endpoint positions calculated in two adjacent iterations is less than a preset threshold. Stop the iteration and take the endpoint position obtained in the last iteration as the convergence endpoint of the endpoint positioning window. The final endpoint position of the strip target is obtained by averaging the coordinates of the five convergent endpoints corresponding to the five endpoint positioning windows.

[0049] In this embodiment, sub-pixel correction of endpoint positions is performed. First, connected components are obtained through threshold segmentation, and the minimum bounding rectangle is calculated. The minimum bounding rectangle is then shrunk inward by 0.5 and 1 pixel, and expanded outward by 0.5 and 1 pixel in four directions, resulting in a total of 5 rectangles. Then, the geometric center of the rectangular window is moved to the obtained corner point. The centroid position of the target endpoint is solved using a square-weighted positioning approach, and the geometric center of the rectangular window is moved back to the newly obtained centroid position of the target endpoint. The loop exits when the change in the centroid position between the two times is less than a set threshold.

[0050] Finally, the above operations are performed on the rectangular windows obtained by shrinking and expanding, respectively, to obtain the coordinate positions of the five target endpoints. The average value is then used as the final endpoint position of the strip target, thus completing the endpoint position correction.

[0051] Furthermore, strip target information is calculated on the sequential image. By repeatedly executing S104-S110 in each frame of the sequential image, the centroid and endpoint positions of the strip targets in each frame can be obtained. Based on the centroid and endpoint positions, the pointing angle of the same strip targets in a single frame can be calculated. Similarly, the pointing changes of the same strip targets in several consecutive frames can be calculated to achieve spatial target situational awareness.

[0052] The present invention also provides a spatial positioning device for a strip-shaped target, comprising: The data acquisition module is used to acquire raw images, which include strip-shaped targets; The positioning window construction module is used to extract the target region and construct multi-scale windows based on the original image to obtain multiple centroid positioning windows. The centroid determination module is used to perform iterative sub-pixel centroid calculation and convergence determination within each centroid positioning window, and to fuse the convergence results of multiple windows to obtain the final centroid position of the strip-shaped target. The endpoint detection module is used to perform endpoint detection on the strip-shaped targets in the original image and obtain the initial endpoint positions; The endpoint determination module is used to iteratively perform square-weighted centroid calculation within multiple scaling windows based on the initial endpoint position until convergence, and to perform coordinate averaging on the convergence results of each window to obtain the final endpoint position.

[0053] It should be noted that the spatial positioning device for strip-shaped targets provided in this embodiment of the invention can execute the spatial positioning method for strip-shaped targets described in any of the above embodiments during actual operation, which will not be elaborated in this embodiment.

[0054] On the other hand, the present invention also provides a computer program product, the computer program product including a computer program stored on a non-transitory computer-readable storage medium, the computer program including program instructions, when the program instructions are executed by a computer, the computer is able to execute the spatial positioning method for strip-shaped targets provided in the above embodiments, the method including: acquiring an original image, the original image including a strip-shaped target; extracting the target region and constructing a multi-scale window based on the original image to obtain multiple centroid positioning windows; performing iterative sub-pixel centroid calculation and convergence judgment in each centroid positioning window, and fusing the convergence results of multiple windows to obtain the final centroid position of the strip-shaped target; performing endpoint detection on the strip-shaped target in the original image to obtain an initial endpoint position; based on the initial endpoint position, iteratively performing square-weighted centroid calculation in multiple scaling windows until convergence, and averaging the convergence results of each window to obtain the final endpoint position.

[0055] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements the spatial localization method based on strip-shaped targets provided in the above embodiments. The method includes: acquiring an original image, the original image including strip-shaped targets; extracting target regions and constructing multi-scale windows based on the original image to obtain multiple centroid localization windows; performing iterative sub-pixel centroid calculation and convergence judgment within each centroid localization window, and fusing the convergence results of multiple windows to obtain the final centroid position of the strip-shaped target; performing endpoint detection on the strip-shaped target in the original image to obtain initial endpoint positions; and iteratively performing square-weighted centroid calculation within multiple scaling windows until convergence based on the initial endpoint positions, and averaging the convergence results of each window to obtain the final endpoint positions.

[0056] 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.

[0057] 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.

[0058] 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 spatial positioning method for a strip-shaped target, characterized in that, include: S102. Acquire the original image, wherein the original image includes the strip-shaped target; S104. Based on the original image, target region extraction and multi-scale window construction are performed to obtain multiple centroid positioning windows, including: threshold segmentation of the original image, extraction of the connected components of the strip-shaped target, and calculation of the minimum bounding rectangle of the connected components; expanding the minimum bounding rectangle outward by a first unit pixel, a second unit pixel, and a third unit pixel in four directions respectively to generate three centroid positioning windows accordingly. S106. Within each centroid positioning window, perform iterative sub-pixel centroid calculation and convergence judgment, and fuse the convergence results of multiple windows to obtain the final centroid position of the strip-shaped target. This includes: within each centroid positioning window, using a trilinear interpolation algorithm to interpolate the pixels within the window to obtain sub-pixel-level grayscale value distribution data; calculating the initial centroid position using a square-weighted centroid algorithm based on the grayscale value distribution data; moving the geometric center of the current centroid positioning window to the initial centroid position to form a new centroid positioning window, and repeating the interpolation and square-weighted centroid calculation process until the distance difference between the centroid positions calculated in two adjacent iterations is less than a preset threshold, at which point iteration stops; the centroid position obtained in the last iteration is taken as the converged centroid of the centroid positioning window; and performing coordinate averaging on the three converged centroids corresponding to the three centroid positioning windows to obtain the final centroid position of the strip-shaped target. S108. Perform endpoint detection on the strip-shaped targets in the original image to obtain the initial endpoint positions; S110. Based on the initial endpoint position, iteratively perform square-weighted centroid calculation within multiple scaling windows until convergence, and perform coordinate averaging on the convergence results of each window to obtain the final endpoint position. This includes: shrinking the minimum bounding rectangle of the connected component inward by a first unit pixel, a second unit pixel, and expanding it outward by a first unit pixel, a second unit pixel, in four directions to generate five endpoint positioning windows; moving the geometric center of each endpoint positioning window to the initial endpoint position, and calculating the endpoint correction position within each endpoint positioning window using the square-weighted centroid algorithm; moving the geometric center of the current endpoint positioning window to the endpoint correction position, and repeating the square-weighted centroid calculation process until the difference in the distance between the endpoint positions calculated in two adjacent iterations is less than a preset threshold, at which point the iteration stops, and the endpoint position obtained in the last iteration is taken as the convergence endpoint of the endpoint positioning window; performing coordinate averaging on the five convergence endpoints corresponding to the five endpoint positioning windows to obtain the final endpoint position of the strip-shaped target.

2. The spatial positioning method for a strip-shaped target according to claim 1, characterized in that, The step of performing endpoint detection on the strip-shaped targets in the original image to obtain the initial endpoint positions includes: The SUSAN algorithm is used to detect the endpoints of the strip-shaped targets in the original image to obtain the initial endpoint positions of the strip-shaped targets.

3. The spatial positioning method for a strip-shaped target according to claim 1, characterized in that, The step of expanding the minimum bounding rectangle outward by a first unit pixel, a second unit pixel, and a third unit pixel in four directions respectively, to generate three centroid positioning windows, includes: The upper and lower boundaries of the minimum bounding rectangle are expanded vertically, and the left and right boundaries are expanded horizontally, with the expansion dimensions in all four directions being the same, thereby generating a first centroid positioning window, a second centroid positioning window, and a third centroid positioning window.

4. The spatial positioning method for a strip-shaped target according to claim 1, characterized in that, The minimum bounding rectangle of the connected component is shrunk inward by a first unit pixel, a second unit pixel, and expanded outward by a first unit pixel and a second unit pixel in four directions, respectively, to generate five endpoint positioning windows, including: The upper and lower boundaries of the minimum bounding rectangle are shrunk inward and expanded outward in the vertical direction, respectively, and the left and right boundaries are shrunk inward and expanded outward in the horizontal direction, respectively, with the shrunk or expanded dimensions being the same in all four directions, thereby generating the first endpoint positioning window, the second endpoint positioning window, the third endpoint positioning window, the fourth endpoint positioning window, and the fifth endpoint positioning window.

5. The spatial positioning method for a strip-shaped target according to claim 1, characterized in that, After obtaining the final centroid position and final endpoint position of the strip-shaped target, the process further includes: S104-S110 are repeated in each frame of the image sequence to obtain the centroid coordinates and endpoint coordinates of the strip-shaped target in each frame; The pointing angle of the strip-shaped target in the corresponding frame is calculated based on the centroid coordinates and endpoint coordinates in the single-frame image. Based on the pointing angle change information and centroid coordinate displacement information in multiple consecutive images, the attitude change parameters and motion trajectory parameters of the strip-shaped target are calculated to achieve spatial target situational awareness.

6. A spatial positioning device for a strip-shaped target, characterized in that, include: The data acquisition module is used to acquire raw images, which include strip-shaped targets; The positioning window construction module is used to extract the target region and construct multi-scale windows based on the original image to obtain multiple centroid positioning windows. The process includes: performing threshold segmentation on the original image, extracting the connected components of the strip-shaped target, and calculating the minimum bounding rectangle of the connected components; expanding the minimum bounding rectangle outward by a first unit pixel, a second unit pixel, and a third unit pixel in four directions respectively, thereby generating three centroid positioning windows. The centroid determination module is used to perform iterative sub-pixel centroid calculation and convergence determination within each centroid positioning window, and to fuse the convergence results of multiple windows to obtain the final centroid position of the strip-shaped target. This includes: within each centroid positioning window, using a trilinear interpolation algorithm to interpolate the pixels within the window to obtain sub-pixel-level grayscale value distribution data; calculating the initial centroid position using a square-weighted centroid algorithm based on the grayscale value distribution data; moving the geometric center of the current centroid positioning window to the initial centroid position to form a new centroid positioning window, and repeating the interpolation and square-weighted centroid calculation process until the distance difference between the centroid positions calculated in two adjacent iterations is less than a preset threshold, at which point iteration stops, and the centroid position obtained in the last iteration is taken as the converged centroid of the centroid positioning window; and performing coordinate averaging on the three converged centroids corresponding to the three centroid positioning windows to obtain the final centroid position of the strip-shaped target. The endpoint detection module is used to perform endpoint detection on the strip-shaped targets in the original image and obtain the initial endpoint positions; The endpoint determination module is used to iteratively perform square-weighted centroid calculation within multiple scaling windows until convergence, based on the initial endpoint position, and to perform coordinate averaging on the convergence results of each window to obtain the final endpoint position. This includes: shrinking the minimum bounding rectangle of the connected component inward by a first unit pixel, a second unit pixel, and expanding it outward by a first unit pixel, a second unit pixel, in four directions to generate five endpoint positioning windows; moving the geometric center of each endpoint positioning window to the initial endpoint position, and calculating the corrected endpoint position within each endpoint positioning window using the square-weighted centroid algorithm; moving the geometric center of the current endpoint positioning window to the corrected endpoint position, and repeating the square-weighted centroid calculation process until the difference in distance between endpoint positions obtained from two adjacent iterations is less than a preset threshold, at which point iteration stops, and the endpoint position obtained from the last iteration is taken as the converged endpoint of that endpoint positioning window; and performing coordinate averaging on the five converged endpoints corresponding to the five endpoint positioning windows to obtain the final endpoint position of the strip-shaped target.

7. 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 spatial positioning method for the strip-shaped target as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Method and apparatus for extracting circular luminous spot second-pixel center

    CN101408985A

  • Camera mass center position extraction method and system, terminal and medium

    CN121458778A