A sub-pixel edge detection method
Patent Information
- Application Number
- CN202110436860.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-22
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2041-04-22
AI Technical Summary
When using the laser section instrument, it is necessary to manually press the button to adjust the laser spot falling on the marking circle, resulting in low accuracy and cannot achieve high-precision internal contour curve detection of tunnel space.
The subpixel edge detection method is adopted to establish a coordinate system, pre-process the image information, edge detection, position calculation and offset calculation, so as to realize adaptive adjustment of the laser spot and ensure the accurate alignment of the spot and the marking circle.
提高了激光光斑与标记圈的对准精度,确保隧道空间内部轮廓线曲线的高精度检测,减少了人为误差。
Smart Images

Figure CN113129322B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a sub-pixel edge detection method. Background Art
[0002] A tunnel is an underground engineering building excavated in rock and soil to form an underground passage. Due to my country's geographical factors, urban development, and transportation development, tunnel engineering has great development potential. Among them, the tunnel section measurement in the early stage of tunnel engineering is a measurement project that must be carried out during tunnel construction and the completion acceptance stage. It controls the plane, elevation and cross-sectional geometric dimensions of the tunnel excavation and is related to whether the tunnel can be dug through.
[0003] At present, tunnel section detection is often processed by total station, laser profiler and background data processing system. Due to the use of non-cooperative target laser ranging technology and precise angle measurement technology, the polar coordinate measurement method is closely combined with computer technology, and professional image processing software is used to quickly obtain the internal contour curve of the tunnel closed space. However, when using the laser profiler, it is necessary to manually press buttons to adjust the laser spot to fall on the marking circle. However, during manual adjustment, the distance moved by each key press is certain, and it is easy to have low accuracy in aligning the adjusted laser spot with the marking circle. As a result, the internal contour curve of the tunnel space closed space formed is not accurate. Therefore, there is an urgent need for a method that can adaptively adjust the laser spot. Summary of the invention
[0004] In order to solve the technical problem that the laser spot can be adaptively adjusted to have a higher alignment accuracy with the marking circle, the present invention provides a sub-pixel edge detection method.
[0005] The basic scheme of the present invention is as follows:
[0006] A sub-pixel edge detection method, comprising the following steps:
[0007] A coordinate system establishment step is to establish a coordinate system for the collected image information, where the image information includes a laser spot and a marking circle;
[0008] Image preprocessing, performing image preprocessing on image information to obtain a target image;
[0009] The edge detection step performs edge detection on the laser spot and the marking circle in the target image to obtain the edge information of the laser spot and the marking circle;
[0010] A position calculation step, calculating the spot position information of the laser spot and the mark circle position information of the mark circle in the coordinate system according to the spot edge information and the mark circle edge information;
[0011] An offset calculation step is to calculate the position offset of the laser spot moving to the marking circle according to the spot position information and the marking circle position information;
[0012] The correction step is to control and adjust the position of the laser spot projected by the laser section detector according to the position offset.
[0013] The beneficial effects of the basic scheme are: 1. A coordinate system is established in the image to facilitate the standardized measurement and calculation of the spot position information of the laser spot and the mark circle position information of the mark circle.
[0014] 2. Perform image preprocessing on the image information to reduce the interference of factors such as noise and color in the image information on subsequent edge detection, that is, to make the subsequent edge detection more accurate.
[0015] 3. Perform edge detection on the laser spot and the marking circle to obtain their respective edge information, and obtain their respective position information based on their respective edge information, that is, realize the transformation of face alignment into point alignment, firstly, avoid the difference in shape and size between the laser spot and the marking circle, and the existence of non-alignment points, which leads to inaccurate positioning. Secondly, convert the face-to-face alignment into point-to-point alignment, that is, determine a positioning point, so that the overall overlapping positioning of the laser spot and the marking circle is more accurate.
[0016] 3. Automatically correct the position of the laser spot projected by the laser section detector according to the position offset, so that the laser spot can coincide with the marking circle more accurately.
[0017] The edge detection step specifically includes the following steps:
[0018] S1, perform global threshold segmentation processing on the target image to obtain a binary image;
[0019] S2, using a filtering operator to detect the edge of the binary image to obtain a grayscale edge image;
[0020] S3, using an interpolation algorithm to interpolate the grayscale edge image to obtain an edge-refined image;
[0021] S4, binarizing the edge-refined image to obtain edge information.
[0022] Beneficial effects: 1. The target image is binarized so that edges in all directions can be detected, which facilitates edge extraction.
[0023] 2. The edge detection method using filtering operators makes the detected edges smooth and reduces the loss of edge points.
[0024] 3. The grayscale edge image is interpolated using the interpolation method to obtain sub-pixel edges, that is, the edges can be refined, the problem of rough edges detected by the filter operator can be improved, and the edge accuracy can be higher.
[0025] Furthermore, a correction judgment step is included between the offset calculation step and the correction step, in which a correction judgment is made on the position offset according to a preset error threshold, and if the position offset is greater than the preset error threshold, a position correction adjustment is performed.
[0026] Beneficial effect: When the position offset between the laser spot and the marking circle is within the error threshold, the correction step is not executed; when the position offset is outside the error threshold, the correction step is executed to ensure that the alignment of the laser spot and the marking circle is within the accuracy range and avoid the factors of the laser section detector's own adjustment accuracy, which leads to the angle of the laser section detector being adjusted all the time and affecting the section detection efficiency.
[0027] Furthermore, the correction step also includes a correction effect tracking step, which calculates the corrected position offset between the laser spot and the marking circle in the corrected image, and whether the corrected position offset is less than a preset error threshold. If not, a device failure prompt message is generated; if less, an alignment completion prompt message is generated.
[0028] Beneficial effect: If the device itself has a movement failure, at this time, the device is controlled to rotate, and the laser spot emitted by the device is difficult to align with the marking circle. In addition, due to the difference in the movement control accuracy of the device itself, when the device is corrected through the position offset, the alignment effect of the laser spot and the marking circle is also different. Therefore, an error threshold is set to determine whether the laser spot and the marking circle are not fully aligned due to the movement control accuracy of the device itself, or due to a device failure.
[0029] Furthermore, the correction effect tracking step specifically includes the following steps:
[0030] Step S1, collecting corrected image information;
[0031] Step S2, establishing a coordinate system in the corrected image;
[0032] Step S3, performing image preprocessing on the corrected image information to obtain a corrected target image;
[0033] Step S4, performing edge detection on the laser spot and the marking circle in the corrected target image respectively to obtain edge information of the corrected laser spot and edge information of the corrected marking circle;
[0034] Step S5, respectively calculating the corrected spot position information of the laser spot and the corrected mark circle position information of the mark circle in the coordinate system according to the corrected spot edge information and the corrected mark circle edge information;
[0035] Step S6, calculating the corrected position offset of the laser spot moving to the marking circle according to the corrected light spot position information and the corrected marking circle position information;
[0036] Step S7, determining whether the position offset after correction is less than a preset error threshold, and if not, generating a device fault prompt message.
[0037] Beneficial effect: The alignment effect of the laser spot and the marking circle after correction is analyzed. If the position offset between the laser spot and the marking circle still exceeds the preset error threshold after correction, it indicates that the rotation of the current laser section detector fails, and a device fault prompt message is generated to facilitate fault detection of the laser section detector. If the position offset between the laser spot and the marking circle after correction is less than the preset error threshold, it indicates that the position of the laser spot after correction is aligned with the marking circle, and an alignment completion prompt message is generated to facilitate the operator to start the position alignment of the next marking circle after receiving the instruction.
[0038] Furthermore, a correction path planning step is also included between the correction step and the correction judgment step, in which the nearest marking circle from the rated number is screened out as the marking circle to be selected according to the position offset, the distribution density of the marking circles around the marking circle to be selected is calculated, and the marking circle to be selected with a high density is selected as the marking circle to be aligned, and the position offset of the laser spot moved to the marking circle to be aligned is used as the position offset of the correction step.
[0039] Beneficial effect: For multiple marking circles with different distribution densities, in order to improve the efficiency of aligning the laser spot with the marking circle, the path planning is performed for the order in which the laser spot is aligned with the marking circle. In this scheme, the position offset is preferentially followed to select a rated number of marking circles as the marking circles to be selected, that is, the marking circles with a short moving distance of the laser spot are selected to improve the alignment efficiency.
[0040] Secondly, the distribution density of other marking circles around each marking circle to be selected is calculated, and those with high distribution density are given priority. This can not only shorten the overall moving distance and improve the alignment efficiency; it can also shorten the overall single movement spacing of the laser spot as much as possible, thereby avoiding the problem of too large movement spacing of the laser spot, which leads to reduced accuracy.
[0041] Furthermore, the path planning step is corrected, specifically including a distance screening step and a density screening step, wherein:
[0042] The distance screening step includes the following steps:
[0043] S1, according to the position offset of the laser spot moving to each marking circle, the distance from each marking circle to the laser spot is obtained;
[0044] S2, selecting two marking circles with the smallest distance from the laser spot from each marking circle as the marking circles to be selected;
[0045] S3, calculating the distance difference between the to-be-selected marking circle and the laser spot, and if the distance difference is not greater than the preset first distance difference, executing the density screening step; if the distance difference is greater than the preset first distance difference, the to-be-selected marking circle with the smallest distance from the laser spot is used as the to-be-selected marking circle;
[0046] In the density screening step, the distribution density of the mark circles around the mark circle to be selected is calculated, and the mark circle to be selected with high density is selected as the mark circle to be aligned. The position offset of the laser spot to the mark circle to be aligned is used as the position offset of the correction step.
[0047] Beneficial effect: Select the marking circle with the smallest distance from the laser spot to shorten the path of the laser spot movement, improve the alignment efficiency, and avoid affecting the correction effect due to the path being too long.
[0048] If the distance difference between the selected mark circle and the laser spot is too large (greater than the preset first distance difference), the mark circle with the smallest distance is preferably selected as the mark circle to be aligned to avoid excessive surface distance and affect the correction effect.
[0049] For the case where the spacing difference between the mark circle to be selected and the laser spot is not large (not greater than the preset first spacing difference), the density of the mark circles around the mark circle to be selected is analyzed, and the mark circle to be selected with a high density is selected as the mark circle to be aligned, thereby shortening the length of the overall laser spot moving path and improving the laser alignment efficiency while ensuring the best correction effect.
[0050] Further, the density screening step includes the following steps:
[0051] S1, draw a density determination area of the same size with the geometric center of the mark circle to be selected;
[0052] S2, counting the number of marked circles in the density determination area corresponding to the marked circles to be selected;
[0053] S3, taking the to-be-selected marking circle with the largest number of marking circles as the marking circle to be aligned, and moving the laser spot to the position offset of the marking circle to be aligned as the position offset of the correction step.
[0054] Beneficial effect: The density judgment area of the same size facilitates accurate judgment of the density of the marking circles around the marking circle to be selected; and by counting the number of marking circles in the density judgment area, the density of the marking circles around the marking circle to be selected can be obtained simply and efficiently.
[0055] Furthermore, the method for drawing the density judgment area in the density screening step is: using the minimum distance between the mark circle to be selected and the laser spot as the radius and the geometric center point of each mark circle to be selected as the center of the circle to draw the density judgment area.
[0056] Beneficial effect: When the spacing between the marking circles to be selected and the laser spot is close, the minimum spacing between the marking circles to be selected and the laser spot is selected as the radius of the density judgment area, so that the spacing between the marking circles and the laser spot in the density judgment area is close, thereby minimizing the overall movement path of the laser spot and improving the laser alignment efficiency.
[0057] Furthermore, the position calculation step specifically calculates the spot position information of the geometric center of the laser spot and the mark circle position information of the geometric center of the mark circle in the coordinate system according to the spot edge information and the mark circle edge information.
[0058] Beneficial effect: Since the smoothness and flatness of the surfaces on which the laser spot and the marking circle are located are different, the shapes of the laser spot and the marking circle are not standard. By calculating their respective geometric centers as their respective position information, the position offset of the marking circle to which the laser spot moves can be obtained, which is close to the actual distance and direction of the laser spot moving to the marking circle to a large extent. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 A flowchart of a first embodiment of a sub-pixel edge detection method;
[0060] Figure 2 It is an edge detection flow chart of a first embodiment of a sub-pixel edge detection method;
[0061] Figure 3 This is a flow chart of a second embodiment of a sub-pixel edge detection method. DETAILED DESCRIPTION
[0062] The following is further described in detail through specific implementation methods:
[0063] Embodiment 1
[0064] A sub-pixel edge detection method, such as Figure 1 As shown, the following steps are included:
[0065] The coordinate system establishment step is to establish a coordinate system in the collected image information, the image information including the laser spot and the marking circle. In this embodiment, the coordinate system is established with the lower right corner of the collected image information as the origin. In other embodiments, other points in the image information can also be used as the coordinate origin.
[0066] Image preprocessing is to perform image preprocessing on the image information to obtain a target image. In this embodiment, the image preprocessing is median filtering to filter out impulse noise or particle noise and protect the image edge for subsequent edge detection.
[0067] In the edge detection step, edge detection is performed on the laser spot and the marking circle in the target image to obtain the edge information of the laser spot and the marking circle. Specifically, Figure 2 As shown, the edge detection step includes the following steps:
[0068] S1, perform global threshold segmentation processing on the target image to obtain a binary image;
[0069] S2, using a filtering operator to detect the edge of the binary image to obtain a grayscale edge image. In this embodiment, the filtering operator is preferably a Sobel operator.
[0070] S3, interpolation processing is performed on the grayscale edge image using an interpolation algorithm to obtain an edge thinning image. In this embodiment, the interpolation algorithm preferably uses a cubic spline interpolation method to interpolate the grayscale edge image.
[0071] S4, binarizing the edge-refined image to obtain edge information.
[0072] The position calculation step calculates the spot position information of the laser spot and the marking circle position information of the marking circle in the coordinate system according to the spot edge information and the marking circle edge information, specifically: calculates the spot position information of the geometric center of the laser spot and the marking circle position information of the geometric center of the marking circle in the coordinate system according to the spot edge information and the marking circle edge information.
[0073] An offset calculation step is to calculate the position offset of the laser spot moving to the marking circle according to the spot position information and the marking circle position information;
[0074] The correction judgment step is to correct the position offset according to a preset error threshold, and if the position offset is greater than the preset error threshold, perform position correction adjustment.
[0075] The correction path planning step selects the marker circle with the smallest spacing as the marker circle to be selected according to the position offset, calculates the distribution density of other marker circles around the marker circle to be selected, selects the marker circle with high density as the marker circle to be aligned, and moves the laser spot to the position offset of the marker circle to be aligned as the position offset of the correction step. Specifically, it includes the distance screening step and the density screening step, in which:
[0076] The distance screening step includes the following steps:
[0077] S1, according to the position offset of the laser spot moving to each marking circle, the distance from each marking circle to the laser spot is obtained;
[0078] S2, according to the distances between each marking circle and the laser spot, selecting the marking circle with the smallest distance among the rated number as the marking circle to be selected;
[0079] S3, calculating the distance difference between the mark circle to be selected and the laser spot, and if the distance difference is greater than the preset first distance difference, executing the density screening step; if the distance difference is not greater than the preset first distance difference, the mark circle to be selected with the smallest distance from the laser spot is used as the mark circle to be aligned;
[0080] The density screening step includes the following steps:
[0081] S1, draw a density judgment area of the same size with the geometric center of the mark circle to be selected; specifically: the minimum distance between the mark circle to be selected and the laser spot is used as the radius, and the geometric center point of each mark circle to be selected is used as the center of the circle to draw the density judgment area.
[0082] S2, counting the number of marked circles in the density determination area corresponding to the marked circles to be selected;
[0083] S3, taking the to-be-selected marking circle with the largest number of marking circles as the marking circle to be aligned, and moving the laser spot to the position offset of the marking circle to be aligned as the position offset of the correction step.
[0084] The correction step is to control and adjust the position of the laser spot projected by the laser section detector according to the position offset.
[0085] Embodiment 2
[0086] The difference from the first embodiment is that: after the correction step, a correction effect tracking step is also included to calculate the corrected position offset between the laser spot and the marking circle in the corrected image, and to determine whether the corrected position offset is less than a preset error threshold. If not, a device failure prompt message is generated; if less, an alignment completion prompt message is generated. Figure 3 As shown, the specific steps include:
[0087] Step S1, collecting corrected image information;
[0088] Step S2, establishing a coordinate system in the corrected image;
[0089] Step S3, performing image preprocessing on the corrected image information to obtain a corrected target image;
[0090] Step S4, performing edge detection on the laser spot and the marking circle in the corrected target image respectively to obtain edge information of the corrected laser spot and edge information of the corrected marking circle;
[0091] Step S5, respectively calculating the corrected spot position information of the laser spot and the corrected mark circle position information of the mark circle in the coordinate system according to the corrected spot edge information and the corrected mark circle edge information;
[0092] Step S6, calculating the corrected position offset of the laser spot moving to the marking circle according to the corrected light spot position information and the corrected marking circle position information;
[0093] Step S7, determining whether the position offset after correction is less than a preset error threshold, and if not, generating a device fault prompt message.
[0094] The above is only an embodiment of the present invention, and the common knowledge such as the known specific structure and characteristics in the scheme is not described in detail here. It should be pointed out that for those skilled in the art, several deformations and improvements can be made without departing from the structure of the present invention, which should also be regarded as the protection scope of the present invention, and these will not affect the effect of the implementation of the present invention and the practicality of the patent. The scope of protection required by this application shall be based on the content of its claims, and the specific implementation methods and other records in the specification can be used to interpret the content of the claims.
Claims
1. A sub-pixel edge detection method, characterized in that: The following steps are involved: A coordinate system establishment step is to establish a coordinate system in the collected image information, where the image information includes a laser spot and a marking circle; Image preprocessing, performing image preprocessing on image information to obtain a target image; The edge detection step performs edge detection on the laser spot and the marking circle in the target image to obtain the edge information of the laser spot and the marking circle; A position calculation step, calculating the spot position information of the laser spot and the mark circle position information of the mark circle in the coordinate system according to the spot edge information and the mark circle edge information; An offset calculation step is to calculate the position offset of the laser spot moving to the marking circle according to the spot position information and the marking circle position information; A correction judgment step, performing correction judgment on the position offset according to a preset error threshold, and performing position correction adjustment if the position offset is greater than the preset error threshold; In the correction path planning step, the marking circle with the smallest spacing is selected as the marking circle to be selected according to the position offset, the distribution density of other marking circles around the marking circle to be selected is calculated, and the marking circle to be selected with a high density is selected as the marking circle to be aligned, and the position offset of the laser spot to be moved to the marking circle to be aligned is used as the position offset of the correction step; The correction step is to control and adjust the position of the laser spot projected by the laser section detector according to the position offset.
2. A sub-pixel edge detection method according to claim 1, characterized in that: The edge detection step specifically includes the following steps: S1, perform global threshold segmentation processing on the target image to obtain a binary image; S2, using a filtering operator to detect the edge of the binary image to obtain a grayscale edge image; S3, using an interpolation algorithm to interpolate the grayscale edge image to obtain an edge-refined image; S4, binarizing the edge-refined image to obtain edge information.
3. A sub-pixel edge detection method according to claim 1, characterized in that: The correction step also includes a correction effect tracking step, which calculates the corrected position offset between the laser spot and the marking circle in the corrected image, and determines whether the corrected position offset is less than a preset error threshold. If not, a device fault prompt message is generated. If it is less, an alignment completion prompt message is generated.
4. A sub-pixel edge detection method according to claim 3, characterized in that: The correction effect tracking steps specifically include the following steps: Step S1, collecting corrected image information; Step S2, establishing a coordinate system in the corrected image; Step S3, performing image preprocessing on the corrected image information to obtain a corrected target image; Step S4, performing edge detection on the laser spot and the marking circle in the corrected target image respectively to obtain edge information of the corrected laser spot and edge information of the corrected marking circle; Step S5, respectively calculating the corrected spot position information of the laser spot and the corrected mark circle position information of the mark circle in the coordinate system according to the corrected spot edge information and the corrected mark circle edge information; Step S6, calculating the corrected position offset of the laser spot moving to the marking circle according to the corrected light spot position information and the corrected marking circle position information; Step S7, determining whether the position offset after correction is less than a preset error threshold, and if not, generating a device fault prompt message.
5. The sub-pixel edge detection method according to claim 1, characterized in that: The corrected path planning step specifically includes a distance screening step and a density screening step, wherein: The distance screening step includes the following steps: S1, according to the position offset of the laser spot moving to each marking circle, the distance from each marking circle to the laser spot is obtained; S2, according to the distances between each marking circle and the laser spot, selecting the marking circle with the smallest distance among the rated number as the marking circle to be selected; S3, calculating the distance difference between the mark circle to be selected and the laser spot, and if the distance difference is greater than the preset first distance difference, executing the density screening step; if the distance difference is not greater than the preset first distance difference, the mark circle to be selected with the smallest distance from the laser spot is used as the mark circle to be aligned; In the density screening step, the distribution density of the mark circles around the mark circle to be selected is calculated, and the mark circle to be selected with high density is selected as the mark circle to be aligned. The position offset of the laser spot to the mark circle to be aligned is used as the position offset of the correction step.
6. A sub-pixel edge detection method according to claim 5, characterized in that: The density screening step includes the following steps: S1, draw a density determination area of the same size with the geometric center of the mark circle to be selected; S2, counting the number of marked circles in the density determination area corresponding to the marked circles to be selected; S3, taking the to-be-selected marking circle with the largest number of marking circles as the marking circle to be aligned, and moving the laser spot to the position offset of the marking circle to be aligned as the position offset of the correction step.
7. A sub-pixel edge detection method according to claim 6, characterized in that: The method for drawing the density judgment area in the density screening step is: the minimum distance between the mark circle to be selected and the laser spot is used as the radius, and the geometric center point of each mark circle to be selected is used as the center of the circle to draw the density judgment area.
8. The sub-pixel edge detection method according to claim 5, characterized in that: The position calculation step specifically calculates the spot position information of the geometric center of the laser spot and the mark circle position information of the geometric center of the mark circle in the coordinate system according to the spot edge information and the mark circle edge information.
Citation Information
Patent Citations
Line structured light based device and line structured light based method for automatic detection of level difference of cutting head of boom-type roadheader
CN102829727A
High-precision tunnel cross section detection method and device based on double laser bands
CN103630088A