Image corner detection method, device and medium
By dividing the image into image blocks and calculating the gradient value, and using the adaptive threshold table to detect corner points, the Fast corner point detection algorithm is solved in the missed detection and missed detection problems in uneven lighting scenes, achieving more efficient corner point extraction.
Patent Information
- Application Number
- CN202311280571.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-28
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2043-09-28
AI Technical Summary
The existing Fast corner detection algorithm has problems of missed and missed detection when images are overexposed, underexposed or scene grayscale changes are poor, and the threshold adjustment depends on personnel experience and has poor results.
By dividing the image to be tested into multiple image blocks, the maximum and average pixel gradient values of each image block are calculated, and the corner points are determined using the adaptive threshold table. The adaptive threshold value is less than 20 to adapt to image blocks with different exposure and grayscale changes, reducing missed detection and missed detection.
It significantly reduces missed and missed detection in uneven lighting scenarios, and improves the accuracy and efficiency of corner point detection.
Smart Images

Figure CN117315281B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and more specifically, to a method, device, and medium for detecting corner points of an image. Background Art
[0002] The Fast (Feature from Accelerated Segment Test) corner detection algorithm is widely used in fields such as VR (Virtual Reality) / AR (Augmented Reality), VSLAM (Visual Segment Mapping), and autonomous driving, and is a common module for hardware acceleration by many SOC manufacturers. Research and improvement of this algorithm is a hot topic in both academia and industry. However, in practical applications, Fast corner detection suffers from a fixed threshold that cannot accommodate a wide range of scenarios: for example, image overexposure, underexposure, and significant grayscale variations. Furthermore, a fixed threshold significantly impacts corner detection, and adjusting the threshold relies heavily on user experience, leading to missed and false detections. The industry generally uses OpenCV methods to extract Fast corners, but this method performs poorly in images with uneven lighting. Summary of the Invention
[0003] The present application is provided to address the above-mentioned deficiencies in the prior art. A method, device, and medium for detecting corner points in an image are needed that can still extract corner points even when the image is overexposed, underexposed, or the scene has poor grayscale variation, significantly reducing missed detections and false detections, and improving the effectiveness of corner detection in scenes with uneven lighting.
[0004] According to a first embodiment of the present application, a method for detecting corners in an image is provided, comprising the following steps: obtaining an image to be tested and dividing the image to be tested into a plurality of first image blocks; calculating pixel gradient values at each position on each of the first image blocks, and obtaining a maximum pixel gradient value and an average pixel gradient value for each of the first image blocks, wherein the maximum pixel gradient value and the average pixel gradient value reflect the exposure or grayscale change of the image to be tested; and obtaining corresponding adaptive thresholds based on the maximum pixel gradient value and the average pixel gradient value of each of the first image blocks by searching a threshold table. The threshold table defines adaptive thresholds corresponding to various maximum pixel gradient values and average pixel gradient values, wherein the corresponding adaptive threshold is less than 20 for a maximum pixel gradient value greater than a first threshold and less than or equal to a fixed pixel maximum value, and an average pixel gradient value greater than a second threshold and less than or equal to a third threshold, wherein the first and second thresholds are greater than or equal to 2, and the third threshold is less than or equal to 20. Based on the adaptive thresholds of each of the first image blocks, corners on each of the first image blocks are determined.
[0005] According to a second embodiment of the present application, a device for detecting corners of an image is provided, comprising an interface and a processor. The interface is configured to acquire an image to be detected. The processor is configured to execute the corner detection method described in various embodiments of the present application.
[0006] According to a third embodiment of the present application, a non-transitory computer-readable medium is provided, on which instructions are stored. When executed by a processor, the instructions execute the steps of the corner detection method described in each embodiment of the present application.
[0007] The image corner detection method, device and medium provided by each embodiment of the present application divide the image to be tested into multiple first image blocks, and extract corner points of each first image block respectively to ensure the number of corner points extracted from the image to be tested and reduce the situations of missing corner points and inappropriate corner point extraction positions; calculate the maximum pixel gradient value and the average pixel gradient value on each of the first image blocks, and obtain the exposure or grayscale change of the entire image block. When the maximum pixel gradient value and the average pixel gradient value fall within a certain range, the grayscale change of the scene caused by overexposure or underexposure of the image is not obvious. At this time, the adaptive threshold is set to be less than or equal to 20 to ensure that the corner points can be extracted, significantly reducing the problems of missed detection and false detection, so that the appropriate number of corner points of the entire image block can be extracted in scenes with uneven lighting, thereby improving the effect of corner detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] In the drawings, which are not necessarily drawn to scale, the same reference numerals may describe similar components in different views. The same reference numerals with letter suffixes or different letter suffixes may represent different instances of similar components. The accompanying drawings generally illustrate various embodiments by way of example and not limitation, and together with the description and claims, serve to illustrate the claimed embodiments. Where appropriate, the same reference numerals are used throughout the drawings to refer to the same or similar parts. Such embodiments are illustrative and are not intended to be exhaustive or exclusive of the present apparatus or method.
[0009] Figure 1 A flowchart showing a method for detecting corner points in an image according to an embodiment of the present application is shown;
[0010] Figure 2 A first exemplary schematic diagram illustrating a threshold value table according to an embodiment of the present application is shown;
[0011] Figure 3 A second exemplary schematic diagram illustrating a threshold value table according to an embodiment of the present application is shown;
[0012] Figure 4 A third exemplary schematic diagram illustrating a threshold value table according to an embodiment of the present application is shown;
[0013] Figure 5 A schematic diagram showing a comparison of corner point extraction between an embodiment of the present application and a comparative example is shown;
[0014] Figure 6 A flowchart showing a method for detecting corners in an image according to another embodiment of the present application is shown;
[0015] Figure 7 A flowchart showing a method for detecting corners of an image according to another embodiment of the present application; and
[0016] Figure 8 A schematic structural diagram of an image corner detection device according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0017] In order to enable those skilled in the art to better understand the technical solution of the present application, the present application is described in detail below in conjunction with the accompanying drawings and specific embodiments. The embodiments of the present application are further described in detail below in conjunction with the accompanying drawings and specific embodiments, but are not intended to limit the present application.
[0018] The terms "first," "second," and similar terms used in this application do not denote any order, quantity, or importance, but are used only to distinguish. The terms "include," "comprise," and similar terms mean that the elements preceding the term include the elements listed after the term, and do not exclude the possibility of also including other elements.
[0019] Figure 1 A flowchart of a method for detecting corner points in an image according to an embodiment of the present application is shown. In step 101, an image to be tested is acquired and divided into a plurality of first image blocks. For example, the size of each first image block is 64 pixels x 64 pixels or 32 pixels x 32 pixels. This allows corner point extraction to be performed separately for each portion of the image to be tested, reducing the possibility of missed or incorrect corner point detections in certain locations of the image to be tested.
[0020] In step 102, the pixel gradient values of each position on each of the first image blocks are calculated, and the maximum pixel gradient value and the average pixel gradient value of each of the first image blocks are obtained, wherein the maximum pixel gradient value and the average pixel gradient value reflect the exposure or grayscale changes of the image to be tested. The pixel gradient value can reflect the brightness changes of each position in the image to be tested. The maximum pixel gradient value is the maximum value of the pixel gradient values in each position, reflecting the maximum brightness change on the entire first image block. The average pixel gradient value is the average value of the pixel gradient values of all positions on the first image block, reflecting the overall brightness change of the first image block. Therefore, the maximum pixel gradient value and the average pixel gradient value can reflect the overall exposure or grayscale changes of the first image block, so as to distinguish different image blocks and select a suitable adaptive threshold.
[0021] In step 103, based on the maximum pixel gradient value and average pixel gradient value of each of the first image blocks, corresponding adaptive thresholds are obtained by searching a threshold table. The threshold table defines adaptive thresholds corresponding to various maximum pixel gradient values and average pixel gradient values. For maximum pixel gradient values greater than a first threshold and less than or equal to a fixed pixel maximum value, and for average pixel gradient values greater than a second threshold and less than or equal to a third threshold, the corresponding adaptive threshold is less than 20. The first and second thresholds are greater than or equal to 2, and the third threshold is less than or equal to 20. The threshold table can be used to obtain an adaptive threshold suitable for the first image block, thereby extracting an appropriate number of corner points. The fixed pixel maximum value is 255, and the first threshold is greater than or equal to 2. The maximum pixel gradient value indicates that some locations in the first image block have large pixel gradient values, indicating texture information. Therefore, it is necessary to determine the corner points of this first image block. The second threshold is greater than or equal to 2, and the third threshold is less than or equal to 20. The average pixel gradient value shows that the overall gradient value on the first image block is not very large, and some positions may be overexposed, underexposed, or have poor grayscale changes. For such image blocks, if the adaptive threshold is not set appropriately, missed detection and false detection may occur. The threshold table of this application corresponds to such first image block, and the set adaptive threshold is less than 20, which helps to detect corner points and significantly reduces the situation where some corner points are missed and not detected. At the same time, it can also avoid the situation where a large number of corner points are detected and some corner points are inappropriate.
[0022] In step 104, corner points on each of the first image blocks are determined based on the adaptive thresholds for each of the first image blocks. Once the adaptive thresholds are determined, corner points can be determined using OpenCV (Open Source Computer Vision Library) calculation methods. OpenCV methods generally determine corner points based on grayscale differences, so determining an appropriate adaptive threshold can significantly reduce missed and false corner point detections.
[0023] Therefore, the corner detection method of the present application can detect corners even for an image with uneven illumination, such as an image with darker or brighter areas, thereby improving the effect of corner detection.
[0024] In some embodiments, the threshold value table further defines a first average pixel gradient value interval and a second average pixel gradient value interval that are independent of each other, such that the minimum value of the first average pixel gradient value interval is greater than the second threshold value and the maximum value is less than or equal to a fourth threshold value, and the minimum value of the second average pixel gradient value interval is greater than or equal to a fifth threshold value and the maximum value is less than or equal to a third threshold value, wherein the fourth threshold value is between 4 and 8 and the fifth threshold value is between 6 and 9. For images to be tested that may contain portions with high exposure (high exposure intensity or long exposure time), underexposure, or poor grayscale variation, two situations can be further divided. The minimum value of the first average pixel gradient value interval is greater than 2, and the maximum value is less than or equal to 8. Therefore, the range of the first average pixel gradient value interval may be (2, 5] or (2, 7], etc., indicating that the pixel gradient value of the first image block as a whole is small, there are more darker or brighter areas, and there is less texture information. The minimum value of the second average pixel gradient value interval is greater than or equal to 6, and the maximum value is less than or equal to 20. Therefore, the range of the second average pixel gradient value interval may be [6, 18] or [6, 20], etc., indicating that the pixel gradient value of the first image block as a whole is relatively small, contains some darker or brighter areas, and contains some texture information.
[0025] In the threshold table, the average pixel gradient value of the first average pixel gradient value interval and the maximum pixel gradient value greater than the first threshold and less than or equal to the fixed pixel maximum value, the range of the first adaptive threshold corresponding to these two is greater than or equal to the middle value within the first average pixel gradient value interval and less than or equal to the fourth threshold; the average pixel gradient value of the second average pixel gradient value interval and the maximum pixel gradient value greater than the first threshold and less than or equal to the fixed pixel maximum value, the range of the second adaptive threshold corresponding to these two is 8 to 14.
[0026] Figure 2 FIG. 1 shows a first example schematic diagram of a threshold value table according to an embodiment of the present application. Figure 2 As shown, the range of the first adaptive threshold corresponding to the first average pixel gradient value interval is [the middle value within the first average pixel gradient value interval, the fourth threshold]. For example, the first adaptive threshold is 4, 5, or 6. In this case, the adaptive threshold is smaller, which helps to obtain more corner points and significantly reduces missed detection and false detection. Furthermore, when the first average pixel gradient value interval is (2, 5), the first adaptive threshold can be selected as 5.
[0027] For the second average pixel gradient value interval, the range of the second adaptive threshold is 8 to 14 (including the boundary values 8 and 14). At this time, the adaptive threshold is relatively small, which can not only obtain more corner points and significantly reduce the missed detection, but also avoid detecting too many corner points and detecting inappropriate ones, and can also avoid improper concentration of corner points. Furthermore, when the second average pixel gradient value interval is [6,20], the second adaptive threshold can be selected as 10.
[0028] In some embodiments, the threshold table further defines a third average pixel gradient value interval and a fourth average pixel gradient value interval that are independent of each other, so that the interval minimum value of the third average pixel gradient value interval is greater than or equal to the seventh threshold, and the interval maximum value is less than or equal to the eighth threshold, and the interval minimum value of the fourth average pixel gradient value interval is greater than or equal to the ninth threshold, and the interval maximum value is less than or equal to the fixed pixel maximum value, wherein the seventh threshold is 21 to 23, the eighth threshold is 25 to 30, and the ninth threshold is 31 to 35.
[0029] Figure 3 FIG. 2 shows a second example schematic diagram of a threshold value table according to an embodiment of the present application. Figure 3 As shown, the minimum value of the third average pixel gradient value interval is greater than or equal to 21, and the maximum value is less than or equal to 30. Therefore, the third average pixel gradient value interval may be [21, 28] or [21, 30], etc., indicating that there are fewer dark or bright areas in the first image block and more texture information. The minimum value of the fourth average pixel gradient value interval is greater than or equal to 31, and the maximum value is less than or equal to 255. Therefore, the fourth average pixel gradient value interval may be [31, 240] or [31, 255], etc., indicating that there are basically no dark or bright areas on the first image block, which is ideal and has rich texture information.
[0030] In the threshold table, the third adaptive threshold corresponding to the average pixel gradient value of the third average pixel gradient value interval and the maximum pixel gradient value greater than the first threshold and less than or equal to the fixed pixel maximum value is in a range greater than or equal to the middle value within the third average pixel gradient value interval and less than or equal to the eighth threshold. Furthermore, the fourth adaptive threshold corresponding to the average pixel gradient value of the fourth average pixel gradient value interval and the maximum pixel gradient value greater than the first threshold and less than or equal to the fixed pixel maximum value is in a range greater than or equal to the ninth threshold and less than or equal to the sixth threshold, where the sixth threshold is between 35 and 45.
[0031] like Figure 3As shown, the range of the third adaptive threshold is [the middle value within the third average pixel gradient value interval, the eighth threshold]. The third adaptive threshold may be 27 or 30, etc. For the corresponding first image block, if the adaptive threshold is greater than the third adaptive threshold, fewer corner points may be obtained, which may result in missed detections. If the adaptive threshold is less than the third adaptive threshold, too many corner points may be obtained, which may result in false detections. Therefore, selecting the third adaptive threshold helps to obtain an appropriate number of corner points and improve corner detection. Furthermore, when the third average pixel gradient value interval is [21, 30], the third adaptive threshold can be 30.
[0032] The range of the fourth adaptive threshold is [9th threshold, 6th threshold], and the fourth adaptive threshold may be 35 or 40, for example. For the corresponding first image block, if the adaptive threshold is less than the fourth adaptive threshold, too many corner points may be obtained, potentially leading to false detections. If the adaptive threshold is greater than the fourth adaptive threshold, too few corner points may be obtained, potentially leading to missed detections. However, this first image block contains rich texture information, so using the fourth adaptive threshold for corner detection in this first image block helps obtain an appropriate number of corner points, improving corner detection. Too dense a concentration of corner points can hinder subsequent corner matching algorithms. Furthermore, when the fourth average pixel gradient value interval is [31, 255], the fourth adaptive threshold is 40. Furthermore, the image blocks corresponding to the third and fourth average pixel gradient value intervals may include locations with significant scene grayscale changes, such as edge points. Setting adaptive thresholds in these two intervals facilitates corner detection in locations with significant scene grayscale changes.
[0033] Therefore, the texture information in the first, second, third, and fourth average pixel gradient value intervals gradually increases, and the exposure or grayscale variation on the image also gradually improves. By setting the minimum and maximum values of each interval, these four intervals can be distinguished, each representing a test image in different situations. The range of maximum pixel gradient values is the same. The first image block corresponding to the first average pixel gradient value interval is generally a darker place such as under a table or a window position with high light intensity; the first image block corresponding to the second average pixel gradient value interval generally includes some overexposed, underexposed, or poorly grayscale variation locations; the first image block corresponding to the third average pixel gradient value interval is likely to exist in general images, with few locations experiencing overexposure, underexposure, or poorly grayscale variation, and most locations being relatively good; the first image block corresponding to the fourth average pixel gradient value interval is rarely present in general images, with basically no locations experiencing overexposure, underexposure, or poorly grayscale variation, which is a relatively ideal situation. Setting different adaptive thresholds for different intervals helps to extract suitable corner points at different image locations.
[0034] In some embodiments, the threshold table further defines: a maximum pixel gradient value that is less than or equal to a first threshold, and an average pixel gradient value that is less than or equal to a second threshold, and the adaptive threshold corresponding to these two values is a fixed pixel maximum value. Figure 4 FIG. 3 shows a third example schematic diagram of a threshold value table according to an embodiment of the present application. Figure 4 As shown, the maximum pixel gradient value is between 0 and the first threshold, the average pixel gradient value is between 0 and the second threshold, the first image block is basically completely dark or completely exposed, and there is basically no texture information. At this time, the adaptive threshold is 255, and there is no need to detect corner points.
[0035] Figure 5 Schematic diagram showing the comparison of corner point extraction between the embodiment of the present application and the comparative example. Figure 5 As shown in FIG. 1 , the number of corner points in the image obtained after corner point detection in the embodiment of the present application is significantly greater than that in the image obtained after corner point detection in the comparative example, which uses the OpenCV corner point detection method. Furthermore, the corner points (1), (2), (3), and (4) in the darker or brighter positions of the embodiment of the present application are not reflected in the image of the comparative example.
[0036] Figure 6 A flowchart of a method for detecting corners in an image according to another embodiment of the present application is shown. In step 601, each of the first image blocks is downsampled to obtain a second image block corresponding to each of the first image blocks. If the size of the first image block is 64 pixels × 64 pixels, the size of the second image block is 32 pixels × 32 pixels. A further downsampling method may be: taking the data of the even rows and even columns in the first image block to generate the second image block. This can reduce the complexity of texture calculation in the first image block and can detect corners more quickly. For example, from 64 pixels × 64 pixels to 32 pixels × 32 pixels, the computational complexity is reduced by 4 times.
[0037] In step 602, pixel gradient values at various locations in the second image block are calculated. Then, in step 603, based on the pixel gradient values at various locations in the second image block corresponding to each of the first image blocks, the maximum pixel gradient value and the average pixel gradient value of each of the first image blocks are obtained. In this way, the maximum pixel gradient value and the average pixel gradient value of the first image block can be obtained with lower computational complexity.
[0038] In some embodiments, the pixel gradient values at each position of the second image block are calculated using a Sobel filter method, which is conducive to quickly obtaining the pixel gradient values.
[0039] Figure 7A flowchart of a method for detecting corner points in an image according to another embodiment of the present application is shown. In step 701, a pixel matrix of a second image block of the image to be detected is obtained. For example, a 4-pixel×4-pixel pixel matrix W of the second image block is:
[0040]
[0041] In step 702, the pixel matrix of the second image block is edge-wrapped to obtain an edge-wrapped pixel matrix, which facilitates obtaining pixel gradient values of pixels at edge positions, such as pixel gradient values at positions A, B, and E in the pixel matrix W.
[0042] In step 703, the pixel matrix after edge wrapping is convolved using the horizontal Sobel convolution factor and the vertical Sobel convolution factor to obtain the horizontal pixel gradient value and the vertical pixel gradient value of each position in the pixel matrix. The Sobel convolution factor in the Sobel filter is
[0043]
[0044] The horizontal Sobel convolution factor is k y Sx *k x Sy ; The vertical sobel convolution factor is k y Sy *k x Sx , where k x Sx =[d ef],k x Sy =[abc], k y Sx and k y Sy They are:
[0045]
[0046] In step 704, based on the horizontal pixel gradient values and vertical pixel gradient values at each position of each second image block included in the first image block, the maximum pixel gradient value and average pixel gradient value of the first image block are obtained. For a 64×64 pixel first image block, downsampled to a 32×32 pixel second image block, the second image block can obtain 1024 horizontal pixel gradient values and 1024 vertical pixel gradient values, for a total of 2048 pixel gradient values. These gradient values can be considered to reflect the grayscale changes of the first image block. Therefore, the first image block has a total of 2048 pixel gradient values. The maximum pixel gradient value is then taken as the maximum pixel gradient value, and the average of the 2048 pixel gradient values is taken as the average pixel gradient value. This allows the exposure and grayscale changes of the first image block to be accurately determined.
[0047] In some embodiments, the pixel matrix of the second image block is subjected to edge wrapping processing to obtain the pixel matrix after edge wrapping, which specifically includes: based on the pixel matrix, using a mirror symmetry method, selecting the matrix elements of the edge wrapping, assigning the matrix elements of the edge wrapping to the corresponding edge wrapping positions of the pixel matrix, and obtaining the pixel matrix after edge wrapping.
[0048] The pixel matrix W' after the pixel matrix W is wrapped is:
[0049]
[0050] After convolution processing of the pixel matrix W' using the above-mentioned sobel convolution factor, the pixel gradient value of each position of the pixel matrix W is obtained as follows:
[0051]
[0052] Where m1=k1F+k2E+k3F+k4B+k5A+k6B+k7F+k8E+k9F (1);
[0053] m2=k1E+k2F+k3G+k4A+k5B+k6C+k7E+k8F+k9G Formula (2); ...
[0055] m 16 =k1K+k2L+k3K+k4O+k5P+k6O+k7K+k8L+k9K formula (16).
[0056] Formulas (1), (2) to (16) are the calculation formulas in the convolution process. By wrapping the edges, the pixel gradient values at the edges of the pixel matrix W' after wrapping are set to 0, which does not affect the calculation of the average pixel gradient value and the maximum gradient value of the entire second image block.
[0057] According to an embodiment of the present application, a device for detecting corners in an image is also provided. The device 800 includes an interface 801 and a processor 802. The interface 801 is configured to acquire an image to be tested. The processor 802 is configured to execute the corner detection method described in any embodiment of the present application. The device can detect corners even in images with uneven illumination, such as those with darker or brighter areas, thereby improving corner detection efficiency and significantly reducing missed detections and false detections.
[0058] According to an embodiment of the present application, a non-transitory computer-readable medium is further provided, on which instructions are stored. When executed by a processor, the instructions perform the steps of the corner detection method described in any embodiment of the present application. The corner detection method of the present application can detect corners even in images with uneven illumination, such as those with darker or brighter areas, thereby improving the effectiveness of corner detection and significantly reducing the problems of missed detection and false detection.
[0059] In addition, although exemplary embodiments have been described herein, the scope includes any and all embodiments based on the present application with equivalent elements, modifications, omissions, combinations (e.g., solutions that intersect various embodiments), adaptations, or changes. The elements in the claims are to be interpreted broadly based on the language employed in the claims and are not limited to the examples described in this specification or during the prosecution of this application, which examples are to be interpreted as non-exclusive. Therefore, this specification and examples are intended to be considered as examples only, with the true scope and spirit being indicated by the following claims and the full scope of their equivalents.
[0060] The above description is intended to be illustrative rather than restrictive. For example, the above examples (or one or more of their solutions) can be used in combination with each other. For example, those of ordinary skill in the art can use other embodiments when reading the above description. In addition, in the above-mentioned specific embodiments, various features can be grouped together to simplify the application. This should not be interpreted as an intention that the features of an application that does not require protection are necessary for any claim. On the contrary, the subject matter of the present application may be less than all the features of the embodiments of a specific application. Thus, the following claims are incorporated into the specific embodiments as examples or embodiments, wherein each claim is independently a separate embodiment, and it is considered that these embodiments can be combined with each other in various combinations or arrangements. The scope of the present invention should be determined with reference to the appended claims and the full scope of equivalents to which these claims are entitled.
[0061] The above embodiments are merely exemplary embodiments of the present application and are not intended to limit the present invention. The scope of protection of the present invention is defined by the claims. Those skilled in the art may make various modifications or equivalent substitutions to the present invention within the spirit and scope of protection of the present application, and such modifications or equivalent substitutions shall also be deemed to fall within the scope of protection of the present invention.
Claims
1. A method for detecting corner points of an image, characterized in that: The corner point detection method comprises: Acquire an image to be tested, and divide the image to be tested into a plurality of first image blocks; Calculating a pixel gradient value at each position on each of the first image blocks, and obtaining a maximum pixel gradient value and an average pixel gradient value of each of the first image blocks, wherein the maximum pixel gradient value and the average pixel gradient value reflect changes in exposure or grayscale of the image to be measured; Based on the maximum pixel gradient value and the average pixel gradient value of each of the first image blocks, corresponding adaptive thresholds are obtained by searching a threshold table, the threshold table defining adaptive thresholds corresponding to various maximum pixel gradient values and average pixel gradient values, wherein for a maximum pixel gradient value greater than a first threshold and less than or equal to a fixed pixel maximum value, and an average pixel gradient value greater than a second threshold and less than or equal to a third threshold, the corresponding adaptive threshold is less than 20, wherein the first threshold and the second threshold are greater than or equal to 2, and the third threshold is less than or equal to 20; Based on the adaptive threshold of each of the first image blocks, a corner point on each of the first image blocks is determined.
2. The corner detection method according to claim 1, wherein: The threshold table further defines a first average pixel gradient value interval and a second average pixel gradient value interval that are independent of each other, such that a minimum value of the first average pixel gradient value interval is greater than the second threshold value, and a maximum value of the interval is less than or equal to a fourth threshold value; a minimum value of the second average pixel gradient value interval is greater than or equal to a fifth threshold value, and a maximum value of the interval is less than or equal to a third threshold value, wherein the fourth threshold value is between 4 and 8, and the fifth threshold value is between 6 and 9; In the threshold table, the range of the first adaptive threshold corresponding to the average pixel gradient value of the first average pixel gradient value interval and the maximum pixel gradient value greater than the first threshold and less than or equal to the fixed pixel maximum value is greater than or equal to the middle value within the first average pixel gradient value interval and less than or equal to the fourth threshold; the range of the second adaptive threshold corresponding to the average pixel gradient value of the second average pixel gradient value interval and the maximum pixel gradient value greater than the first threshold and less than or equal to the fixed pixel maximum value is 8 to 14.
3. The corner detection method according to claim 1, wherein: The threshold table further defines a third average pixel gradient value interval and a fourth average pixel gradient value interval that are independent of each other, such that a minimum value of the third average pixel gradient value interval is greater than or equal to a seventh threshold, and a maximum value of the third average pixel gradient value interval is less than or equal to an eighth threshold; and a minimum value of the fourth average pixel gradient value interval is greater than or equal to a ninth threshold, and a maximum value of the fourth average pixel gradient value interval is less than or equal to a fixed pixel maximum value, wherein the seventh threshold is 21 to 23, the eighth threshold is 25 to 30, and the ninth threshold is 31 to 35; In the threshold table, the range of the third adaptive threshold corresponding to the average pixel gradient value of the third average pixel gradient value interval and the maximum pixel gradient value greater than the first threshold and less than or equal to the fixed pixel maximum value is greater than or equal to the middle value within the third average pixel gradient value interval and less than or equal to the eighth threshold; the range of the fourth adaptive threshold corresponding to the average pixel gradient value of the fourth average pixel gradient value interval and the maximum pixel gradient value greater than the first threshold and less than or equal to the fixed pixel maximum value is greater than or equal to the ninth threshold and less than or equal to the sixth threshold, wherein the sixth threshold is 35 to 45.
4. The corner detection method according to any one of claim 1, characterized in that: The threshold table further defines: a maximum pixel gradient value that is less than or equal to a first threshold, and an average pixel gradient value that is less than or equal to a second threshold, and the adaptive threshold corresponding to these two values is a fixed pixel maximum value.
5. The corner detection method according to any one of claim 1, characterized in that: Calculating the pixel gradient value at each position on the first image block and obtaining the maximum pixel gradient value and the average pixel gradient value of each first image block specifically includes: Downsampling each of the first image blocks to obtain a second image block corresponding to each of the first image blocks; Calculating pixel gradient values at various positions of the second image block; Based on the pixel gradient values at each position of the second image block corresponding to each of the first image blocks, a maximum pixel gradient value and an average pixel gradient value of each of the first image blocks are obtained.
6. The corner detection method according to claim 5, characterized in that: The pixel gradient value at each position of the second image block is calculated using a Sobel filtering method.
7. The corner detection method according to claim 6, characterized in that: Obtaining the maximum pixel gradient value and the average pixel gradient value of the first image block based on the pixel gradient values at each position of the second image block corresponding to each of the first image blocks specifically includes: Obtaining a pixel matrix of a second image block of the image to be measured; Performing edge wrapping processing on the pixel matrix of the second image block to obtain an edge-wrapped pixel matrix; Using a horizontal Sobel convolution factor and a vertical Sobel convolution factor to perform convolution processing on the pixel matrix after edge wrapping, respectively, to obtain a horizontal pixel gradient value and a vertical pixel gradient value at each position of the pixel matrix; Based on the horizontal pixel gradient values and the vertical pixel gradient values at each position of the second image block corresponding to the first image block, the maximum pixel gradient value and the average pixel gradient value of the first image block are obtained.
8. The corner detection method according to claim 7, wherein: The pixel matrix of the second image block is subjected to edge wrapping processing to obtain the pixel matrix after edge wrapping, which specifically includes: based on the pixel matrix, using the mirror symmetry method, selecting the matrix elements of the edge wrapping, assigning the matrix elements of the edge wrapping to the corresponding edge wrapping positions of the pixel matrix, and obtaining the pixel matrix after edge wrapping.
9. A device for detecting corner points of an image, characterized in that: The corner point detection device comprises: An interface configured to acquire an image to be measured; A processor configured to execute the corner detection method according to any one of claims 1 to 8.
10. A non-transitory computer-readable medium having instructions stored thereon, which, when executed by a processor, execute the steps of the corner detection method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Self-adaptation threshold value Harris corner detection method
CN103413306A
Determining pixels textual characteristics
US20050123198A1