Corner point target detection method, terminal equipment and storage medium
By constructing edge binary images in scale space and fitting local angles, the problems of false detection and missed detection in the existing corner point detection algorithm are solved, and high-precision and efficient corner point detection are achieved.
Patent Information
- Application Number
- CN202311640233.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-30
- Publication Date
- 2025-05-30
AI Technical Summary
When existing corner point detection algorithms search for extreme points in image space or arc length space, they are prone to cause a large number of false detection and missed detection, resulting in data redundancy and low detection efficiency.
By constructing edge binary images in scale space, the local angles of each edge point are calculated, and the local angles within the interval are fitted by a unimodal Gaussian function to determine the corner point position and angle.
It effectively narrows the search range of corner point detection, reduces data redundancy, improves detection accuracy and efficiency, and controls errors at the pixel level.
Smart Images

Figure CN120070493A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of corner detection, and in particular, to a corner target detection method, a terminal device, and a storage medium. Background Art
[0002] Due to the stability of corner features in images, they are often applied to visual detection tasks such as motion detection, video tracking, 3D modeling, object recognition, and image retrieval. The corner detection algorithm is a method used in a computer vision system to extract such features, and it is one of the key algorithms for the entire visual task. However, there is currently no mathematical definition of corners that coincides with human perception, and it can only be described from features. For example, if there are two different edge directions locally at a certain point or the point is an extreme point of local intensity, it is called a corner. Exactly because there is no unified and precise mathematical definition, different corner detection ideas and algorithms have emerged based on different feature definitions.
[0003] There are mainly three different calculation ideas for corner detection methods. First, search for extreme points of intensity by calculating the local region correlation of pixel gray values in the two-dimensional space of the image, such as the Harris algorithm, the Susan algorithm, and their improved algorithms. Second, determine the corner position by finding extreme points of curvature in the arc length space of the edge, which is called the CSS technique, such as the curvature scale space technique and its improved algorithms. Third, first define a certain corner mathematical model, and then determine the corner position by searching for a matching region in the image space. Due to the influence of noise, whether searching for extreme points through the image space or the arc length space, a large number of false detections and missed detections are likely to occur. For this reason, a basic strategy is: detect as many corner points as possible that meet the feature requirements, and then screen out the "true" corner points that meet a certain established standard from these candidate corner points, so as to reduce false detections. In the first type of algorithm, the Harris algorithm, the Susan algorithm, and other detection algorithms that utilize regional correlation features can detect the vast majority of feature corner targets in the image, only achieving the first step of the above strategy. For visual tasks, there is a large amount of redundancy in these corner data, so specific interesting corner targets need to be identified from them subsequently. The second type of algorithm is limited to searching in the arc length space of the edge, and the number of detected corner points is generally less than that of the first type of algorithm, but it still endeavors to find all curvature extreme points in the arc length space. The main difference between such algorithms lies in the method of screening and eliminating candidate corner points. For example, some set a global threshold, and some determine an adaptive threshold by finding a local support domain. However, the interesting corner targets in real visual tasks are often only a very small part of the feature corner points. Instead of designing a screening algorithm after detecting all feature corner points, it is better to narrow the corner detection range as much as possible from the very beginning. Summary of the Invention
[0004] To solve the above problems, the present invention proposes a corner target detection method, a terminal device, and a storage medium.
[0005] The specific solution is as follows:
[0006] A corner target detection method includes the following steps:
[0007] S1: Obtain a corresponding edge binary image based on the image to be detected;
[0008] S2: Based on the edge binary image, obtain the coordinate point set corresponding to each edge;
[0009] S3: Calculate the local angle corresponding to each point in each edge;
[0010] S4: Based on the change trend of the local angles of all points in the same edge, determine the interval where the corner is located through the start and end points where mutations occur;
[0011] S5: Fit the local angles of each point in the interval with a unimodal Gaussian function, and use the peak point of the Gaussian function as the corner.
[0012] Furthermore, the method for obtaining the edge binary image in step S1 is as follows:
[0013] S101: Perform 4 times of smoothing filtering on the image to be detected in a loop to obtain 4 images with different scales;
[0014] S102: Calculate the corresponding number of edges based on the results of 4 times of smoothing filtering. If the number of edges calculated continuously for 3 times is the same, it is determined that the number of edges is stable, and enter S104; otherwise, enter S103;
[0015] S103: After downsampling the result of the 4th smoothing filtering, perform 4 times of smoothing filtering on the downsampled image in a loop, and return to S102;
[0016] S104: Extract the edge binary image based on the topmost image in the scale space.
[0017] Furthermore, in step S2, a search algorithm based on 8-neighborhood relationship is used to obtain the coordinate point set corresponding to each edge.
[0018] Furthermore, when using the search algorithm based on 8-neighborhood relationship to obtain the coordinate point set corresponding to each edge in step S2, an edge determination operator is set to determine whether a pixel point is an edge point and to determine the coordinates of the next edge point;
[0019] First, perform zero-padding expansion on the outer edge of the edge binary image, search for the first non-zero pixel value from the origin of the image from top to bottom and from left to right, and calculate the size of the corresponding edge determination operator;
[0020] When the edge determination operator ≤ 2, there are the following two cases: (1) If the edge determination operator < 1, extend the detection antenna forward by a specified number of pixels and then make a judgment again. If the condition that the edge determination operator < 1 is still satisfied, the possibility of discontinuity is excluded and this edge is closed; (2) If the edge determination operator ≥ 1, the determination point is an effective edge point, and the next search pixel point is determined based on this point;
[0021] When the edge determination operator > 2, after saving the coordinates of the current point, take the non-zero point farthest from this point along the direction of edge extension as the next continuous edge point.
[0022] Furthermore, the method for calculating the local angle of a certain point is as follows:
[0023] S301: Calculate the angle corresponding to the ray formed by taking this point as an endpoint and passing through other points on the same edge i represents the serial number of other points on the same edge;
[0024] S302: Calculate the normalized distance d from other points on the same edge of this point to this point i ;
[0025] S303: Further transform the normalized distance d through the sigmoid function i into a numerical value ρ i ;
[0026] S304: According to the numerical value ρ after the transformation of the normalized distance i , calculate the weight ω corresponding to other points on the same edge i : ω i = ρ i / ∑ i ρ i ;
[0027] S305: Perform weighted fitting on the angles of multiple rays in front of this point to obtain the angle of the ray pointing forward corresponding to this point
[0028] S306: Perform weighted fitting on the angles of multiple rays behind this point to obtain the angle of the ray pointing backward corresponding to this point
[0029] S307: Based on the angle of the ray pointing forward corresponding to this point and the angle of the ray pointing backward obtain the local angle θ corresponding to this point o .
[0030] Furthermore, in step S307, the calculation formula for the local angle θ o is:
[0031]
[0032] Among them, min represents taking the minimum value.
[0033] A corner target detection terminal device includes a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the method in the above embodiments of the present invention are implemented.
[0034] A computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the steps of the method in the above embodiments of the present invention are implemented.
[0035] The present invention adopts the above technical solutions, overcomes the problem of data redundancy generated by traditional detection algorithms, and can detect target corner points with significant features and their angles, where the accuracy of the synthetic image is at the pixel level. Description of the Drawings
[0036] Figure 1 Shown is a flowchart of the method in Embodiment 1 of the present invention.
[0037] Figure 2 Shown is a flowchart for constructing the scale space image in this embodiment.
[0038] Figure 3 Shown is a schematic diagram of the possible positions of the next edge point when Y(i, j) = 1 in this embodiment.
[0039] Figure 4 Shown is a schematic diagram of the possible positions of the next edge point when Y(i, j) = 2 in this embodiment.
[0040] Figure 5 Shown is the weight distribution diagram of the normalized distance in this embodiment.
[0041] Figure 6 Shown is a synthetic image with added white noise and containing 7 corner points in this embodiment.
[0042] Figure 7 Shown is the detection result image corresponding to the synthetic image in this embodiment.
[0043] Figure 8 Shown is a schematic diagram of the edge θ value change curve and the determination of the corner point support interval in this embodiment.
[0044] Figure 9 Shown is the fitting curve of the θ value in the corner point interval and the schematic diagram of target corner point determination in this embodiment. Detailed Embodiments
[0045] To further illustrate the embodiments, the present invention provides accompanying drawings. These drawings are part of the disclosure of the present invention, mainly used to illustrate the embodiments, and can be combined with the relevant descriptions in the specification to explain the operating principle of the embodiments. With reference to these contents, those of ordinary skill in the art should be able to understand other possible implementation manners and the advantages of the present invention.
[0046] The present invention will be further described below in conjunction with the accompanying drawings and specific implementation manners.
[0047] Embodiment 1:
[0048] The embodiment of the present invention provides a corner target detection method, as Figure 1 shown, the method includes the following steps:
[0049] S1: Obtain the corresponding edge binary image based on the image to be detected.
[0050] The multi-scale space is often used to search for relatively stable image features when the scale changes. The scale space can be created by continuously performing Gaussian convolution on the image. Set the two-dimensional Gaussian kernel function as H(x, y, σ 0 ), and σ 0 is its standard deviation. Substitute the original image I(x, y) (i.e., the image to be detected) and the two-dimensional Gaussian kernel function H(x, y, σ 0 ) into the filtering function Φ (convolution operation) defined by formula (1) for smoothing filtering.
[0051] Φ(I(x, y), H(x, y, σ 0 )) = ∫∫I(u, v)H(x - u, y - v)dudv (1)
[0052] Based on this, in this embodiment, the method for obtaining the edge binary image as Figure 2 shown is set, including the following steps:
[0053] S101: Perform smoothing filtering on the image to be detected 4 times in a loop to obtain 4 images with different scales;
[0054] S102: Calculate the corresponding number of edges based on the results of the 4 times of smoothing filtering. If the number of edges calculated continuously 3 times is the same, it is determined that the number of edges is stable, and enter S104; otherwise, enter S103;
[0055] S103: After downsampling the result of the 4th smoothing filtering, perform smoothing filtering on the downsampled image 4 times in a loop, and return to S102;
[0056] S104: Extract the edge binary image based on the topmost image in the scale space.
[0057] To simplify the filtering calculation and keep the kernel function H(x, y, σ 0 ) unchanged, let the output of the original image I(x, y) after being filtered by the filtering function Φ for k times be denoted as Then, according to the convolution property, the image after (k + 1)-time smoothing filtering is:
[0058]
[0059] Therefore, when i = 0, after Figure 2 the inner loop in it will obtain 4 different scale images Then, extract the edges in these images. If the number of edges is the same in three consecutive scale images, it is considered that the "number of edges is stable"; otherwise, it is called unstable and enters the downsampling process. After that, it re-enters the scale transformation to generate images at a larger scale again. Although the variance of the kernel function involved in the smoothing filtering does not change at this time (it is still σ 0 ), the input to the filtering function Φ is the downsampled image. Therefore, relative to the original image, the relationship between its scale and the original scale is σ 1 = 2σ 0 . Loop like this until the number of edges is stable and then exit. The reason for setting 4-time smoothing filtering in the above process is that according to the convolution property, the scale of 4-time convolution is That is, 2σ. When obtaining another set of 4 images by downsampling the image at this scale and finding the coordinates with a fixed convolution kernel, the benchmark is 2σ. Therefore, setting 4-time smoothing filtering ensures the continuous change of the scale.
[0060] In such an image space with gradually increasing scale, a large amount of small and messy edge information in the image is gradually filtered out, and those relatively stable and prominent edge features are retained. Performing gradient operation, adaptive threshold segmentation, and Sobel detection on the top-layer image in the scale space can obtain the edge binary image, which is denoted as f(i, j), where the gray value of the edge points is set to 1 and the gray value of the background points is 0.
[0061] S2: Based on the edge binary image, obtain the coordinate point sets corresponding to each edge.
[0062] The non-zero points in the binary image f(i, j) represent edges. In the most ideal state in the image space, these non-zero points show continuous and single-pixel distribution. However, in some edges, there will be pixel accumulation or pixel discontinuity. To extract the pixel positions of each edge and their extension order on the edge, in this embodiment, a search algorithm based on 8-neighborhood relationship is adopted, which can overcome the problems of pixel accumulation or discontinuity.
[0063] Within the 8-neighborhood range of the pixel, design formula (3) as the edge determination operator Y(i, j) of the algorithm:
[0064]
[0065] Among them, m and n respectively represent the increased number of pixels in rows and columns.
[0066] The edge determination operator has two functions: First, determine whether the current pixel is an edge point according to the value of Y(i, j); Second, determine the coordinates of the next edge point. The specific application method of this operator is as follows:
[0067] First, perform zero-padding expansion on the outer edge of the binary edge image, expanding one column on both the top and bottom and on both the left and right. Search for the first non-zero pixel value from the origin of the image from top to bottom and from left to right, and calculate the value of Y(i, j) according to Equation (3). The following discusses several cases separately according to whether the pixels are stacked:
[0068] When Y(i, j) ≤ 2, different edge coordinate search strategies are adopted according to its size: (1) If Y(i, j) < 1, it means that there is no next extended pixel point at the point (i, j) on the edge or there is only an interruption. At this time, the operator will detect that the antenna extends forward by a specified number of pixels and then judge again. If the condition is still met, the possibility of interruption is excluded and this edge is closed. The size of the specified pixel can be set by those skilled in the art according to needs, such as setting it to 2. (2) If Y(i, j) ≥ 1, it means that the point (i, j) is a valid edge point and there is a next continuous edge point within its 8-neighborhood. The next search pixel point should be determined accordingly. If Y(i, j) = 1, the pixel value distribution of the 8-neighborhood of the point (i, j) is in the form of Figure 3 and their horizontal or vertical mirror images (where, "o" represents the current point, and "*" represents the non-zero pixels in its 8-neighborhood). At this time, the algorithm first saves the coordinates of the point (i, j) and sets f(i, j) to zero, and then transfers to Figure 3 the pixel marked with "*" (which is the next continuous edge point) in, calculates the value of Y(*) of this point, and thus enters a new judgment and search process.
[0069] If Y(i, j) = 2, the pixel value distribution of the 8-neighborhood of the point (i, j) is in the form of Figure 4 and their horizontal or vertical mirror images. Figure 4 The first two figures in show that the next pixel of the current pixel enters the edge inflection point. After the algorithm saves the coordinates of the current point, it will determine the pixel farthest from this point as the next continuous edge point, and at the same time set the pixel values of the other two points to zero. Figure 4 The last figure in shows that the current pixel belongs to the middle point of the edge rather than the starting point of the edge. The algorithm will not perform zero-setting processing. After incrementing i or j, continue to search for non-zero pixel value points.
[0070] When Y(i,j)>2, pixels are stacked at the edge. After saving the coordinates of the current point, the non-zero point farthest from the current point is taken as the next continuous edge point along the direction of the edge extension.
[0071] S3: Calculate the local angle corresponding to each point in each edge.
[0072] The scale transformation not only filters out noise and extracts significant edge features, but also blunts the local edge features of the target. Next, the angle between two rays with the current pixel as the vertex will be fitted through a larger set of points along two opposite directions on the edge, thereby avoiding detecting corner points only through blunted local data with discontinuities.
[0073] The set {(x i ,y i )|(x i ,y i )∈Edge k , i=1,…,N} represents the coordinates of N pixels belonging to the kth edge, where x i Indicates the row number, y i Indicates the number of columns it sits in.
[0074] First, take the oth pixel point in the point set as the vertex and pass through the vertex (x o ,y o ) and any other point (x i ,y i ) as a ray, and the angle from the horizontal rightward direction to the ray in the counterclockwise direction is defined as follows:
[0075]
[0076] The inequality in the brackets is a logical judgment. If it is satisfied, it is 1, otherwise it is 0. o ,y o ) is the endpoint, and the coordinates of the M points in front of it can be obtained by applying formula (4) to obtain M angles
[0077] Then, apply formula (5) to calculate the distance from these M points to the vertex (x o ,y o ) is the normalized distance d i , and the normalized distance d is converted into i Further converted into numerical value ρ i (like Figure 5 As shown, where α = 10, β = 0.5), the weight ω of the angles of these M rays can be further calculated i =ρ i / ∑i ρ i Here, the Sigmoid function is further used to process the normalized distance. The purpose is to give a larger ρ value to the far point and a smaller ρ value to the near point. And a larger ρ value can obtain a larger weight, that is, give it more trust when performing weighted fitting. Finally, the angles of these M rays are weighted and fitted to obtain a ray with the o-th pixel as the vertex and pointing forward, as shown in formula (7).
[0078]
[0079]
[0080]
[0081] Similarly, the angles of the rays pointing backward with the vertex (x o , y o ) can be fitted through M points behind the vertex, denoted as By taking the difference between the two, the local angle θ o , y o ) presented at the vertex on the edge can be obtained as o :
[0082]
[0083] Among them, ranges from (0, 360°). When it is greater than 180°, the difference between it and 360° is taken as the value of θ o , and finally it is converted to (0, 180°). Hereinafter, the angular feature value calculated for each pixel according to formula (8) is called the corner strength value of this point. The smaller its value, the more obvious the corner feature is.
[0084] In this embodiment, the number of points in front of and behind the vertex selected during fitting is equal, both being M. In other embodiments, they may not be equal, and no limitation is made here.
[0085] S4: Based on the change trend of the local angles of all points on the same edge, determine the interval where the corner is located through the start and end points where the mutation occurs.
[0086] For any point in the edge point set, the calculation of its local angle θ value utilizes the coordinates of 2M points around it. Considering that the contributions of these 2M data to this θ value are different, corresponding weights are assigned according to their distances from the fixed point, which avoids large errors caused by over-reliance on local data. If these θ values are unfolded along the edge, a one-dimensional signal that changes with its position is formed, and the signal mutates near the corner point, and its amplitude is determined by the angle presented at the corner point. Generally, the proportion of corner point pixels is small, most θ values are close to 180°, and the data that mutate near the corner point are in the minority. Therefore, through simple statistical analysis, the region where the mutation occurs can be found, such as by comparing the data with the variance. In this way, the interval where the corner point is located can be judged by detecting the start and end points of the mutation.
[0087] S5: Fit the local angles of each point in the interval with a unimodal Gaussian function, and take the peak point of the Gaussian function as the corner point.
[0088] In an ideal situation, all θ values in the interval should present a symmetric triangular wave or a normal distribution waveform. At this time, the specific position of the corner point and its θ value can be determined by searching for the extreme points in the interval. However, due to the influence of real reasons such as noise, quantization error, the blunt effect of filtering, and the thresholding operation during edge extraction, the distribution of θ values in the interval shows a certain randomness, and there are a few outliers. According to the aforementioned idealized assumption, the algorithm uses a unimodal Gaussian function to fit the θ value data in the interval, and defines the Gaussian model function as shown in formula (9).
[0089]
[0090]
[0091]
[0092]
[0093] Then, according to the least squares principle, the model parameters can be obtained when the residual between the θ value data in the interval and the Gaussian fitting function value is the smallest. It should be noted that such a forced fitting process is sensitive to the initial values of the parameters. If random numbers or inappropriate settings are used, the fitting will fail. The initialization method adopted here is: assume that there are N pixels in the interval where the corner point is located, and the position of the i-th pixel on the edge is marked as s i , then the initial values of the parameters can be determined according to formulas (10) - (12).
[0094] In summary, in this embodiment, the image is first processed by smoothing filtering, and the edge point set is obtained by extracting and storing in sequence the same group of images using the operator shown in formula (3). When the number of edges (the number of point sets) of three consecutive images in the same group of four images is the same, further downsampling is stopped, and the point set corresponding to the last image at the current scale is used as the final number of edges. Then, the local angle θ value reflecting the corner strength is calculated. According to formulas (4) to (8), the θ value of each point in the edge point set is calculated, where one θ value is generated for every 2M data, and the M value can be selected according to the edge length, such as N / 50. The M value cannot be too small, otherwise there will be a large error, and a minimum threshold should be set for short edges. Finally, the corner position and angle are determined according to the θ value. The θ value is a characteristic value detected point by point along the curve through a detection window with a width of 2M, and this characteristic value will only mutate when the window moves near the corner. Therefore, it is easy to find the interval where the corner is located (corresponding to the pulse width in the following text Figure 8 ). Then, a single-peak Gaussian model is used to fit the θ value data of the point set in this interval, and the extreme point of the Gaussian function is used as the corner in this interval, so as to obtain the position and angle of the corner.
[0095] Experimental analysis
[0096] Figure 6 is a synthetic image with added white noise containing 7 corners. Stable edges can be obtained at the original image scale, the edge point set is extracted and the θ value is calculated, and the distribution quantity and proportion of each angle are shown in Table 1. It can be seen that the θ values of more than 87% of the pixels are between 170° and 180°. Unfolding all the θ values in the order they appear on the edge gives Figure 8 the upper curve in, where there are 7 spike pulse waveforms similar to each other. They reflect the change of the θ value in the corner area. Further, the rectangular pulse signal corresponding to the spike pulse can be extracted. Each rectangular pulse corresponds to a corner interval, and its pulse width corresponds to the interval on the edge corresponding to the pixel points where the θ value changes violently around the corner.
[0097] Table 1
[0098]
[0099] The θ values in the corner interval (pulse width range) do not show an ideal waveform due to factors such as noise, pixel quantization, and repeated filtering. For example, in the Figure 8 distribution shown, some are single-peak, some are multi-peak, some are basically symmetric, some are skewed to one side, and there are extremely few outlier points. Based on the idealized assumption, a single-peak Gaussian function is used to fit them, Figure 9The fitting curve is calculated based on the θ values within 7 rectangular pulse widths. The peak of each Gaussian curve is marked with a triangle, and the corresponding abscissa is the index s of the corner point estimated by the algorithm on the edge curve. i After converting the edge index to image coordinates, it is marked with a triangle in Figure 7 , and the corresponding θ estimated value is marked below. This method of determining corner points through the fitting curve avoids the influence of a few outliers.
[0100] In order to narrow the search range of corner points and reduce the redundancy of corner point data, an edge-based corner point target detection method in the scale space is proposed in the embodiment of the present invention. The main work includes the following three points: First, a scale space is constructed, and the termination condition of the scale transformation is set in combination with the specific detection task, achieving a certain balance between removing redundant edges and retaining feature edges; Second, a decision operator and a specific application algorithm for sequentially searching the edge point set according to the neighbor relationship between edge pixels are proposed, overcoming the problems of discontinuity and pixel overlap on the edge; Third, a calculation method for the index value reflecting the edge intensity is proposed, based on which the support interval of the corner point is found and the final target corner point is fitted. The experimental results show that the method of this embodiment can detect all corner point positions and angles, and its error can be controlled at the pixel level in the synthesized noise image.
[0101] Embodiment 2:
[0102] The present invention also provides a corner point target detection terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps in the above method embodiment of Embodiment 1 of the present invention are implemented.
[0103] Furthermore, as an executable solution, the corner point target detection terminal device can be a computing device such as a desktop computer, a notebook, a palm computer, and a cloud server. The corner point target detection terminal device may include, but is not limited to, a processor and a memory. Those skilled in the art can understand that the above composition structure of the corner point target detection terminal device is only an example of the corner point target detection terminal device, and does not constitute a limitation on the corner point target detection terminal device. It may include more or fewer components than the above, or combine some components, or different components. For example, the corner point target detection terminal device may also include input and output devices, network access devices, a bus, etc. The embodiment of the present invention does not make a limitation on this.
[0104] Further, as an executable solution, the so-called processor may be a Central Processing Unit (CPU), or may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The processor is the control center of the corner target detection terminal device, and connects various parts of the entire corner target detection terminal device through various interfaces and lines.
[0105] The memory can be used to store the computer program and / or module. The processor realizes various functions of the corner target detection terminal device by running or executing the computer program and / or module stored in the memory, and by calling the data stored in the memory. The memory mainly includes a program storage area and a data storage area. Among them, the program storage area can store an operating system and application programs required for at least one function; the data storage area can store data created according to the use of the mobile phone, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as a hard disk, memory, plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, Flash Card, at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage devices.
[0106] The present invention also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of the method in the above embodiments of the present invention are implemented.
[0107] If the modules / units integrated in the corner point target detection terminal device are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, to implement all or part of the processes in the above-mentioned embodiment methods of the present invention, it can also be completed by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above-mentioned various method embodiments can be realized. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disc, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), and software distribution medium, etc.
[0108] Although the present invention has been specifically shown and described in conjunction with the preferred embodiments, those skilled in the art should understand that various changes can be made to the present invention in form and detail without departing from the spirit and scope of the present invention defined by the appended claims, and all such changes are within the protection scope of the present invention.
Claims
1. A corner target detection method, characterized in that: it includes the following steps: S1: Obtain the corresponding edge binary image based on the image to be detected; S2: Based on the edge binary image, obtain the coordinate point sets corresponding to the respective edges; S3: Calculate the local angles corresponding to the points in each edge; S4: Based on the change trend of the local angles of all points in the same edge, determine the interval where the corner is located through the starting and ending points where mutations occur; S5: Fit the local angles of the points in the interval with a unimodal Gaussian function, and take the peak point of the Gaussian function as the corner.
2. The corner target detection method according to claim 1, characterized in that: The method for obtaining the edge binary image in step S1 is: S101: Perform smoothing filtering on the image to be detected 4 times in a loop to obtain 4 images with different scales; S102: Calculate the corresponding number of edges based on the results of the 4 times of smoothing filtering. If the number of edges calculated continuously 3 times is the same, it is determined that the number of edges is stable, and go to S104; otherwise, go to S103; S103: After downsampling the result of the 4th smoothing filtering, perform smoothing filtering on the downsampled image 4 times in a loop, and return to S102; S104: Extract the edge binary image based on the topmost image in the scale space.
3. The corner target detection method according to claim 1, characterized in that: In step S2, a search algorithm based on the 8-neighborhood relationship is used to obtain the coordinate point sets corresponding to the respective edges.
4. The corner target detection method according to claim 3, characterized in that: When step S2 uses a search algorithm based on the 8-neighborhood relationship to obtain the coordinate point sets corresponding to the respective edges, an edge determination operator is set to determine whether a pixel point is an edge point and to determine the coordinates of the next edge point; First, perform zero-padding expansion on the outer edge of the edge binary image, search for the first non-zero pixel value from the origin of the image from top to bottom and from left to right, and calculate the magnitude of the corresponding edge determination operator; If the edge determination operator ≤ 2, there are the following two situations: (1) If the edge determination operator < 1, extend the detection antenna forward by a specified number of pixels and then judge again. If the condition edge determination operator < 1 is still satisfied, the possibility of discontinuity is excluded, and this edge is closed; (2) If the edge determination operator ≥ 1, determine that the point is a valid edge point, and determine the next search pixel point based on this point; If the edge determination operator > 2, after saving the coordinates of the current point, take the non-zero point farthest from this point along the direction of edge extension as the next consecutive edge point.
5. The corner target detection method according to claim 1, characterized in that: The method for calculating the local angle of a certain point is: S301: Calculate the angle corresponding to the ray formed by taking this point as an endpoint and passing through other points on the same edge i represents the serial number of other points on the same edge; S302: Calculate the normalized distance d from other points on the same edge as this point to this point i ; S303: Further transform the normalized distance d into a numerical value ρ through the sigmoid function i i ; S304: The value ρ after being transformed according to the normalized distance i , calculate the weights ω corresponding to other points on the same edge i : ω i = ρ i / ∑ i ρ i ; S305: Weightedly fit the angles of multiple rays in front of this point to obtain the angle of the ray pointing forward corresponding to this point S306: Weightedly fit the angles of multiple rays behind this point to obtain the angle of the ray pointing backward corresponding to this point S307: Based on the angles of the rays pointing forward and backward corresponding to this point obtain the local angle θ corresponding to this point o . 6. The corner target detection method according to claim 5, characterized in that: The local angle θ in step S307 o The calculation formula is as follows: wherein, min represents taking the minimum value.
7. A corner target detection terminal device, characterized in that: it includes a processor, a memory, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
8. A computer-readable storage medium storing a computer program, wherein: when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.