An X-corner positioning method and device

By acquiring the subpixel boundary points in the image and fitting them, the problem that traditional methods are difficult to achieve accurate positioning of X-angle point subpixels is solved, and high-precision positioning of X-angle point is achieved.

CN119991817BActive Publication Date: 2025-06-17TRUE HEALTH (GUANGDONG HENGQIN) MEDICAL TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510466474.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-15
Publication Date
2025-06-17
Estimated Expiration
2045-04-15

AI Technical Summary

Technical Problem

In computer vision and image processing applications, it is difficult for traditional methods to achieve accurate positioning at the center of the X-corner target, especially when the X-corner point is unclear and there is adhesion.

Method used

By obtaining the pixel points in the image containing X corner points, and obtaining the subpixel points located on the black and white boundary line and the white and black boundary line respectively, fitting to obtain the straight line equation, and finally computing the intersection point to determine the X corner points and their subpixel coordinates.

Benefits of technology

The subpixel-level accuracy of X-corner point positioning is achieved, and the positioning difficulties of traditional methods in the absence of clear center points are overcome, and the needs of high-precision image processing and measurement are met.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119991817B_ABST
    Figure CN119991817B_ABST
Patent Text Reader

Abstract

The present invention provides an X-corner positioning method and device, which are applied to the technical fields of computer vision and image processing. The method includes: obtaining pixel points in an image containing X-corners in a preset direction, where the preset direction is the order of selecting pixel points in black-and-white pixel regions; respectively obtaining a number of sub-pixel demarcation points located on the black-and-white demarcation line and the white-black demarcation line among the pixel points, where the black-and-white demarcation line is the demarcation line transitioning from the black pixel region to the white pixel region, and the white-black demarcation line is the demarcation line transitioning from the white pixel region to the black pixel region; respectively fitting the sub-pixel demarcation points on the black-and-white demarcation line and the white-black demarcation line to obtain a black demarcation line linear equation and a white demarcation line linear equation; obtaining the intersection point of the black-and-white demarcation line linear equation and the white-black demarcation line linear equation to obtain the X-corner and the sub-pixel coordinates of the X-corner. The present invention realizes accurate positioning of the X-corner.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer vision and image processing, and particularly relates to an X-corner positioning method and device. Background Art

[0002] In computer vision applications, black and white X-shaped corners are often used as positioning marker points, and it is crucial to accurately obtain the coordinates of the center positions of such corners. In most actual application scenarios, only obtaining the corner coordinates at the pixel level is far from sufficient, and sub-pixel level accuracy is often required.

[0003] However, limited by the actual manufacturing process level, in some application scenarios, the center points of the X-corner targets are unclear and there is a certain degree of adhesion. Traditional positioning algorithms often have difficulty achieving accurate positioning when dealing with such unclear center points, resulting in the inability to accurately obtain the sub-pixel coordinates of the center of the X-corner target. Summary of the Invention

[0004] In view of this, on the one hand, the present invention provides an X-corner positioning method, including:

[0005] Obtaining pixel points in an image containing X-corners in a preset direction, where the preset direction is the order of selecting pixel points in the black and white pixel regions;

[0006] Respectively obtaining a number of sub-pixel demarcation points located on the black and white demarcation lines and the white and black demarcation lines, where the black and white demarcation line is the demarcation line from the black pixel area to the white pixel area, and the white and black demarcation line is the demarcation line from the white pixel area to the black pixel area;

[0007] Respectively fitting the sub-pixel demarcation points on the black and white demarcation lines and the white and black demarcation lines to obtain a black demarcation line straight line equation and a white demarcation line straight line equation;

[0008] Obtaining the intersection point of the black and white demarcation line straight line equation and the white and black demarcation line straight line equation to obtain the X-corner and the sub-pixel coordinates of the X-corner.

[0009] Optionally, obtaining a number of sub-pixel demarcation points located on the black and white demarcation line includes:

[0010] For the pixel points from the black pixel area to the white pixel area, dividing all pixel points into blocks, fitting the pixel points in adjacent pixel regions according to the blocks to obtain a number of first fitting curves, and the pixel values of the first fitting curves increase from small to large;

[0011] Selecting the pixel points with the largest pixel value change on each of the first fitting curves;

[0012] Curve fitting the pixel points with the largest pixel value change to obtain a number of first parabolas;

[0013] Select the extreme points on each first parabola to obtain a number of sub-pixel demarcation points located on the black-and-white demarcation line.

[0014] Optionally, obtaining a number of sub-pixel demarcation points located on the black-and-white demarcation line among the pixel points includes:

[0015] For the pixel points where the black pixel area transitions to the white pixel area, divide all the pixel points into blocks, and sequentially fit the pixel points in the adjacent pixel areas within the first block among the pixel points where the two black pixel areas transition to the white pixel area to obtain two first fitting curves, and the pixel values of the first fitting curves increase from small to large;

[0016] Respectively select the pixel points with the largest change in pixel values on the two first fitting curves;

[0017] Perform curve fitting on the pixel points with the largest change in pixel values to obtain two first parabolas;

[0018] Respectively select the extreme points on the two first parabolas to obtain sub-pixel demarcation points located on the black-and-white demarcation line;

[0019] Continue to sequentially fit the pixel points in the adjacent pixel areas within the remaining blocks until all sub-pixel demarcation points located on the black-and-white demarcation line within all blocks are obtained.

[0020] Optionally, performing curve fitting on the pixel points with the largest change in pixel values to obtain a first parabola includes:

[0021] Perform adjacent point pixel difference calculation on the pixel points with the largest change in pixel values;

[0022] Perform curve fitting on the corresponding pixel points according to the pixel differences to obtain a first parabola.

[0023] Optionally, if the pixel difference is greater than 0, select the maximum value points on the first parabola to obtain a number of sub-pixel demarcation points located on the black-and-white demarcation line.

[0024] Optionally, obtaining a number of sub-pixel demarcation points located on the white-and-black demarcation line among the pixel points includes:

[0025] For the pixel points where the white pixel area transitions to the black pixel area, divide all the pixel points into blocks, and fit the pixel points in the adjacent pixel areas according to the blocks to obtain a number of second fitting curves, and the pixel values of the second fitting curves decrease from large to small;

[0026] Select the pixel points with the largest change in pixel values on each of the second fitting curves;

[0027] Curve fitting is performed on the pixel points with the largest pixel value changes to obtain a number of second parabolas;

[0028] The extreme points on each second parabola are selected to obtain a number of sub-pixel demarcation points located on the white-black demarcation line.

[0029] Optionally, obtaining a number of sub-pixel demarcation points located on the white-black demarcation line among the pixel points includes:

[0030] For the pixel points where the white pixel area transitions to the black pixel area, all pixel points are divided into blocks, and the pixel points in the adjacent pixel areas within the first block among the pixel points where the two white pixel areas transition to the black pixel area are respectively curve-fitted in sequence to obtain two second fitting curves, and the pixel values of the second fitting curves decrease from large to small;

[0031] The pixel points with the largest pixel value changes on the two second fitting curves are respectively selected;

[0032] Curve fitting is performed on the pixel points with the largest pixel value changes to obtain two second parabolas;

[0033] The extreme points on the two second parabolas are respectively selected to obtain sub-pixel demarcation points located on the white-black demarcation line;

[0034] Continue to perform curve fitting on the pixel points in the adjacent pixel areas within the remaining blocks in sequence until all sub-pixel demarcation points located on the white-black demarcation line within all blocks are obtained.

[0035] Optionally, curve fitting the pixel points with the largest pixel value changes to obtain a second parabola includes:

[0036] Calculate the pixel differences between adjacent points for the pixel points with the largest pixel value changes;

[0037] Curve fitting is performed on the corresponding pixel points according to the pixel differences to obtain a second parabola.

[0038] Optionally, if the pixel difference is less than 0, the minimum value points on the second parabola are selected to obtain sub-pixel demarcation points located on the white-black demarcation line.

[0039] In a second aspect of the present invention, an X-corner positioning device is provided, and the device includes: a processor and a memory connected to the processor; wherein, the memory stores instructions executable by the processor, and when the instructions are executed by the processor, the processor is enabled to execute the above-mentioned X-corner positioning method.

[0040] The present invention first obtains image pixel points orderly and completely in a preset direction, laying a comprehensive data foundation for subsequent processing; then obtains sub-pixel demarcation points through screening, improves the positioning accuracy of the demarcation line to the sub-pixel level, excludes the interference of useless pixel points, and accurately determines the positions of the black-and-white demarcation line and the white-and-black demarcation line; then fits the sub-pixel demarcation points into the straight-line equations of the black-and-white demarcation line and the white-and-black demarcation line respectively. Since the intersection point of the two demarcation lines is the X corner point, finally, the X corner point and its sub-pixel coordinates are accurately obtained by solving the intersection point of the straight-line equations, meeting the requirements for X corner point positioning in high-precision image processing and measurement. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for use in the description of the specific embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0042] Figure 1 It is a schematic flowchart of the X corner point positioning method in the embodiment of the present invention;

[0043] Figure 2 It is a diagram of selected pixel points in the embodiment of the present invention;

[0044] Figure 3 It is a first fitting curve diagram in the embodiment of the present invention;

[0045] Figure 4 It is a first parabola diagram in the embodiment of the present invention;

[0046] Figure 5 It is a diagram of demarcation points on the black-and-white demarcation line and the white-and-black demarcation line in the embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0047] The following will clearly and completely describe the technical solutions of the present invention with reference to the drawings. Obviously, the described embodiments are some embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.

[0048] In the description of the present invention, it should be noted that the orientation or positional relationship indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. is based on the orientation or positional relationship shown in the drawings. It is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be construed as a limitation to the present invention. In addition, the terms "first", "second", and "third" are only used for descriptive purposes and should not be construed as indicating or implying relative importance.

[0049] In the description of the present invention, it should be noted that unless otherwise clearly specified and defined, the terms "installed", "connected", and "connected" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be directly connected or indirectly connected through an intermediate medium, and it can also be the communication inside two elements. It can be a wireless connection or a wired connection. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0050] In addition, the technical features involved in different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0051] As Figure 1 shown, an embodiment of the present invention provides an X-corner positioning method, which is executed by an electronic device such as a computer or a server, and specifically includes:

[0052] S1, obtain pixel points in the image containing the X-corner according to a preset direction, where the preset direction is the order of selecting pixel points in the black and white pixel areas. The black pixel area and the white pixel area do not strictly refer to pure black (pixel value is 0) and white (pixel value is 255). The black pixel area refers to an area in the image where the overall pixel value is at a relatively low level, and the white pixel area is an area in the image where the overall pixel value is at a relatively high level.

[0053] The preset direction can be clockwise or counterclockwise. Before obtaining the pixel points, a coordinate system is established for the image with the lower left corner of the image as the origin, as Figure 2 shown. Taking Figure 2 as an example, starting from the direction of the arrow for clockwise rotation, it is divided into the first black pixel area, the first white pixel area, the second black pixel area, and the second white pixel area. First, select pixel points in the order from the first black pixel area to the first white pixel area to the second black pixel area to the second white pixel area. When selecting pixel points in the first black pixel area and the first white pixel area, first set a coordinate as the first pixel point (as Figure 2In (11) of, a row of pixel points can be selected according to the rule of keeping the ordinate unchanged and changing the abscissa (such as Figure 2 11, 12,..., 1n in), and then change the ordinate. With the changed ordinate, select a row of pixel points with different abscissas (such as Figure 2 21,..., 2n in), and finally obtain multiple rows of pixel points; then when selecting the second darkest pixel area, select according to the abscissas of the pixel points in the second darkest pixel area, and select the first column of pixel points (such as Figure 2 5n,..., nn in), and then change the abscissa and select according to the rule of the pixel points in the first lightest pixel area. Similarly, the second lightest pixel area also selects pixel points according to this rule.

[0054] S2. Respectively obtain a number of sub-pixel demarcation points located on the black-and-white demarcation line and the white-and-black demarcation line among the pixel points. The black-and-white demarcation line is the demarcation line transitioning from the black pixel area to the white pixel area, and the white-and-black demarcation line is the demarcation line transitioning from the white pixel area to the black pixel area.

[0055] Since the pixel points selected in step S1 are not the pixel points closest to the black-and-white demarcation line or the white-and-black demarcation line, it is necessary to screen a number of sub-pixel demarcation points located on the black-and-white demarcation line and the white-and-black demarcation line. Figure 2 In, the demarcation line M is the black-and-white demarcation line, and the demarcation line N is the white-and-black demarcation line.

[0056] S3. Respectively fit the sub-pixel demarcation points on the black-and-white demarcation line and the white-and-black demarcation line to obtain the black demarcation line straight line equation and the white demarcation line straight line equation.

[0057] The straight line equation can be fitted by the least squares method.

[0058] S4. Obtain the intersection point of the black demarcation line straight line equation and the white-and-black demarcation line straight line equation to obtain the X corner point and the sub-pixel coordinates of the X corner point.

[0059] In this embodiment, first, the image pixel points are obtained orderly and completely in a preset direction, laying a comprehensive data foundation for subsequent processing; then, the sub-pixel demarcation points are obtained through screening, improving the demarcation line positioning accuracy to the sub-pixel level, excluding the interference of useless pixel points, and accurately determining the positions of the black-and-white demarcation line and the white-and-black demarcation line; then, the sub-pixel demarcation points are respectively fitted into the straight line equations of the black-and-white demarcation line and the white-and-black demarcation line. Since the intersection point of the two demarcation lines is the X corner point, finally, the X corner point and its sub-pixel coordinates are accurately obtained by solving the intersection point of the straight line equations, meeting the requirements for the positioning of the X corner point in high-precision image processing and measurement.

[0060] In one embodiment, obtaining a number of sub-pixel demarcation points located on the black-and-white demarcation line in step S2 specifically includes:

[0061] S211a. For pixel points where the black pixel area transitions to the white pixel area, divide all pixel points into blocks, fit the pixel points in adjacent pixel areas according to the blocks to obtain several first fitting curves, and the pixel values of the first fitting curves increase from small to large.

[0062] S212a. Select the pixel points with the largest pixel value change on each of the first fitting curves.

[0063] S213a. Perform curve fitting on the pixel points with the largest pixel value change to obtain several first parabolas.

[0064] S214a. Select the extreme points on each of the first parabolas to obtain several sub-pixel demarcation points located on the black and white demarcation line.

[0065] Specifically, taking the transition from the first black pixel area to the first white pixel area in Figure 2 as an example, divide all pixel points into blocks according to the ordinate, and those with the same ordinate are grouped into the same block. For example, points 11, 12,..., 1n are one block, and points 21,..., 2n are one block. Then, fit the pixel points in the same block according to the pixel values to obtain a curve, and this fitting curve reflects the pixel value changes of different pixel points in the same block. The fitting curve of one block is as shown in Figure 3 , where the abscissa P i is the position of the pixel point, the abscissa is the pixel value of the pixel point, and the ordinate f(P i ) is the pixel value. Due to the limitations of the camera itself, in the captured image, the black and white boundary is not an ideal situation where there is a clear distinction between black and white for individual pixels. In reality, the pixel values at the edge are gradually changing. Therefore, to find the position with the largest change, it can be seen that the pixel values h1 and h2 of the fitting curve have the largest change. Then, the pixel points within this range are the positions closest to the black and white demarcation line (i.e., the green pixel points in Figure 2 ). Then, the pixel points circled in Figure 3 can be fitted into a first parabola, and finally, the extreme point of the first parabola is the demarcation point located on the black and white demarcation line (the yellow point a1 in Figure 2 ). Then, find the demarcation points of other blocks according to the above method. The same applies to the transition from the second black pixel area to the second white pixel area. Finally, find all the demarcation points located on the black and white demarcation line, such as the demarcation points on the black and white demarcation line in Figure 5 .

[0066] In this embodiment, by performing block fitting on the pixel points transitioning from the black pixel region to the white pixel region, a first fitting curve that can reflect the change of pixel values from small to large is obtained, comprehensively and meticulously capturing the change of pixel values within different blocks. Then, the pixel points with the largest pixel change on each first fitting curve are selected, which not only reduces the computational amount but also avoids the influence of useless points on the fitting result, and can accurately locate the pixel positions closest to the black and white dividing line. Then, these pixel points with the largest pixel change are curve-fitted to obtain a first parabola. Finally, the extreme points on each first parabola are selected to obtain the sub-pixel dividing points, achieving the accuracy improvement from the pixel level to the sub-pixel level, providing more accurate position information for accurately determining the black and white dividing line, and helping to more precisely complete related tasks such as X corner point positioning in the subsequent process.

[0067] In another embodiment, obtaining several sub-pixel dividing points located on the black and white dividing line in step S2 specifically includes:

[0068] S211b. For the pixel points transitioning from the black pixel region to the white pixel region, all the pixel points are divided into blocks, and in sequence, the pixel points in the adjacent pixel regions within the first block of the pixel points transitioning from the two black pixel regions to the white pixel region are respectively fitted to obtain two first fitting curves, and the pixel values of the first fitting curves increase from small to large.

[0069] S212b. Respectively select the pixel points with the largest pixel value change on the two first fitting curves.

[0070] S213b. Curve-fit the pixel points with the largest pixel value change to obtain two first parabolas.

[0071] S214b. Respectively select the extreme points on the two first parabolas to obtain the sub-pixel dividing points located on the black and white dividing line.

[0072] S215b. Continue to sequentially fit the pixel points in the adjacent pixel regions within the remaining blocks until all the sub-pixel dividing points located on the black and white dividing line within all the blocks are obtained.

[0073] Specifically, obtaining the sub-pixel demarcation points on the black-and-white demarcation line also includes another method. Similarly, the pixel points transitioning from the first black pixel region to the first white pixel region are divided into blocks according to the ordinate. Pixel points with the same ordinate are grouped into the same block. For example, points 11, 12, ……, 1n form a block, and points 21, ……, 2n form a block. Then, the pixel points transitioning from the second black pixel region to the second white pixel region are divided into blocks according to the ordinate. Pixel points with the same ordinate are grouped into the same block. For example, points n1, ……, nn form a block. Then, in the order of the preset direction, the pixel points of the first layer are processed first. For example, the pixel points 11, 12, ……, 1n are fitted into a curve according to the pixel values. Then, a position with the largest change is found in the curve. The pixel points within this change range are the positions closest to the black-and-white demarcation line. Then, the pixel points within the range can be fitted into the first parabola. Finally, the extreme point of the first parabola is found, which is the point on the black-and-white demarcation line ( Figure 2 the yellow point a1 in); then, the demarcation points in the blocks n1, ……, nn are found according to the above method ( Figure 2 the yellow point a2 in), and the demarcation points of the second block transitioning from the first black pixel region to the first white pixel region and the demarcation points of the second block transitioning from the second black pixel region to the second white pixel region are found in sequence. Finally, all the demarcation points on the black-and-white demarcation line are found, such as Figure 5 the demarcation points on the black-and-white demarcation line in.

[0074] In this embodiment, by fitting the pixel points transitioning from two black pixel regions to white pixel regions in blocks respectively, two first fitting curves are obtained, which comprehensively presents the change of pixel values from small to large during the transition of different black pixel regions, providing a basis for accurately positioning the demarcation line; then, the pixel points with the largest pixel change on the two curves are selected, which not only reduces the calculation amount but also avoids the influence of useless points on the fitting result, and can accurately locate the pixel positions closest to the black-and-white demarcation line; then, these key pixel points are fitted into the first parabola, and then the extreme points on each first parabola are selected to obtain the sub-pixel demarcation points, realizing the accuracy improvement from the pixel level to the sub-pixel level, providing more accurate position information for accurately determining the black-and-white demarcation line. Repeating the operation on the remaining blocks in sequence ensures that the sub-pixel demarcation points in all blocks are obtained, completely covering the black-and-white demarcation line, thus providing comprehensive and accurate information for accurately extracting the X corner points in the subsequent process.

[0075] Further, in the above steps S213a and S213b, curve fitting is performed on the pixel points with the largest pixel change to obtain the first parabola, which specifically includes:

[0076] Calculating the pixel differences between adjacent points of the pixel points with the largest pixel change.

[0077] Curve fitting is performed on the corresponding pixel points according to the pixel difference to obtain the first parabola.

[0078] Specifically, as Figure 3 shown, the pixel points with the largest pixel value change are the pixel points in the circle. Then, the pixel values of these pixel points are calculated for the difference, taking Figure 2 the green pixel points in the midpoints 11, 12,..., 1n as an example. Their pixel values increase successively. The pixel values of adjacent pixel points can be calculated for the difference successively and then fitted to obtain the first parabola. As Figure 4 shown, the abscissa P i is the position of the pixel point, and the ordinate f’(P i ) corresponds to the pixel difference between the pixel point and the adjacent pixel point.

[0079] In this embodiment, by calculating the pixel difference between adjacent points for the pixel points with the largest pixel value change, the change relationship between pixel points can be further explored, the characteristics of pixel value change can be highlighted, and the recognizability of the pixel point change rule is effectively enhanced. Curve fitting is performed on the corresponding pixel points according to the pixel difference to obtain the first parabola, which accurately describes the pixel value change trend and makes the change relationship between pixel points more intuitive and clear. This processing method provides a more accurate data basis for subsequent precise positioning of sub-pixel demarcation points, which helps to improve the accuracy and reliability of the entire X corner point positioning process.

[0080] Furthermore, if the pixel difference is greater than 0, the maximum value points on the first parabola are selected to obtain several sub-pixel demarcation points located on the black and white demarcation line.

[0081] Specifically, when calculating the difference, since Figure 2 the pixel values of the green pixel points from the black pixel area to the white pixel area in increase from small to large. If the pixel value of the latter pixel point is subtracted from the pixel value of the previous pixel point, the pixel difference is greater than 0. The first parabola fitted is as Figure 4 shown in. ∆1 is the minimum pixel difference, and ∆2 is the maximum pixel difference. Then, the maximum value point represents the position where the pixel change is the largest, which is the demarcation point on the black and white demarcation line. However, if the difference is calculated as the previous pixel point minus the latter pixel point, the selection method is opposite to the above.

[0082] In this embodiment, by selecting specific points on the first parabola according to the pixel difference situation to determine the sub-pixel demarcation points on the black-and-white demarcation line, when the pixel difference is greater than 0, the maximum value points on the first parabola are selected as the sub-pixel demarcation points. Combining with the actual situation that the pixel values change from small to large from the black pixel area to the white pixel area, this rule conforms to the logic of pixel value change. The maximum value points can accurately represent the position where the pixel change is the largest, that is, the key position of the black-and-white demarcation line, improving the accuracy and reliability of determining the sub-pixel demarcation points on the black-and-white demarcation line, and providing a solid foundation for subsequent image processing tasks such as X-corner point positioning.

[0083] In one embodiment, in step S2, obtaining several sub-pixel demarcation points on the black-and-white demarcation line among the pixel points specifically includes:

[0084] S221a. For the pixel points transitioning from the white pixel area to the black pixel area, all pixel points are divided into blocks, and the pixel points in adjacent pixel areas are fitted according to the blocks to obtain several second fitting curves, and the pixel values of the second fitting curves decrease from large to small

[0085] S222a. Select the pixel points with the largest pixel value change on each second fitting curve.

[0086] S223a. Curve-fit the pixel points with the largest pixel value change to obtain several second parabolas.

[0087] S224a. Select the extreme value points on each second parabola to obtain several sub-pixel demarcation points on the black-and-white demarcation line.

[0088] Specifically, when obtaining the demarcation points on the black-and-white demarcation line, mainly consider the transition from the first white pixel area to the second black pixel area and the transition from the second white pixel area to the first black pixel area. First, divide the pixels in the area where the first white pixel area transitions to the second black pixel area into blocks. Divide all pixel points into blocks according to the abscissa, and those with the same abscissa are grouped into the same block. For example, points 1n, 2n,..., nn are one block, and multiple blocks are divided in this way. Then, fit the pixel points in the same block into a curve according to the pixel values. This fitting curve reflects the pixel value change of different pixel points in the same block. Due to the limitations of the camera itself, in the captured pictures, the black-and-white boundary is not an ideal situation where the black and white are clearly separated between single pixels. In reality, the pixel values at the edge are gradually changing. So, to find the position with the largest change, the pixel points within this range are the positions closest to the black-and-white demarcation line. Then, the pixel points within this range can be curve-fitted into a second parabola, and finally, the extreme value point of the second parabola is the demarcation point on the black-and-white demarcation line. Then, find the demarcation points of other blocks according to the above method, and the same applies to the transition from the second white pixel area to the first black pixel area. Finally, find all the demarcation points on the black-and-white demarcation line, such as Figure 5The demarcation points on the white-black demarcation line.

[0089] In this embodiment, by performing block fitting on the pixel points transitioning from the white pixel region to the black pixel region, a second fitting curve that can reflect the change of pixel values from large to small is obtained, comprehensively and meticulously capturing the change of pixel values within different blocks. Then, the pixel points with the largest pixel change on each second fitting curve are selected, which not only reduces the calculation amount but also avoids the influence of useless points on the fitting result, and can accurately locate the pixel positions closest to the white-black demarcation line. Then, these pixel points with the largest pixel change are curve-fitted to obtain a second parabola. Finally, the extreme points on each second parabola are selected to obtain sub-pixel demarcation points, achieving an accuracy improvement from the pixel level to the sub-pixel level, providing more accurate position information for accurately determining the white-black demarcation line, and helping to more accurately complete related tasks such as X corner point positioning in the subsequent process.

[0090] In another embodiment, obtaining several sub-pixel demarcation points on the white-black demarcation line in step S2 specifically includes:

[0091] S221b. For the pixel points transitioning from the white pixel region to the black pixel region, all pixel points are divided into blocks, and in sequence, the pixel points in the adjacent pixel regions within the first block of the pixel points transitioning from the two white pixel regions to the black pixel region are respectively fitted to obtain two second fitting curves, and the pixel values of the second fitting curves decrease from large to small.

[0092] S222b. Respectively select the pixel points with the largest pixel value change on the two second fitting curves.

[0093] S223b. Curve-fit the pixel points with the largest pixel value change to obtain two second parabolas.

[0094] S224b. Respectively select the extreme points on the two second parabolas to obtain the sub-pixel demarcation points on the white-black demarcation line.

[0095] S225b. Continue to fit the pixel points in the adjacent pixel regions within the remaining blocks in sequence until all sub-pixel demarcation points on the white-black demarcation line within all blocks are obtained.

[0096] Specifically, obtaining the sub-pixel demarcation points located on the white-black demarcation line also includes another method. Similarly, the pixel points transitioning from the first white pixel area to the second black pixel area are divided into blocks according to the abscissa, and those with the same abscissa are grouped into the same block. For example, points 1n, 2n, ……, nn form a block. Multiple blocks are divided in this way. Then, the pixel points transitioning from the second white pixel area to the first black pixel area are divided into blocks according to the abscissa, and those with the same abscissa are grouped into the same block. For example, points 11, 21, ……, n1 form a block. Then, in the order of the preset direction, first process the pixel points in the first layer. For example, fit the pixel points 1n, 2n, ……, nn into a curve according to the pixel values. Then, find a position with the largest change in the curve. The pixel points within this change range are the positions closest to the white-black demarcation line. Then, the pixel points within the range can be fitted into a second parabola. Finally, find the extreme point of the second parabola, which is the point located on the white-black demarcation line. Then, find the demarcation points in blocks 11, 21, ……, n1 according to the above method. Sequentially find the demarcation points of the second block transitioning from the first white pixel area to the second black pixel area and the demarcation points of the second block transitioning from the second white pixel area to the first black pixel area. Finally, find all the demarcation points located on the white-black demarcation line, such as Figure 5 the demarcation points on the white-black demarcation line.

[0097] In this embodiment, by fitting the pixel points transitioning from two white pixel areas to black pixel areas in blocks respectively to obtain two second fitting curves, it comprehensively presents the change situation of the pixel values from large to small during the transition of different black pixel areas, providing a basis for accurately positioning the demarcation line. Then, select the pixel points with the largest pixel change on the two curves, which not only reduces the calculation amount but also avoids the influence of useless points on the fitting result, and can accurately position the pixel positions closest to the black-white demarcation line. Then, fit these key pixel points into a second parabola, and then select the extreme points on each second parabola to obtain sub-pixel demarcation points, realizing the accuracy improvement from the pixel level to the sub-pixel level, providing more accurate position information for accurately determining the white-black demarcation line. Repeat the operation on the remaining blocks in sequence to ensure that the sub-pixel demarcation points in all blocks are obtained, completely covering the white-black demarcation line, thus providing comprehensive and accurate information for accurately extracting the X corner points subsequently.

[0098] Further, in step S223a and step S223b, curve fitting is performed on the pixel points with the largest pixel value change to obtain a second parabola, specifically including:

[0099] Calculate the pixel differences between adjacent points of the pixel points with the largest pixel value change.

[0100] Perform curve fitting on the corresponding pixel points according to the pixel differences to obtain a second parabola.

[0101] Specifically, the pixel points with the largest pixel value change are the pixel points in the circle. Then, the pixel values of these pixel points are subjected to difference calculation. The pixel values of these pixel points with the largest change decrease successively. The pixel values of adjacent pixel points can be successively subjected to difference calculation and fitting to obtain a second parabola.

[0102] In this embodiment, by performing adjacent pixel difference calculation on the pixel points with the largest pixel value change, the change relationship between pixel points can be further explored, the characteristics of pixel value change can be highlighted, and the recognizability of the pixel point change rule is effectively enhanced. According to the pixel difference, the corresponding pixel points are curve-fitted to obtain a second parabola, which accurately describes the pixel value change trend and makes the change relationship between pixel points more intuitive and clear. This processing method provides a more accurate data basis for subsequent accurate positioning of sub-pixel demarcation points, and helps to improve the accuracy and reliability of the entire X-corner positioning process.

[0103] Further, if the pixel difference is less than 0, the minimum value point on the second parabola is selected to obtain the sub-pixel demarcation point located on the white-black demarcation line.

[0104] Specifically, when performing difference calculation, since the pixel values of the green pixel points from the white pixel area to the black pixel area change from large to small, if the pixel value of the latter pixel point is subtracted from the pixel value of the previous pixel point, the pixel difference is less than 0. Then, the minimum value point represents the position with the largest pixel change, which is the demarcation point on the white-black demarcation line. However, if the difference calculation is the previous pixel point minus the latter pixel point, the selection method is opposite to the above.

[0105] In this embodiment, by selecting specific points on the second parabola according to the pixel difference situation to determine the sub-pixel demarcation point on the white-black demarcation line, when the pixel difference is less than 0, the minimum value point on the second parabola is selected as the sub-pixel demarcation point. Combining with the actual situation that the pixel values change from large to small from the white pixel area to the black pixel area, this rule conforms to the logic of pixel value change. The minimum value point can accurately represent the position with the largest pixel change, that is, the key position of the white-black demarcation line, improving the accuracy and reliability of determining the sub-pixel demarcation point on the white-black demarcation line, and providing a solid foundation for subsequent image processing tasks such as X-corner positioning.

[0106] Those skilled in the art should understand that the embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0107] The present invention is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present invention. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, as well as the combination of flows and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to the processors of general-purpose computers, special-purpose computers, embedded processors, or other programmable data processing devices to generate a machine, such that the instructions executed by the processors of the computer or other programmable data processing devices produce means for implementing the functions specified in one flow Figure 1 one flow or multiple flows and / or blocks Figure 1 or multiple blocks.

[0108] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory produce a manufactured article including instruction means that implement the functions specified in one flow Figure 1 one flow or multiple flows and / or blocks Figure 1 or multiple blocks.

[0109] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one flow Figure 1 one flow or multiple flows and / or blocks Figure 1 or multiple blocks.

[0110] Obviously, the above embodiments are merely examples for clear illustration and not limitations on the implementation manners. For those of ordinary skill in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to enumerate all the implementation manners here. And the obvious changes or modifications derived therefrom are still within the protection scope of the present invention.

Claims

1. A method for locating an X corner point, characterized in that: include: Acquire pixel points in the image containing the X corner point according to a preset direction, where the preset direction is the order in which pixel points are selected from the black and white pixel area; Respectively obtain a plurality of sub-pixel boundary points located on the black-white boundary line and the white-black boundary line in the pixel point, wherein the black-white boundary line is a boundary line from a black pixel area to a white pixel area, and the white-black boundary line is a boundary line from a white pixel area to a black pixel area; Fitting the black-white dividing line and the sub-pixel dividing points on the black-white dividing line respectively to obtain a black-white dividing line straight line equation and a black-white dividing line straight line equation; Obtain the intersection of the black-white dividing line equation and the white-black dividing line equation to obtain the X corner point and the sub-pixel coordinates of the X corner point; The step of obtaining a plurality of sub-pixel boundary points located on the black-white boundary line in the pixel point includes: For the pixel points where the black pixel area transitions to the white pixel area, all the pixel points are divided into blocks, and the pixel points of the adjacent pixel areas are fitted according to the blocks to obtain a plurality of first fitting curves, wherein the pixel values ​​of the first fitting curves are from small to large; Selecting the pixel point with the largest pixel value change on each of the first fitting curves; Calculate the pixel difference between adjacent pixels of the pixel with the largest pixel value change; Performing curve fitting on corresponding pixel points according to pixel differences to obtain a plurality of first parabolas; Selecting extreme value points on each first parabola to obtain a number of sub-pixel dividing points located on the black-white dividing line; Acquiring a plurality of sub-pixel boundary points located on the white-black boundary line in the pixel point, including: For the pixel points where the white pixel area transitions to the black pixel area, all the pixel points are divided into blocks, and the pixel points of the adjacent pixel areas are fitted according to the blocks to obtain a plurality of second fitting curves, wherein the pixel values ​​of the second fitting curves are arranged from large to small; Selecting the pixel point with the largest pixel value change on each of the second fitting curves; Calculate the pixel difference between adjacent pixels of the pixel with the largest pixel value change; Performing curve fitting on the corresponding pixel points according to the pixel difference to obtain a plurality of second parabolas; The extreme value points on each second parabola are selected to obtain a number of sub-pixel boundary points located on the white-black boundary line.

2. The method according to claim 1, characterized in that Acquiring a plurality of sub-pixel boundary points located on the black-white boundary line from the pixel point also includes: For the pixel points where the black pixel area transitions to the white pixel area, all the pixel points are divided into blocks, and the pixel points in the adjacent pixel areas in the first block of the pixel points where the two black pixel areas transition to the white pixel area are fitted in sequence to obtain two first fitting curves, wherein the pixel values ​​of the first fitting curves are from small to large; Select the pixel points with the largest pixel value changes on the two first fitting curves respectively; Perform curve fitting on the pixel points with the largest pixel value changes to obtain two first parabolas; Selecting two extreme value points on the first parabola respectively to obtain a sub-pixel dividing point located on the black-white dividing line; Continue to fit the pixel points of the adjacent pixel areas in the remaining blocks in order until the sub-pixel boundary points located on the black-white boundary line in all blocks are obtained.

3. The method according to claim 2, characterized in that If the pixel difference is greater than 0, the maximum point on the first parabola is selected to obtain a plurality of sub-pixel boundary points located on the black-white boundary line.

4. The method according to claim 1, characterized in that: Acquiring a plurality of sub-pixel boundary points located on the white-black boundary line from the pixel point also includes: For the pixel points where the white pixel area transitions to the black pixel area, all the pixel points are divided into blocks, and the pixel points in the adjacent pixel areas in the first block of the pixel points where the two white pixel areas transition to the black pixel area are fitted in sequence to obtain two second fitting curves, and the pixel values ​​of the second fitting curves are from large to small; Select the pixel points with the largest pixel value changes on the two second fitting curves respectively; Perform curve fitting on the pixel points with the largest pixel value changes to obtain two second parabolas; Select two extreme value points on the second parabola respectively to obtain a sub-pixel dividing point located on the white-black dividing line; Continue to fit the pixel points of the adjacent pixel areas in the remaining blocks in order until the sub-pixel boundary points located on the white-black boundary line in all blocks are obtained.

5. The method according to claim 4, characterized in that If the pixel difference is less than 0, the minimum point on the second parabola is selected to obtain a sub-pixel boundary point located on the white-black boundary line.

6. An X-corner positioning device, characterized in that: include: A processor and a memory connected to the processor; wherein the memory stores instructions executable by the processor, and the instructions are executed by the processor so that the processor executes the X corner point positioning method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Satellite target extraction method

    CN103020997A

  • Straight line fitting method and system with sub-pixel precision

    CN115601540A