Method and device for determining Z-axis coordinate of height map, equipment and storage medium
By determining the adjacent laser points of the sampling point and its reference Z-axis coordinates in the height map, the Z-axis coordinates of the sampling point are accurately calculated, which solves the problem of using the Z-axis coordinates of the nearest point, resulting in a decrease in accuracy, and improves the accuracy of the Z-axis coordinates in the height map.
Patent Information
- Application Number
- CN202411729706.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-03-11
AI Technical Summary
When using the Z-axis coordinates of the nearest point as the Z-axis coordinates of the sampling point in the height map, the accuracy of the Z-axis coordinates will decrease.
By obtaining the first X coordinate of the current sampling point in the laser line image and the second X coordinate in the height map, adjacent laser points are determined, and the Z coordinate of the sampling point in the height map is accurately determined based on the reference Z-axis coordinates and the second X coordinates of the adjacent laser points.
Improve the accuracy of determining the Z-axis coordinates in the height map, and avoids assignment of the Z-axis coordinates of the closest point with the smallest distance to the sampling point.
Smart Images

Figure CN119594856A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of industrial machine vision technology, and in particular to a method, device, equipment and storage medium for determining Z-axis coordinates of a height map. Background Art
[0002] Since 3D imaging uses laser to form a laser image on the surface of an object, and then a line laser camera collects the laser image, it has the advantages of non-contact, high precision, and strong adaptability. Therefore, 3D imaging is widely used in the field of industrial vision.
[0003] In order to speed up the rate at which line laser cameras collect laser images, line laser cameras usually only output the contour height information of the object's Z axis. However, since the lens of a line laser camera is a special tilt lens, according to the perspective principle, in the series of (X, Z) coordinates calculated by each laser point of the laser line, the point spacing in the X direction has the characteristic of being larger near and smaller far, making the actual spacing of the X axis unequal. In order to sample the (X, Z) coordinates equally, the nearest neighbor method is used to obtain the Z coordinate of the closest point with the smallest distance to the sampling point on the X axis to assign a value to the sampling point. However, there is a certain distance between the sampling point and the nearest point on the X axis. Using the Z axis coordinate of the nearest point as the Z axis coordinate of the sampling point in the height map will result in a decrease in the accuracy of the obtained Z axis coordinate.
[0004] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention
[0005] The main purpose of this application is to provide a method for determining the Z-axis coordinate of a height map, aiming to solve the technical problem that using the Z-axis coordinate of the nearest point as the Z-axis coordinate of the sampling point in the height map will result in a decrease in the accuracy of the obtained Z-axis coordinate.
[0006] To achieve the above object, the present application proposes a method for determining the Z-axis coordinates of a height map, the method comprising:
[0007] Obtaining a first X coordinate of a current sampling point in a laser line image and a second X coordinate of the current sampling point in a height map, wherein the height map is obtained by mapping the laser line image;
[0008] Based on the first X coordinate, determining adjacent laser points of the current sampling point;
[0009] The Z-axis coordinate of the current sampling point in the height map is determined based on the reference Z-axis coordinate of the adjacent laser point in the laser line image and the second X-coordinate.
[0010] In one embodiment, the step of determining the adjacent laser points of the current sampling point based on the first X coordinate comprises:
[0011] Based on the first X coordinate, determining a point interval of the current sampling point in the laser line image;
[0012] Determine whether there is a missing laser point in the landing point interval;
[0013] If it is determined that there is no missing laser point, the laser points at both ends of the landing point interval are determined to be adjacent laser points of the current sampling point.
[0014] In one embodiment, the step of determining the Z-axis coordinate of the current sampling point in the height map based on the reference Z-axis coordinate of the adjacent laser point in the laser line image and the second X-coordinate comprises:
[0015] Determine whether the current sampling point coincides with the adjacent laser point;
[0016] If it is determined that the two adjacent laser points do not overlap, then the reference Z-axis coordinates and the reference X-axis coordinates of the two adjacent laser points are obtained;
[0017] Determine a linear relationship between the X-axis and the Z-axis of the current sampling point based on the reference Z-axis coordinate and the reference X-axis coordinate;
[0018] Based on the linear relationship and the second X coordinate, a Z-axis coordinate of the current sampling point in the height map is determined.
[0019] In one embodiment, the step of determining the Z-axis coordinate of the current sampling point in the height map based on the reference Z-axis coordinate of the adjacent laser point in the laser line image and the second X-coordinate further includes:
[0020] If it is determined that the adjacent laser point coincides with the adjacent laser point, the reference Z coordinate of the adjacent laser point is obtained, and the reference Z coordinate is determined to be the Z-axis coordinate of the current sampling point in the height map.
[0021] In one embodiment, after the step of determining whether there is a missing laser point in the landing point interval, the step further includes:
[0022] If it is determined that the laser point is missing, the step of obtaining the first X coordinate of the current sampling point in the laser line image and the second X coordinate of the current sampling point in the height map is performed to determine the Z axis coordinate of the next sampling point in the height map.
[0023] In one embodiment, before the step of obtaining the second X coordinate of the current sampling point in the height map, the method further includes:
[0024] Get the preset sampling interval and preset height map width;
[0025] Based on the preset height map width, determining an X-axis zero point in the height map;
[0026] The step of obtaining the second X coordinate of the current sampling point in the height map mapped by the laser line image comprises:
[0027] Determine a mapping position of the current sampling point in the height map;
[0028] Based on the X-axis zero point, the preset sampling interval and the position, a second X coordinate of the current sampling point in the height map is determined.
[0029] In addition, to achieve the above purpose, the present application also proposes a device for determining the Z-axis coordinates of a height map, the device for determining the Z-axis coordinates of a height map comprising:
[0030] An acquisition module, used to acquire a first X coordinate of a current sampling point in a laser line image and a second X coordinate of the current sampling point in a height map, wherein the height map is obtained by mapping the laser line image;
[0031] A first determination module, configured to determine adjacent laser points of the current sampling point based on the first X coordinate;
[0032] The second determination module is used to determine the Z-axis coordinate of the current sampling point in the height map based on the reference Z-axis coordinate of the adjacent laser point in the laser line image and the second X-coordinate.
[0033] In addition, to achieve the above-mentioned purpose, the present application also proposes a device for determining the Z-axis coordinates of a height map, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the method for determining the Z-axis coordinates of a height map as described above.
[0034] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the method for determining the Z-axis coordinates of the height map as described above are implemented.
[0035] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the method for determining the Z-axis coordinates of the height map as described above are implemented.
[0036] One or more technical solutions proposed in this application have at least the following technical effects:
[0037] The position of the current sampling point in the laser line image is determined by obtaining the first X coordinate of the current sampling point in the laser line image, and the adjacent laser point of the current sampling point in the laser image is determined according to the first X coordinate, and the Z-axis coordinate of the current sampling point in the height map is determined according to the second X coordinate of the current sampling point in the height map and the Z-axis coordinate of the adjacent laser point in the laser line image (reference Z-axis coordinate), so as to accurately determine the Z-axis coordinate of the sampling point in the height map, avoid using the Z-axis coordinate of the nearest point with the smallest distance to the sampling point for assignment, and thereby improve the accuracy of determining the Z-axis coordinate in the height map. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0039] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0040] Figure 1 A schematic diagram of a flow chart provided for the first embodiment of a method for determining the Z-axis coordinates of a height map of the present application;
[0041] Figure 2 A scene schematic diagram is provided for the method of determining the Z-axis coordinates of the height map of this application;
[0042] Figure 3 Another scenario schematic diagram is provided for the method of determining the Z-axis coordinate of the height map of this application;
[0043] Figure 4 A brief flowchart of the method for determining the Z-axis coordinates of the height map of this application is provided;
[0044] Figure 5 A schematic diagram of a flow chart provided for the second embodiment of the method for determining the Z-axis coordinates of the height map of the present application;
[0045] Figure 6 A schematic diagram of a process flow provided for the third embodiment of the method for determining the Z-axis coordinates of the height map of the present application;
[0046] Figure 7 This is a schematic diagram of the module structure of a device for determining Z-axis coordinates of a height map according to an embodiment of the present application;
[0047] Figure 8 Schematic diagram of the device structure of the hardware operating environment involved in the method for determining the Z-axis coordinates of the height map in the embodiment of the present application.
[0048] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0049] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0050] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0051] The main solution of the embodiment of the present application is: the line laser camera obtains the first X coordinate of the current sampling point in the laser line image, and the second X coordinate of the current sampling point in the height map, and the height map is obtained by mapping the laser line image; based on the first X coordinate, the adjacent laser point of the current sampling point is determined; based on the reference Z-axis coordinate of the adjacent laser point in the laser line image and the second X coordinate, the Z-axis coordinate of the current sampling point in the height map is determined.
[0052] In this embodiment, for ease of description, the following description is made using a line laser camera as the execution subject.
[0053] In order to speed up the rate at which line laser cameras collect laser images, line laser cameras usually only output the contour height information of the object's Z axis. However, since the lens of a line laser camera is a special tilt lens, according to the principle of perspective, in the series of (X, Z) coordinates calculated by each laser point of the laser line, the point spacing in the X direction has the characteristic of being larger near and smaller far, making the actual spacing of the X axis unequal. In order to sample the (X, Z) coordinates equally, the nearest neighbor method is used to obtain the Z coordinate of the closest point with the smallest distance to the sampling point on the X axis to assign a value to the sampling point. However, there is a certain distance between the sampling point and the nearest point on the X axis. Using the Z axis coordinate of the nearest point as the Z axis coordinate of the sampling point in the height map will result in a decrease in the accuracy of the obtained Z axis coordinate.
[0054] The present application provides a solution, which determines the position of the current sampling point in the laser line image by obtaining the first X coordinate of the current sampling point in the laser line image, and determines the adjacent laser point of the current sampling point in the laser image according to the first X coordinate, and determines the Z-axis coordinate of the current sampling point in the height map according to the second X coordinate of the current sampling point in the height map obtained and the Z-axis coordinate of the adjacent laser point in the laser line image (reference Z-axis coordinate), so as to accurately determine the Z-axis coordinate of the sampling point in the height map, avoid using the Z-axis coordinate of the nearest point with the smallest distance to the sampling point for assignment, and thereby improve the accuracy of determining the Z-axis coordinate in the height map.
[0055] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a line laser camera, etc. The following takes a line laser camera as an example to illustrate this embodiment and the following embodiments.
[0056] Based on this, the present application embodiment provides a method for determining the Z-axis coordinate of the height map, referring to Figure 1 , Figure 1 Schematic diagram of the flow chart of the first embodiment of the method for determining the Z-axis coordinate of the height map of the present application.
[0057] In this embodiment, the method for determining the Z-axis coordinate of the height map includes steps S10 to S30:
[0058] Step S10, obtaining a first X coordinate of a current sampling point in a laser line image, and a second X coordinate of the current sampling point in a height map, wherein the height map is obtained by mapping the laser line image;
[0059] It should be noted that the current sampling point is the point that currently needs to be mapped from the laser line image to the height map. The set of these points represents the outline of the laser-irradiated object in the height map. The number of sampling points may be equal to the number of laser points in the laser line image; it may also be different from the number of laser points in the laser line image; and the sampling points may or may not coincide with the laser points on the laser line image.
[0060] For example, refer to Figure 2 ,In the scenario where the sampling interval of the adopted points is larger than the interval between each two adjacent laser points in the laser line image, the number of sampling points in the height map is smaller than the number in the laser line image, and the positions of the sampling points in the height map partially overlap with the laser points in the laser line image (data to be sampled), and partially do not overlap.
[0061] For example, refer to Figure 3 ,In the scenario where the sampling interval of the adopted points is smaller than the interval between each two adjacent laser points in the laser line image, the number of ,sampling points in the height map is larger than the number in the laser line image, and the positions of ,sampling points in the height map partially overlap with the laser points in the data to be ,sampled, and partially do not overlap.
[0062] It should be noted that a laser line image refers to an image obtained by laser scanning, in which the laser line reflects the height information of the object surface and is used to obtain three-dimensional data of the object surface. A height map is a two-dimensional image obtained by mapping the laser line image, which represents the height change of the object surface.
[0063] Optionally, before step S10, the method for determining the Z-axis coordinate of the height map further includes:
[0064] Get the preset sampling interval and preset height map width;
[0065] Based on the preset height map width, determining an X-axis zero point in the height map;
[0066] The step S10 further includes:
[0067] Determine a mapping position of the current sampling point in the height map;
[0068] Based on the X-axis zero point, the preset sampling interval and the position, a second X coordinate of the current sampling point in the height map is determined.
[0069] It should be noted that the preset sampling interval can be the distance between adjacent sampling points in the height map. The sampling interval determines the resolution and detail of the height map, that is, the smaller the sampling interval, the higher the resolution, and the higher the detail displayed by the height map. The preset height map width can be the total width of the height map in the X-axis direction. Since the height map is a two-dimensional image, the grayscale value of each pixel represents the height of the point. The X-axis zero point can be the starting point or origin of the X-axis in the height map. The mapping position can be to convert the points in the laser line image to the corresponding positions in the height map.
[0070] It can be understood that by obtaining the preset sampling interval and the height map width, determining the X-axis zero point in the height map, and using the mapping algorithm to convert the position of the current sampling point in the laser line image into the height map, the mapping position of the current sampling point in the height map is determined to accurately determine the second X coordinate of the current sampling point in the height map, thereby achieving effective fusion of the laser line image and the height map.
[0071] Step S20, determining the adjacent laser points of the current sampling point based on the first X coordinate;
[0072] It should be noted that the adjacent laser points are laser points in the laser line image that are adjacent to the current sampling point, and also include laser points in the laser line image that overlap with the current sampling point.
[0073] It can be understood that in order to avoid using the Z-axis coordinate of the laser point closest to the current sampling point to assign the Z-axis coordinate of the current sampling point in the height map, it is necessary to determine the laser point adjacent to the current sampling point in the laser line image, or the laser point overlapping with the current sampling point in the laser line image, so as to accurately determine the Z-axis coordinate of the current sampling point in the height map by using the adjacent laser point or the overlapping laser point as a reference and combining the second X coordinate of the current sampling point in the height map.
[0074] In a specific implementation, after determining the first X coordinate of the current sampling point in the laser line image, the landing point of the current sampling point in the laser line image is determined according to the first X coordinate, and the adjacent laser points at both ends of the current sampling point are determined according to the landing point. If the landing point happens to be a laser point in the laser line image, the laser point can be regarded as an adjacent laser point of the current sampling point, so as to facilitate the subsequent determination of the Z-axis coordinate of the current sampling point in the height map according to the coordinates of the adjacent laser points and in combination with the second X coordinate of the current sampling point.
[0075] Step S30: determining the Z-axis coordinate of the current sampling point in the height map based on the reference Z-axis coordinate of the adjacent laser point in the laser line image and the second X-coordinate.
[0076] It should be noted that the reference Z-axis coordinate refers to the vertical position of the adjacent laser points in the laser line image. This coordinate can be used as a reference, and is not directly used to assign a value. The linear relationship between the X-axis and the Z-axis in the laser line image for the current sampling point is determined to determine the Z-axis coordinate of the current sampling point in the height map based on the linear relationship.
[0077] It can be understood that since the current sampling point may not be any laser point in the laser line image, that is, there may be no Z coordinate value of the current sampling point in the laser line image, in order to accurately determine the Z coordinate value of the current sampling point, after determining the adjacent laser points of the current sampling point, the Z coordinates of the adjacent laser points are marked as reference Z-axis coordinates, and the reference Z-axis coordinates are used as a reference to determine the linear relationship between the X-axis and the Z-axis of the current sampling point in the area where the laser line image is located, so as to determine the Z-axis coordinate corresponding to the second X-coordinate according to the linear relationship, and then determine the Z-axis coordinate of the current sampling point in the height map, so as to accurately determine the Z-axis coordinate corresponding to the second X-coordinate of the current sampling point, avoid using the Z coordinate of the nearest laser point as the Z-axis coordinate of the current sampling point in the height map, and thus improve the accuracy of determining the Z-axis coordinate in the height map.
[0078] In the specific implementation, refer to Figure 4, assuming that the sampling interval is d, the height map width is W, and there are N (X, Z) point sequences in the actual contour. The goal is to fill the N (X, Z) point sequences with the same interval sampling to the appropriate position of a row in the height map. Set the X coordinate corresponding to the W / 2 position in the height map to 0, the left coordinate is a negative value, and the right coordinate is a positive value. After determining the sampling point, traverse each point H(i) in the corresponding row of the height map, and calculate the second X coordinate X(c) corresponding to H(i) by the following formula; according to the obtained first X coordinate X(1) of H(i), find out which two points H(i) falls between from the data to be sampled, and record them as P(m) and P(n); calculate the Z coordinate information of H(i), construct a straight line Z=aX+b through P(m) and P(n), bring X(c) into the straight line, and calculate the corresponding Z axis coordinate.
[0079] The calculation formula of X(c) is: X(c)=(-W / 2+i)*d.
[0080] The present embodiment provides a method for determining the Z-axis coordinate of a height map, wherein the position of the current sampling point in the laser line image is determined by obtaining a first X-coordinate of the current sampling point in the laser line image, and an adjacent laser point of the current sampling point in the laser image is determined according to the first X-coordinate, and the Z-axis coordinate of the adjacent laser point in the laser line image is determined according to the second X-coordinate of the current sampling point in the height map obtained, so as to accurately determine the Z-axis coordinate of the sampling point in the height map, avoid using the Z-axis coordinate of the nearest point with the smallest distance to the sampling point for assignment, and thereby improve the accuracy of determining the Z-axis coordinate in the height map.
[0081] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can refer to the above introduction, and will not be repeated later. Figure 5 , step S20 includes steps S22 to S23:
[0082] Step S21, determining the drop interval of the current sampling point in the laser line image based on the first X coordinate;
[0083] Step S22, determining whether there is a missing laser point in the landing point interval;
[0084] Step S23: If it is determined that there is no missing laser point, the laser points at both ends of the landing point interval are determined to be adjacent laser points of the current sampling point.
[0085] It should be noted that the landing interval is the specific area where the current sampling point is located in the laser line image, and the two endpoints of the landing interval are two adjacent laser points on the X axis in the laser line image. The missing laser point can be a point that should have received the laser but failed to receive the laser.
[0086] It is understandable that in actual applications, due to the influence of factors such as environment and light, laser points may be missing to varying degrees. By judging whether there are missing laser points in the landing point interval and determining the adjacent laser points accordingly, it is possible to avoid the loss of reference value due to the two adjacent laser points being too far apart. By judging whether there are missing laser points in the landing point interval, it is ensured that the adjacent laser points that need to be referenced have reference value, thereby minimizing the error in determining the Z-axis coordinate of the current sampling point in the height map based on the adjacent laser points, thereby improving the accuracy of determining the Z-axis coordinate in the height map.
[0087] In a specific implementation, since the laser line image is usually composed of multiple discrete laser points, these laser points form a continuous line on the image. In order to determine the landing interval of the current sampling point, the laser line image can be divided into intervals according to two adjacent laser points as endpoints, and then the landing interval of the current sampling point is found from each interval according to the first X coordinate. When the laser is used to irradiate the detected object, the laser point in the laser line image may be missing due to sensor failure, obstruction or other reasons. In order to avoid using adjacent laser points with large errors as references to determine the Z-axis coordinates of the current sampling point in the height map, it is necessary to determine whether the laser point is missing in the landing interval, that is, the point where the laser should have been received does not receive the laser. When it is determined that the landing interval does not lack laser points, the laser points at both ends of the landing interval are determined as adjacent laser points of the current sampling point, and the error caused by the large distance between the two adjacent laser points is reduced, thereby improving the accuracy of determining the Z-axis coordinates in the height map based on the adjacent laser points.
[0088] Optionally, after step S22, the following steps are further included:
[0089] If it is determined that the laser point is missing, the step of obtaining the first X coordinate of the current sampling point in the laser line image and the second X coordinate of the current sampling point in the height map is performed to determine the Z axis coordinate of the next sampling point in the height map.
[0090] It is understandable that since the laser points in the laser line image will reduce the accuracy of the Z-axis coordinates finally obtained, in order to make the contour composed of the Z-axis coordinates in the height map accurately represent the contour of the detected object, therefore, when determining the missing laser points in the landing interval, the determination of the Z-axis coordinates of the sampling point in the height map can be skipped, and the processing of the next sampling point can be started to avoid obtaining Z-axis coordinates with large errors and changing the contour of the detected object represented by the height map.
[0091] Based on the first and second embodiments of the present application, in the third embodiment of the present application, the same or similar contents as those in the above embodiments can be referred to the above introduction, and will not be described in detail later. Figure 6 , step S30 includes steps S31 to S34:
[0092] Step S31, determining whether the current sampling point coincides with the adjacent laser point;
[0093] Step S32, if it is determined that the adjacent laser points do not overlap, obtaining the reference Z-axis coordinates and the reference X-axis coordinates of the two adjacent laser points;
[0094] Step S33, determining the linear relationship between the X-axis and the Z-axis of the current sampling point based on the reference Z-axis coordinate and the reference X-axis coordinate;
[0095] Step S34: determining the Z-axis coordinate of the current sampling point in the height map based on the linear relationship and the second X-coordinate.
[0096] It should be noted that the linear relationship may be Z=aX+b.
[0097] It can be understood that since the linear relationship obtained based on adjacent laser points also characterizes the contour of the area corresponding to the current sampling point on the detected object, the linear relationship about the current sampling point determined by the laser line image can be applied to the linear relationship between the X-axis and the Z-axis of the current sampling point in the height map. Therefore, the Z-axis coordinate of the current sampling point in the height map can be accurately determined based on the linear relationship and the second X-coordinate.
[0098] Optionally, step S30 may further include:
[0099] If it is determined that the adjacent laser point coincides with the adjacent laser point, the reference Z coordinate of the adjacent laser point is obtained, and the reference Z coordinate is determined to be the Z-axis coordinate of the current sampling point in the height map.
[0100] It can be understood that, since the current sampling point coincides with the adjacent laser point, it means that the laser line image has detected the Z-axis coordinate of the detected object at that location, and since the reference X-coordinate of the adjacent laser point is the same as the second X-axis coordinate of the current sampling point, the reference Z-coordinate of the adjacent laser point is the Z-axis coordinate of the current sampling point in the height map.
[0101] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the method for determining the Z-axis coordinates of the height map of the present application. More forms of simple transformations based on this technical concept are all within the scope of protection of the present application.
[0102] This application also provides a device for determining the Z-axis coordinate of the height map, please refer to Figure 7 , the device for determining the Z-axis coordinate of the height map includes:
[0103] An acquisition module 10 is used to acquire a first X coordinate of a current sampling point in a laser line image and a second X coordinate of the current sampling point in a height map, wherein the height map is obtained by mapping the laser line image;
[0104] A first determination module 20, configured to determine adjacent laser points of the current sampling point based on the first X coordinate;
[0105] The second determination module 30 is configured to determine the Z-axis coordinate of the current sampling point in the height map based on the reference Z-axis coordinate of the adjacent laser point in the laser line image and the second X-coordinate.
[0106] Optionally, the first determination module 20 is further used to determine, based on the first X coordinate, a landing point interval of the current sampling point in the laser line image; determine whether a laser point is missing in the landing point interval; if it is determined that no laser point is missing, determine the laser points at both ends of the landing point interval as adjacent laser points of the current sampling point.
[0107] Optionally, the second determination module 30 is further used to determine whether the current sampling point coincides with the adjacent laser point; if it is determined that the current sampling point does not coincide with the adjacent laser point, obtain the reference Z-axis coordinate and the reference X-axis coordinate of the two adjacent laser points; based on the reference Z-axis coordinate and the reference X-axis coordinate, determine the linear relationship between the X-axis and the Z-axis of the current sampling point; based on the linear relationship and the second X-coordinate, determine the Z-axis coordinate of the current sampling point in the height map.
[0108] Optionally, the second determination module 30 is further configured to obtain a reference Z coordinate of the adjacent laser point if it is determined that the adjacent laser point coincides with the adjacent laser point, and determine the reference Z coordinate to be the Z-axis coordinate of the current sampling point in the height map.
[0109] Optionally, the first determination module 20 is further used to execute the step of obtaining the first X coordinate of the current sampling point in the laser line image and the second X coordinate of the current sampling point in the height map if it is determined that the laser point is missing, and determine the Z-axis coordinate of the next sampling point in the height map.
[0110] Optionally, the acquisition module 10 is further used to obtain a preset sampling interval and a preset height map width; determine the X-axis zero point in the height map based on the preset height map width; determine the mapping position of the current sampling point in the height map; and determine the second X coordinate of the current sampling point in the height map based on the X-axis zero point, the preset sampling interval and the position.
[0111] The device for determining the Z-axis coordinates of the height map provided by the present application adopts the method for determining the Z-axis coordinates of the height map in the above-mentioned embodiment, which can solve the technical problem that the accuracy of the obtained Z-axis coordinates is reduced by using the Z-axis coordinates of the nearest point as the Z-axis coordinates of the sampling point in the height map. Compared with the prior art, the beneficial effects of the device for determining the Z-axis coordinates of the height map provided by the present application are the same as the beneficial effects of the method for determining the Z-axis coordinates of the height map provided by the above-mentioned embodiment, and the other technical features in the device for determining the Z-axis coordinates of the height map are the same as the features disclosed in the above-mentioned embodiment method, which will not be repeated here.
[0112] The present application provides a device for determining the Z-axis coordinates of a height map, the device for determining the Z-axis coordinates of a height map comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for determining the Z-axis coordinates of the height map in the above-mentioned embodiment one.
[0113] Reference below Figure 8 , which shows a schematic diagram of the structure of a device for determining the Z-axis coordinates of a height map suitable for implementing an embodiment of the present application. The device for determining the Z-axis coordinates of a height map in the embodiment of the present application may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 8 The device for determining the Z-axis coordinate of the height map shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0114] like Figure 8As shown, the device for determining the Z-axis coordinate of the height map may include a processing device 1001 (such as a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. Various programs and data required for the operation of the device for determining the Z-axis coordinate of the height map are also stored in the RAM 1004. The processing device 1001, the ROM 1002, and the RAM 1004 are connected to each other via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems may be connected to the I / O interface 1006: input devices 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1003 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 1009. The communication device 1009 may allow the device for determining the Z-axis coordinate of the height map to communicate wirelessly or wired with other devices to exchange data. Although the figure shows a device for determining the Z-axis coordinate of the height map with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or have instead.
[0115] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0116] The device for determining the Z-axis coordinates of the height map provided by the present application adopts the method for determining the Z-axis coordinates of the height map in the above-mentioned embodiment, which can solve the technical problem that the accuracy of the obtained Z-axis coordinates is reduced by using the Z-axis coordinates of the nearest point as the Z-axis coordinates of the sampling point in the height map. Compared with the prior art, the beneficial effects of the device for determining the Z-axis coordinates of the height map provided by the present application are the same as the beneficial effects of the method for determining the Z-axis coordinates of the height map provided by the above-mentioned embodiment, and the other technical features in the device for determining the Z-axis coordinates of the height map are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0117] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0118] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0119] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, the computer-readable program instructions being used to execute the method for determining the Z-axis coordinates of the height map in the above-mentioned embodiment.
[0120] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0121] The computer-readable storage medium may be included in the device for determining the Z-axis coordinate of the height map; or may exist independently without being assembled into the device for determining the Z-axis coordinate of the height map.
[0122] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the device for determining the Z-axis coordinate of the height map, the device for determining the Z-axis coordinate of the height map: obtains a first X coordinate of a current sampling point in a laser line image, and a second X coordinate of the current sampling point in a height map, wherein the height map is obtained by mapping the laser line image; determines an adjacent laser point of the current sampling point based on the first X coordinate; and determines the Z-axis coordinate of the current sampling point in the height map based on a reference Z-axis coordinate of the adjacent laser point in the laser line image and the second X coordinate.
[0123] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0124] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0125] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0126] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned method for determining the Z-axis coordinates of the height map, and can solve the technical problem that the accuracy of the obtained Z-axis coordinates is reduced when the Z-axis coordinates of the nearest point are used as the Z-axis coordinates of the sampling point in the height map. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the method for determining the Z-axis coordinates of the height map provided by the above-mentioned embodiment, and will not be repeated here.
[0127] The present application also provides a computer program product, including a computer program, which implements the steps of the method for determining the Z-axis coordinate of the height map as described above when the computer program is executed by a processor.
[0128] The computer program product provided by the present application can solve the technical problem that the accuracy of the obtained Z-axis coordinates is reduced when the Z-axis coordinates of the nearest point are used as the Z-axis coordinates of the sampling point in the height map. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as those of the method for determining the Z-axis coordinates of the height map provided by the above embodiment, and will not be elaborated here.
[0129] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A method for determining the Z-axis coordinate of a height map, characterized in that: The method includes: Obtaining a first X coordinate of a current sampling point in a laser line image and a second X coordinate of the current sampling point in a height map, wherein the height map is obtained by mapping the laser line image; Based on the first X coordinate, determining adjacent laser points of the current sampling point; The Z-axis coordinate of the current sampling point in the height map is determined based on the reference Z-axis coordinate of the adjacent laser point in the laser line image and the second X-coordinate.
2. The method according to claim 1, characterized in that The step of determining the adjacent laser points of the current sampling point based on the first X coordinate comprises: Based on the first X coordinate, determining a point interval of the current sampling point in the laser line image; Determine whether there is a missing laser point in the landing point interval; If it is determined that there is no missing laser point, the laser points at both ends of the landing point interval are determined to be adjacent laser points of the current sampling point.
3. The method according to claim 2, characterized in that The step of determining the Z-axis coordinate of the current sampling point in the height map based on the reference Z-axis coordinate of the adjacent laser point in the laser line image and the second X-coordinate comprises: Determine whether the current sampling point coincides with the adjacent laser point; If it is determined that the two adjacent laser points do not overlap, obtaining the reference Z-axis coordinates and the reference X-axis coordinates of the two adjacent laser points; Determine a linear relationship between the X-axis and the Z-axis of the current sampling point based on the reference Z-axis coordinate and the reference X-axis coordinate; Based on the linear relationship and the second X coordinate, a Z-axis coordinate of the current sampling point in the height map is determined.
4. The method according to claim 3, characterized in that The step of determining the Z-axis coordinate of the current sampling point in the height map based on the reference Z-axis coordinate of the adjacent laser point in the laser line image and the second X-coordinate further includes: If it is determined that the adjacent laser point coincides with the adjacent laser point, the reference Z coordinate of the adjacent laser point is obtained, and the reference Z coordinate is determined to be the Z-axis coordinate of the current sampling point in the height map.
5. The method according to claim 2, characterized in that After the step of determining whether there is a missing laser point in the landing point interval, the following step is further included: If it is determined that the laser point is missing, the step of obtaining the first X coordinate of the current sampling point in the laser line image and the second X coordinate of the current sampling point in the height map is performed to determine the Z axis coordinate of the next sampling point in the height map.
6. The method according to claim 1, characterized in that Before the step of obtaining the second X coordinate of the current sampling point in the height map, the following step is further included: Get the preset sampling interval and preset height map width; Based on the preset height map width, determining an X-axis zero point in the height map; The step of obtaining the second X coordinate of the current sampling point in the height map mapped by the laser line image comprises: Determine a mapping position of the current sampling point in the height map; Based on the X-axis zero point, the preset sampling interval and the position, a second X coordinate of the current sampling point in the height map is determined.
7. A device for determining the Z-axis coordinate of a height map, characterized in that: The device comprises: An acquisition module, used to acquire a first X coordinate of a current sampling point in a laser line image and a second X coordinate of the current sampling point in a height map, wherein the height map is obtained by mapping the laser line image; A first determination module, configured to determine adjacent laser points of the current sampling point based on the first X coordinate; The second determination module is used to determine the Z-axis coordinate of the current sampling point in the height map based on the reference Z-axis coordinate of the adjacent laser point in the laser line image and the second X-coordinate.
8. A device for determining the Z-axis coordinate of a height map, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the method for determining the Z-axis coordinate of the height map according to any one of claims 1 to 6.
9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the method for determining the Z-axis coordinate of the height map according to any one of claims 1 to 6 are implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the method for determining the Z-axis coordinate of the height map according to any one of claims 1 to 6 are implemented.