A method and system for wire tracking based on a Gaussian process
By using a Gaussian process-based wire tracing method and leveraging Gaussian regression of gradient images and anchor point sets, the accuracy and cost issues of wire segmentation and tracing in existing technologies are resolved, achieving efficient and accurate wire detection.
Patent Information
- Application Number
- CN202310791783.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-29
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2043-06-29
AI Technical Summary
Existing wire segmentation and tracking methods are insufficient in terms of accuracy and cost. Classical methods cannot adaptively segment wires with different textures, while deep learning methods require large datasets and specialized hardware, resulting in high universality and cost.
A Gaussian process-based wire tracking method is adopted. By acquiring gradient images, detecting anchor point sets, performing Gaussian process regression and kernel density distribution estimation, high-probability anchor points are selected and merged to generate wire detection results.
It improves the accuracy and efficiency of wire tracking, reduces dependence on datasets and hardware, reduces data processing volume, and adapts to wire segmentation in different environments.
Smart Images

Figure CN117173220B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to a wire tracing method and system based on Gaussian processes. Background Technology
[0002] Indoor and outdoor robots need to detect cables in the space in real time during movement in order to avoid obstacles. Most existing cable segmentation and tracking methods use classic methods based on image features or neural networks trained with deep learning.
[0003] The classical methods include edge detectors using the Sobel operator and line tracking based on active contour methods, while the deep learning methods include semantic segmentation and detection based on DNNs.
[0004] The classic method only extracts single features such as points and lines from the image, without taking into account the distribution of the dataset itself. The wire tracing method designed by it cannot adaptively segment the outline of wires with different textures, resulting in low accuracy in wire tracing. The deep learning method used by the latter usually requires a large dataset and dedicated hardware to be used in practice, which is not very common and has a high cost. Summary of the Invention
[0005] To address the aforementioned technical problems, this invention discloses a wire tracing method and system based on Gaussian processes, which reduces the efficiency and cost of wire tracing and improves the accuracy of wire segmentation and tracing.
[0006] To achieve the above objectives, this invention discloses a wire tracing method based on a Gaussian process, comprising:
[0007] Obtain the gradient image corresponding to the image to be detected, and check whether the first anchor point set corresponding to the image to be detected is empty;
[0008] If the first set of anchor points corresponding to the image to be detected is empty, then the second set of anchor points corresponding to the image to be detected is obtained according to the preset wire template image;
[0009] If the first anchor point set corresponding to the image to be detected is not empty, then the Gaussian process is updated according to the first anchor point set, and the homogeneous change of the image to be detected is estimated through the gradient image, so that the first anchor point set is processed according to the homogeneous change to obtain the second anchor point set corresponding to the image to be detected.
[0010] Perform Gaussian process regression on the second anchor point set to obtain several first sampling curves corresponding to the second anchor point set;
[0011] The gradient image is used to filter the plurality of first sampling curves to determine the second sampling curve, and the kernel density distribution of the second sampling curve is estimated to obtain the distribution probability of each of the plurality of second anchor points contained in the second sampling curve.
[0012] Based on the distribution probability, several third anchor points with distribution probabilities greater than a preset probability threshold are obtained from the several second anchor points.
[0013] The plurality of third anchor points are subjected to interval suppression and merged with the second anchor point set to obtain the third anchor point set corresponding to the image to be detected;
[0014] The image to be detected is subjected to wire detection based on the third set of anchor points to obtain the wire detection result of the image to be detected.
[0015] This invention discloses a wire tracing method based on Gaussian processes. By using Gaussian process regression, the efficiency and accuracy of wire tracing are improved. Based on Gaussian process regression, the method first acquires the gradient image corresponding to the image to be detected, facilitating the filtering of subsequently obtained anchor points, reducing the amount of data to be processed, and improving the efficiency of wire tracing. Then, while acquiring the gradient image, it checks whether the image to be detected has a corresponding set of anchor points to determine if the image to be detected has reference anchor points. If so, the Gaussian process is updated for the anchor point set, and the secondary transformation is calculated to apply the transformation of the existing anchor point set to the current image, thereby avoiding the need to redetermine anchor points, reducing data processing volume, and improving the efficiency of wire tracing. If not, a preset line can be used for wire tracing. The material template image first determines the set of anchor points corresponding to the image to be detected. After obtaining the set of anchor points, Gaussian regression is performed on the set of anchor points to obtain several corresponding curves. Each curve includes several anchor points. Then, the curves are filtered, and the anchor points in the filtered curves are further filtered to obtain more accurate anchor points. Then, the image to be detected is traced according to the anchor points to obtain the tracing result of the wire. This invention uses the Gaussian process regression method to trace the wire based on the information of different wires in different environments. It does not require training on a large-scale dataset, thus improving the efficiency of wire tracing. At the same time, this invention uses a preset image template to generate anchor points for the image to be detected and performs wire tracing according to the curves corresponding to the anchor points, thereby improving the efficiency of wire tracing.
[0016] As a preferred example, obtaining the gradient image corresponding to the image to be detected includes:
[0017] Gaussian smoothing is applied to the image to be detected to obtain the corresponding Gaussian image.
[0018] The image to be detected is convolved according to a preset gradient kernel to obtain the gradient image in the two-dimensional direction corresponding to the Gaussian image.
[0019] The present invention performs Gaussian smoothing on the image to be detected to reduce the noise present in the image. Then, it uses a preset gradient kernel to perform convolution processing on the Gaussian image to obtain a gradient image in two dimensions, which facilitates the subsequent screening of anchor points, removes anchor points with large errors, and improves the accuracy of wire detection.
[0020] As a preferred example, obtaining the second set of anchor points corresponding to the image to be detected based on the preset wire template image includes:
[0021] The image to be detected is subjected to Gaussian pyramid transformation to obtain several pyramid images corresponding to the image to be detected.
[0022] Based on the preset wire template diagram, normalization matching is performed on each layer of the pyramid image in the plurality of pyramid images to obtain the second anchor point set corresponding to the image to be detected.
[0023] The present invention performs Gaussian pyramid transformation on the image to be detected to obtain several layers of pyramid images corresponding to the image to be detected, so as to use a preset wire template image to perform normalization matching on each layer of pyramid image, thereby improving the accuracy of anchor point extraction.
[0024] As a preferred example, the process of updating the Gaussian based on the first anchor point set and estimating the homogeneous change of the image to be detected using the gradient image, so as to process the first anchor point set according to the homogeneous change to obtain a second anchor point set corresponding to the image to be detected, includes:
[0025] The homogeneous change between the previous frame image and the image to be detected is estimated based on the gradient image to obtain the homogeneous change between the previous frame image and the image to be detected.
[0026] The first set of anchor points is transformed to the image to be detected according to the homogeneous transformation, and anchor points that are not within the range of the image to be detected are removed to obtain the second set of anchor points corresponding to the image to be detected.
[0027] When the present invention detects the existence of an anchor point set in the current frame detection image, it calculates the homogeneous change between the previous frame image and the current frame image, and then changes the anchor point set into the current frame, so as to determine the anchor points of the wire image in the current frame based on the previous anchor point set, thereby improving the efficiency and accuracy of wire detection.
[0028] As a preferred example, the Gaussian process regression is performed on the second anchor point set to obtain several first sampling curves corresponding to the second anchor point set, including:
[0029] Calculate the noise kernel matrix and weight vector corresponding to each anchor point in the second anchor point set, and perform Gaussian process regression on each anchor point in the second anchor point set based on the noise kernel matrix and weight vector to obtain the posterior prediction distribution value corresponding to each anchor point; the posterior prediction distribution value includes the posterior mean and variance;
[0030] The second set of anchor points is rasterized, and the anchor points in the second set of anchor points are sampled according to the posterior predicted distribution value to generate the plurality of first sampling curves; the first sampling curves contain a plurality of anchor points.
[0031] This invention performs Gaussian process regression on the anchor points in the second set of anchor points to obtain the distribution value of each anchor point. Then, the anchor points are connected according to the distribution value to generate several corresponding curves, so as to basically determine the curve pixels of the wire, which facilitates subsequent wire tracking and improves the efficiency and accuracy of wire tracking.
[0032] As a preferred example, the step of filtering the plurality of first sampling curves based on the gradient image to determine the second sampling curve includes:
[0033] Based on the gradient image, a score is calculated for each of the plurality of first sampling curves using a preset scoring formula, and each of the plurality of first sampling curves is sorted according to the score.
[0034] Based on the sorting, several second sampling curves with the highest scores are selected from the several first sampling curves.
[0035] This invention uses a preset scoring formula to calculate the overlap between each sampling curve and the gradient image, and then scores the first sampling curve based on the overlap to obtain a score corresponding to each sampling curve. Based on the scores, several first sampling curves with the highest scores are selected as second sampling curves, thereby reducing errors and improving the accuracy of wire tracking.
[0036] As a preferred example, the step of estimating the kernel density distribution of the second sampling curve to obtain the distribution probability of each of the plurality of second anchor points contained in the second sampling curve includes:
[0037] Based on the preset kernel density estimation method and Gaussian kernel, the kernel density distribution of each second anchor point contained in the second sampling curve is estimated to obtain the distribution function corresponding to each second anchor point;
[0038] The distribution probability corresponding to each second anchor point is obtained based on the distribution function.
[0039] This invention utilizes a kernel density estimation method to estimate the distribution probability of each anchor point in a second curve, so that the anchor points in the curve can be screened according to the distribution probability, thereby improving the accuracy of wire tracing.
[0040] As a preferred example, the step of performing interval suppression on the plurality of third anchor points and merging them with the second anchor point set to obtain the third anchor point set corresponding to the image to be detected includes:
[0041] The plurality of third anchor points are divided into intervals according to the preset interval length to obtain a plurality of sub-intervals;
[0042] The third anchor point with the highest probability distribution in each of the several sub-intervals is retained, and the third anchor point with the highest probability distribution is merged into the second anchor point set to obtain the third anchor point set.
[0043] The present invention divides the third anchor point into intervals so that the anchor point with the highest probability distribution is retained in each interval. The anchor point with the highest probability distribution is merged with the second anchor point set, which can accurately locate the position of the wire in the image to be detected and improve the accuracy of the wire detection.
[0044] On the other hand, this invention discloses a wire tracing system based on a Gaussian process, including an image processing module, an anchor point acquisition module, a Gaussian processing module, a distribution calculation module, a filtering module, a merging module, and a tracing module:
[0045] The image processing module is used to obtain the gradient image corresponding to the image to be detected, and to detect whether the first anchor point set corresponding to the image to be detected is empty;
[0046] The anchor point acquisition module is used to acquire a second anchor point set corresponding to the image to be detected based on a preset wire template image if the first anchor point set corresponding to the image to be detected is empty. If the first anchor point set corresponding to the image to be detected is not empty, the Gaussian process is updated based on the first anchor point set, and the homogeneous change of the image to be detected is estimated through the gradient image, so that the first anchor point set is processed according to the homogeneous change to obtain the second anchor point set corresponding to the image to be detected.
[0047] The Gaussian processing module is used to perform Gaussian process regression on the second anchor point set to obtain several first sampling curves corresponding to the second anchor point set.
[0048] The distribution calculation module is used to filter the plurality of first sampling curves according to the gradient image, determine the second sampling curve, and perform kernel density distribution estimation on the second sampling curve to obtain the distribution probability of each of the plurality of second anchor points contained in the second sampling curve.
[0049] The filtering module is used to filter from the plurality of second anchor points according to the distribution probability to obtain a plurality of third anchor points whose distribution probability is greater than a preset probability threshold;
[0050] The merging module is used to perform interval suppression on the plurality of third anchor points and merge them with the second anchor point set to obtain the third anchor point set corresponding to the image to be detected.
[0051] The tracking module is used to perform wire tracking on the image to be detected based on the third anchor point set, and obtain the wire tracking result of the image to be detected.
[0052] This invention discloses a wire tracing system based on Gaussian processes. By using Gaussian process regression, the system improves the efficiency and accuracy of wire tracing. First, it acquires the gradient image corresponding to the image to be detected, facilitating the filtering of subsequently obtained anchor points, reducing the amount of data to be processed, and improving the efficiency of wire tracing. Then, while acquiring the gradient image, it checks whether the image to be detected has a corresponding set of anchor points to determine if a reference anchor point exists. If it does, the Gaussian process is updated for the anchor point set, and the subsequent transformation is calculated to apply the transformation to the current image, thereby avoiding the need to redetermine anchor points, reducing data processing volume, and improving the efficiency of wire tracing. If no anchor point exists, a preset line can be used for wire tracing. The material template image first determines the set of anchor points corresponding to the image to be detected. After obtaining the set of anchor points, Gaussian regression is performed on the set of anchor points to obtain several corresponding curves. Each curve includes several anchor points. Then, the curves are filtered, and the anchor points in the filtered curves are further filtered to obtain more accurate anchor points. Then, the image to be detected is traced according to the anchor points to obtain the tracing result of the wire. This invention uses the Gaussian process regression method to trace the wire based on the information of different wires in different environments. It does not require training on a large-scale dataset, thus improving the efficiency of wire tracing. At the same time, this invention uses a preset image template to generate anchor points for the image to be detected and performs wire tracing according to the curves corresponding to the anchor points, thereby improving the efficiency of wire tracing.
[0053] As a preferred example, the image processing module further includes a smoothing unit and a convolution unit;
[0054] The smoothing unit is used to perform Gaussian smoothing on the image to be detected to obtain a Gaussian image corresponding to the image to be detected.
[0055] The convolution unit is used to perform convolution processing on the image to be detected according to a preset gradient kernel to obtain the gradient image in the two-dimensional direction corresponding to the Gaussian image.
[0056] The present invention performs Gaussian smoothing on the image to be detected to reduce the noise present in the image. Then, it uses a preset gradient kernel to perform convolution processing on the Gaussian image to obtain a gradient image in two dimensions, which facilitates the subsequent screening of anchor points, removes anchor points with large errors, and improves the accuracy of wire detection. Attached Figure Description
[0057] Figure 1 : A schematic flowchart of a wire tracing method based on a Gaussian process provided in an embodiment of the present invention;
[0058] Figure 2 : A schematic diagram of a wire tracking system based on a Gaussian process provided in an embodiment of the present invention. Detailed Implementation
[0059] 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.
[0060] Example
[0061] This invention provides a wire tracing method based on a Gaussian process. The specific implementation process of the wire tracing method can be found in [reference needed]. Figure 1 It mainly includes steps 101 to 108, the steps being:
[0062] Step 101: Obtain the gradient image corresponding to the image to be detected, and detect whether the first anchor point set corresponding to the image to be detected is empty.
[0063] In this embodiment, the step mainly includes: performing Gaussian smoothing on the image to be detected to obtain a Gaussian image corresponding to the image to be detected; performing convolution processing on the image to be detected according to a preset gradient kernel to obtain a gradient image in the two-dimensional direction corresponding to the Gaussian image.
[0064] For example, in this embodiment, a video stream is acquired through a camera. The video stream contains several frames of image data. Assuming that the image to be detected is the k-th frame, the gradient image of the current frame k is calculated. The gradient image is obtained by performing Gaussian smoothing on the original image, and then performing a convolution operation on the image using a gradient kernel to obtain the gradient image ∇I in the x and y directions. k .
[0065] This step performs Gaussian smoothing on the image to be detected to reduce noise. Then, a preset gradient kernel is used to convolve the Gaussian image to obtain a gradient image in two dimensions. This facilitates the subsequent selection of anchor points, eliminating anchor points with large errors and improving the accuracy of wire detection.
[0066] Step 102: If the first anchor point set corresponding to the image to be detected is empty, then obtain the second anchor point set corresponding to the image to be detected according to the preset wire template image.
[0067] In this embodiment, the step mainly includes: performing Gaussian pyramid transformation on the image to be detected to obtain several pyramid images corresponding to the image to be detected; and performing normalization matching on each pyramid image in the several pyramid images according to a preset wire template diagram to obtain a second anchor point set corresponding to the image to be detected.
[0068] For example, in this embodiment, if the current anchor point set is empty, an initial anchor point set S0 of the wire distribution in the image is obtained using a preset wire template image. Preferably, the initial points of the wire distribution in the initial frame I0 are obtained using a template image T. A Gaussian pyramid transformation is performed on I0, and for each pyramid layer, normalization matching is performed using the template T to obtain the initial anchor point set S0. The specific steps of performing the Gaussian pyramid transformation using the template image include obtaining the current frame image I0. k The d-layer Gaussian pyramid method is as follows: the first layer image is I k Gaussian blurring is performed to obtain I k,1 ′, downsample it to obtain the second-level pyramid image P k,2 Then P k,2 Continue repeating Gaussian blurring and downsampling to obtain a pyramid image set. Using a template image T, perform template matching once for each layer of the pyramid image set. The template matching method is as follows: assuming the template is T and the matching image is I, use a normalized correlation coefficient to match the pyramid {I} of image I. k ,P k,2 ,…,P k,dThe matching process generates scores {S1, S2, ..., Sn}. The final score for template matching is the maximum value among these scores. For each template in the template database, the above method is used to obtain a score. The highest score is selected as the matching score between the template database and the image. Preferably, a score threshold can be set. If the score is greater than the set threshold, subsequent operations are performed. Otherwise, the current frame is skipped.
[0069] The present invention performs Gaussian pyramid transformation on the image to be detected to obtain several layers of pyramid images corresponding to the image to be detected, so as to use a preset wire template image to perform normalization matching on each layer of pyramid image, thereby improving the accuracy of anchor point extraction.
[0070] Step 103: If the first anchor point set corresponding to the image to be detected is not empty, then update the Gaussian process according to the first anchor point set, and estimate the homogeneous change of the image to be detected through the gradient image, so as to process the first anchor point set according to the homogeneous change to obtain the second anchor point set corresponding to the image to be detected.
[0071] In this embodiment, the step mainly includes: estimating the homogeneous change between the previous frame image and the image to be detected based on the gradient image to obtain the homogeneous change between the previous frame image and the image to be detected; transforming the first anchor point set to the image to be detected based on the homogeneous change, and removing anchor points that are not within the range of the image to be detected to obtain the second anchor point set corresponding to the image to be detected.
[0072] For example, if the current anchor point set is not empty, the anchor point set S obtained from the previous frame is used. k-1 Update the Gaussian process to obtain the posterior predicted distribution PPD, and use ▽I k Estimate the homogeneous transformation H from frame k-1 to frame k. k Using H k Set the anchor point set S of frame k-1 k-1 Transform to k frames and remove points outside the range of k frames to obtain S. k In this embodiment, ▽I k Estimate the homogeneous transformation H from frame k-1 to frame k. k Includes the set of anchor points S for frame k-1. k-1 Solve for the optimal H k =argmax score(p,▽I k (p)), p∈S k-1 H is obtained by using Gauss-Newton equations. k .
[0073] In this embodiment, when an anchor point set is detected in the current frame image, the homogeneous change between the previous frame image and the current frame image is calculated, and then the anchor point set is changed into the current frame. This allows the anchor points of the wire image in the current frame to be determined based on the previous anchor point set, thereby improving the efficiency and accuracy of wire detection.
[0074] Step 104: Perform Gaussian process regression on the second anchor point set to obtain several first sampling curves corresponding to the second anchor point set.
[0075] In this embodiment, the step mainly includes: calculating the noise kernel matrix and weight vector corresponding to each anchor point in the second anchor point set, and performing Gaussian process regression on each anchor point in the second anchor point set according to the noise kernel matrix and weight vector to obtain the posterior predicted distribution value corresponding to each anchor point; the posterior predicted distribution value includes the posterior mean and variance; rasterizing the second anchor point set, and sampling the anchor points in the second anchor point set according to the posterior predicted distribution value to generate the plurality of first sampling curves; the first sampling curves contain a plurality of anchor points.
[0076] For example, in this embodiment, Gaussian process regression is applied to the second anchor point set to obtain the posterior predicted distribution PPD, and L curves f are sampled on the x-axis grid using the PPD. L ={x li y li Let f be a curve, l∈1,···L. Each curve contains several anchor points. For all points in the second anchor point set, calculate the noisy kernel matrix K and the weight vector a of all samples. Rasterize the x-axis. For each point on the rasterized graph, calculate its posterior mean and variance. Use this mean and variance to sample L points to obtain L curves f. L ={x li y li}, l∈1,···L. Further, in this embodiment, the Gaussian process used is P(f * |x,y)~N(0,K ** ),K ** =K(x*,x*), where K uses the RBF kernel function. D = (x,y) is the training set for each iteration, specifically x is the set of image x-coordinates of the anchor point set obtained in each round of calculation, and y is the set of corresponding image y-coordinates.
[0077] This embodiment performs Gaussian process regression on the anchor points in the second set of anchor points to obtain the distribution value of each anchor point. Then, the anchor points are connected according to the distribution value to generate several corresponding curves, so as to basically determine the curve pixels of the wire, which facilitates subsequent wire tracking and improves the efficiency and accuracy of wire tracking.
[0078] Step 105: Based on the gradient image, filter the plurality of first sampling curves to determine the second sampling curve, and perform kernel density distribution estimation on the second sampling curve to obtain the distribution probability of each of the plurality of second anchor points contained in the second sampling curve.
[0079] In this embodiment, the step mainly includes: calculating the score corresponding to each of the plurality of first sampling curves according to the gradient image using a preset scoring formula, and sorting each of the plurality of first sampling curves according to the score; selecting a plurality of second sampling curves with the highest scores from the plurality of first sampling curves according to the sorting; performing kernel density distribution estimation on each second anchor point contained in the second sampling curve according to a preset kernel density estimation method and Gaussian kernel to obtain the distribution function corresponding to each second anchor point; and obtaining the distribution probability corresponding to each second anchor point according to the distribution function.
[0080] For example, in this embodiment, a gradient image ▽I is used. k Score the L curves, select the top m best curves, and perform kernel density distribution estimation (KDE). For each point in the selected highest-scoring curves, calculate its probability using KDE. Preferably, use the gradient image ▽I. k Score the L curves, select the top m best curves, and perform kernel density distribution estimation (KDE) using the formula... That is, the summation of the neighborhood and the corresponding gradient image within the window of each point is used as the score. The top m highest scores are selected and the kernel density estimation method is used. A Gaussian kernel with a bandwidth of h = 5 pixels is used to estimate the distribution function p(x,y) of all points in the highest score curve. The distribution probability corresponding to each anchor point in the highest score curve is calculated based on the distribution function.
[0081] This embodiment uses the kernel density estimation method to estimate the distribution probability of each anchor point in the second curve, so as to filter the anchor points in the curve according to the distribution probability and improve the accuracy of wire tracking.
[0082] Step 106: Based on the distribution probability, select several third anchor points from the several second anchor points whose distribution probability is greater than a preset probability threshold.
[0083] In this embodiment, the step mainly includes: comparing the probability distribution corresponding to each anchor point in the highest score curve with a preset probability threshold, and removing anchor points from the highest score curve that are less than the probability threshold.
[0084] Step 107: Perform interval suppression on the plurality of third anchor points and merge them with the second anchor point set to obtain the third anchor point set corresponding to the image to be detected.
[0085] This step mainly includes: dividing the plurality of third anchor points into intervals according to a preset interval length to obtain a plurality of sub-intervals; retaining the third anchor point with the highest distribution probability in each of the plurality of sub-intervals, and merging the third anchor point with the highest distribution probability into the second anchor point set to obtain the third anchor point set.
[0086] For example, in this embodiment, the x-axis is divided into sp sub-intervals, and non-maximum suppression is performed on each sub-interval to obtain a new set of anchor points. This new set of anchor points is then merged with the second set of anchor points. Preferably, the x-axis is divided into sp sub-intervals with a length of Δx. The point with the highest probability distribution in each interval is retained and added to the second set of anchor points to obtain the third set of anchor points.
[0087] Step 108: Perform wire tracing on the image to be detected based on the third anchor point set to obtain the wire tracing result of the image to be detected.
[0088] On the other hand, embodiments of the present invention also provide a wire tracking system based on a Gaussian process. For the specific structural composition of the tracking system, please refer to... Figure 2 It includes an image processing module 201, an anchor point acquisition module 202, a Gaussian processing module 203, a distribution calculation module 204, a filtering module 205, a merging module 206, and a tracking module 207.
[0089] The image processing module 201 is used to acquire the gradient image corresponding to the image to be detected, and to detect whether the first anchor point set corresponding to the image to be detected is empty;
[0090] The anchor point acquisition module 202 is used to acquire a second anchor point set corresponding to the image to be detected based on a preset wire template image if the first anchor point set corresponding to the image to be detected is empty. If the first anchor point set corresponding to the image to be detected is not empty, the Gaussian process is updated based on the first anchor point set, and the homogeneous change of the image to be detected is estimated through the gradient image, so that the first anchor point set is processed according to the homogeneous change to obtain the second anchor point set corresponding to the image to be detected.
[0091] The Gaussian processing module 203 is used to perform Gaussian process regression on the second anchor point set to obtain several first sampling curves corresponding to the second anchor point set.
[0092] The distribution calculation module 204 is used to filter the plurality of first sampling curves according to the gradient image, determine the second sampling curve, and perform kernel density distribution estimation on the second sampling curve to obtain the distribution probability of each of the plurality of second anchor points contained in the second sampling curve.
[0093] The filtering module 205 is used to filter from the plurality of second anchor points according to the distribution probability to obtain a plurality of third anchor points whose distribution probability is greater than a preset probability threshold.
[0094] The merging module 206 is used to perform interval suppression on the plurality of third anchor points and merge them with the second anchor point set to obtain the third anchor point set corresponding to the image to be detected.
[0095] The tracking module 207 is used to perform wire tracking on the image to be detected based on the third anchor point set, and obtain the wire tracking result of the image to be detected.
[0096] In this embodiment, the image processing module 201 further includes a smoothing unit and a convolution unit;
[0097] The smoothing unit is used to perform Gaussian smoothing on the image to be detected to obtain a Gaussian image corresponding to the image to be detected.
[0098] The convolution unit is used to perform convolution processing on the image to be detected according to a preset gradient kernel to obtain the gradient image in the two-dimensional direction corresponding to the Gaussian image.
[0099] This embodiment discloses a wire tracing method and system based on Gaussian processes. By using Gaussian process regression, the efficiency and accuracy of wire tracing are improved. Based on Gaussian process regression for wire tracing, the gradient image corresponding to the image to be detected is first obtained. This facilitates the filtering of subsequently obtained anchor points, reducing the amount of data to be processed and improving the efficiency of wire tracing. Next, while obtaining the gradient image, it is checked whether the image to be detected has a corresponding set of anchor points. This determines whether the image to be detected has reference anchor points. If they exist, the Gaussian process is updated for the anchor point set, and the secondary transformation is calculated to apply the transformation of the existing anchor point set to the current image, thereby avoiding the need to redetermine anchor points, reducing data processing volume, and improving the efficiency of wire tracing. If they do not exist, a preset method can be used... The method first determines the set of anchor points corresponding to the image to be detected using a wire template image. After obtaining the set of anchor points, Gaussian regression is performed on the set of anchor points to obtain several corresponding curves. Each curve includes several anchor points. Then, the curves are filtered, and the anchor points in the filtered curves are further filtered to obtain more accurate anchor points. Then, wire tracking is performed on the image to be detected based on the anchor points to obtain the wire tracking result. This invention uses the Gaussian process regression method to perform wire tracking based on information of different wires in different environments. It does not require training on a large-scale dataset, thus improving the efficiency of wire tracking. At the same time, this invention generates anchor points for the image to be detected by using a preset image template, and performs wire tracking based on the curves corresponding to the anchor points, thereby improving the efficiency of wire tracking.
[0100] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention for those skilled in the art.
Claims
1. A wire tracing method based on Gaussian processes, characterized in that, include: Obtain the gradient image corresponding to the image to be detected, and check whether the first anchor point set corresponding to the image to be detected is empty; If the first set of anchor points corresponding to the image to be detected is empty, then the second set of anchor points corresponding to the image to be detected is obtained according to the preset wire template image; If the first anchor point set corresponding to the image to be detected is not empty, then the Gaussian process is updated according to the first anchor point set, and the homogeneous change of the image to be detected is estimated through the gradient image, so that the first anchor point set is processed according to the homogeneous change to obtain the second anchor point set corresponding to the image to be detected. Perform Gaussian process regression on the second anchor point set to obtain several first sampling curves corresponding to the second anchor point set; The gradient image is used to filter the plurality of first sampling curves to determine the second sampling curve, and the kernel density distribution of the second sampling curve is estimated to obtain the distribution probability of each of the plurality of second anchor points contained in the second sampling curve. Based on the distribution probability, several third anchor points with distribution probabilities greater than a preset probability threshold are obtained from the several second anchor points. The plurality of third anchor points are subjected to interval suppression and merged with the second anchor point set to obtain the third anchor point set corresponding to the image to be detected; Based on the third set of anchor points, wire tracing is performed on the image to be detected to obtain the wire tracing result of the image to be detected.
2. The wire tracing method based on Gaussian process as described in claim 1, characterized in that, The step of obtaining the gradient image corresponding to the image to be detected includes: Gaussian smoothing is applied to the image to be detected to obtain the corresponding Gaussian image. The image to be detected is convolved according to a preset gradient kernel to obtain the gradient image in the two-dimensional direction corresponding to the Gaussian image.
3. The wire tracing method based on a Gaussian process as described in claim 1, characterized in that, The step of obtaining the second anchor point set corresponding to the image to be detected based on the preset wire template image includes: The image to be detected is subjected to Gaussian pyramid transformation to obtain several pyramid images corresponding to the image to be detected. Based on the preset wire template diagram, normalization matching is performed on each layer of the pyramid image in the plurality of pyramid images to obtain the second anchor point set corresponding to the image to be detected.
4. The wire tracing method based on a Gaussian process as described in claim 1, characterized in that, The step of updating the Gaussian process based on the first anchor point set and estimating the homogeneous change of the image to be detected using the gradient image, so as to process the first anchor point set according to the homogeneous change to obtain the second anchor point set corresponding to the image to be detected, includes: The homogeneous change between the previous frame image and the image to be detected is estimated based on the gradient image to obtain the homogeneous change between the previous frame image and the image to be detected. The first set of anchor points is transformed to the image to be detected according to the homogeneous transformation, and anchor points that are not within the range of the image to be detected are removed to obtain the second set of anchor points corresponding to the image to be detected.
5. The wire tracing method based on a Gaussian process as described in claim 1, characterized in that, The step of performing Gaussian process regression on the second anchor point set to obtain several first sampling curves corresponding to the second anchor point set includes: Calculate the noise kernel matrix and weight vector corresponding to each anchor point in the second anchor point set, and perform Gaussian process regression on each anchor point in the second anchor point set based on the noise kernel matrix and weight vector to obtain the posterior prediction distribution value corresponding to each anchor point; the posterior prediction distribution value includes the posterior mean and variance; The second set of anchor points is rasterized, and the anchor points in the second set of anchor points are sampled according to the posterior predicted distribution value to generate the plurality of first sampling curves; the first sampling curves contain a plurality of anchor points.
6. The wire tracing method based on Gaussian process as described in claim 1, characterized in that, The step of filtering the plurality of first sampling curves based on the gradient image to determine the second sampling curve includes: Based on the gradient image, a score is calculated for each of the plurality of first sampling curves using a preset scoring formula, and each of the plurality of first sampling curves is sorted according to the score. Based on the sorting, several second sampling curves with the highest scores are selected from the several first sampling curves.
7. The wire tracing method based on a Gaussian process as described in claim 1, characterized in that, The step of estimating the kernel density distribution of the second sampling curve to obtain the distribution probability of each of the several second anchor points contained in the second sampling curve includes: Based on the preset kernel density estimation method and Gaussian kernel, the kernel density distribution of each second anchor point contained in the second sampling curve is estimated to obtain the distribution function corresponding to each second anchor point; The distribution probability corresponding to each second anchor point is obtained based on the distribution function.
8. The wire tracing method based on Gaussian process as described in claim 1, characterized in that, The step of performing interval suppression on the plurality of third anchor points and merging them with the second anchor point set to obtain the third anchor point set corresponding to the image to be detected includes: The plurality of third anchor points are divided into intervals according to the preset interval length to obtain a plurality of sub-intervals; The third anchor point with the highest probability distribution in each of the several sub-intervals is retained, and the third anchor point with the highest probability distribution is merged into the second anchor point set to obtain the third anchor point set.
9. A wire tracking system based on a Gaussian process, characterized in that, It includes an image processing module, an anchor point acquisition module, a Gaussian processing module, a distribution calculation module, a filtering module, a merging module, and a tracking module; The image processing module is used to obtain the gradient image corresponding to the image to be detected, and to detect whether the first anchor point set corresponding to the image to be detected is empty; The anchor point acquisition module is used to acquire a second anchor point set corresponding to the image to be detected based on a preset wire template image if the first anchor point set corresponding to the image to be detected is empty; if the first anchor point set corresponding to the image to be detected is not empty, the Gaussian process is updated based on the first anchor point set, and the homogeneous change of the image to be detected is estimated through the gradient image, so that the first anchor point set is processed according to the homogeneous change to obtain the second anchor point set corresponding to the image to be detected. The Gaussian processing module is used to perform Gaussian process regression on the second anchor point set to obtain several first sampling curves corresponding to the second anchor point set. The distribution calculation module is used to filter the plurality of first sampling curves according to the gradient image, determine the second sampling curve, and perform kernel density distribution estimation on the second sampling curve to obtain the distribution probability of each of the plurality of second anchor points contained in the second sampling curve. The filtering module is used to filter from the plurality of second anchor points according to the distribution probability to obtain a plurality of third anchor points whose distribution probability is greater than a preset probability threshold; The merging module is used to perform interval suppression on the plurality of third anchor points and merge them with the second anchor point set to obtain the third anchor point set corresponding to the image to be detected. The tracking module is used to perform wire tracking on the image to be detected based on the third anchor point set, and obtain the wire tracking result of the image to be detected.
10. A wire tracking system based on a Gaussian process as described in claim 9, characterized in that, The image processing module also includes a smoothing unit and a convolution unit; The smoothing unit is used to perform Gaussian smoothing on the image to be detected to obtain a Gaussian image corresponding to the image to be detected. The convolution unit is used to perform convolution processing on the image to be detected according to a preset gradient kernel to obtain the gradient image in the two-dimensional direction corresponding to the Gaussian image.
Citation Information
Patent Citations
Anti-shielding infrared target tracking method
CN110276785A
Online Sparse Matrix Gaussian Process Regression And Visual Applications
US20090164405A1