Corner point position positioning method and device, electronic equipment and readable medium

By identifying the corner positions of the polygonal frame and performing equal-division interpolation during the camera calibration process, and calculating the average grayscale value of the edge points, the problem of inaccurate corner positions is solved, and the accuracy of camera position and posture is improved.

CN114283191BActive Publication Date: 2026-02-13TOTEM VISION (GUANGZHOU) DIGITAL TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111458548.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-01
Publication Date
2026-02-13
Estimated Expiration
2041-12-01

AI Technical Summary

Technical Problem

In virtual reality products, during the camera calibration process, the existing technology does not accurately locate the corner points, resulting in large errors in the camera's position and posture.

Method used

By acquiring images captured by a camera, identifying the corner positions of polygonal bounding boxes, connecting them to form polygons composed of edges, and performing equal-division interpolation processing, the average grayscale value within a certain pixel range around the edge points is calculated, and the target corner point position is determined based on the surrounding grayscale values ​​of the edge points.

Benefits of technology

It improves the accuracy of corner point positioning, reduces errors in camera position and attitude, and enhances the precision of camera calibration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114283191B_ABST
    Figure CN114283191B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a corner point position positioning method and device, electronic equipment and readable medium, the method comprises: acquiring the image collected by the camera, wherein the image comprises a plurality of polygon frames, the corner point position of the polygon frame is identified from the image, the polygon formed by the connecting line of the corner points of the polygon frame is obtained, the edge line is equally divided and interpolated, a plurality of edge line points are obtained, the average value of the gray value in the certain pixel range around the edge line point is calculated as the peripheral gray value, when the peripheral gray value of the edge line point on the polygon is equal, the corner point position is determined as the target corner point position, when the peripheral gray value of the edge line point on the polygon is not equal, that is, the identified corner point position is not accurate enough, the more accurate target corner point position is further determined through the peripheral gray value of the edge line point, so as to solve the problem that the corner point position positioned in the camera calibration process is not accurate enough, resulting in large error of the finally determined camera position and attitude.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the positioning technical field, in particular to a corner point position positioning method, a corner point position positioning device, an electronic device and a computer readable medium. BACKGROUND

[0002] In virtual reality products, especially in virtual-real combined applications, it is necessary to calibrate the camera for shooting real scenes. In the calibration process, a specific object with a known size is usually shot, and then the camera position and posture are positioned by using data calculation method according to the position of the object in the shooting image, the actual size of the object and the camera imaging formula.

[0003] At present, a hairpin is usually used as a recognition object, and the image containing the hairpin is subjected to gray scale and binary processing, and then the contour and polygon approximation and the corner point sub-pixel approximation algorithm are used to identify the corner points of the black frame of the hairpin.

[0004] However, since the contour and polygon approximation are processed on the binary black and white image, the position of the found corner point is not accurate enough, thereby resulting in large errors of the finally determined camera position and posture. SUMMARY

[0005] Embodiments of the present application provide a corner point position positioning method, device, electronic device and computer readable storage medium to solve the problem that the positioned corner point position is not accurate enough in the camera calibration process, thereby resulting in large errors of the finally determined camera position and posture.

[0006] Embodiments of the present application disclose a corner point position positioning method, comprising:

[0007] acquiring an image collected by a camera, wherein the image comprises a plurality of polygon frames;

[0008] identifying corner point positions of the polygon frames from the image;

[0009] connecting the corner points of the polygon frames to obtain a plurality of edges of a polygon;

[0010] performing equal division interpolation processing on the edges to obtain a plurality of edge points;

[0011] calculating the average value of the gray scale of a certain pixel range around the edge points as a peripheral gray scale value;

[0012] when the peripheral gray scale values of the edge points on the polygon are equal, determining the corner point positions as target corner point positions;

[0013] When the peripheral gray scale values of the edge points on the polygon are not equal, a target corner point position is determined according to the peripheral gray scale values of the edge points.

[0014] Optionally, the identifying the corner point position of the polygon frame from the image comprises:

[0015] converting the image into a gray scale image;

[0016] performing a binaryzation process on the gray scale image to obtain a mask image;

[0017] performing a contour finding process, a polygon approximation process and a corner sub-pixel approximation process on the mask image to determine the corner point position of the polygon frame.

[0018] Optionally, the determining the target corner point position according to the peripheral gray scale values of the edge points comprises:

[0019] calculating an average value of the peripheral gray scale values of the edge points on the polygon as a reference peripheral gray scale value;

[0020] determining a suspected point having a peripheral gray scale value equal to the reference peripheral gray scale value within a preset range of the edge point;

[0021] determining a straight line according to the suspected points corresponding to each of the edge points on the edge line;

[0022] determining a position of an intersection point between the straight lines as the target corner point position.

[0023] Optionally, the determining the suspected point having a peripheral gray scale value equal to the reference peripheral gray scale value within a preset range of the edge point comprises:

[0024] Step 1: when an absolute value of a difference between the peripheral gray scale value of the edge point and the reference peripheral gray scale value is within a preset range, the edge point is determined as the suspected point, otherwise, Step 2 is performed;

[0025] Step 2: a straight line passing through the edge point and perpendicular to the edge line is determined as a suspected baseline, and a point on the suspected baseline having a preset pixel distance from the edge point is determined as a suspected reference point;

[0026] Step 3: an average value of gray scales within a certain pixel range of the suspected reference point is calculated as a peripheral gray scale value, and under an assumption that the peripheral gray scale values on the suspected baseline are linearly and monotonously distributed, a point on the baseline having a peripheral gray scale value equal to the reference peripheral gray scale value is determined as the suspected point according to the peripheral gray scale value of the suspected reference point, the peripheral gray scale value of the edge point and a pixel distance between the edge point and the suspected reference point;

[0027] Step four: calculating the average value of the gray scale in a certain pixel range around the suspected point as the real surrounding gray scale value, and determining that the suspected point is correct when the absolute value of the difference between the real surrounding gray scale value of the suspected point and the reference surrounding gray scale value is within a preset range; otherwise, taking the suspected point as a suspected reference point and returning to step three.

[0028] Optionally, the step of determining a suspected point with a surrounding gray scale value as the reference surrounding gray scale value within the preset range of the edge point includes:

[0029] Step one: determining the edge point as a suspected point when the absolute value of the difference between the surrounding gray scale value of the edge point and the reference surrounding gray scale value is within a preset range, or executing step two;

[0030] Step two: determining a point that is a preset pixel away from the edge point in the direction outside the polygon as a suspected reference point, and calculating the average value of the gray scale in a certain pixel range around the suspected reference point as a surrounding gray scale value;

[0031] Step three: determining the suspected reference point as a suspected point when the absolute value of the difference between the surrounding gray scale value of the suspected reference point and the reference surrounding gray scale value is within the preset range; or taking the suspected reference point as an edge point when the absolute value of the difference between the surrounding gray scale value of the suspected reference point and the reference surrounding gray scale value is not within the preset range, and the absolute value of the difference between the surrounding gray scale value of the suspected reference point and the reference surrounding gray scale value is smaller than the absolute value of the difference between the surrounding gray scale value of the edge point and the reference surrounding gray scale value, and returning to execute step two.

[0032] Optionally, after step two, the method further includes:

[0033] Step three: executing step four when the absolute value of the difference between the surrounding gray scale value of the suspected reference point and the reference surrounding gray scale value is not within the preset range, and the absolute value of the difference between the surrounding gray scale value of the suspected reference point and the reference surrounding gray scale value is greater than or equal to the absolute value of the difference between the surrounding gray scale value of the edge point and the reference surrounding gray scale value.

[0034] Step four: determining a point that is a preset pixel away from the edge point in the direction inside the polygon as a suspected reference point, and calculating the average value of the gray scale in a certain pixel range around the suspected reference point as a surrounding gray scale value.

[0035] Step five: when the absolute value of the difference between the peripheral gray value of the presumed reference point and the reference peripheral gray value is within the preset range, the presumed reference point is determined as a presumed point; when the absolute value of the difference between the peripheral gray value of the presumed reference point and the reference peripheral gray value is not within the preset range, the presumed reference point is regarded as an edge point, and step four is executed again.

[0036] Optionally, the step of determining the average gray value within a certain pixel range around the edge point as the reference peripheral gray value for the presumed point comprises:

[0037] Step one: when the absolute value of the difference between the peripheral gray value of the edge point and the reference peripheral gray value is within the preset range, the edge point is determined as a presumed point; otherwise, step two is executed.

[0038] Step two: a point within a preset pixel range in the direction of the inside of the polygon is determined as a presumed reference point, and the average gray value within a certain pixel range around the presumed reference point is calculated as a peripheral gray value.

[0039] Step three: when the absolute value of the difference between the peripheral gray value of the presumed reference point and the reference peripheral gray value is within the preset range, the presumed reference point is determined as a presumed point; when the absolute value of the difference between the peripheral gray value of the presumed reference point and the reference peripheral gray value is not within the preset range, and the absolute value of the difference between the peripheral gray value of the presumed reference point and the reference peripheral gray value is smaller than the absolute value of the difference between the peripheral gray value of the edge point and the reference peripheral gray value, the presumed reference point is regarded as an edge point, and step two is executed again.

[0040] Optionally, after step two, the method further comprises:

[0041] Step three: when the absolute value of the difference between the peripheral gray value of the presumed reference point and the reference peripheral gray value is not within the preset range, and the absolute value of the difference between the peripheral gray value of the presumed reference point and the reference peripheral gray value is greater than or equal to the absolute value of the difference between the peripheral gray value of the edge point and the reference peripheral gray value, step four is executed.

[0042] Step four: a point within a preset pixel range in the direction of the outside of the polygon is determined as a presumed reference point, and the average gray value within a certain pixel range around the presumed reference point is calculated as a peripheral gray value.

[0043] Step five: when the absolute value of the difference between the peripheral gray value of the presumed reference point and the reference peripheral gray value is within a preset range, the presumed reference point is determined as a presumed point; when the absolute value of the difference between the peripheral gray value of the presumed reference point and the reference peripheral gray value is not within the preset range, the presumed reference point is regarded as a sideline point, and step four is executed again.

[0044] The embodiment of the application further discloses a corner point position positioning device, comprising:

[0045] An image acquisition module is configured to acquire an image collected by a camera, wherein the image comprises a multi-layer polygon frame.

[0046] A corner point identification module is configured to identify a corner point position of the polygon frame from the image.

[0047] A corner point connection module is configured to connect the corner points of the polygon frame to obtain a polygon composed of sidelines.

[0048] A sideline interpolation module is configured to perform uniform interpolation processing on the sidelines to obtain a plurality of sideline points.

[0049] A gray value calculation module is configured to calculate an average gray value of a certain pixel range around the sideline points as a peripheral gray value.

[0050] A first position determination module is configured to determine the corner point position as a target corner point position when the peripheral gray values of the sideline points on the polygon are equal.

[0051] A second position determination module is configured to determine a target corner point position according to the peripheral gray values of the sideline points when the peripheral gray values of the sideline points on the polygon are not equal.

[0052] Optionally, the corner point identification module comprises:

[0053] An image conversion submodule is configured to convert the image into a gray-scale image.

[0054] An image processing submodule is configured to perform binaryzation processing on the gray-scale image to obtain a mask image.

[0055] A corner point determination submodule is configured to perform contour processing, polygon approximation processing and corner point subpixel approximation processing on the mask image to determine the corner point position of the polygon frame.

[0056] Optionally, the second position determination module comprises:

[0057] A gray value calculation submodule is configured to calculate an average value of the peripheral gray values of the sideline points on the polygon as a reference peripheral gray value.

[0058] a speculative point determination sub-module, configured to determine a speculative point with a peripheral gray value being the reference peripheral gray value within a preset range of the edge point;

[0059] a straight line determination sub-module, configured to determine a straight line according to the speculative points corresponding to the edge points on the edge line;

[0060] a corner point determination sub-module, configured to determine a position of an intersection between the straight lines as a target corner point position.

[0061] Optionally, the speculative point determination sub-module comprises:

[0062] a first difference value judgment unit, configured to determine the edge point as a speculative point when an absolute value of a difference between the peripheral gray value of the edge point and the reference peripheral gray value is within a preset range, and otherwise call a reference point determination unit;

[0063] the reference point determination unit, configured to take a straight line passing through the edge point and being perpendicular to the edge line as a speculative baseline, and take a point on the speculative baseline with a preset pixel distance from the edge point as a speculative reference point;

[0064] a speculative point determination unit, configured to calculate a gray average value within a certain pixel range of the peripheral of the speculative reference point as a peripheral gray value, and determine a point on the baseline with a peripheral gray value being the reference peripheral gray value as a speculative point according to the peripheral gray value of the speculative reference point, the peripheral gray value of the edge point and a pixel distance between the edge point and the speculative reference point under an assumption that the peripheral gray values on the baseline are linearly and monotonously distributed;

[0065] a second difference value judgment unit, configured to calculate a gray average value within a certain pixel range of the peripheral of the speculative point as a real peripheral gray value, and determine the speculative point to be correct when an absolute value of a difference between the real peripheral gray value of the speculative point and the reference peripheral gray value is within a preset range, and otherwise take the speculative point as a speculative reference point and call the speculative point determination unit.

[0066] Optionally, the speculative point determination sub-module comprises:

[0067] a third difference value judgment unit, configured to determine the edge point as a speculative point when an absolute value of a difference between the peripheral gray value of the edge point and the reference peripheral gray value is within a preset range, and otherwise call a reference point determination unit;

[0068] the reference point determination unit, further configured to determine a point with a preset pixel on an outer side of the polygon as a speculative reference point, and calculate a gray average value within a certain pixel range of the peripheral of the speculative reference point as a peripheral gray value.

[0069] The fourth difference value judging unit is configured to determine the suspected reference point as a suspected point when the absolute value of the difference between the peripheral gray scale value of the suspected reference point and the reference peripheral gray scale value is within the preset range, and determine the suspected reference point as an edge line point and call the reference point determining unit when the absolute value of the difference between the peripheral gray scale value of the suspected reference point and the reference peripheral gray scale value is not within the preset range and the absolute value of the difference between the peripheral gray scale value of the suspected reference point and the reference peripheral gray scale value is smaller than the absolute value of the difference between the peripheral gray scale value of the edge line point and the reference peripheral gray scale value.

[0070] Optionally, the method further comprises:

[0071] The third difference value judging unit is further configured to call the reference point determining unit when the absolute value of the difference between the peripheral gray scale value of the suspected reference point and the reference peripheral gray scale value is not within the preset range and the absolute value of the difference between the peripheral gray scale value of the suspected reference point and the reference peripheral gray scale value is greater than or equal to the absolute value of the difference between the peripheral gray scale value of the edge line point and the reference peripheral gray scale value.

[0072] The reference point determining unit is configured to determine a point of the edge line point in a direction of an inside of the polygon by a preset number of pixels as a suspected reference point, and calculate an average value of gray scales in a certain pixel range around the suspected reference point as a peripheral gray scale value.

[0073] The fourth difference value judging unit is further configured to determine the suspected reference point as a suspected point when the absolute value of the difference between the peripheral gray scale value of the suspected reference point and the reference peripheral gray scale value is within the preset range, and determine the suspected reference point as an edge line point and call the reference point determining unit when the absolute value of the difference between the peripheral gray scale value of the suspected reference point and the reference peripheral gray scale value is not within the preset range.

[0074] Optionally, the suspected point determining sub-module comprises:

[0075] The third difference value judging unit is further configured to determine the edge line point as a suspected point when the absolute value of the difference between the peripheral gray scale value of the edge line point and the reference peripheral gray scale value is within the preset range, and call the reference point determining unit otherwise.

[0076] The reference point determining unit is configured to determine a point of the edge line point in a direction of an inside of the polygon by a preset number of pixels as a suspected reference point, and calculate an average value of gray scales in a certain pixel range around the suspected reference point as a peripheral gray scale value.

[0077] The fourth difference judgment unit is further configured to determine the suspected reference point as a suspected point when the absolute value of the difference between the peripheral gray scale value of the suspected reference point and the reference peripheral gray scale value is within the preset range, and to determine the suspected reference point as an edge line point and call the reference point determination unit when the absolute value of the difference between the peripheral gray scale value of the suspected reference point and the reference peripheral gray scale value is not within the preset range and the absolute value of the difference between the peripheral gray scale value of the suspected reference point and the reference peripheral gray scale value is less than the absolute value of the difference between the peripheral gray scale value of the edge line point and the reference peripheral gray scale value.

[0078] Optionally, the method further comprises:

[0079] The third difference judgment unit is further configured to call the reference point determination unit when the absolute value of the difference between the peripheral gray scale value of the suspected reference point and the reference peripheral gray scale value is not within the preset range and the absolute value of the difference between the peripheral gray scale value of the suspected reference point and the reference peripheral gray scale value is greater than or equal to the absolute value of the difference between the peripheral gray scale value of the edge line point and the reference peripheral gray scale value.

[0080] The reference point determination unit is configured to determine a point that is a preset number of pixels in the direction outside the polygon as a suspected reference point, and to calculate an average gray scale value in a certain pixel range around the suspected reference point as a peripheral gray scale value.

[0081] The fourth difference judgment unit is further configured to determine the suspected reference point as a suspected point when the absolute value of the difference between the peripheral gray scale value of the suspected reference point and the reference peripheral gray scale value is within the preset range, and to determine the suspected reference point as an edge line point and call the reference point determination unit when the absolute value of the difference between the peripheral gray scale value of the suspected reference point and the reference peripheral gray scale value is not within the preset range.

[0082] The embodiment of the application further discloses an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus.

[0083] The memory is used to store a computer program.

[0084] The processor is used to execute the program stored on the memory, and realizes the method as described in the embodiment of the application.

[0085] The embodiment of the application further discloses one or more computer readable media, which store instructions, and when executed by one or more processors, make the processor execute the method as described in the embodiment of the application.

[0086] The embodiment of the present application comprises the following advantages: an image captured by a camera is acquired, the image comprises a polygon frame with multiple layers, corner point positions of the polygon frame are identified from the image, a polygon formed by connecting the corner points of the polygon frame is obtained, the edges are equally divided and interpolated, a plurality of edge points are obtained, the average value of the gray scale within a certain pixel range around the edge points is calculated as the peripheral gray scale value, when the peripheral gray scale values of the edge points on the polygon are equal, the corner point positions are determined as target corner point positions, and when the peripheral gray scale values of the edge points on the polygon are not equal, the target corner point positions are determined according to the peripheral gray scale values. By applying the embodiment of the present application, after the corner point positions in the image are identified, the polygon formed by connecting the corner points of the polygon frame is obtained, the edges are equally divided and interpolated, a plurality of edge points are obtained, the average value of the gray scale within a certain pixel range around the edge points is calculated as the peripheral gray scale value, when the peripheral gray scale values of the edge points on the polygon are equal, it is indicated that the identified corner point positions are accurate, and the corner point positions are determined as target corner point positions, and when the peripheral gray scale values of the edge points on the polygon are not equal, that is, the identified corner point positions are not accurate enough, the more accurate target corner point positions are further determined according to the peripheral gray scale values of the edge points, so as to solve the problem that the corner point positions positioned in the camera calibration process are not accurate enough, resulting in large errors of the finally determined camera positions and postures. BRIEF DESCRIPTION OF DRAWINGS

[0087] Figure 1 is a step flow chart of a corner point position positioning method provided in the embodiment of the present application;

[0088] Figure 2 is a schematic diagram of a meander plate provided in the embodiment of the present application;

[0089] Figure 3 is a step flow chart of another corner point position positioning method provided in the embodiment of the present application;

[0090] Figure 4 is a schematic diagram of a preliminary corner point position provided in the embodiment of the present application;

[0091] Figure 5 is a schematic diagram of an edge point peripheral gray scale value provided in the embodiment of the present application;

[0092] Figure 6 is a schematic diagram of a suspected point peripheral gray scale value provided in the embodiment of the present application;

[0093] Figure 7 is a schematic diagram of a target corner point position determination principle provided in the embodiment of the present application;

[0094] Figure 8 is a structure block diagram of a corner point position positioning device provided in the embodiment of the present application;

[0095] Figure 9 is a block diagram of an electronic device provided in an embodiment of the present application;

[0096] Figure 10 is a schematic diagram of a computer readable medium provided in an embodiment of the present application. DETAILED DESCRIPTION

[0097] In order to make the above objectives, characteristics and advantages of the present application more apparent and comprehensible, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0098] Referring to Figure 1 , a step flowchart of a corner point position positioning method provided in an embodiment of the present application is shown, which can specifically include the following steps:

[0099] Step 101: acquiring an image captured by a camera, wherein the image includes multiple layers of polygon frames.

[0100] The image captured by the camera can be an image obtained by shooting a calibration board, and the calibration board can be a polygon board including multiple layers of polygon frames. For example, the polygon board can be a meander board, referring to Figure 2 , a schematic diagram of a meander board provided in an embodiment of the present application is shown, wherein the meander board includes multiple layers of meander frames.

[0101] Specifically, the image captured by the camera including multiple layers of polygon frames is acquired.

[0102] Step 102: identifying the corner point positions of the polygon frames from the image.

[0103] Specifically, the corner point positions of each layer of polygon frames can be determined by an image recognition algorithm, but the identified corner point positions are not accurate enough.

[0104] Step 103: connecting the corner points of the polygon frames to obtain a polygon composed of edges.

[0105] Specifically, the corner points outside or inside the same polygon frame are connected to obtain edges, and the polygon can be composed of the edges, for example, the corner points of the meander frame are connected to obtain a quadrangle composed of edges.

[0106] Step 104: performing equal division interpolation processing on the edges to obtain a plurality of edge points.

[0107] Specifically, for a polygon, equal division interpolation (linear interpolation) processing is performed on each edge of the polygon, and the edge is divided into N equal parts to obtain N-1 edge points, for example, the edge is equally divided and interpolated by 3 to divide the edge into three equal parts.

[0108] Step 105: calculating the average value of the gray scale in a certain pixel range around the edge point as the peripheral gray scale value.

[0109] Specifically, the corner point position is superimposed on the gray scale image in advance, and the edge point is interpolated on the gray scale image, so that the average value of the gray scale of the pixels (in a certain pixel range) around the obtained edge point can be calculated and used as the peripheral gray scale value of the edge point.

[0110] Step 106: when the peripheral gray scale values of the edge points on the polygon are equal, the corner point position is determined as the target corner point position.

[0111] Specifically, the peripheral gray scale values of each edge point on the same polygon are compared, and if they are equal, it means that each edge of the polygon coincides with each edge of the polygon frame, so the corner point position determined at this time is accurate, and the corner point position is determined as the target corner point position.

[0112] Step 107: when the peripheral gray scale values of the edge points on the polygon are not equal, the target corner point position is determined according to the peripheral gray scale values of the edge points.

[0113] Specifically, the peripheral gray scale values of each edge point on the same polygon are compared, and if they are not equal, it means that the edges of the polygon do not coincide with the edges of the polygon frame, that is, the corner point position determined at this time is not accurate enough, so the peripheral gray scale values of the edge points are used to further determine the target corner point position.

[0114] By applying the embodiment of the present application, after the corner point position in the image is identified, the corners of the polygon frame are connected to form a polygon composed of edges, the edges are evenly divided and interpolated to obtain a plurality of edge points, the average value of the gray scale in a certain pixel range around the edge point is calculated as the peripheral gray scale value, when the peripheral gray scale values of the edge points on the polygon are equal, it means that the identified corner point position is accurate, and the corner point position is determined as the target corner point position, when the peripheral gray scale values of the edge points on the polygon are not equal, that is, the identified corner point position is not accurate enough, the more accurate target corner point position is further determined through the peripheral gray scale values of the edge points, so as to solve the problem that the corner point position positioned in the camera calibration process is not accurate enough, resulting in large errors in the finally determined camera position and attitude.

[0115] Referring to Figure 3 , a step flowchart of another corner point position positioning method provided in the embodiment of the present application is shown, which can specifically include the following steps:

[0116] Step 301: acquiring an image collected by a camera, wherein the image includes a plurality of polygon frames.

[0117] Step 302: identifying the corner point position of the polygon frame from the image.

[0118] In an embodiment of the present application, the step 302 comprises: converting the image into a gray-scale image; performing a binaryzation process on the gray-scale image to obtain a mask image; performing a contour finding process, a polygon approximation process and a corner point sub-pixel approximation process on the mask image to determine the corner point position of the polygon frame.

[0119] Specifically, after obtaining the image comprising the multi-layer polygon frame, the image is converted into a gray-scale image, then a binaryzation process is performed on the gray-scale image to obtain a mask image, and a contour finding process, a polygon approximation process and a corner point sub-pixel approximation process are performed on the mask image to determine the corner point position of the polygon frame.

[0120] Referring to Figure 4 , a schematic diagram of a preliminary corner point position provided in an embodiment of the present application is shown, as shown in the figure, the corner point position of the polygon frame determined through the polygon approximation process and the corner point sub-pixel approximation process is not accurate, such as the positions of the two corner points at the lower left and the lower right in the figure.

[0121] It should be noted that the gray-scale conversion process, the binaryzation process, the contour finding process, the polygon approximation process and the corner point sub-pixel approximation process performed on the image in the embodiment of the present application can be realized by using the prior art, therefore, the embodiment of the present application does not limit the specific steps of identifying the corner point position in the image.

[0122] Step 303: connecting the corner points of the polygon frame to obtain a polygon composed of edge lines.

[0123] Step 304: performing an equal division interpolation process on the edge lines to obtain a plurality of edge line points.

[0124] Step 305: calculating the average value of the gray scale in a certain pixel range around the edge line point as the peripheral gray scale value.

[0125] Step 306: when the peripheral gray scale values of the edge line points on the polygon are equal, the corner point position is determined as the target corner point position.

[0126] Step 307: when the peripheral gray scale values of the edge line points on the polygon are not equal, the average value of the peripheral gray scale values of the edge line points on the polygon is calculated as a reference peripheral gray scale value.

[0127] Specifically, whether the peripheral gray scale values of each edge point on the same polygon are equal is compared, if not, it indicates that the edge of the polygon is not coincided with the edge of the polygon frame, that is, the position of the corner point is inaccurate, thus the average value of the peripheral gray scale values of all edge points on the polygon is calculated and taken as the reference peripheral gray scale value. The reference peripheral gray scale value represents the peripheral gray scale value of the edge point when the position of the corner point is accurate.

[0128] Step 308: determining a suspected point with a peripheral gray scale value being the reference peripheral gray scale value within the preset range of the edge point.

[0129] Specifically, the average value of the gray scale within a certain pixel range of the suspected point can be confirmed as the peripheral gray scale value, and the suspected point can be confirmed according to each edge point, and the suspected point is located on the edge when the position of the corner point is accurate.

[0130] In an embodiment of the present application, the step 308 comprises:

[0131] Step one: when the absolute value of the difference between the peripheral gray scale value of the edge point and the reference peripheral gray scale value is within the preset range, the edge point is determined as the suspected point, otherwise step two is executed.

[0132] Specifically, an edge point is selected, the absolute value of the difference between the peripheral gray scale value of the edge point and the reference peripheral gray scale value is calculated, if the absolute value of the difference is within the preset range, it indicates that the peripheral gray scale value of the edge point is equal to or close to the reference peripheral gray scale value, that is, the edge point is located on the edge when the position of the corner point is accurate, and the edge point can be determined as the suspected point, if the absolute value of the difference is outside the preset range, it indicates that the peripheral gray scale value of the edge point is greatly different from the reference peripheral gray scale value, and the edge point is not located on the edge when the position of the corner point is accurate, and step two is executed.

[0133] Step two: a straight line passing through the edge point and being perpendicular to the edge is taken as a suspected baseline, and a point on the suspected baseline and being a preset pixel distance away from the edge point is taken as a suspected reference point.

[0134] Specifically, a straight line passing through the edge point and being perpendicular to the edge is taken as a suspected baseline, and a point on the suspected baseline and being a preset pixel distance away from the edge point is taken as a suspected reference point, and there are two points on the suspected baseline and being a preset pixel distance away from the edge point, one is inside the polygon and the other is outside the polygon, and one of the two points can be taken as the suspected reference point.

[0135] Step three: calculate the average value of the gray scale in a certain pixel range around the presumed reference point as the peripheral gray scale value, and under the assumption that the peripheral gray scale value on the presumed baseline is linearly and monotonously distributed, determine the point on the baseline with the peripheral gray scale value proportional to the peripheral gray scale value of the presumed reference point, the peripheral gray scale value of the edge point, and the pixel distance between the edge point and the presumed reference point as the presumed point.

[0136] Specifically, the average value of the gray scale in a certain pixel range around the presumed reference point is calculated as the peripheral gray scale value of the presumed reference point, and under the assumption that the peripheral gray scale value on the presumed baseline is linearly and monotonously distributed, the peripheral gray scale value of any point on the presumed baseline can be determined in proportion to the peripheral gray scale value of the presumed reference point, the peripheral gray scale value of the edge point, and the pixel distance between the edge point and the presumed reference point, so that the point on the presumed baseline with the peripheral gray scale value proportional to the reference peripheral gray scale value can be determined as the presumed point. It should be noted that the presumed point is determined under the assumption that the peripheral gray scale value on the presumed baseline is linearly and monotonously distributed, so the real peripheral gray scale value of the presumed point may not equal the reference peripheral gray scale value.

[0137] Step four: calculate the average value of the gray scale in a certain pixel range around the presumed point as the real peripheral gray scale value, and when the absolute value of the difference between the real peripheral gray scale value of the presumed point and the reference peripheral gray scale value is within a preset range, determine that the presumed point is correct; otherwise, take the presumed point as the presumed reference point and return to step three.

[0138] Specifically, the average value of the gray scale in a certain pixel range around the presumed point is calculated as the real peripheral gray scale value, and when the absolute value of the difference between the real peripheral gray scale value of the presumed point and the reference peripheral gray scale value is within a preset range, it indicates that the peripheral gray scale value of the presumed point is equal to or close to the reference peripheral gray scale value, i.e., the presumed point is located on the edge line when the corner point position is accurate, and the presumed point is determined to be correct.

[0139] If the absolute value of the difference between the real peripheral gray scale value of the presumed point and the reference peripheral gray scale value is not within the preset range, it indicates that the presumed point is incorrect, and the presumed point is taken as the presumed reference point to determine the presumed point in step 3 until the presumed point with the absolute value of the difference between the real peripheral gray scale value and the reference peripheral gray scale value within the preset range is determined.

[0140] In the embodiment of the present application, according to the reference peripheral gray value, the iterative method is used to continuously determine the reference point on the reference line, and finally the reference point or the reference point whose absolute value of the difference between the peripheral gray value and the reference peripheral gray value is within the preset range is determined as the reference point. The straight lines are determined by connecting the reference points, and the position of the intersection point between the straight lines is the accurate corner point position and is determined as the target corner point position. The problem that the corner point position is not accurate enough in the camera calibration process and leads to a large error in the finally determined camera position and posture is solved.

[0141] In an embodiment of the present application, step 308 comprises:

[0142] Step one: when the absolute value of the difference between the peripheral gray value of the edge line point and the reference peripheral gray value is within the preset range, the edge line point is determined as the reference point, otherwise step two is executed.

[0143] Specifically, an edge line point is selected, and the absolute value of the difference between the peripheral gray value of the edge line point and the reference peripheral gray value is calculated. If the absolute value of the difference is within the preset range, it indicates that the peripheral gray value of the edge line point is equal to or close to the reference peripheral gray value, that is, the edge line point is located on the edge line when the corner point position is accurate, and the edge line point can be determined as the reference point. If the absolute value of the difference is outside the preset range, it indicates that the peripheral gray value of the edge line point is greatly different from the reference peripheral gray value, and the edge line point is not located on the edge line when the corner point position is accurate, and step two is executed.

[0144] Step two: a point of the edge line point in the direction of the outside of the polygon by a preset pixel is determined as the reference point, and the average value of the gray values in the peripheral pixel range of the reference point is calculated as the peripheral gray value.

[0145] Specifically, a point of the edge line point in the direction of the outside of the polygon by a preset pixel is determined as the reference point, and the average value of the gray values in the peripheral pixel range of the reference point is calculated as the peripheral gray value.

[0146] Step three: when the absolute value of the difference between the peripheral gray value of the reference point and the reference peripheral gray value is within the preset range, the reference point is determined as the reference point; when the absolute value of the difference between the peripheral gray value of the reference point and the reference peripheral gray value is not within the preset range, and the absolute value of the difference between the peripheral gray value of the reference point and the reference peripheral gray value is less than the absolute value of the difference between the peripheral gray value of the edge line point and the reference peripheral gray value, the reference point is determined as the edge line point, and step two is executed.

[0147] Specifically, when the absolute value of the difference between the peripheral gray value of the reference point and the reference peripheral gray value is not within the preset range, and the absolute value of the difference between the peripheral gray value of the reference point and the reference peripheral gray value is less than the absolute value of the difference between the peripheral gray value of the edge point and the reference peripheral gray value, it is indicated that the reference point is close to the reference point, that is, the reference point is on the outside of the polygon, and the interpolation of the reference point in the outside direction of the polygon is correct, so that the reference point is taken as the edge point, and the reference point is interpolated in the outside direction of the polygon to finally determine the reference point whose absolute value of the difference between the peripheral gray value and the reference peripheral gray value is within the preset range.

[0148] When the absolute value of the difference between the peripheral gray value of the reference point and the reference peripheral gray value is within the preset range, it is indicated that the peripheral gray value of the reference point is equal to or close to the reference peripheral gray value, that is, the reference point is located on the edge line when the position of the corner point is accurate, and the reference point can be determined as the reference point.

[0149] In an embodiment of the present application, after step two, further comprising:

[0150] Step three: when the absolute value of the difference between the peripheral gray value of the reference point and the reference peripheral gray value is not within the preset range, and the absolute value of the difference between the peripheral gray value of the reference point and the reference peripheral gray value is greater than or equal to the absolute value of the difference between the peripheral gray value of the edge point and the reference peripheral gray value, step four is executed.

[0151] Specifically, when the absolute value of the difference between the peripheral gray value of the reference point and the reference peripheral gray value is not within the preset range, and the absolute value of the difference between the peripheral gray value of the reference point and the reference peripheral gray value is greater than or equal to the absolute value of the difference between the peripheral gray value of the edge point and the reference peripheral gray value, it is indicated that the reference point is close to the edge point, that is, the reference point is in the inside direction of the polygon, and it is necessary to interpolate the reference point in the inside direction of the polygon, that is, step four is executed.

[0152] Step four: determining a point of the edge point in the inside direction of the polygon by a preset pixel as the reference point, and calculating the average gray value in a certain pixel range around the reference point as the peripheral gray value.

[0153] Specifically, a point of the edge point is interpolated in the inside direction of the polygon by a preset pixel to be the reference point, and the average gray value in a certain pixel range around the reference point is calculated as the peripheral gray value.

[0154] Step five: when the absolute value of the difference between the peripheral gray value of the presumed reference point and the reference peripheral gray value is within the preset range, the presumed reference point is determined as a presumed point; when the absolute value of the difference between the peripheral gray value of the presumed reference point and the reference peripheral gray value is not within the preset range, the presumed reference point is regarded as a sideline point, and step four is returned to be executed.

[0155] Specifically, when the absolute value of the difference between the peripheral gray value of the presumed reference point and the reference peripheral gray value is not within the preset range, and the absolute value of the difference between the peripheral gray value of the presumed reference point and the reference peripheral gray value is less than the absolute value of the difference between the peripheral gray value of the sideline point and the reference peripheral gray value, it is indicated that the presumed point is close to the presumed reference point, the presumed point is in the inside direction of the polygon, the interpolation of the presumed reference point in the inside direction of the polygon is correct, and thus the presumed reference point is regarded as a sideline point, step two is returned to be executed, and the presumed reference point is interpolated in the inside direction of the polygon to finally determine the presumed reference point whose absolute value of the difference between the peripheral gray value and the reference peripheral gray value is within the preset range.

[0156] When the absolute value of the difference between the peripheral gray value of the presumed reference point and the reference peripheral gray value is within the preset range, it is indicated that the peripheral gray value of the presumed reference point is equal to or close to the reference peripheral gray value, that is, the presumed reference point is located on the sideline when the corner position is accurate, and the presumed reference point can be determined as a presumed point.

[0157] The way of first interpolating a presumed reference point in the inside direction of the polygon is specifically as follows:

[0158] The step 308 comprises:

[0159] Step one: when the absolute value of the difference between the peripheral gray value of the sideline point and the reference peripheral gray value is within the preset range, the sideline point is determined as a presumed point, otherwise, step two is executed.

[0160] Specifically, a sideline point is selected, the absolute value of the difference between the peripheral gray value of the sideline point and the reference peripheral gray value is calculated, if the absolute value of the difference is within the preset range, it is indicated that the peripheral gray value of the sideline point is equal to or close to the reference peripheral gray value, that is, the sideline point is located on the sideline when the corner position is accurate, and the sideline point can be determined as a presumed point, if the absolute value of the difference is not within the preset range, it is indicated that the peripheral gray value of the sideline point is greatly different from the reference peripheral gray value, and the sideline point is not located on the sideline when the corner position is accurate, and step two is executed.

[0161] Step two: a point of the sideline point in the inside direction of the polygon by a preset pixel is determined as a presumed reference point, and an average gray value in a certain pixel range around the presumed reference point is calculated as a peripheral gray value.

[0162] Specifically, a pixel is interpolated in the inside direction of the polygon at the edge point to obtain a prediction reference point, and an average value of the gray scale in a certain pixel range around the prediction reference point is calculated as a surrounding gray scale value.

[0163] Step three: when the absolute value of the difference between the surrounding gray scale value of the prediction reference point and the reference surrounding gray scale value is within the preset range, the prediction reference point is determined as a prediction point; when the absolute value of the difference between the surrounding gray scale value of the prediction reference point and the reference surrounding gray scale value is not within the preset range, and the absolute value of the difference between the surrounding gray scale value of the prediction reference point and the reference surrounding gray scale value is smaller than the absolute value of the difference between the surrounding gray scale value of the edge point and the reference surrounding gray scale value, the prediction reference point is taken as the edge point, and step two is executed again.

[0164] Specifically, when the absolute value of the difference between the surrounding gray scale value of the prediction reference point and the reference surrounding gray scale value is not within the preset range, and the absolute value of the difference between the surrounding gray scale value of the prediction reference point and the reference surrounding gray scale value is smaller than the absolute value of the difference between the surrounding gray scale value of the edge point and the reference surrounding gray scale value, it is indicated that the prediction point is close to the prediction reference point, i.e., the prediction point is in the inside direction of the polygon, and the interpolation of the prediction reference point in the inside direction of the polygon is correct, so the prediction reference point is taken as the edge point, step two is executed again, and the prediction reference point is interpolated in the inside direction of the polygon to finally determine the prediction reference point whose absolute value of the difference between the surrounding gray scale value and the reference surrounding gray scale value is within the preset range.

[0165] When the absolute value of the difference between the surrounding gray scale value of the prediction reference point and the reference surrounding gray scale value is within the preset range, it is indicated that the surrounding gray scale value of the prediction reference point is equal to or close to the reference surrounding gray scale value, i.e., the prediction reference point is located on the edge line when the position of the corner point is accurate, and the prediction reference point can be determined as the prediction point.

[0166] In an embodiment of the present application, after step two, the method further comprises:

[0167] Step three: when the absolute value of the difference between the surrounding gray scale value of the prediction reference point and the reference surrounding gray scale value is not within the preset range, and the absolute value of the difference between the surrounding gray scale value of the prediction reference point and the reference surrounding gray scale value is greater than or equal to the absolute value of the difference between the surrounding gray scale value of the edge point and the reference surrounding gray scale value, step four is executed.

[0168] Specifically, when the absolute value of the difference between the gray value of the surrounding area of ​​the inferred reference point and the gray value of the surrounding area of ​​the reference point is not within the preset range, and the absolute value of the difference between the gray value of the surrounding area of ​​the inferred reference point and the gray value of the surrounding area of ​​the reference point is greater than or equal to the absolute value of the difference between the gray value of the surrounding area of ​​the edge point and the gray value of the surrounding area of ​​the reference point, it indicates that the inferred point is close to the edge point, that is, the inferred point is in the direction outside the polygon, and interpolation needs to be performed in the direction outside the polygon to determine the inferred reference point, that is, to execute step four.

[0169] Step 4: Determine the point of the edge line in the direction of the preset number of pixels outside the polygon as the inferred reference point, and calculate the average gray value within a certain pixel range around the inferred reference point as the surrounding gray value.

[0170] Specifically, a point is pre-interpolated by a preset pixel in the direction of the edge point outward from the polygon as a speculative reference point, and the average gray value within a certain pixel range around the speculative reference point is calculated as the surrounding gray value.

[0171] Step 5: When the absolute value of the difference between the gray value around the predicted reference point and the gray value around the reference is within a preset range, the predicted reference point is determined as a predicted point; when the absolute value of the difference between the gray value around the predicted reference point and the gray value around the reference is not within a preset range, the predicted reference point is used as an edge point, and the process returns to step 4.

[0172] Specifically, when the absolute value of the difference between the gray values ​​of the surrounding area of ​​the inferred reference point and the gray values ​​of the surrounding area of ​​the reference point is not within the preset range, and the absolute value of the difference between the gray values ​​of the surrounding area of ​​the inferred reference point and the gray values ​​of the surrounding area of ​​the reference point is less than the absolute value of the difference between the gray values ​​of the surrounding area of ​​the edge point and the gray values ​​of the surrounding area of ​​the reference point, it indicates that the inferred point is close to the inferred reference point, that is, the inferred point is in the direction outside the polygon. The inferred reference point interpolated in the direction outside the polygon is correct. Therefore, the inferred reference point is taken as the edge point, and the process returns to step two to continue interpolating the inferred reference point in the direction outside the polygon, so as to finally determine the inferred reference point whose absolute value of the difference between the surrounding gray values ​​and the gray values ​​of the surrounding area of ​​the reference point is within the preset range.

[0173] When the absolute value of the difference between the gray value of the surrounding area of ​​the inferred reference point and the gray value of the surrounding area of ​​the reference is within a preset range, it means that the gray value of the surrounding area of ​​the inferred reference point is equal to or close to the gray value of the surrounding area of ​​the reference. That is, the inferred reference point is located on the edge line when the corner point is accurately located, and the inferred reference point can be determined as the inferred point.

[0174] In this embodiment of the invention, based on the reference surrounding gray value, a reference point is continuously interpolated and estimated by a preset number of pixels in the direction of the outer or inner side of the polygon from the edge point through an iterative method. This makes the surrounding gray value of the estimated reference point gradually approach the surrounding gray value, and finally, the estimated reference point whose absolute value of the difference between the surrounding gray value and the reference surrounding gray value is within a preset range is determined as the estimated point.

[0175] Referring to Figure 5 , a schematic diagram of a peripheral gray value of an edge point provided in an embodiment of the present application is shown; in the diagram, the peripheral gray values of the edge points on the same quadrangle are not the same, that is, the edges of the quadrangle do not coincide with the edges of the quadrangle frame. Figure 6 , a schematic diagram of a peripheral gray value of a conjecture point provided in an embodiment of the present application is shown; in the diagram, the peripheral gray values of the conjecture points on the same quadrangle are the same, that is, the straight line formed by the conjecture points coincides with the edges of the quadrangle frame.

[0176] Step 309: determining a straight line according to the conjecture points corresponding to the edge points on the edge.

[0177] Specifically, the conjecture points corresponding to the edge points on the same edge are connected, and a straight line can be determined, that is, each edge can determine a corresponding edge.

[0178] Step 310: determining the position of the intersection point between the straight lines as the target corner point position.

[0179] Specifically, each straight line is intersected, a new polygon is obtained, and the position of the corner point of the polygon, that is, the intersection position of the straight lines, is determined as the target corner point position, as shown in Figure 6 .

[0180] Referring to Figure 7 , a schematic diagram of a target corner point position determination principle provided in an embodiment of the present application is shown; in the diagram, a quadrangle composed of edges is obtained by connecting the corner point positions, the edges are evenly divided and interpolated to obtain two edge points, a conjecture reference point is obtained based on the edge points being interpolated to the outside of the quadrangle, the conjecture points whose absolute values of the difference between the peripheral gray values and the reference peripheral gray values are within a preset range are determined according to the conjecture reference point, a straight line is formed by the two conjecture points, the point where the straight line intersects with another straight line is the accurate corner point, and is output as the target corner point position.

[0181] In an embodiment of the present application, the conjecture points whose absolute values of the difference between the peripheral gray values and the reference peripheral gray values are within a preset range are determined according to the reference peripheral gray values by an iterative manner, the conjecture points are connected to determine straight lines, the position of the intersection point between the straight lines is the accurate corner point position, and is determined as the target corner point position, thereby solving the problem that the corner point position positioned in the camera calibration process is not accurate enough, resulting in a large error of the finally determined camera position and attitude.

[0182] It should be noted that, for the method embodiments, the series of acts complement each other to achieve the purpose of this embodiment, therefore, the sequence of the acts should not be construed as a limitation of the embodiments of this application. In addition, those skilled in the art should understand that the acts described in the specification are only preferred acts, and not all acts are necessary for the embodiments of this application.

[0183] With reference to Figure 8 , a structural block diagram of a corner point position positioning device provided in an embodiment of the application is shown, which can specifically include the following modules:

[0184] An image acquisition module 801 is configured to acquire an image acquired by a camera, wherein the image includes a multi-layer polygon frame.

[0185] A corner point identification module 802 is configured to identify a corner point position of the polygon frame from the image.

[0186] A corner point connection module 803 is configured to connect the corner points of the polygon frame to obtain a polygon composed of edges.

[0187] An edge interpolation module 804 is configured to perform uniform interpolation processing on the edges to obtain a plurality of edge points.

[0188] A gray value calculation module 805 is configured to calculate a gray average value in a certain pixel range around the edge point as a surrounding gray value.

[0189] A first position determination module 806 is configured to determine the corner point position as a target corner point position when the surrounding gray values of the edge points on the polygon are equal.

[0190] A second position determination module 807 is configured to determine a target corner point position according to the surrounding gray values of the edge points when the surrounding gray values of the edge points on the polygon are not equal.

[0191] Optionally, the corner point identification module 802 includes:

[0192] An image conversion submodule is configured to convert the image into a gray image.

[0193] An image processing submodule is configured to perform binaryzation processing on the gray image to obtain a mask image.

[0194] A corner point determination submodule is configured to perform contour processing, polygon approximation processing, and corner point sub-pixel approximation processing on the mask image to determine the corner point position of the polygon frame.

[0195] Optionally, the second position determining module 807 comprises:

[0196] a gray value calculating sub-module, configured to calculate an average value of the peripheral gray values of the edge line points on the polygon as a reference peripheral gray value;

[0197] a presumed point determining sub-module, configured to determine a presumed point within a preset range of the edge line point, the peripheral gray value of which is the reference peripheral gray value;

[0198] a straight line determining sub-module, configured to determine a straight line according to the presumed points corresponding to the edge line points on the edge line;

[0199] an angle point determining sub-module, configured to determine the position of the intersection point between the straight lines as a target angle point position.

[0200] Optionally, the presumed point determining sub-module comprises:

[0201] a first difference judging unit, configured to determine the edge line point as a presumed point when the absolute value of the difference between the peripheral gray value of the edge line point and the reference peripheral gray value is within a preset range, and otherwise call a reference point determining unit;

[0202] the reference point determining unit, configured to take a straight line passing through the edge line point and perpendicular to the edge line as a presumed baseline, and take a point on the presumed baseline at a preset pixel distance from the edge line point as a presumed reference point;

[0203] a presumed point determining unit, configured to calculate the average value of the gray values within a certain pixel range of the peripheral of the presumed reference point as a peripheral gray value, and under the assumption that the peripheral gray values on the presumed baseline are linearly and monotonously distributed, determine a point on the baseline with a peripheral gray value equal to the reference peripheral gray value as a presumed point according to the peripheral gray value of the presumed reference point, the peripheral gray value of the edge line point and the pixel distance between the edge line point and the presumed reference point;

[0204] a second difference judging unit, configured to calculate the average value of the gray values within a certain pixel range of the peripheral of the presumed point as a real peripheral gray value, and determine the presumed point to be correct when the absolute value of the difference between the real peripheral gray value of the presumed point and the reference peripheral gray value is within a preset range, and otherwise take the presumed point as a presumed reference point and call the presumed point determining unit.

[0205] Optionally, the presumed point determining sub-module comprises:

[0206] a third difference judging unit, configured to determine the edge line point as a presumed point when the absolute value of the difference between the peripheral gray value of the edge line point and the reference peripheral gray value is within a preset range, and otherwise call a reference point determining unit;

[0207] The reference point determination unit is further configured to determine a point of the edge line point by a preset number of pixels in a direction outside the polygon as a reference point, and calculate an average value of the gray scale in a certain pixel range around the reference point as a surrounding gray scale value;

[0208] The fourth difference value judgment unit is configured to determine the reference point as a suspected point when an absolute value of a difference between the surrounding gray scale value of the reference point and the reference surrounding gray scale value is within the preset range, and determine the reference point as an edge line point when the absolute value of the difference between the surrounding gray scale value of the reference point and the reference surrounding gray scale value is not within the preset range and the absolute value of the difference between the surrounding gray scale value of the reference point and the reference surrounding gray scale value is smaller than an absolute value of a difference between the surrounding gray scale value of the edge line point and the reference surrounding gray scale value, and call the reference point determination unit.

[0209] Optionally, the method further comprises:

[0210] The third difference value judgment unit is further configured to call the reference point determination unit when the absolute value of the difference between the surrounding gray scale value of the reference point and the reference surrounding gray scale value is not within the preset range and the absolute value of the difference between the surrounding gray scale value of the reference point and the reference surrounding gray scale value is greater than or equal to the absolute value of the difference between the surrounding gray scale value of the edge line point and the reference surrounding gray scale value.

[0211] The reference point determination unit is further configured to determine a point of the edge line point by a preset number of pixels in a direction inside the polygon as a reference point, and calculate an average value of the gray scale in a certain pixel range around the reference point as a surrounding gray scale value;

[0212] The fourth difference value judgment unit is further configured to determine the reference point as a suspected point when an absolute value of a difference between the surrounding gray scale value of the reference point and the reference surrounding gray scale value is within the preset range, and determine the reference point as an edge line point when the absolute value of the difference between the surrounding gray scale value of the reference point and the reference surrounding gray scale value is not within the preset range and the absolute value of the difference between the surrounding gray scale value of the reference point and the reference surrounding gray scale value is smaller than an absolute value of a difference between the surrounding gray scale value of the edge line point and the reference surrounding gray scale value, and call the reference point determination unit.

[0213] Optionally, the suspected point determination submodule comprises:

[0214] The third difference value judgment unit is further configured to determine the edge line point as a suspected point when an absolute value of a difference between the surrounding gray scale value of the edge line point and the reference surrounding gray scale value is within the preset range, and call the reference point determination unit otherwise.

[0215] The reference point determination unit is further configured to determine a point of the edge point in a direction of inside of the polygon by a preset number of pixels as a reference point, and calculate an average value of the gray scale in a certain pixel range around the reference point as a surrounding gray scale value;

[0216] The fourth difference value judgment unit is further configured to determine the reference point as a suspected point when the absolute value of the difference between the surrounding gray scale value of the reference point and the surrounding gray scale value of the reference point is within the preset range, and determine the reference point as an edge point when the absolute value of the difference between the surrounding gray scale value of the reference point and the surrounding gray scale value of the reference point is not within the preset range and the absolute value of the difference between the surrounding gray scale value of the reference point and the surrounding gray scale value of the reference point is smaller than the absolute value of the difference between the surrounding gray scale value of the edge point and the surrounding gray scale value of the reference point, and call the reference point determination unit.

[0217] Optionally, the method further comprises:

[0218] The third difference value judgment unit is further configured to call the reference point determination unit when the absolute value of the difference between the surrounding gray scale value of the reference point and the surrounding gray scale value of the reference point is not within the preset range and the absolute value of the difference between the surrounding gray scale value of the reference point and the surrounding gray scale value of the reference point is greater than or equal to the absolute value of the difference between the surrounding gray scale value of the edge point and the surrounding gray scale value of the reference point.

[0219] The reference point determination unit is further configured to determine a point of the edge point in a direction of outside of the polygon by a preset number of pixels as a reference point, and calculate an average value of the gray scale in a certain pixel range around the reference point as a surrounding gray scale value;

[0220] The fourth difference value judgment unit is further configured to determine the reference point as a suspected point when the absolute value of the difference between the surrounding gray scale value of the reference point and the surrounding gray scale value of the reference point is within the preset range, and determine the reference point as an edge point when the absolute value of the difference between the surrounding gray scale value of the reference point and the surrounding gray scale value of the reference point is not within the preset range and the absolute value of the difference between the surrounding gray scale value of the reference point and the surrounding gray scale value of the reference point is smaller than the absolute value of the difference between the surrounding gray scale value of the edge point and the surrounding gray scale value of the reference point, and call the reference point determination unit.

[0221] For the device embodiment, it is basically similar to the method embodiment, so the description is relatively simple, and the related parts are described in the part of the method embodiment.

[0222] In addition, the embodiment of the present application also provides an electronic device, such as Figure 9 As shown in the figure, the electronic device comprises a processor 901, a communication interface 902, a memory 903 and a communication bus 904, wherein the processor 901, the communication interface 902 and the memory 903 complete mutual communication through the communication bus 904,

[0223] The memory 903 is configured to store a computer program.

[0224] The processor 901 is configured to execute the program stored in the memory 903, and implement the corner point positioning method described in the above embodiments.

[0225] The communication bus mentioned in the terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or only one type of bus.

[0226] The communication interface is configured to communicate between the terminal and other devices.

[0227] The memory can include a Random Access Memory (RAM) and can also include a non-volatile memory, such as at least one disk memory. Optionally, the memory can also be at least one storage device located away from the aforementioned processor.

[0228] The processor mentioned above can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; can also be a Digital Signal Processing (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.

[0229] As shown in FIG. 10, in another embodiment provided by the present application, a computer readable storage medium 1001 is also provided, and the computer readable storage medium 1001 stores instructions, and when the instructions run on a computer, the computer executes the corner point positioning method described in the above embodiments. Figure 10

[0230] ​In yet another embodiment of the present disclosure, a computer program product including instructions, which when executed on a computer, cause the computer to perform the corner point positioning method described in the above embodiments.

[0231] In the above embodiments, the implementation can be wholly or partially in software, hardware, firmware, or any combination thereof. When implemented in software, the implementation can be in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, the computer instructions cause the computer to perform the processes or functions described in the embodiments of the present disclosure. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable apparatus. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions can be transmitted from one website site, computer, server, or data center to another website site, computer, server, or data center through a wired (for example, coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (for example, infrared, wireless, microwave, etc.) manner. The computer-readable storage medium can be any available medium accessible by a computer or a data storage device such as a server, data center, etc. that includes one or more available media integrated. The available medium can be a magnetic medium (for example, floppy disk, hard disk, magnetic tape), an optical medium (for example, DVD), or a semiconductor medium (for example, Solid State Disk (SSD)), etc.

[0232] It should be noted that, in this document, the terms such as first and second are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "contain" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. Without more limitations, the element defined by the statement "including a" does not exclude the presence of other identical elements in the process, method, article or device including the element.

[0233] The various embodiments in the specification are described in a related manner, and the same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on the difference from other embodiments. In particular, for the system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the part of the method embodiments.

[0234] The above only describes the preferred embodiments of the present application, and is not used to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method of locating a corner point position, characterized by, The method comprises the following steps: acquiring an image captured by a camera, wherein the image comprises a multi-layer polygon frame; identifying a corner point position of the polygon frame from the image; connecting the corner points of the polygon frame to obtain a polygon composed of edge lines; performing equal division interpolation processing on the edge lines to obtain a plurality of edge line points; calculating an average value of the gray scale within a certain pixel range around the edge line points as a peripheral gray scale value; when the peripheral gray scale values of the edge line points on the polygon are equal, determining the corner point position as a target corner point position; when the peripheral gray scale values of the edge line points on the polygon are not equal, determining a target corner point position according to the peripheral gray scale values of the edge line points.

2. The method of claim 1, wherein, The step of identifying the corner point position of the polygon frame from the image comprises the following steps: converting the image into a gray scale image; performing binary processing on the gray scale image to obtain a mask image; performing contour finding processing, polygon approximation processing and corner sub-pixel approximation processing on the mask image to determine the corner point position of the polygon frame.

3. The method of claim 1, wherein, The step of determining a target corner point position according to the peripheral gray scale values of the edge line points comprises the following steps: calculating an average value of the peripheral gray scale values of the edge line points on the polygon as a reference peripheral gray scale value; determining a suspected point within a preset range of the edge line point and having a peripheral gray scale value equal to the reference peripheral gray scale value; determining a straight line according to the suspected points corresponding to each of the edge line points on the edge line; determining a position of an intersection point between the straight lines as a target corner point position.

4. The method of claim 3, wherein, The step of determining a suspected point within a preset range of the edge line point and having a peripheral gray scale value equal to the reference peripheral gray scale value comprises the following steps: Step 1: when an absolute value of a difference between the peripheral gray scale value of the edge line point and the reference peripheral gray scale value is within a preset range, determining the edge line point as a suspected point, otherwise, performing Step 2; Step 2: taking a straight line passing through the edge line point and perpendicular to the edge line as a suspected baseline, and taking a point on the suspected baseline and having a preset pixel distance from the edge line point as a suspected reference point; Step 3: calculating an average value of the gray scale within a certain pixel range around the suspected reference point as a peripheral gray scale value, under the assumption that the peripheral gray scale values on the suspected baseline are linearly and monotonously distributed, determining a point on the suspected baseline and having a peripheral gray scale value equal to the reference peripheral gray scale value as a suspected point according to the peripheral gray scale value of the suspected reference point, the peripheral gray scale value of the edge line point and a pixel distance between the edge line point and the suspected reference point; Step 4: calculating an average value of the gray scale within a certain pixel range around the suspected point as a real peripheral gray scale value, when an absolute value of a difference between the real peripheral gray scale value of the suspected point and the reference peripheral gray scale value is within a preset range, determining that the suspected point is correct, otherwise, taking the suspected point as a suspected reference point and returning to perform Step 3.

5. A corner point position positioning apparatus characterized by comprising: The method comprises the following steps: an image acquisition module is configured to acquire an image captured by a camera, wherein the image comprises a multi-layer polygon frame; a corner point identification module is configured to identify a corner point position of the polygon frame from the image; The corner point connecting module is configured to connect the corner points of the polygon frame to obtain a polygon composed of the side lines; The side line interpolation module is configured to perform uniform interpolation processing on the side lines to obtain a plurality of side line points; The gray value calculation module is configured to calculate the average gray value of a certain pixel range around the side line points as the peripheral gray value; The first position determination module is configured to determine the position of the corner point as the target corner point position when the peripheral gray values of the side line points on the polygon are equal; The second position determination module is configured to determine the target corner point position according to the peripheral gray values of the side line points when the peripheral gray values of the side line points on the polygon are not equal.

6. The apparatus of claim 5, wherein, The corner point recognition module comprises: The image conversion submodule is configured to convert the image into a gray-scale image; The image processing submodule is configured to perform binary processing on the gray-scale image to obtain a mask image; The corner point determination submodule is configured to perform contour processing, polygon approximation processing and corner sub-pixel approximation processing on the mask image to determine the position of the corner point of the polygon frame.

7. The apparatus of claim 5, wherein, The second position determination module comprises: The gray value calculation submodule is configured to calculate the average value of the peripheral gray values of the side line points on the polygon as the reference peripheral gray value; The conjecture point determination submodule is configured to determine a conjecture point having the reference peripheral gray value within a predetermined range of the side line point; The straight line determination submodule is configured to determine a straight line according to the conjecture points corresponding to the side line points on the side line; The corner point determination submodule is configured to determine the position of the intersection point between the straight lines as the target corner point position.

8. The apparatus of claim 7, wherein, The conjecture point determination submodule comprises: The first difference value judgment unit is configured to determine the side line point as the conjecture point when the absolute value of the difference between the peripheral gray value of the side line point and the reference peripheral gray value is within a predetermined range, and otherwise call the reference point determination unit; The reference point determination unit is configured to take a straight line passing through the side line point and perpendicular to the side line as a conjecture baseline, and take a point on the conjecture baseline having a predetermined pixel distance from the side line point as a conjecture reference point; The conjecture point determination unit is configured to calculate the average gray value of a certain pixel range around the conjecture reference point as the peripheral gray value, and under the assumption that the peripheral gray values on the conjecture baseline are linearly and monotonously distributed, determine a point on the conjecture baseline having the reference peripheral gray value as the conjecture point according to the peripheral gray value of the conjecture reference point, the peripheral gray value of the side line point and the pixel distance between the side line point and the conjecture reference point; The second difference value judgment unit is configured to calculate the average gray value of a certain pixel range around the conjecture point as the real peripheral gray value, and determine that the conjecture point is correct when the absolute value of the difference between the real peripheral gray value of the conjecture point and the reference peripheral gray value is within a predetermined range, and otherwise take the conjecture point as the conjecture reference point and call the conjecture point determination unit.

9. An electronic device, comprising: comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory accomplish mutual communication through the communication bus; the memory, configured to store a computer program; the processor, configured to execute the program stored on the memory, so as to realize the method in any one of claims 1-4.

10. One or more computer-readable media having instructions stored thereon that, when executed by one or more processors, cause the processors to perform the method of any one of claims 1-4.

Citation Information

Patent Citations

  • Robust recognition method for AR code marked on cylinder

    CN106407973A

  • Multi-camera-based measurement method and device and storage medium

    CN113516721A