Three-dimensional color point cloud construction method, device, system and storage medium
Through laser sweeping and visual sensing technology, the three-dimensional coordinates and color information of the target workpiece are extracted, and combined with triangulation method and grayscale center of gravity method, a high-precision three-dimensional color point cloud model is constructed, solving the problem of low accuracy in the existing technology The problem meets the needs of high-precision and high-efficiency three-dimensional reconstruction.
Patent Information
- Application Number
- CN202111618027.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-27
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2041-12-27
AI Technical Summary
The existing three-dimensional reconstruction technology cannot meet the needs of high precision, high efficiency, and obtaining color information during production and processing. Especially when detecting the object to be measured, the system error is large and the geometric measurement accuracy is not high, making it difficult to meet the requirements of high-precision processing.
A three-dimensional color point cloud construction method is adopted, and the target workpiece is swept through the laser beam through the laser emitting device, and the discrete spot image is obtained, the three-dimensional coordinates and color information of pixel points are extracted, combined with the creation of the workpiece contour line, and the triangle is adopted. The measurement method and the grayscale center of gravity method are accurately matched to build a three-dimensional color point cloud model.
It realizes high-precision and efficient three-dimensional reconstruction, obtains the three-dimensional model of the real size and surface color of the target workpiece to meet the needs of high-precision processing.
Smart Images

Figure CN114494468B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image processing, and specifically relates to a three-dimensional color point cloud construction method, a three-dimensional color point cloud construction device, a three-dimensional color point cloud construction system and a computer-readable storage medium. Background Art
[0002] 3D reconstruction refers to the establishment of a mathematical model suitable for computer representation and processing for 3D objects. It is the basis for processing, operating and analyzing the properties of 3D objects in a computer environment. It is also a key technology for establishing virtual reality in the computer to express the objective world. It plays a vital role in object processing. 3D reconstruction involves the measurement of 3D objects. Among them, non-contact measurement (the measuring tool does not need to contact the 3D object) is widely used due to its high efficiency. Currently, non-contact measurement mainly includes time-of-flight method, binocular vision method, etc.
[0003] The time-of-flight method determines the distance between the sensor and the object to be measured by the time difference between the detection light emitted by the transmitter and reflected by the object to be measured to the receiver; this method has a large system error and does not have the function of detecting the color information of the object to be measured. The binocular vision method uses two cameras to obtain two images of the same position of the object to be measured from different perspectives, and then obtains the distance information of the object to be measured through the parallax method; this method has a large amount of calculation when finding the corresponding relationship between the two images, and the geometric measurement accuracy is not high, which makes it difficult to meet the high-precision reconstruction requirements during processing operations.
[0004] Therefore, in the production and processing process, there is an urgent need for a color point cloud reconstruction method for three-dimensional objects to meet the needs of high-precision, high-efficiency, and color information-acquired three-dimensional reconstruction during processing, thereby ensuring accurate recognition of the posture of the processed object and precise positioning of the processing part in the subsequent processing process. Summary of the invention
[0005] In order to overcome the above-mentioned shortcomings of the prior art, the purpose of the present invention is to provide a three-dimensional color point cloud construction method, aiming to solve the technical problem that the current three-dimensional reconstruction technology cannot meet the requirements of high-precision, high-efficiency and color information-obtainable three-dimensional reconstruction in the production and processing process.
[0006] In order to achieve the purpose, the technical solution adopted by the present invention is as follows:
[0007] A three-dimensional color point cloud construction method is applied to a processing device, wherein the processing device comprises a conveying device, a fixed support, a laser emitting device and a visual sensing device, wherein the laser emitting device and the visual sensing device are installed on the fixed support, the conveying device is used to convey a target workpiece, and the fixed support is located on a conveying path of the conveying device;
[0008] The three-dimensional color point cloud construction method comprises the following steps:
[0009] The target workpiece is conveyed through the fixed support by the conveying device, and a linear laser beam is emitted to the target workpiece by the laser emitting device;
[0010] In the process of the line laser beam scanning the target workpiece, the visual sensor device continuously acquires a discrete light spot image formed by the line laser beam projected on the target workpiece;
[0011] Obtaining the three-dimensional coordinates of the target pixel points corresponding to the discrete spot image;
[0012] Acquiring the color information of the target pixel through the visual sensing device;
[0013] The color information is matched with the three-dimensional coordinates of the target pixel points to obtain a three-dimensional color point cloud model of the target workpiece.
[0014] Furthermore, the step of obtaining the three-dimensional coordinates of the target pixel points corresponding to the discrete spot image includes:
[0015] Based on the discrete spot image, generating a corresponding workpiece contour line;
[0016] Extracting the pixel points through which the workpiece contour line passes as the target pixel points;
[0017] The three-dimensional coordinates of the laser emitting device and the three-dimensional coordinates of the visual sensing device are acquired, and the three-dimensional coordinates of the target pixel point are calculated by using triangulation method.
[0018] Furthermore, the step of generating a corresponding workpiece contour line based on the discrete spot image includes:
[0019] Obtaining the centroid of each laser point in the discrete spot image by using the grayscale centroid method;
[0020] The centroid of each laser point is linearly fitted by the least square method to obtain the workpiece contour line.
[0021] Furthermore, the step of continuously acquiring the discrete spot image formed by the linear laser beam projected on the target workpiece through the visual sensing device includes:
[0022] Continuously acquiring a photographic image containing the target workpiece through the visual sensing device;
[0023] Based on the wavelength information of the linear laser beam, the discrete spot image is extracted from the captured image through a filtering device.
[0024] Furthermore, the processing equipment further comprises a light source compensation device, and the light source compensation device is installed on the fixed bracket;
[0025] After the step of continuously acquiring the photographic image containing the target workpiece by the visual sensing device, the method further comprises:
[0026] A fill light operation is performed on the captured image through the light source compensation device.
[0027] Furthermore, the step of acquiring the color information of the target pixel through the visual sensing device includes:
[0028] Acquire the moving distance of the target workpiece on the conveying device in each frame;
[0029] Based on the moving distance per frame, adjusting the three-dimensional coordinates of the target pixel point to obtain the color coordinates of the target pixel point;
[0030] Acquiring color information corresponding to the color coordinates through the visual sensing device as target color information;
[0031] The step of matching the color information with the three-dimensional coordinates of the target pixel point comprises:
[0032] The target color information is combined with the three-dimensional coordinates of the corresponding target pixel points.
[0033] Furthermore, before the step of conveying the target workpiece through the fixed support by the conveying device, the step includes:
[0034] The detection member is conveyed through the fixed bracket by the conveying device; wherein the detection member has a detection mark perpendicular to the conveying direction of the conveying device;
[0035] Intercepting a first captured image and a second captured image containing the detection mark by the visual sensing device; wherein the first captured image and the second captured image are separated by one frame;
[0036] The straight-line distance between the detection mark on the first captured image and the detection mark on the second captured image is calculated as the moving distance per frame of the target workpiece on the conveying device.
[0037] Correspondingly, the present invention further proposes a three-dimensional color point cloud construction device, the three-dimensional color point cloud construction device comprising:
[0038] A driving module, used to control the conveying device to convey the target workpiece through the fixed bracket, control the laser emitting device to emit a line laser beam to the target workpiece, and control the visual sensor device to continuously acquire a discrete spot image formed by the line laser beam projected on the target workpiece;
[0039] An acquisition module, used to acquire the three-dimensional coordinates of the target pixel point corresponding to the discrete spot image, and to acquire the color information of the target pixel point through the visual sensing device;
[0040] A construction module is used to match the color information with the three-dimensional coordinates of the target pixel point to obtain a three-dimensional color point cloud model of the target workpiece.
[0041] Correspondingly, the present invention also proposes a three-dimensional color point cloud construction system, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the computer program is executed by the processor, the steps of the three-dimensional color point cloud construction method as described above are implemented.
[0042] Correspondingly, the present invention also proposes a computer-readable storage medium, on which a three-dimensional color point cloud construction program is stored. When the three-dimensional color point cloud construction program is executed by a processor, the steps of the three-dimensional color point cloud construction method as described above are implemented.
[0043] Compared with the prior art, the present invention has the following beneficial effects:
[0044] The three-dimensional color point cloud construction method proposed in the present invention is that during the process of the transmission device transporting the target workpiece, the line laser beam emitted by the laser emitting device can completely scan the target workpiece as the target workpiece moves, and the laser point projected on the target workpiece by the line laser beam in each frame image is obtained through the visual sensing device, and the three-dimensional coordinates of the pixel points (i.e., the target pixel points) where each laser point is located are extracted, and then the color information of each target pixel point is correspondingly collected, and finally the three-dimensional coordinates of each target pixel point are combined with the color information of the target pixel point, so as to obtain a three-dimensional model that can characterize the actual size and surface color of the target workpiece in an accurate and efficient manner, i.e., the three-dimensional color point cloud model of the target workpiece. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the embodiments of the present invention 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, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying creative work.
[0046] Figure 1 A schematic diagram of a process of constructing a three-dimensional color point cloud according to an embodiment of the present invention;
[0047] Figure 2 A schematic diagram of a detailed process of an embodiment of a method for constructing a three-dimensional color point cloud according to the present invention;
[0048] Figure 3 A schematic diagram of a process flow of another embodiment of a method for constructing a three-dimensional color point cloud according to the present invention;
[0049] Figure 4 It is a schematic diagram of the structure of the processing equipment in the embodiment of the present invention;
[0050] Figure 5 Schematic diagram of a method for acquiring the moving distance of a target workpiece per frame in an embodiment of the present invention;
[0051] Figure 6 A schematic diagram of the structure of a device involved in an embodiment of the present invention;
[0052] Figure 7 The figure is a schematic diagram of the system structure of the hardware operating environment involved in the embodiment of the present invention.
[0053] Description of reference numerals:
[0054] Label name Label name 1 Conveyor 4 Visual sensor device 2 Fixed bracket 5 Target artifact 3 Laser emission device 6 Light source compensation device
[0055] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0056] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0057] like Figure 7 As shown, Figure 7 It is a structural schematic diagram of a three-dimensional color point cloud construction system involved in an embodiment of the present invention.
[0058] like Figure 7As shown, the three-dimensional color point cloud construction system may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0059] Optionally, the 3D color point cloud construction system may further include a camera, an RF (Radio Frequency) circuit, a sensor, an audio circuit, a WiFi module, etc. Among them, the sensor may include a light sensor, a motion sensor, an infrared sensor, and other sensors, which will not be described in detail here.
[0060] Those skilled in the art will understand that Figure 7 The specific structure shown in the figure does not constitute a limitation on the three-dimensional color point cloud construction system, and may include more or less components than those shown in the figure, or a combination of certain components, or a different arrangement of components.
[0061] like Figure 7 As shown, the memory 1005 as a computer-readable storage medium may include an operating system, a network communication module, a user interface module, and a three-dimensional color point cloud construction program.
[0062] exist Figure 7 In the three-dimensional color point cloud construction system shown, the network interface 1004 is mainly used to connect to the backend server and perform data communication with the backend server; the user interface 1003 is mainly used to connect to the client (user end) and perform data communication with the client; and the processor 1001 can be used to call the three-dimensional color point cloud construction program stored in the memory 1005 and perform the following operations:
[0063] The target workpiece is conveyed through the fixed support by a conveying device, and a linear laser beam is emitted to the target workpiece by a laser emitting device;
[0064] When the line laser beam is scanning the target workpiece, the discrete spot image formed by the line laser beam projected on the target workpiece is continuously acquired through the visual sensing device;
[0065] Obtain the three-dimensional coordinates of the target pixel points corresponding to the discrete spot image;
[0066] Acquire the color information of the target pixel through the visual sensor device;
[0067] The color information is matched with the three-dimensional coordinates of the target pixel points to obtain a three-dimensional color point cloud model of the target workpiece.
[0068] Further, the processor 1001 may call the network operation control application stored in the memory 1005, and further perform the following operations:
[0069] Based on the discrete spot image, the corresponding workpiece contour line is generated;
[0070] Extract the pixel points where the workpiece contour line passes through as the target pixel points;
[0071] The three-dimensional coordinates of the laser emitting device and the three-dimensional coordinates of the visual sensor device are obtained, and the three-dimensional coordinates of the target pixel point are calculated using triangulation.
[0072] Further, the processor 1001 may call the network operation control application stored in the memory 1005, and further perform the following operations:
[0073] The centroid of each laser point in the discrete spot image is obtained by the grayscale centroid method;
[0074] The centroid of each laser point is linearly fitted using the least squares method to obtain the workpiece contour.
[0075] Further, the processor 1001 may call the network operation control application stored in the memory 1005, and further perform the following operations:
[0076] Continuously obtain a shooting picture containing a target workpiece through a visual sensor device;
[0077] Based on the wavelength information of the linear laser beam, a discrete spot image is extracted from the captured image through a filtering device.
[0078] Further, the processor 1001 may call the network operation control application stored in the memory 1005, and further perform the following operations:
[0079] The light source compensation device performs fill light operation on the captured image.
[0080] Further, the processor 1001 may call the network operation control application stored in the memory 1005, and further perform the following operations:
[0081] Obtaining the moving distance of the target workpiece on the conveying device in each frame;
[0082] Based on the moving distance of each frame, the three-dimensional coordinates of the target pixel are adjusted to obtain the color coordinates of the target pixel;
[0083] The color information corresponding to the color coordinates is obtained through the visual sensing device as the target color information.
[0084] Further, the processor 1001 may call the network operation control application stored in the memory 1005, and further perform the following operations:
[0085] Combine the target color information with the three-dimensional coordinates of the corresponding target pixel points.
[0086] Further, the processor 1001 may call the network operation control application stored in the memory 1005, and further perform the following operations:
[0087] The detection piece is conveyed through the fixed bracket by a conveying device; wherein the detection piece has a detection mark perpendicular to the conveying direction of the conveying device;
[0088] Intercepting a first captured image and a second captured image containing the detection mark by a visual sensing device; wherein the first captured image and the second captured image are separated by one frame;
[0089] The straight-line distance between the detection mark on the first captured image and the detection mark on the second captured image is calculated as the moving distance per frame of the target workpiece on the conveying device.
[0090] Reference Figures 1 to 4 An embodiment of the present invention provides a three-dimensional color point cloud construction method, which is applied to a processing device, wherein the processing device includes a conveying device 1, a fixed support 2, a laser emitting device 3 and a visual sensor device 4, wherein the laser emitting device 3 and the visual sensor device 4 are installed on the fixed support 2, the conveying device 1 is used to convey a target workpiece 5, and the fixed support 2 is located on the conveying path of the conveying device 1; the three-dimensional color point cloud construction method includes:
[0091] S1, transporting the target workpiece 5 through the fixed support 2 by the conveying device 1, and emitting a linear laser beam to the target workpiece 5 by the laser emitting device 3;
[0092] S2, when the line laser beam is scanning the target workpiece 5, the discrete spot image formed by the line laser beam projected on the target workpiece 5 is continuously acquired by the visual sensor device 4; wherein the visual sensor device 4 is mounted on the fixed bracket 2;
[0093] The conveying device 1 can be a conveying chain as shown in the figure or other driving equipment that can realize the conveying of workpieces; the line laser beam can be regarded as a continuous line segment composed of a number of laser points, and the laser points on the line laser beam can be projected onto the target workpiece 5 and collected by the visual sensor device 4. Among them, the visual sensor device 4 can be a color camera connected to the image processing device. Preferably, the laser emitting device 3 is located directly above the conveying surface of the conveying device 1 (that is, the surface on which the target workpiece 5 is placed, which can be parallel to the horizontal plane) and emits the line laser beam vertically downward, so that the projection direction of the line laser beam is perpendicular to the conveying surface of the conveying device 1; in the process of the line laser beam completely sweeping the target workpiece 5 (that is, the target workpiece 5 completely passes through the line laser beam), the visual sensor device 4 captures each frame of the image (that is, the discrete spot image) containing the laser points projected on the target workpiece 5 and displays it on the display surface of the image processing device (specifically, it can be a display screen).
[0094] S3, obtaining the three-dimensional coordinates of the target pixel points corresponding to the discrete spot image;
[0095] When the line laser beam is projected onto the target workpiece 5, the trajectory of the line laser beam will fit the outer contour of the target workpiece 5. Therefore, by obtaining the three-dimensional coordinates of the laser point projected onto the target workpiece 5 in each frame image and combining the three-dimensional coordinates of each frame image, a coordinate set will be formed. The coordinate set includes the three-dimensional coordinates of all laser points projected onto the target workpiece 5, which can characterize the outer contour shape of the target workpiece 5, and based on this, a three-dimensional model of the target workpiece 5 can be constructed.
[0096] Specifically, the method for obtaining the above-mentioned three-dimensional coordinates can be to extract the pixel points (i.e., target pixel points) where each laser point is located in each frame image through an image processing device, and then extract the three-dimensional coordinates of each target pixel point, and use the extracted three-dimensional coordinates of the target pixel point as the three-dimensional coordinates of the laser point.
[0097] S4, obtaining color information of the target pixel through the visual sensor device 4;
[0098] S5, matching the color information with the three-dimensional coordinates of the target pixel point to obtain a three-dimensional color point cloud model of the target workpiece 5.
[0099] The visual sensing device 4 has a color information acquisition function, and the color information can be specifically the three primary color parameters of R (red), G (green), and B (blue) of each target pixel in each frame of the image. When the three-dimensional coordinates and color information of all target pixels in a frame of discrete spot image are known, the three-dimensional coordinates and color information of each target pixel are combined to obtain the three-dimensional color point cloud image of the frame. By combining the three-dimensional color point cloud images of each frame, a three-dimensional model that can characterize the real size and surface color of the target workpiece 5 is formed, that is, a three-dimensional color point cloud model of the target workpiece 5.
[0100] It can be seen that in the three-dimensional color point cloud construction method provided by the present embodiment, during the process of the conveying device 1 transporting the target workpiece 5, the line laser beam emitted by the laser emitting device 3 can completely scan the target workpiece 5 as the target workpiece 5 moves, and the laser point projected on the target workpiece 5 by the line laser beam in each frame image is obtained through the visual sensing device 4, and the three-dimensional coordinates of the pixel points (i.e., the target pixel points) where each laser point is located are extracted, and then the color information of each target pixel point is correspondingly collected, and finally the three-dimensional coordinates of each target pixel point are combined with the color information of the target pixel point, so as to obtain a three-dimensional model that can characterize the real size and surface color of the target workpiece 5 in an accurate and efficient manner, i.e., a three-dimensional color point cloud model of the target workpiece 5.
[0101] Specifically, refer to Figures 1 to 4 , step S3 comprises:
[0102] S31, generating a corresponding workpiece contour line based on the discrete spot image;
[0103] S32, extracting the pixel points through which the contour line of the workpiece passes as the target pixel points;
[0104] Since the laser points projected on the target workpiece 5 by the line laser beam acquired by the visual sensor device 4 are relatively discrete, the target pixel points extracted based on this are difficult to accurately characterize the actual direction of the contour line of the target workpiece 5. Therefore, this specific implementation integrates the laser points on the target workpiece 5 in each frame image into continuous line segments (i.e., workpiece contour lines), and then extracts the target pixel points based on the workpiece contour lines, so that the final constructed three-dimensional model of the target workpiece 5 can be more accurate. Specifically, the integration of the laser points on the target workpiece 5 into the workpiece contour line can be achieved by manual operation in the discrete spot image, or by automatic linear fitting through a related algorithm using an image processing device.
[0105] S33, obtaining the three-dimensional coordinates of the laser emitting device 3 and the three-dimensional coordinates of the visual sensor device 4, and calculating the three-dimensional coordinates of the target pixel point by using triangulation method.
[0106] Triangulation is a method of measuring the distance of a target by using the angle between the target point to be measured and the known endpoints on a fixed reference line. When a side length and two observation angles are known, the target point to be measured can be calibrated as the third point on a triangle. In this specific implementation, the target pixel point is used as the target point to be measured, and the point where the laser emitting device 3 and the point where the visual sensor device 4 are located are used as two known endpoints. After the three-dimensional coordinates of the laser emitting device 3 and the visual sensor device 4 are extracted by an image processing device, the three-dimensional coordinates of the target pixel point can be obtained by triangulation.
[0107] Specifically, refer to Figures 1 to 4 , step S31 comprises:
[0108] S311, obtaining the centroid of each laser point in the discrete spot image by grayscale centroid method;
[0109] The grayscale centroid method is used to obtain the centroid of the laser point in the discrete spot image. First, each frame of the discrete spot image needs to be grayscaled. Grayscale processing is to convert the discrete spot image that is initially in color into a grayscale image. Different grayscale values in the grayscale image correspond to different light intensities. Specifically, the image processing device usually uses the RGB model (additive color mixing model) for image display. The RGB model uses red (R), green (G), and blue (B) as the three primary colors of the image. The value range of R, G, and B is 0 to 255. When R=G=B, the image presents a grayscale color. The discrete spot image is grayscaled, that is, the R, G, and B values of each pixel in the discrete spot image are adjusted to a common grayscale value according to a certain ratio. The grayscale value can be calculated by the following formula:
[0110]
[0111] After obtaining the grayscale image, the coordinates of the light intensity weight centroid can be calculated based on the grayscale image according to the distribution of grayscale values, that is, the centroid in the grayscale value distribution is used as the center of the laser point. Since the grayscale centroid method is an existing algorithm, its specific calculation process is not described in detail here.
[0112] S312, performing linear fitting on the centroid of each laser point by the least square method to obtain the contour line of the workpiece.
[0113] The least squares method is to find the best function match for the data by minimizing the sum of squares of errors. When applied to linear fitting of graphics, it is mainly reflected in finding a straight line that minimizes the sum of distances from all known points to the straight line. After obtaining the centroid coordinates of the laser point through the grayscale centroid method, the workpiece contour line can be obtained through the least squares fitting based on each centroid coordinate, so that the workpiece contour line can be more closely aligned with the real contour of the target workpiece 5, thereby improving the accuracy of the final constructed three-dimensional model of the target workpiece 5.
[0114] Specifically, refer to Figures 1 to 4 , step S2 comprises:
[0115] S21, continuously acquiring a photographic image including the target workpiece 5 through the visual sensor device 4;
[0116] S22, based on the wavelength information of the linear laser beam, a discrete spot image is extracted from the captured image through a filtering device.
[0117] The filter device is specifically an optical filter, which is used for wavelength selection. It can filter out the required wavelength from a large number of wavelengths, and light other than this wavelength will be rejected. In the specific implementation process, the image area containing the wired laser beam in the shooting picture can be retained by the filtering effect of the filter device to form a discrete spot image, while other irrelevant areas can be automatically ignored, thereby reducing the system's computing intensity, saving power consumption, and improving the system's computing efficiency.
[0118] Specifically, refer to Figures 1 to 4 , after step S21, comprising:
[0119] S211 , performing fill light operation on the captured image through the light source compensation device 6 ; wherein the light source compensation device 6 is installed on the fixed bracket 2 .
[0120] The light source compensation device 6 is used to increase the brightness of the shooting picture to obtain a clearer image. The light source compensation device 6 may specifically include various light emitting devices.
[0121] Further, refer to Figures 1 to 4 In an exemplary embodiment, step S4 includes:
[0122] S41, obtaining the moving distance of the target workpiece 5 on the conveying device 1 in each frame;
[0123] S42, adjusting the three-dimensional coordinates of the target pixel point based on the moving distance of each frame to obtain the color coordinates of the target pixel point;
[0124] S43, acquiring color information corresponding to the color coordinates through the visual sensing device 4 as target color information;
[0125] Step S5 includes:
[0126] S51, combining the target color information with the three-dimensional coordinates of the corresponding target pixel point.
[0127] When the line laser beam emitted by the laser emitting device 3 is projected onto the target workpiece 5, since the line laser beam itself has a color (usually red), the color of the area on the surface of the target workpiece 5 covered by the line laser beam will change accordingly. At this time, the color information of the target pixel point acquired by the visual sensor device 4 will be distorted (it cannot represent the true color of the target workpiece 5 in this area). Based on this, one solution is to wait until the target pixel point leaves the line laser beam projection area as the target workpiece 5 moves (specifically, it can be after the target workpiece 5 continues to move a frame of distance), then acquire the color information of the target pixel point, and combine the acquired color information with the previously acquired three-dimensional coordinates, so that a three-dimensional color point cloud model with accurate color information can be obtained.
[0128] Specifically, Figure 4 and Figure 5 As shown, the y-axis is used as the moving direction of the target workpiece 5 and a coordinate system is established. At this time, the three-dimensional coordinate set of m target pixel points in the n-th frame discrete spot image can be recorded as:
[0129]
[0130] The three-dimensional coordinate set of m target pixel points in the discrete spot image of the n+1th frame is:
[0131]
[0132] Where d is the moving distance of the target workpiece 5 per frame, then The three-dimensional coordinates of The color coordinates of the corresponding target pixel in the image are obtained by the visual sensor device 4. The color information of The real color information of the target pixel in The three-dimensional coordinates of the target pixel points in the image are combined to obtain the nth frame three-dimensional color point cloud image with accurate color information. The discrete spot images of other frames are processed in the same way, and finally a three-dimensional color point cloud model of the target workpiece 5 with accurate color information can be obtained.
[0133] Specifically, refer to Figures 1 to 4 , before step S1, comprising:
[0134] S01, conveying the detection piece through the fixed bracket 2 by the conveying device 1; wherein the detection piece has a detection mark perpendicular to the conveying direction of the conveying device 1;
[0135] S02, intercepting a first captured image and a second captured image containing the detection mark by the visual sensor device 4; wherein the first captured image and the second captured image are separated by one frame;
[0136] S03 , calculating the straight-line distance between the detection mark on the first captured image and the detection mark on the second captured image as the moving distance per frame of the target workpiece 5 on the conveying device 1 .
[0137] In this specific implementation, the detection member may be a cardboard, and the detection mark may be a straight line segment drawn or pasted on the cardboard. Figure 5 As shown, before constructing a three-dimensional color point cloud model of the target workpiece 5, the detection piece is placed on the conveying device 1. Driven by the conveying device 1, the detection mark in the second captured image captured by the visual sensing device 4 moves a certain distance relative to the detection mark on the first captured image. By measuring this distance, the moving distance of each frame of the target workpiece 5 can be conveniently obtained.
[0138] It should be noted that, in practical applications, the detection member and the detection mark are not limited to the above forms, and they only need to serve as a marking form to facilitate the detection of the moving distance of each frame.
[0139] Correspondingly, refer to Figure 4 and Figure 6 The embodiment of the present invention further provides a three-dimensional color point cloud construction device, the three-dimensional color point cloud construction device comprising:
[0140] The driving module 10 is used to control the conveying device 1 to convey the target workpiece 5 through the fixed bracket 2, control the laser emitting device 3 to emit a line laser beam to the target workpiece 5, and control the visual sensor device 4 to continuously acquire a discrete spot image formed by the line laser beam projected on the target workpiece 5;
[0141] An acquisition module 20, used to acquire the three-dimensional coordinates of the target pixel corresponding to the discrete spot image, and to acquire the color information of the target pixel through the visual sensor device 4;
[0142] The construction module 30 is used to match the color information with the three-dimensional coordinates of the target pixel points to obtain a three-dimensional color point cloud model of the target workpiece 5 .
[0143] The three-dimensional color point cloud construction device of the present embodiment is used to implement the aforementioned three-dimensional color point cloud construction method. Therefore, the specific implementation method of the three-dimensional color point cloud construction device can be seen in the embodiment part of the three-dimensional color point cloud construction method in the previous text. For example, the driving module 10 is used to implement steps S1 and S2 in the above-mentioned three-dimensional color point cloud construction method, the acquisition module 20 is used to implement steps S3 and S4 in the above-mentioned three-dimensional color point cloud construction method, and the construction module 30 is used to implement step S5 in the above-mentioned three-dimensional color point cloud construction method. Therefore, its specific implementation method can refer to the description of the above-mentioned embodiment and will not be repeated here.
[0144] Correspondingly, an embodiment of the present invention also provides a computer-readable storage medium, which stores a three-dimensional color point cloud construction program. When the three-dimensional color point cloud construction program is executed by a processor, the steps of the three-dimensional color point cloud construction method in any of the above embodiments are implemented.
[0145] In this embodiment, the above-mentioned computer-readable storage medium may include but is not limited to any type of disk (including floppy disks, hard disks, optical disks, CD-ROMs, and magneto-optical disks), ROM (Read-Only Memory), RAM (Random Access Memory), EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), flash memory, magnetic cards or optical cards, and other media that can store program codes.
[0146] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0147] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0148] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0149] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A three-dimensional color point cloud construction method, applied to processing equipment, characterized in that: The processing equipment includes a conveying device, a fixed support, a laser emitting device and a visual sensor device, wherein the laser emitting device and the visual sensor device are installed on the fixed support, the conveying device is used to convey the target workpiece, and the fixed support is located on the conveying path of the conveying device; The three-dimensional color point cloud construction method comprises the following steps: The detection member is conveyed through the fixed bracket by the conveying device; wherein the detection member has a detection mark perpendicular to the conveying direction of the conveying device; Intercepting a first captured image and a second captured image containing the detection mark by the visual sensing device; wherein the first captured image and the second captured image are separated by one frame; Calculating a straight-line distance between the detection mark on the first captured image and the detection mark on the second captured image as a moving distance per frame of the target workpiece on the conveying device; The target workpiece is conveyed through the fixed support by the conveying device, and a linear laser beam is emitted to the target workpiece by the laser emitting device; In the process of the line laser beam scanning the target workpiece, the visual sensor device continuously acquires a discrete light spot image formed by the line laser beam projected on the target workpiece; Obtaining the three-dimensional coordinates of the target pixel points corresponding to the discrete spot image; Acquiring the color information of the target pixel through the visual sensing device; Matching the color information with the three-dimensional coordinates of the target pixel point to obtain a three-dimensional color point cloud model of the target workpiece; The step of acquiring the color information of the target pixel point by the visual sensing device comprises: Acquire the moving distance of the target workpiece on the conveying device in each frame; Based on the moving distance per frame, adjusting the three-dimensional coordinates of the target pixel point to obtain the color coordinates of the target pixel point; Acquiring color information corresponding to the color coordinates through the visual sensing device as target color information; The step of matching the color information with the three-dimensional coordinates of the target pixel point comprises: The target color information is combined with the three-dimensional coordinates of the corresponding target pixel points.
2. The three-dimensional color point cloud construction method according to claim 1, characterized in that: The step of obtaining the three-dimensional coordinates of the target pixel points corresponding to the discrete spot image includes: Based on the discrete spot image, generating a corresponding workpiece contour line; Extracting the pixel points through which the workpiece contour line passes as the target pixel points; The three-dimensional coordinates of the laser emitting device and the three-dimensional coordinates of the visual sensing device are acquired, and the three-dimensional coordinates of the target pixel point are calculated by using triangulation method.
3. The method for constructing a three-dimensional color point cloud according to claim 2, characterized in that: The step of generating a corresponding workpiece contour line based on the discrete spot image comprises: Obtaining the centroid of each laser point in the discrete spot image by using the grayscale centroid method; The centroid of each laser point is linearly fitted by the least square method to obtain the workpiece contour line.
4. The three-dimensional color point cloud construction method according to claim 1, characterized in that: The step of continuously acquiring the discrete spot image formed by the linear laser beam projected on the target workpiece through the visual sensing device comprises: Continuously acquiring a photographic image containing the target workpiece through the visual sensing device; Based on the wavelength information of the linear laser beam, the discrete spot image is extracted from the captured image through a filtering device.
5. The method for constructing a three-dimensional color point cloud according to claim 4, characterized in that: The processing equipment further comprises a light source compensation device, and the light source compensation device is mounted on the fixed bracket; After the step of continuously acquiring the photographic image containing the target workpiece by the visual sensing device, the method further comprises: A fill light operation is performed on the captured image through the light source compensation device.
6. A three-dimensional color point cloud construction system, characterized in that: The three-dimensional color point cloud construction system includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the steps of the three-dimensional color point cloud construction method as described in any one of claims 1 to 5 are implemented.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a three-dimensional color point cloud construction program, and when the three-dimensional color point cloud construction program is executed by the processor, the steps of the three-dimensional color point cloud construction method according to any one of claims 1 to 5 are implemented.
