Anti-interference visual alignment method based on Hough transform collaborative template pre-positioning

By combining a visual alignment method based on Hough transform and template pre-alignment with Gaussian pyramid and normalized cross-correlation template matching, the problem of visual alignment methods being susceptible to interference on motion platforms is solved, and efficient and accurate acquisition of multi-degree-of-freedom information is achieved.

CN121564091APending Publication Date: 2026-02-24KUNMING UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511515602.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-22
Publication Date
2026-02-24

AI Technical Summary

Technical Problem

Existing visual alignment methods are susceptible to electromagnetic interference on motion platforms, physical contact sensors are easily damaged, non-physical contact sensors can only measure a single degree of freedom, Hall sensors are sensitive to electromagnetic interference, electromagnetic sensors are easily affected by temperature changes, template matching algorithms have difficulty coping with scale and rotation angle changes, and Hough transform line detection is easily affected by noise interference, leading to false detections.

Method used

An anti-interference visual alignment method based on Hough transform cooperative template pre-positioning is adopted. The template image pyramid is generated for preprocessing, and Gaussian pyramid and normalized cross-correlation template matching are combined to reduce the detection area and perform parallel line filtering. Canny edge detection and Hough line detection are used to achieve accurate positioning.

Benefits of technology

It improves detection efficiency, reduces false detections, enhances matching accuracy and speed in complex environments, adapts to scale and angle changes, and reduces sensitivity to noise interference.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121564091A_ABST
    Figure CN121564091A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image processing, and discloses an anti-interference visual alignment method based on Hough transform collaborative template pre-positioning. According to the method, multi-scale and multi-angle matching is directly carried out on an original size image, so that time is consumed, a Gaussian pyramid is used for downsampling an image, and firstly, the zoom ratio and the rotation angle of a mark on an input image relative to a mark on a template are roughly recognized on a top-layer image; matching is carried out on the bottom layer image according to the known relative zoom ratio and the rotation angle, after the mark position is found on the top layer image of the pyramid, matching is carried out on the top layer image without full-image matching, position coordinates are obtained through matching on the bottom layer image, the position coordinates are mapped to the bottom layer image, and the top layer image is obtained; a plurality of pixels are expanded on the coordinate by taking the size of a template subjected to scaling and rotation as a reference to select an ROI image, template matching is performed on the ROI image, the matching method disclosed by the invention consumes 0.108 seconds on average for each image, and the pyramid-free method consumes 2.518 seconds on average for each image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, specifically to an anti-interference visual alignment method based on Hough transform cooperative template pre-positioning. Background Technology

[0002] In the field of motion platform alignment, physical contact sensors can suffer physical damage, while non-physical contact sensors can mostly only measure a single degree of freedom. Hall sensors are sensitive to electromagnetic interference, and electromagnetic sensors are easily affected by temperature changes. In contrast, vision methods avoid physical contact, thus preventing physical damage and wear; they can acquire multi-degree-of-freedom information, simplifying system complexity; and they are highly robust to environmental conditions.

[0003] In the fields of computer vision and digital image processing, template matching is a method for finding and recognizing target shapes in an image; these target shapes are referred to as markers. The template matching process requires two images: the image to be detected has a higher resolution and is the object of the target search, while the template image containing the marker has a lower resolution. Template matching involves sliding the template image across the image to be detected to calculate a matching score at each position. The position with the highest matching score is identified as the target position. Common template matching algorithms include Normalized Cross-Correlation (NCC), Sum of Squared Errors (SSD), and Maximum Nearest Neighbor Distance (MCD). However, these algorithms struggle to handle markers with scale and rotation variations.

[0004] Hough transform line detection is a classic computer vision method for extracting the geometric features of straight lines from images, widely used in industrial inspection and traffic scene perception. The core of Hough transform line detection is to transform the line features, which are difficult to directly identify in image space, into peak signals that are easy to detect in parameter space through mathematical space transformation, thereby achieving accurate localization and extraction of lines within the image. The image containing line features to be analyzed is called the source image, and the linear geometric structure to be detected (such as part edges, lane lines, building outlines, etc.) is called the target line. The target line is described using a mathematical parameter model (such as polar coordinate parameter ρ-θ, rectangular coordinate parameter kb, etc.), and processing this mathematical parameter model is the core of the method. Common Hough transform-based line detection algorithms include Standard Hough Transform (SHT), Probabilistic Hough Transform (PHT), and Multiscale Hough Transform (MSHT). These algorithms struggle to handle the problem of pseudo-straight line generation caused by noise and other edge point interference, making them prone to false detection or detection failure when affected by image noise and other factors. For example, in assisted driving, they may detect incorrect lane line positions and directions. Summary of the Invention

[0005] To address the shortcomings of existing technologies, this invention provides an anti-interference visual alignment method based on Hough transform cooperative template pre-alignment, which has advantages such as improved detection efficiency and solves the aforementioned technical problems.

[0006] To achieve the above objectives, the present invention provides the following technical solution: an anti-interference visual alignment method based on Hough transform cooperative template pre-alignment, comprising the following steps: S1: Preprocessing template, specifically a set of template image pyramids that generate template images, and scaling and rotating the top layer to obtain several preprocessed top layer template images; S2: Perform pre-positioning processing on the input image and obtain the pre-positioned ROI image; S3: Perform fine-tuning on the ROI image output by S2 to obtain the marked coordinates.

[0007] As a preferred embodiment of the present invention, the specific steps of S2 are as follows: S2.1: Convert the input image into a single-channel grayscale image and perform mean filtering. After mean filtering, perform binarization using the threshold calculated by the Otsu algorithm and generate an input image pyramid with the same number of layers as the template image pyramid. S2.2: Perform normalized cross-correlation template matching between the top-level template image of the template image pyramid and the top-level input image pyramid, calculate the matching score, and select the top three corresponding matching results with the matching scores sorted in descending order. The matching result includes the matching score, the coordinates of the matching position on the input image, and the scaling and rotation values ​​of the top-level template image used. S2.3: Apply scaling and rotation transformations to the template pyramid bottom image using the scaling and rotation values ​​selected in S2.2. Based on the matching results selected in S2.2, map the matching position coordinates to the input image pyramid bottom image, and extend the transformed template pyramid bottom image by several pixels based on the length and width of the matching result to crop the ROI image; S2.4: Perform normalized cross-correlation template matching between the transformed template bottom layer image and the ROI image to obtain a series of bottom layer matching results, and select the matching result with the highest matching score; S2.5: The ROI image is pre-positioned by combining the matching position coordinates corresponding to the matching result selected in S2.4 with the length and width of the transformed template image corresponding to the result and expanding it by several pixels.

[0008] As a preferred embodiment of the present invention, the specific expression for calculating the matching score in step S2.2 is as follows: in, and These are the x and y coordinates of the input image, respectively. and These are the x and y coordinates of the template image, Indicates the input image in coordinates Pixel value at that location, Indicates the template image in coordinates Pixel value at that location, and These are the width and height of the scaled and rotated template images, respectively. This represents the average pixel value of the template image after scaling and rotation. This indicates that the input image is in the coordinate system. The average pixel value within the window described by the width and height of the scaled and rotated template image.

[0009] As a preferred embodiment of the present invention, the average pixel value of the scaled and rotated template image The specific expression is as follows: in, and These are the x and y coordinates of the template image, Indicates the template image in coordinates Pixel value at that location, and These are the width and height of the template image after scaling and rotation, respectively.

[0010] As a preferred technical solution of the present invention, the input image is determined by coordinates. The average pixel value within the window described by the width and height of the scaled and rotated template image. The specific expression is as follows: in, , Both represent summation. Representing coordinates Pixel value at that location, and These are the x and y coordinates of the input image, respectively. and These are the horizontal and vertical coordinates of the template image, respectively.

[0011] As a preferred technical solution of the present invention, step S3 specifically includes the following steps: S3.1: Apply Sobel convolution kernel size 3 to the pre-positioned ROI image in S2 to obtain the marked edge image; S3.2: Perform Hough line detection on the marked edge image with a distance resolution of 1 pixel and an angle resolution of 1° to obtain several straight lines; S3.3: Perform parallel line filtering, retain lines with at least one parallel line, group parallel lines together, and discard single lines without parallel lines. S3.4: Determine if there are only two sets of parallel lines. If not, the detection in the current frame fails, and the detection continues in the next frame. If so, average the two sets of parallel lines to obtain two average straight lines. S3.5: Determine whether the angle difference between the two average lines is greater than a certain threshold. If so, calculate the intersection of the two average lines, which is the marker coordinate. Otherwise, the current frame is considered a detection failure, and the next frame is then used for detection.

[0012] Compared with the prior art, the present invention provides an anti-interference visual alignment method based on Hough transform cooperative template pre-alignment, which has the following beneficial effects: This invention addresses the time-consuming multi-scale, multi-angle matching on the original-size image using existing technology. By using Gaussian pyramid downsampling, the scaling factor and rotation angle of the markers on the input image relative to the markers on the template are first roughly identified on the top-level image. Then, matching is performed on the bottom-level image based on the known relative scaling factor and rotation angle. By finding the marker position on the top-level pyramid image, full-image matching on the bottom-level image is unnecessary, thus improving matching efficiency. The position coordinates are obtained by matching on the top-level image and mapped to the bottom-level image. Then, a Region of Interest (ROI) image is selected by expanding outward by several pixels from this coordinate based on the scaled and rotated template size. Template matching is then performed on this ROI image. The matching method of this invention takes an average of 0.108 seconds per image, while the method without a pyramid takes an average of 2.518 seconds per image. Attached Figure Description

[0013] Figure 1 This is a schematic diagram illustrating an example of the markings used in this invention; Figure 2 This is a schematic diagram of the process of the present invention; Figure 3 This is a schematic diagram of partial information of the annotated file used in the experiment of this invention. Detailed Implementation

[0014] 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, and 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.

[0015] Please see Figures 1-2 An anti-interference visual alignment method based on Hough transform cooperative template pre-alignment includes the following steps: S1: Template preprocessing: Generate a pyramid of template images (the template images are single-channel binarized images, processed during the template image creation stage), with a certain number of pyramid layers. Scale the top layer of the template image pyramid with a certain scaling range (test values ​​0.8 to 1.2) and a certain scaling step (test value 0.1) to obtain a series of images (including the original image with a scaling factor of 1). Iterate through this series of scaled images, rotating each scaled image with a certain rotation angle range (test values ​​0° to 90°, because the example is marked as 90° rotationally symmetric) and a certain rotation step (test value 10°) to obtain a series of images (including the original images with rotation degrees of 0 and 360). Finally, obtain a series of scaled and rotated top-level template images (rotation followed by scaling is also acceptable). Only the top layer of the template image pyramid is scaled and rotated; the other layers are not processed at this stage. S2. Reservation process: Each frame of the image to be detected (hereinafter referred to as the input image) is first converted into a single-channel grayscale image, then subjected to mean filtering, and then binarized using the threshold calculated by the Otsu algorithm to generate an input image pyramid with the same number of layers (3 layers for testing) as the template image pyramid (this pyramid is generated from the input image). Then, the preprocessed series of top-level template images are traversed, and normalized cross-correlation template matching is performed on the top-level input image pyramid. The correlation data with the best score in each match is recorded as the matching result, resulting in a series of matching results. Each matching result includes the best matching score of that match, the coordinates of the matching position on the input image, and the scaling and rotation values ​​of the top-level template image used.

[0016] The matching score is calculated using equation (1), and is obtained for each matching. One matching score; in and The width and height of the input image are respectively. The higher the matching score calculated by the normalized cross-correlation method, the better.

[0017] All matching results are sorted by matching score, and the top three matching results with the best scores are recorded (the first three results are taken during testing). These matching results are iterated through, and the scaling and rotation values ​​in each matching result are used to apply scaling and rotation transformations to the bottom layer image of the template pyramid (the bottom layer is matched directly after the top layer is matched; intermediate layers are not matched). The matching position coordinates in each matching result are mapped to the bottom layer image of the input image pyramid. The ROI image is then cropped by extending the dimensions of the transformed template image corresponding to the matching result by several pixels. Normalized cross-correlation template matching is performed between the transformed bottom layer image and the ROI image to obtain a series of bottom layer matching results. The matching position coordinates corresponding to the best-scoring matching result (only the best-scoring result is taken) are combined with the dimensions of the transformed template image corresponding to that result and extended by several pixels to obtain the ROI used for fine localization (since the input image has been processed into a single-channel binary image, this ROI is also a single-channel binary image). Both the top-level matching mentioned above and this stage use "normalized cross-correlation template matching" in this process, but the difference is: 1. In the top-level matching stage, the "scaled and rotated template top-level image" is traversed to match the "input image top-level image".

[0018] 2. In this stage, the three matching results obtained from the top-level matching are traversed, and the scaling and rotation values ​​in the matching results are used to scale and rotate the template bottom image. The transformed template bottom image is then matched with the ROI image cropped from the bottom image of the input image pyramid.

[0019] in and These are the x and y coordinates of the input image, respectively. and These are the x and y coordinates of the template image, and These are the width and height of the template image after a two-dimensional affine transformation (i.e., scaling and rotation). Indicates the template image in coordinates Pixel value at that location, Indicates the input image in coordinates Pixel value at that location, This represents the average pixel value of the template image after a two-dimensional affine transformation. This indicates that the input image is in the coordinate system. The average pixel value in the window described by the width and height of the template image after the two-dimensional affine transformation is specifically expanded as follows during the above expansion process: the length and width are expanded by 20 pixels each. During the expansion, the center of the ROI rectangle remains unchanged. That is, the left edge of the ROI rectangle moves 10 pixels to the left relative to the center of the ROI rectangle, and the right edge moves 10 pixels to the right relative to the center of the ROI rectangle. The same applies to the top and bottom edges. In the specific operation of OpenCV: the coordinates of the ROI rectangle (the coordinates of the ROI are the coordinates of the top left corner of the rectangle) move 10 pixels to the left (when the ROI coordinates move, the length and width of the rectangle do not change, so at this time the right edge of the ROI will move 10 pixels to the left at the same time), and the right edge moves 20 pixels to the right relative to the center of the ROI rectangle. 3. Precise positioning process: The pre-located ROI (single-channel binary image) is processed using Canny edge detection with a Sobel convolution kernel size of 3 to obtain a labeled edge image. Hough line detection with a distance resolution of 1 pixel and an angle resolution of 1° is then performed on the labeled edge image to obtain several straight lines. Parallel line filtering is then performed: lines with at least one parallel line are retained, and mutually parallel lines are grouped together; single lines without mutually parallel lines are discarded. It is determined whether there are only two groups of parallel lines. If not, the current frame detection fails, and the next frame is detected. If so, the two groups of parallel lines are averaged to obtain two average lines. Finally, it is determined whether the angle difference between the two average lines is greater than a certain threshold. If so, the intersection point of the two average lines is calculated, and this intersection point is the labeled coordinate; otherwise, the current frame is considered a detection failure, and the next frame is detected. Since the labeled cross shape has only two lines, ideally only two average lines will be obtained, resulting in only one intersection point, which is the labeled coordinate. This invention proposes a visual detection algorithm based on template matching and Hough line detection for visual alignment. To address the difficulty of normalized cross-correlation template matching in handling scale and angle variations, this invention employs two-dimensional affine transformation and Gaussian image pyramids. Regarding the issue of Hough line detection, where multiple lines are easily detected on a single edge due to noise or non-target edge clutter, this invention avoids this problem by reducing the detection area and averaging parallel lines.

[0020] Gaussian image pyramids are a computer vision technique for multi-scale image representation. This method processes the original image into a series of hierarchical images. The original image, which serves as the processing baseline, is called the bottom layer image. Images with progressively decreasing resolution are generated layer by layer from the bottom layer upwards (the width and height are reduced to half each layer, and the total number of pixels is reduced to one-quarter each layer). The lower-level images are first smoothed by Gaussian kernel convolution before the image layers with decreasing resolution are generated upwards. The overall structure, resembling a pyramid with the largest width and height at the bottom and the smallest at the top, is named as such.

[0021] To achieve the above objectives, the visual alignment algorithm of the present invention is divided into two parts: pre-alignment and fine alignment.

[0022] The precise positioning algorithm of this invention relies on a specific type of marker, which must use the intersection of the crosshairs as the marker coordinate point. Pre-positioning algorithms are not subject to this restriction. Example markers include... Figure 1 As shown.

[0023] Pre-localization process: First, capture images of the target marker and create a template image from the captured marker image. This template image is processed into a single-channel binarized image to improve the accuracy of template matching. The pixels covered by the marker are pure white, and other areas are pure black. Then, create a set of Gaussian image pyramids (hereinafter referred to as pyramids) for the template image and each frame of the input image. Perform multi-scale, multi-angle normalized cross-correlation template matching on the top layer of the pyramid for rapid localization, and record the best matching results. Finally, refer to the matching results of the top layer to perform normalized cross-correlation template matching on the bottom layer of the pyramid. The area with the best matching score in this matching is the location of the identified marker. This area is appropriately expanded by several pixels to select the ROI (Region of Interest) for fine localization processing.

[0024] The fine localization process is as follows: First, Canny edge detection is applied to the pre-localized ROI image; then, Hough line detection is performed on the edge image to obtain a set of lines; next, these lines are filtered for parallel lines to obtain several sets of parallel lines; then, it is determined whether there are only two sets of parallel lines. If so, the average of each set of parallel lines is calculated to obtain an average line; otherwise, the current frame is considered a detection failure. Finally, it is determined whether the average lines are approximately perpendicular to each other. If so, the intersection points between each pair of average lines are calculated, and these intersection points are the marker coordinates; otherwise, the current frame is considered a detection failure. This invention proposes a visual alignment algorithm, which has the following advantages: (1) Within the preset range of scale and angle variation, the present invention can successfully identify and match with a high score.

[0025] (2) In the field of visual alignment, this invention uses Gaussian pyramid acceleration for scale-adaptive template matching. Compared with methods that simply scale and rotate templates without pyramid acceleration, this invention only traverses the scaled and rotated templates for matching in the top layer (small-size layer) where the matching computation is small, and uses the top layer matching information for a small number of matches in the bottom layer (original-size layer) where the matching computation is large. Therefore, it is faster. The experiment collected 200 images with a resolution of 1920×1080 as the test dataset. The final experimental results are shown in Table 1 below: Table 1 In Table 1, “Rotation and Scaling NCC” refers to NCC template matching without a pyramid but with rotation and scaling, and “Pre-positioning of the present invention” refers to NCC template matching with a pyramid and with rotation and scaling proposed in the present invention. In this embodiment, the specific experimental procedure is as follows: Two hundred images with a resolution of 1920×1080 were collected as a test dataset. The image coordinates of the center of each image were labeled. The labeling process did not modify the image; instead, the corresponding image coordinate values ​​for each image were saved in a labeling file (XML format). Furthermore, a white dot was added to the center of each label to assist in manually labeling the center coordinates. After obtaining the image coordinates of the labels, the visual alignment algorithm designed in this paper calculates the Euclidean distance between the obtained coordinates and the manually labeled coordinates in the labeling file (i.e.,...). ) as pixel error; To obtain the actual position error, the camera used in the experiment needs to be calibrated. The calibration method of Zhang Zhengyou was used, and the data obtained are as follows: Among them Internal Reference As an external reference, These are the distortion coefficients. The data obtained from calibration can be used to map pixel errors to actual position errors.

[0026] Rotation and scaling parameters: scaling range from 0.8× to 1.2×, step size 0.1×; rotation range from 0° to 90°, step size 10°. The final experimental results are shown in Table 2 below: Table 2 The algorithm of this invention consists of two parts: pre-positioning and fine positioning. The 0.106 seconds in Table 1 above is the time of the pre-positioning algorithm only. Table 1 is for comparison with the algorithm without pyramid acceleration to show that the pre-positioning algorithm of this invention is faster. Table 2 is the experiment of the overall algorithm (i.e., pre-positioning + fine positioning), with an additional fine positioning process. The success rate of 100% in Table 1 is the matching success rate. In the overall algorithm in Table 2, the matching success rate of pre-positioning is naturally also 100% (the image dataset used is the same as that in Table 1). In the dataset, 1% of the images may not have two lines after the parallel line processing of fine positioning. For example, there may only be one line left, and there may be no intersection point. (3) Pre-positioning reduces the detection area, and Hough line detection will not be affected by too much noise from points far from the edge.

[0027] (4) In the field of visual alignment, pre-positioning is used to narrow the detection range of straight lines and parallel line filtering plus averaging to avoid the Hough line false detection problem. After grouping parallel lines, averaging can avoid the interference of non-target edge clutter points on the target edge line detection in Hough line detection. Normalized cross-correlation template matching struggles to handle markers with scale and angle transformations. This invention scales and rotates a smaller template image, then matches it against the input image.

[0028] Performing multi-scale, multi-angle matching directly on the original-size image is too time-consuming. Using Gaussian pyramid downsampled images, we first roughly identify the scaling factor and rotation angle of the markers on the input image relative to the markers on the template on the top-level (small-size) image, and then perform matching on the bottom-level (original-size) image based on the known relative scaling factor and rotation angle.

[0029] After finding the marked location on the top layer image of the pyramid, it is not necessary to perform full-image matching on the bottom layer image. The location coordinates are obtained by matching on the top layer image, and these location coordinates are mapped to the bottom layer image. Then, a Region of Interest (ROI) image is selected by expanding outward by several pixels from this coordinate based on the template size that has been scaled and rotated. Template matching is then performed on this ROI image.

[0030] Hough line detection is prone to false detection due to noise across the entire image. Pre-positioning can be used to reduce the detection area and avoid the influence of large-scale noise.

[0031] Hough line detection is prone to false detection due to cluttered points at non-target edges. A parallel line averaging method can be used to mitigate this. The method described in this invention is applicable to scenarios where a precise relative positional relationship between the actuator and the operating plane is required.

[0032] 1. Surface Mount Technology (SMT) for Printed Circuit Boards (PCBs): SMT precisely mounts surface mount components such as resistors, capacitors, and chips onto pre-defined pads on the PCB. This requires the pads and the component gripper to maintain a precise relative position. Markers are created on the PCB, and a camera is mounted on the gripper. A visual alignment algorithm is used to detect the mark position (the mark position is the position of the PCB relative to the camera). The vector difference between the current mark position and the target position is calculated. This vector difference is then combined with the position of the pad on the PCB in the Gerber file to ensure the control system maintains a precise relative position between the target pad and the gripper, guaranteeing correct mounting.

[0033] 2. Printing production dates on beverage bottles on an assembly line: Marks are made near the area where printing is required. The camera recognizes the mark position, and through coordinate transformation, the printing head can print the production date to the designated position.

[0034] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. An anti-interference visual alignment method based on Hough transform cooperative template pre-alignment, characterized in that: Includes the following steps: S1: Preprocessing template, specifically a set of template image pyramids that generate template images, and scaling and rotating the top layer to obtain several preprocessed top layer template images; S2: Perform pre-positioning processing on the input image and obtain the pre-positioned ROI image; S3: Perform fine-tuning on the ROI image output by S2 to obtain the marked coordinates.

2. The anti-interference visual alignment method based on Hough transform cooperative template pre-alignment according to claim 1, characterized in that: The specific steps of S2 are as follows: S2.1: Convert the input image into a single-channel grayscale image and perform mean filtering. After mean filtering, perform binarization using the threshold calculated by the Otsu algorithm and generate an input image pyramid with the same number of layers as the template image pyramid. S2.2: Perform normalized cross-correlation template matching between the top-level template image of the template image pyramid and the top-level input image pyramid, calculate the matching score, and select the top three corresponding matching results with the matching scores sorted in descending order. The matching result includes the matching score, the coordinates of the matching position on the input image, and the scaling and rotation values ​​of the top-level template image used. S2.3: Apply scaling and rotation transformations to the template pyramid bottom image using the scaling and rotation values ​​selected in S2.

2. Based on the matching results selected in S2.2, map the matching position coordinates to the input image pyramid bottom image, and extend the transformed template pyramid bottom image by several pixels based on the length and width of the matching result to crop the ROI image; S2.4: Perform normalized cross-correlation template matching between the transformed template bottom layer image and the ROI image to obtain a series of bottom layer matching results, and select the matching result with the highest matching score; S2.5: The ROI image is pre-positioned by combining the matching position coordinates corresponding to the matching result selected in S2.4 with the length and width of the transformed template image corresponding to the result and expanding it by several pixels.

3. The anti-interference visual alignment method based on Hough transform cooperative template pre-alignment according to claim 2, characterized in that: The specific expression for calculating the matching score in S2.2 is as follows: in, and These are the x and y coordinates of the input image, respectively. and These are the x and y coordinates of the template image, Indicates the input image in coordinates Pixel value at that location, Indicates the template image in coordinates Pixel value at that location, and These are the width and height of the scaled and rotated template images, respectively. This represents the average pixel value of the template image after scaling and rotation. This indicates that the input image is in the coordinate system. The average pixel value within the window described by the width and height of the scaled and rotated template image.

4. The anti-interference visual alignment method based on Hough transform cooperative template pre-alignment according to claim 2, characterized in that: The average pixel value of the scaled and rotated template image The specific expression is as follows: in, and These are the x and y coordinates of the template image, Indicates the template image in coordinates Pixel value at that location, and These are the width and height of the template image after scaling and rotation, respectively.

5. The anti-interference visual alignment method based on Hough transform cooperative template pre-alignment according to claim 2, characterized in that: The input image is composed of coordinates The average pixel value within the window described by the width and height of the scaled and rotated template image. The specific expression is as follows: in, , Both represent summation. Representing coordinates Pixel value at that location, and These are the x and y coordinates of the input image, respectively. and These are the horizontal and vertical coordinates of the template image, respectively.

6. The anti-interference visual alignment method based on Hough transform cooperative template pre-alignment according to claim 1, characterized in that: S3 specifically includes the following steps: S3.1: Apply Sobel convolution kernel size 3 to the pre-positioned ROI image in S2 to obtain the marked edge image; S3.2: Perform Hough line detection on the marked edge image with a distance resolution of 1 pixel and an angle resolution of 1° to obtain several straight lines; S3.3: Perform parallel line filtering, retain lines with at least one parallel line, group parallel lines together, and discard single lines without parallel lines. S3.4: Determine if there are only two sets of parallel lines. If not, the detection in the current frame fails, and the detection continues in the next frame. If so, average the two sets of parallel lines to obtain two average straight lines. S3.5: Determine whether the angle difference between the two average lines is greater than a certain threshold. If so, calculate the intersection of the two average lines, which is the marker coordinate. Otherwise, the current frame is considered a detection failure, and the next frame is then used for detection.