Whole vehicle log diameter grade measurement and code spraying method, device and system
By acquiring 3D point cloud data of log stacks using a three-axis moving truss and scanning camera, calculating log diameter, and planning inkjet printing paths, automatic measurement and inkjet printing of log diameter were achieved, improving efficiency and safety.
Patent Information
- Application Number
- CN202510873322.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-26
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2045-06-26
AI Technical Summary
The current process of measuring and marking log diameters requires manual processing, which is inefficient and poses safety hazards.
By controlling a three-axis moving truss to drive a scanning camera along the length of the log, a three-dimensional point cloud of the log stack outline is obtained, the log diameter is calculated, and a coding path is planned based on the three-dimensional point cloud data. The three-axis moving truss then drives the coding device to perform automatic measurement and coding.
It enables automatic measurement and coding of log diameter parameters, improving the level of automation and digitization, and solving the problems of low efficiency and safety hazards of manual measurement.
Smart Images

Figure CN120702360B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of log measurement technology, specifically to a method, equipment, and system for measuring and marking the diameter of logs in a vehicle. Background Technology
[0002] At docks / logging plants, logging inspection relies heavily on manual measurement of each log. Traditional inspection methods use chalk to mark the ends of logs, which can lead to data loss during long-term storage. Repetitive inspections are required before shipment, resulting in a heavy workload, long processing times, and inaccurate data. Furthermore, the extensive manual involvement on-site frequently leads to serious safety accidents.
[0003] Therefore, there is an urgent need for a new method for measuring and coding the diameter of logs in a vehicle, in order to achieve intelligent processing of log diameter measurement and coding, and reduce the workload of workers. Summary of the Invention
[0004] In view of this, the present invention provides a method, equipment and system for measuring and coding the diameter of logs in a vehicle, so as to solve the technical problem that the existing log diameter measurement and coding process requires manual processing and is inefficient.
[0005] In a first aspect, the present invention provides a method for measuring and coding the diameter of logs in a vehicle, comprising: controlling a three-axis moving truss to drive a scanning camera along the length of the log and controlling the scanning camera to take pictures, thereby acquiring a three-dimensional point cloud of the log stack outline edge; determining the horizontal downward position coordinates and initial downward depth of the camera based on the three-dimensional point cloud of the log stack outline edge; controlling the three-axis moving truss to move the camera based on the horizontal downward position coordinates and initial downward depth, and controlling the camera to take pictures, thereby acquiring the outline three-dimensional point cloud data of the front end face and rear end face of the log stack; calculating the log diameter based on the outline three-dimensional point cloud data; planning a coding path based on the log diameter and the center position of the log end face determined based on the outline three-dimensional point cloud data; and controlling the three-axis moving truss to move the coding device based on the coding path and controlling the coding device to perform coding.
[0006] This invention controls a three-axis moving truss to move a scanning camera along the length of the log and take pictures, acquiring a three-dimensional point cloud of the log stack's outline edge. Based on the three-dimensional point cloud of the log stack's outline edge, the horizontal downward position coordinates and initial downward depth of the camera are determined. Based on the horizontal downward position coordinates and the initial downward depth, the three-axis moving truss is controlled to move the camera and take pictures, obtaining the outline three-dimensional point cloud data of the front and rear faces of the log stack. The log diameter is calculated based on the outline three-dimensional point cloud data. Based on the log diameter and the center position of the log end face determined based on the outline three-dimensional point cloud data, a coding path is planned. Based on the coding path, the three-axis moving truss is controlled to move a coding device and control the coding device to perform coding. This enables automatic measurement and coding of log diameter parameters, improving the automation and digitization level of log measurement, effectively solving the objective problems of current manual measurement, addressing the pain points of traditional log measurement, and reducing the potential safety risks of traditional measurement.
[0007] In one optional implementation, determining the horizontal downward position coordinates and initial downward depth of the camera based on the three-dimensional point cloud of the log stack outline edge includes: calculating the number of log stacks and the horizontal coordinate position of the end face and the stack height corresponding to each log stack based on the three-dimensional point cloud of the log stack outline edge; determining the horizontal downward position coordinates of the camera based on the horizontal coordinate position of the end face; and calculating the initial downward depth of the camera based on the stack height and a pre-set platform depth.
[0008] In this method, by calculating the number of stacks of logs, the horizontal coordinate position of the end face of each stack, and the stack height, the movement position of the camera can be determined, thereby enabling the acquisition of images of the end face of the logs.
[0009] In one optional implementation, calculating the initial depth of the camera based on the stacking height and the preset platform depth includes: subtracting the preset platform depth from the stacking height to obtain the initial depth of the camera.
[0010] In this method, the initial depth of the camera is obtained by subtracting the pre-set depth of the pallet from the stacking height. The method is simple, easy to implement, and can quickly and accurately determine the initial depth of the camera, thus ensuring the acquisition of clear and accurate images of the log end face and improving the accuracy of log diameter measurement.
[0011] In one optional implementation, after determining the horizontal downward position coordinates and initial downward depth of the camera based on the three-dimensional point cloud of the log stack outline edge, the method includes: calculating the number of target downward probes based on the stack height.
[0012] In this method, the number of times the target is lowered is calculated based on the stacking height. This allows for a reasonable arrangement of the number of times the camera is lowered according to the actual height of the log stack. This ensures that a sufficient amount of image data can be obtained to accurately calculate the log diameter, while also avoiding the camera from falling too low and hitting the vehicle platform.
[0013] In one optional implementation, the camera is an array-type binocular vision camera. Correspondingly, the step of controlling the three-axis moving truss to move the camera and take pictures based on the horizontal downward position coordinates and the initial downward depth, to obtain the contour 3D point cloud data of the front and rear faces of the log stack, includes: controlling the three-axis moving truss to move the camera along the X and Y axes to the horizontal downward position, then downward along the Z axis to the initial downward depth and controlling the camera to take pictures; controlling the three-axis moving truss to descend the camera sequentially along the Z axis to a preset depth until the target number of downward descents is reached, and controlling the camera... After each descent, an image is taken; the left and right eye-facing images captured by the camera are acquired, and a deep learning-based binocular stereo matching algorithm is used to calculate the sub-3D point clouds of the front and rear faces of the logs in the log stack. Based on a feature point matching algorithm, the pose relationship between the array cameras in the camera is calculated, and the sub-3D point clouds are stitched together into a whole point cloud according to the pose relationship. Based on a target segmentation algorithm, the left eye-facing image of the camera is segmented to obtain the log end face contour, and the coordinates of the log end face contour are projected onto the whole point cloud to obtain the 3D point cloud data of the log front and rear face contours of the log stack.
[0014] In this approach, a deep learning-based binocular stereo matching algorithm is used to calculate the left and right eye end face images, and a feature point matching algorithm is used to stitch the sub-3D point cloud. This improves the accuracy and reliability of image processing and point cloud stitching, thereby obtaining the outline 3D point cloud data of the log stack more accurately, and thus improving the accuracy of log diameter calculation.
[0015] In one optional implementation, the step of calculating the log diameter based on the contour 3D point cloud data includes: calculating the major axis diameter and minor axis diameter of each log on the front and rear ends of the log based on the contour 3D point cloud data; calculating the average value of the major axis diameter and the minor axis diameter to obtain the average diameter of each log on the front and rear ends of the log; determining the matching pair of the front and rear ends of the log based on the 3D positional relationship of the contour 3D point cloud data of the front and rear ends of the log; and rounding the average diameter of the end face with the smaller average diameter in the matching pair according to a 2cm rounding rule to obtain the log diameter.
[0016] This method improves the accuracy and comprehensiveness of log diameter calculation, and by using the average diameter of the end face with the smaller average diameter in the matching pair as the log diameter, it is more in line with log measurement standards.
[0017] In one optional implementation, the major axis diameter and minor axis diameter of each log in the front and rear faces of the log are calculated based on the contour 3D point cloud data, including: extracting the end face contour of each log in the front and rear faces of the log based on the contour 3D point cloud data; determining the center point of the end face contour; starting from a straight line passing through the center point, rotating the straight line counterclockwise or clockwise by a preset angle until it is rotated 180 degrees, wherein the preset angle is 2 to 5 degrees; calculating the distance between the two intersection points of the straight line and the end face contour after each preset angle rotation; determining the shortest distance between the two intersection points, and determining the minor axis diameter based on the shortest distance; drawing a perpendicular line based on the shortest distance; and determining the major axis diameter based on the distance between the perpendicular line and the two intersection points of the end face contour.
[0018] In this method, the major and minor axis diameters of the end face profile can be accurately determined by calculating the distance between the intersection points by rotating a straight line.
[0019] In one optional implementation, before controlling the three-axis moving truss to drive the scanning camera along the length of the log and controlling the scanning camera to take pictures to obtain the three-dimensional point cloud of the log stack outline edge, the method includes: identifying whether the vehicle currently traveling to the detection area of the three-axis moving truss is a log transport vehicle; if the vehicle is not a log transport vehicle, then the vehicle is allowed to pass; if the vehicle is a log transport vehicle, then the method proceeds to the step of controlling the three-axis moving truss to drive the scanning camera along the length of the log and controlling the scanning camera to take pictures to obtain the three-dimensional point cloud of the log stack outline edge.
[0020] This method can identify whether a vehicle currently traveling to the three-axis moving truss detection area is a log transport vehicle, allowing non-transport vehicles to pass through, avoiding unnecessary detection and measurement of non-target vehicles, and improving the system's operating efficiency.
[0021] In a second aspect, the present invention provides a computer device, comprising: a memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the whole vehicle log diameter measurement and inkjet printing method of the first aspect of the present invention.
[0022] Thirdly, the present invention provides a whole vehicle log diameter measurement and coding system, comprising: a frame column; a three-axis movable truss disposed above the frame column for moving a scanning camera, a photographic camera and a coding device; and a computer device as described in the second aspect of the present invention. Attached Figure Description
[0023] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0024] Figure 1 This is a flowchart illustrating the whole vehicle log diameter measurement and inkjet printing method according to an embodiment of the present invention;
[0025] Figure 2 This is a schematic diagram of the whole vehicle log diameter measurement and inkjet printing system according to an embodiment of the present invention;
[0026] Figure 3 This is a schematic diagram of the workflow of the whole vehicle log diameter measurement and inkjet printing system according to an embodiment of the present invention;
[0027] Figure 4 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention.
[0028] Explanation of reference numerals in the attached figures:
[0029] 1. X-axis truss; 2. Y-axis truss; 3. Z-axis truss; 4. Frame columns; 5. Leveling base; 6. Scanning camera; 7. Photograph camera; 8. Inkjet printer. Detailed Implementation
[0030] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0031] To address the issue of manual measurement of logs in related technologies, this invention proposes a method, equipment, and system for measuring and marking the diameter of logs in a vehicle. This effectively solves the problems of low efficiency, large errors, and high safety hazards associated with manual measurement, and is suitable for automated measurement and marking of the volume of logs in vehicles in scenarios such as ports and logistics centers.
[0032] According to an embodiment of the present invention, a method for measuring and marking the diameter of logs in a vehicle is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0033] This embodiment provides a method for measuring and marking the diameter of logs in a vehicle. It can be used with computer equipment, such as a smart terminal with a programmable logic controller, an industrial computer, or a tablet computer. This method is based on the whole-vehicle log diameter measurement and marking system of this invention, combined with... Figure 1 and Figure 2 As shown, the method includes the following steps:
[0034] Step S101: Control the three-axis moving truss to drive the scanning camera 6 to move along the length of the log and control the scanning camera 6 to take pictures to obtain the three-dimensional point cloud of the log stack outline edge.
[0035] Specifically, the three-axis movable truss is set above the frame column 4. During the inspection, the vehicle carrying logs drives to the bottom of the frame column 4. The bottom of the frame column 4 is equipped with a leveling base 5.
[0036] The three-axis moving truss includes X-axis truss 1, Y-axis truss 2, and Z-axis truss 3, respectively, arranged along the X-axis, Y-axis, and Z-axis directions, with the X-axis parallel to the length of the log. Each truss is made of high-strength structural steel and integrates a servo drive system, a sliding rail running unit, and anti-collision protection devices. By adding laser rangefinders and miniature cameras to the truss end mechanisms, combined with OpenCV algorithms, obstacles are identified to prevent hard collisions with the truss.
[0037] There are two X-axis trusses 1, with an effective travel of approximately 15.3 meters. There are four Y-axis trusses 2, with two Y-axis trusses 2 positioned before and after the X-axis trusses 1, each with an effective travel of approximately 4.4 meters. Each Y-axis truss 2 has at least one Z-axis truss 3, with an effective travel of approximately 3.2 meters and a load capacity ≥200kg. It uses helical gear and ball screw transmission to eliminate backlash. The three-axis moving trusses are fixed to the frame columns 4, and the adjustable base ensures the equipment installation remains at a constant level, guaranteeing stable operation. The trusses are constructed from high-strength steel welded together, with CNC-machined slide rail mounting slots.
[0038] Two sets of Y-axis trusses 2 are set at the rear, which are connected to two sets of X-axis trusses 1 on the large frame by sliders. The trusses are moved on high-precision slide rails by servo motors. Two sets of Z-axis trusses 3 are fixed on the two sets of Y-axis trusses 2 respectively. One set of Z-axis trusses 3 has a scanning camera 6 and a photographing camera 7 fixed at the end. The Z-axis trusses 3 are driven by servo motors to move from the rear of the vehicle to move the scanning camera 6 to scan the outline of the log. The Z-axis trusses 3 are driven to move vertically to move the photographing camera 7 to take pictures of the end face of the log. The other set of Z-axis trusses 3 has a coding unit fixed at the end. The coding unit is driven by Y-axis and Z-axis servo motors to reach the end face of the log. The coding device 8 fine-tunes the position of the nozzle to realize the end face printing operation.
[0039] The structure of the two sets of Y-axis trusses 2 and Z-axis trusses 3 at the front end is the same as that of the two sets of Y-axis trusses 2 and Z-axis trusses 3 at the rear end. Anti-collision protection is provided between the four sets of Y-axis trusses 2, which serves as a safety protection mechanism during equipment operation.
[0040] In one example, a servo motor drives a motion mechanism to move the Y-axis truss 2 rapidly across the X-axis truss 1 at a speed of up to 1 m / s, with a repeatability accuracy of ±0.5 mm. A servo motor also drives the Z-axis truss 3 to move vertically across the Y-axis truss 2 at a speed of 0.8 m / s, with a repeatability accuracy of ±0.25 mm.
[0041] The computer equipment controls the movement of each truss by controlling the rotation of servo motors integrated on each truss. Specifically, when the log vehicle arrives at its designated position, the detection program is initiated. The computer equipment controls the servo motors to move the Z-axis truss 3, which is equipped with scanning cameras 6. The end scanning camera 6 starts scanning from the end of the vehicle and stops scanning at the front end of the vehicle pallet. Subsequently, the scanning camera group 6 moves to the middle position of the X-axis truss 1, and the scanning calculation information is synchronously transmitted to the computer equipment.
[0042] Scanning camera 6 employs a binocular vision camera, which performs real-time target tracking of the log outline based on the captured video. When the boundary of the log stack's end face is located directly below the camera, the truss movement stops and the binocular vision camera is controlled to take a picture, obtaining a 3D point cloud of the log stack's outline edge through a binocular vision algorithm.
[0043] Step S102: Determine the horizontal downward position coordinates and initial downward depth of the camera 7 based on the three-dimensional point cloud of the log stack outline edge.
[0044] Specifically, the 3D point cloud of the log stack outline includes the coordinate and shape information of the log outline. Based on this, the size and position information of the log stack in the 3D point cloud of the log stack outline can be calculated. According to the size and position information of the log stack, the horizontal downward position coordinates and initial downward depth of the camera 7 can be determined, so that the camera 7 can descend to a suitable position to capture the log end face image. The obtained log end face image includes the bottom edge or the top edge of the stack.
[0045] By employing a binocular vision camera as the scanning camera 6 to scan and obtain the 3D point cloud of the log stack outline edge, the horizontal downward probe position coordinates and initial downward probe depth of the camera 7 are determined. Compared with traditional 3D modeling calculation methods, this method has the advantages of lower computational load and faster scanning speed. Furthermore, in related solutions, the use of a laser 3D scanning method discards the RGB information of the target. In practical applications, this can easily lead to misidentification of the truck cab, truck bed, and other debris as part of the timber, resulting in calculation errors. The solution in this embodiment of the invention considers the RGB information of the timber simultaneously, resulting in better fault tolerance, higher calculation accuracy, and faster scanning speed, reducing the waiting time during the scanning process.
[0046] Step S103: Based on the horizontal downward position coordinates and the initial downward depth, control the three-axis moving truss to drive the camera 7 to move and control the camera 7 to take pictures, thereby obtaining the three-dimensional point cloud data of the outline of the front and rear ends of the log stack.
[0047] Specifically, the X-axis servo motor is controlled to drive the front and rear cameras 7 to the corresponding end face downward position according to the horizontal downward position coordinates. After reaching the corresponding position, the front and rear Z-axis trusses 3 start to drive the front and rear cameras 7 to start downward to take pictures under the control of the computer equipment. Based on the images taken by the front and rear cameras 7, the contour three-dimensional point cloud data of the front and rear ends of the log are generated respectively.
[0048] Step S104: Calculate the log diameter based on the three-dimensional point cloud data of the contour.
[0049] Specifically, the three-dimensional point cloud data of the end face contour includes the coordinate information of the contour of each log end face. Therefore, the diameter of the log front face can be calculated based on the three-dimensional point cloud data of the log front face contour, and the diameter of the log rear face can be calculated based on the three-dimensional point cloud data of the log rear face contour. The log diameter is calculated based on the log front face diameter and the log rear face diameter. Preferably, the size of the log rear face diameter and the log front face diameter can be compared, and the smaller value can be taken as the log diameter.
[0050] Step S105: Plan the inkjet printing path based on the log diameter and the center position of the log end face determined based on the three-dimensional point cloud data of the profile. Based on the inkjet printing path, control the three-axis moving truss to drive the inkjet printing device 8 to move and control the inkjet printing device 8 to print.
[0051] Specifically, camera 7 scans and images the end face of the log, stitches the images acquired by each camera into a complete image, segments the outline of the log end face using a deep learning algorithm, and obtains the center position of each log in three-dimensional space by analyzing the depth information of the log end face. The center position P of the log end face is then obtained. w and log diameter D w Then, firstly, based on the center position P of the log end face. w and log diameter D w Calculate the boundary profile of the log stack and the average center-to-center spacing of the end faces of each log. Among them, D sum It is the sum of the diameters of all the end faces of the logs, N w The log stack is modeled as a dynamic, hierarchical network based on its boundary contour and the average center-to-center spacing of the log ends. The number of rows and columns in the stack is then calculated. The row and column of each log are determined by its position and used as its index. A path planning algorithm iterates through the log nodes in the dynamic hierarchical network model in a spiral fashion, generating a coding sequence list and calculating the optimal coding path. Finally, collision avoidance constraints are applied to the optimal coding path (Path) and the log boundary contour (Conta) to optimize and obtain a safe coding path (Path). * By incorporating the physical constraints of log stacking, this paper optimizes the Traveling Salesman Problem (TSP) for log inkjet printing. Compared to the traditional TSP, it utilizes various methods including brute-force enumeration, dynamic programming, branch and bound, and greedy algorithms, with time complexities of O((n-1)!) and O(n...) respectively. 2 2 n O(n!), O(n) 2 The solution time complexity of this invention can reach O(nlog(n)), which is much lower than that of traditional methods. It significantly reduces the computation time and the time to find the optimal path, thereby improving the efficiency of log measuring and coding.
[0052] Furthermore, adjustable control telescopic structures and coding devices 8 are installed at the ends of the two sets of Z-axis trusses 3 of the three-axis moving truss. A position sensor provides real-time feedback on the safe printing distance, ensuring the coding device 8 remains at a safe threshold distance. The adjustable control telescopic structure keeps the printhead position at a safe threshold of 50mm. The dot matrix printhead prints onto the log end face one by one using an algorithm path, with repeatability controlled within 0.5mm. The coding machine is suitable for environments with temperatures ranging from 0℃ to 45℃ and can print clearly even on uneven or damp log end faces, with font sizes ranging from 50mm to 80mm. After printing is complete, the system verifies the printing results and, if correct, provides a voice prompt for the transport vehicle to leave.
[0053] The log diameter range applicable to the detection of this invention is 80mm-1200mm, and the length specifications include 4 meters, 6 meters and 12 meters, etc. The vehicle transport stacking is 1 or 2 stacks, and the gap between 2 stacks is greater than 800mm. If the stacking gap is too small, manual intervention is required.
[0054] This invention, through a three-axis moving truss, drives a scanning camera 6 to move along the length of the log and takes pictures, acquiring a three-dimensional point cloud of the log stack outline edge. Based on the three-dimensional point cloud of the log stack outline edge, the horizontal downward position coordinates and initial downward depth of a camera 7 are determined. Based on the horizontal downward position coordinates and the initial downward depth, the three-axis moving truss is controlled to move the camera 7 and take pictures, obtaining the outline three-dimensional point cloud data of the front and rear faces of the log stack. The log diameter is calculated based on the outline three-dimensional point cloud data. Based on the log diameter and the center position of the log end face determined based on the outline three-dimensional point cloud data, a coding path is planned. Based on the coding path, the three-axis moving truss is controlled to move a coding device 8 and the coding device 8 is controlled to perform coding. This enables automatic measurement and coding of log diameter parameters, improves the automation and digitization level of log measurement, effectively solves the objective problems of current manual measurement, addresses the pain points of traditional log measurement, and reduces the potential safety risks of traditional measurement.
[0055] In some embodiments, step S102, determining the horizontal downward position coordinates and initial downward depth of the camera 7 based on the three-dimensional point cloud of the log stack outline edge, includes:
[0056] Step S1021: Compute the number of log stacks and the horizontal coordinate position of the end face and the stack height of each log stack based on the three-dimensional point calculation of the edge of the log stack outline.
[0057] Specifically, there may be more than one stack of logs on each vehicle. Therefore, the number of log stacks is first identified. For example, when the distance between two adjacent logs is greater than 500mm, it is determined that these two logs belong to two different stacks, and the number of stacks is 2.
[0058] Based on the position coordinates in the 3D point cloud of the log stack outline edge, the horizontal coordinates of the end face and the stack height of each stack are further calculated.
[0059] Step S1022: Determine the horizontal downward position coordinates of the camera 7 based on the horizontal coordinate position of the end face.
[0060] Specifically, the horizontal coordinate position of the end face is used as a reference, and the distance between the camera 7 and the end face is determined by adding the field of view of the camera 7, thus obtaining the coordinates of the horizontal downward probe position.
[0061] Step S1023: Calculate the initial depth of the camera 7 based on the stacking height and the preset vehicle platform depth.
[0062] Specifically, the initial depth of the camera 7 is obtained by subtracting the pre-set depth of the pallet from the stacking height. This method of obtaining the initial depth of the camera 7 by subtracting the pre-set depth of the pallet from the stacking height is simple, easy to implement, and can quickly and accurately determine the initial depth of the camera, ensuring the acquisition of clear and accurate images of the log end faces, thereby improving the accuracy of log diameter measurement.
[0063] In this embodiment of the invention, by calculating the number of stacks of logs, the horizontal coordinate position of the end face of each stack, and the stack height, the moving position of the camera 7 can be determined, thereby achieving the acquisition of log end face images.
[0064] Further, in step S102, after determining the horizontal downward position coordinates and initial downward depth of the camera 7 based on the three-dimensional point cloud of the log stack outline edge, the following steps are included:
[0065] Step S1024: Calculate the number of times the target will be lowered based on the stacking height.
[0066] Specifically, a preset depth is set for each downward movement, and the target number of downward movements is obtained by dividing the stack height by the preset depth.
[0067] In one example, the target is lowered 4 times, with a preset depth of 400mm-600mm for each lowering. The target is lowered 4 times to take pictures. After the picture detection is completed, the Z-axis truss 3 is quickly lifted and moved to the middle position of the stack.
[0068] The embodiments of the present invention can reasonably arrange the number of times the camera 7 descends according to the actual height of the log stack, which not only ensures that a sufficient amount of image data can be obtained to accurately calculate the log diameter, but also avoids the descent height being too low and hitting the vehicle platform.
[0069] In some embodiments, the camera 7 is an array-type binocular vision camera. Correspondingly, step S103, which controls the three-axis moving truss to move the camera 7 based on the horizontal downward position coordinates and the initial downward depth, and controls the camera 7 to take pictures to obtain the contour three-dimensional point cloud data of the front and rear faces of the log stack, includes:
[0070] Step S1031: Control the three-axis moving truss to move the camera 7 along the X-axis and Y-axis to the horizontal downward position, then move it down along the Z-axis to the initial downward depth and control the camera 7 to take a picture.
[0071] Step S1032: Control the three-axis moving truss to drive the camera 7 to descend sequentially along the Z-axis to a preset depth until the number of descents reaches the target number of descents, and control the camera 7 to take a picture after each descent;
[0072] Step S1033: Obtain the left eye view image and the right eye view image captured by the camera 7. Calculate the left eye view image and the right eye view image using a deep learning-based binocular stereo matching algorithm to obtain the sub-3D point cloud of the front and rear ends of the log stack.
[0073] Step S1034: Based on the feature point matching algorithm, calculate and obtain the pose relationship between the array cameras in the camera 7, and stitch several sub-3D point clouds into an overall point cloud according to the pose relationship.
[0074] Step S1035: The left eye-side image of the camera 7 is segmented based on the target segmentation algorithm to obtain the log end face contour, and the coordinates of the log end face contour are projected into the overall point cloud to obtain the three-dimensional point cloud data of the log front and rear end face contours of the log stack.
[0075] Specifically, the array-type binocular vision camera is set along the Y-axis. Using an array-type binocular vision camera can acquire images from multiple cameras at once, improving shooting efficiency.
[0076] By controlling the number of dips and the depth of dips, it is ensured that the images taken during multiple dips, when stitched together, include the bottom edge or top edge of the stack.
[0077] After capturing images of the left and right end faces of the log using an array of binocular vision cameras, a deep learning-based binocular stereo matching algorithm is used to obtain sub-3D point clouds of the log end faces. Simultaneously, a feature point matching algorithm is used to calculate the pose relationships between the array of cameras, thus stitching together the aforementioned sub-3D point clouds into a unified point cloud. Furthermore, using the RGB image acquired by the left eye of the binocular camera, an accurate log end face contour is obtained based on a target segmentation algorithm. The coordinates of the log end face contour are then projected onto the unified point cloud to obtain the 3D point cloud data of the log end face contour.
[0078] Based on the 3D point cloud data of the log end face contour, the log diameter and the center position coordinates of the log end face are further calculated.
[0079] In this approach, a deep learning-based binocular stereo matching algorithm calculates the left and right end-face images, and a feature point matching algorithm stitches together the sub-3D point clouds to obtain the overall point cloud. The log end-face contour is then projected onto a color image to obtain the contour 3D point cloud data. Compared to using a surface grating structured light camera to acquire 3D coordinates, this method, employing an array-type binocular vision camera, offers lower equipment costs and more controllable technology. Furthermore, surface grating structured light camera technology faces challenges in practice, including mutual interference from multiple camera arrays and multipath interference (especially near the vehicle floor), resulting in slower imaging speeds and weaker anti-interference capabilities. This invention employs an advanced depth model-based binocular depth recovery algorithm, achieving accuracy comparable to structured light cameras while offering faster imaging speeds, stronger anti-interference capabilities, and more controllable algorithm performance.
[0080] In some embodiments, step S104, calculating the log diameter based on the contour 3D point cloud data, includes:
[0081] Step S1041: Calculate the major axis diameter and minor axis diameter of each log in the front end face and rear end face of the log based on the three-dimensional point cloud data of the contour.
[0082] Step S1041 includes:
[0083] Step a1: Extract the end face contours of each log in the front and rear face of the log based on the contour 3D point cloud data.
[0084] Step a2: Determine the center point of the end face contour. Starting from the straight line passing through the center point, rotate the straight line counterclockwise or clockwise by a preset angle until it is rotated 180 degrees. The preset angle is 2 to 5 degrees.
[0085] Step a3: Calculate the distance between the two intersection points of the straight line and the end face contour after each rotation of the straight line by a preset angle;
[0086] Step a4: Determine the shortest distance between the two intersection points, determine the minor axis diameter based on the shortest distance, draw a perpendicular line based on the shortest distance, and determine the major axis diameter based on the distance between the two intersection points of the perpendicular line and the end face profile.
[0087] The preset angle is between 2 and 5 degrees. This small reference allows for a more accurate determination of the minor axis diameter. By rotating the straight line to calculate the distance between the intersection points, the major and minor axis diameters of the end face profile can be accurately determined.
[0088] For example, the straight line passing through the center point is initially in a horizontal position with a preset angle of 3 degrees. That is, the straight line is rotated by 3 degrees each time, and the distance between the two intersection points of the straight line and the end face contour is calculated to obtain the diameter in the corresponding direction. After rotating 180 degrees, the diameters in each direction are obtained. Finally, the minimum value is selected as the minor axis diameter, and the vertical line of the minor axis is taken as the major axis direction, and the vertical line is taken as the vertical major diameter.
[0089] Step S1042: Calculate the average value of the major axis diameter and the minor axis diameter to obtain the average diameter of each log at the front end face and the rear end face of the log.
[0090] The average diameter is calculated by taking the average of the short and long diameters and then rounding it according to the rules. This method conforms to the international standard for calculating the diameter of logs and has high applicability.
[0091] Step S1043: Determine the matching pair of the front and rear faces of the log based on the three-dimensional positional relationship between the three-dimensional point cloud data of the front face and the rear face of the log.
[0092] The contours of the same log in the three-dimensional point cloud data of the front and rear faces are relative. Therefore, it is possible to determine whether the contours in the three-dimensional point cloud data of the front and rear faces are the same log based on the three-dimensional position of the log contour. The contours of the same log in the three-dimensional point cloud data of the front and rear faces are considered as a matching pair.
[0093] Step S1044: The average diameter of the end face with the smaller average diameter in the matching pair is processed according to the 2cm rounding rule to obtain the log diameter grade.
[0094] Specifically, while calculating the average diameter of the front and rear ends of the log, the matching pairs of the front and rear ends are calculated, and the end face with the smaller diameter in the same matching pair is taken as the final log end face for volume calculation. The average diameter of this end face is then processed according to the 2cm rounding rule, with 2cm as the increment unit, and any value less than 2cm is rounded up or down to obtain the final log diameter.
[0095] The embodiments of the present invention use intelligent identification of matching pairs. By taking the average diameter of the end face with the smaller average diameter in the matching pair as the log diameter grade, it is more in line with the log measurement standard. There is no need to arrange the logs by size in advance, reducing manual intervention. It has higher feasibility in actual business and the detection process is more convenient.
[0096] In some embodiments, before controlling the three-axis moving truss to drive the scanning camera 6 along the length of the log and controlling the scanning camera 6 to take pictures and obtain the three-dimensional point cloud of the log stack outline edge in step S101, the following steps are included:
[0097] Step b1: Identify whether the vehicle currently traveling to the detection area of the three-axis moving truss is a log transport vehicle.
[0098] Step b2: If the vehicle is not a log transport vehicle, it is allowed to pass. If the vehicle is a log transport vehicle, the process proceeds to the step of controlling the three-axis moving truss to drive the scanning camera 6 to move along the length of the log and controlling the scanning camera 6 to take pictures to obtain the three-dimensional point cloud of the log stack outline edge.
[0099] Specifically, when a log transport vehicle approaches the roller shutter door in front of the inspection workshop, the camera located at the entrance, such as the roller shutter door, takes a picture of the vehicle and identifies the license plate information. The license plate information is then matched against a pre-set log transport vehicle database. When the identified license plate information is found in the pre-set log transport vehicle database, the front and rear roller shutter doors open, and the vehicle enters the inspection area, triggering log detection and coding. Otherwise, the vehicle is allowed to pass.
[0100] This method can identify whether a vehicle currently traveling to the three-axis moving truss detection area is a log transport vehicle, allowing non-transport vehicles to pass through, avoiding unnecessary detection and measurement of non-target vehicles, and improving the system's operating efficiency.
[0101] In this embodiment of the invention, the detected log diameter information and the preset log transport vehicle database can be stored locally or in the cloud. Local storage uses SQLite for real-time storage, while cloud storage is synchronized to AWS S3 storage via the MQTT protocol and supports AES-256 encryption.
[0102] This invention also provides a schematic diagram of the structure of a computer device, such as... Figure 4As shown, the computer device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 4 Take a processor 10 as an example.
[0103] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.
[0104] The memory 20 stores instructions executable by at least one processor 10 to cause at least one processor 10 to perform the method shown in the above embodiments.
[0105] The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the computer device. Furthermore, the memory 20 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 20 may optionally include memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0106] The memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 20 may also include a combination of the above types of memory.
[0107] The computer device also includes an input device 30 and an output device 40. The processor 10, memory 20, input device 30, and output device 40 can be connected via a bus or other means. Figure 4 Taking the example of a connection between China and Israel via a bus.
[0108] Input device 30 can receive input numerical or character information, and generate key signal inputs related to user settings and function control of the computer device, such as a touchscreen, keypad, mouse, trackpad, touchpad, joystick, one or more mouse buttons, trackball, joystick, etc. Output device 40 may include display devices, auxiliary lighting devices (e.g., LEDs), and haptic feedback devices (e.g., vibration motors). The aforementioned display devices include, but are not limited to, liquid crystal displays, light-emitting diodes, displays, and plasma displays. In some alternative embodiments, the display device may be a touchscreen.
[0109] This invention also provides a whole vehicle log diameter measurement and coding system, including:
[0110] Frame column 4;
[0111] A three-axis movable truss is set above the frame column 4 to drive the scanning camera 6, the photographing camera 7 and the inkjet printer 8 to move.
[0112] The computer device as described in the above embodiments of the present invention.
[0113] The three-axis moving truss includes an X-axis truss 1, a Y-axis truss 2, and a Z-axis truss 3. Each truss has a slide rail and a drive mechanism. The drive mechanism can be a motor with a gear and rack to achieve linear transmission, driving the slider on the slide rail to move linearly. The X-axis truss 1 and the Y-axis truss 2 are connected by sliders, and the Y-axis truss 2 and the Z-axis truss 3 are connected by sliders. The sliders between the two trusses adopt the method of main sliders and auxiliary support sliders to provide a stable and smooth support structure for the Z-axis truss 3. Compared with the traditional Z-axis truss overall upward moving structure, it effectively reduces the overall structural frame by 3 meters.
[0114] Furthermore, the whole-vehicle log diameter measurement and coding system also includes a vehicle identification device, which includes a license plate recognition system and front and rear roller shutters. Video detection is used to determine whether a vehicle is a log transport vehicle; non-transport vehicles are not allowed to pass through the measurement equipment workshop. Parking marker blocks are set up in the detection equipment area, and transport vehicles must follow the physical marker lines.
[0115] The whole vehicle log diameter measurement and marking system also includes a data storage management module. The data storage management module can use local or cloud storage. The storage system can detect the equipment operation status in real time through the application interface, accurately detect the equipment's full life cycle status, dynamically display the measurement process of the transport vehicle, and the detection data can be connected to the production system.
[0116] like Figure 3 As shown, the overall workflow of the whole vehicle log diameter measurement and coding system of this invention is as follows:
[0117] The system identifies the vehicle as a log transport vehicle through video surveillance. Upon receiving the identification, the system initiates a detection procedure. The end-scanning camera 6, controlled by a computer, starts scanning from the end of the vehicle and stops at the front of the pallet. The camera group then moves to the middle of the X-axis truss 1, and the scan information is simultaneously transmitted to the computer. Based on this information, the computer obtains the number of log stacks, the horizontal coordinates of the end face of each stack, and the stack height. This information is used to determine the horizontal downward position coordinates of the camera 7. For each log stack, the two sets of cameras 7, controlled by the computer, move to the horizontal downward position coordinates via X-axis servo motors. Once at the designated position, the Z-axis truss 3, under computer control, begins to lower the cameras 7 to take pictures, with each downward movement being 400mm-600mm, completed in 3-4 passes. After the photo inspection is completed, the Z-axis truss 3 is quickly lifted and moved to the middle position of the stack. Simultaneously, the coding device 8 starts to move to the optimal end face printing position. After the coding of one stack is completed, the next stack is photographed and coded. After the process is completed, the camera 7 is reset.
[0118] The whole-vehicle log diameter measurement and marking system of this invention achieves fully automated operation of log end face contour recognition, diameter calculation, marking, and volume measurement through visual image acquisition and processing, deep learning algorithms, and high-precision mechanical control. The system supports log diameters from 80mm to 1200mm and lengths from 4m to 12m, with a detection error of ≤3%, marking positioning accuracy of ±0.5mm, and a single log detection and marking time of ≤3 seconds. It effectively solves the pain points of low efficiency, large errors, and high safety hazards of manual measurement and is suitable for various scenarios such as ports and logistics centers.
[0119] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and all such modifications and variations fall within the scope of protection.
Claims
1. A method for measuring and marking the diameter of logs in a vehicle, characterized in that, include: The three-axis moving truss is controlled to drive the scanning camera to move along the length of the log and to take pictures to obtain the three-dimensional point cloud of the log stack outline edge. The horizontal downward position coordinates and initial downward depth of the camera are determined based on the three-dimensional point cloud of the log stack outline edge. Based on the horizontal downward position coordinates and the initial downward depth, the three-axis moving truss is controlled to drive the camera to move and take pictures, thereby obtaining the contour three-dimensional point cloud data of the front and rear faces of the log stack. Calculate the log diameter based on the three-dimensional point cloud data of the outline; The coding path is planned based on the log diameter and the center position of the log end face determined based on the three-dimensional point cloud data of the profile. Based on the coding path, the three-axis moving truss is controlled to move the coding device and control the coding device to spray code. The step of determining the horizontal downward position coordinates and initial downward depth of the camera based on the three-dimensional point cloud of the log stack outline includes: calculating the number of log stacks and the horizontal coordinate position of the end face and the stack height corresponding to each log stack based on the three-dimensional point cloud of the log stack outline; determining the horizontal downward position coordinates of the camera based on the horizontal coordinate position of the end face; and calculating the initial downward depth of the camera based on the stack height and the pre-set platform depth. The calculation of the initial depth of the camera based on the stacking height and the preset platform depth includes: The initial depth of the camera is obtained by subtracting the pre-set depth of the vehicle platform from the stacking height. After determining the horizontal downward position coordinates and initial downward depth of the camera based on the three-dimensional point cloud of the log stack outline edge, the process includes: calculating the number of target downward probes based on the stack height; The camera is an array-type binocular vision camera. Correspondingly, the three-axis moving truss, controlled based on the horizontal downward position coordinates and the initial downward depth, moves the camera and takes pictures to obtain the three-dimensional point cloud data of the contours of the front and rear faces of the log stack, including: After controlling the three-axis moving truss to move the camera along the X-axis and Y-axis to the horizontal downward position, it moves down along the Z-axis to the initial downward depth and controls the camera to take a picture. The three-axis moving truss is controlled to drive the camera to descend sequentially along the Z-axis to a preset depth until the number of descents reaches the target number of descents, and the camera is controlled to take a picture after each descent; The left and right eye-view images captured by the camera are obtained. The left and right eye-view images are calculated using a deep learning-based binocular stereo matching algorithm to obtain the sub-3D point clouds of the front and rear ends of the log stack. Based on the feature point matching algorithm, the pose relationship between the array cameras in the camera is calculated and obtained, and the several sub-3D point clouds are stitched together into a whole point cloud according to the pose relationship. The left eye-side image of the camera is segmented based on the target segmentation algorithm to obtain the log end face contour. The coordinates of the log end face contour are then projected into the overall point cloud to obtain the three-dimensional point cloud data of the log front and rear end faces of the log stack.
2. The method for measuring and marking the diameter of logs in a vehicle according to claim 1, characterized in that, The calculation of log diameter based on the contour 3D point cloud data includes: Based on the three-dimensional point cloud data of the profile, calculate the major axis diameter and minor axis diameter of each log in the front and rear face of the log respectively; Calculate the average value of the major axis diameter and the minor axis diameter to obtain the average diameter of each log at the front end face and the rear end face of the log; The matching pair of the front and rear faces of the log is determined based on the three-dimensional positional relationship between the three-dimensional point cloud data of the front and rear faces of the log. The average diameter of the end face with the smaller average diameter in the matching pair is rounded down by 2cm to obtain the log diameter grade.
3. The method for measuring and marking the diameter of logs in a vehicle according to claim 1, characterized in that, Based on the aforementioned 3D point cloud data, the major axis diameter and minor axis diameter of each log in the front and rear face of the log are calculated, including: Based on the three-dimensional point cloud data of the outline, extract the end face contours of each log in the front and rear face of the log. Determine the center point of the end face contour, and starting from the straight line passing through the center point, rotate the straight line counterclockwise or clockwise by a preset angle until it is rotated 180 degrees, wherein the preset angle is 2 degrees to 5 degrees. Calculate the distance between the two intersection points of the straight line and the end face contour after each rotation of the straight line by a preset angle; Determine the shortest distance between the two intersection points, and determine the minor axis diameter based on the shortest distance. Draw a perpendicular line based on the shortest distance, and determine the major axis diameter based on the distance between the two intersection points of the perpendicular line and the end face profile.
4. The method for measuring and marking the diameter of logs in a vehicle according to claim 1, characterized in that, Before controlling the three-axis moving truss to drive the scanning camera along the length of the log and controlling the scanning camera to take pictures to obtain the three-dimensional point cloud of the log stack outline edge, the process includes: Identify whether the vehicle currently traveling into the detection area of the three-axis moving truss is a log transport vehicle; If the vehicle is not a log transport vehicle, it is allowed to pass. If the vehicle is a log transport vehicle, the process proceeds to the step of controlling the three-axis moving truss to drive the scanning camera along the length of the log and controlling the scanning camera to take pictures to obtain the three-dimensional point cloud of the log stack outline edge.
5. A computer device, characterized in that, include: The system includes a memory and a processor, which are interconnected and communicate with each other. The memory stores computer instructions, and the processor executes the computer instructions to perform the whole vehicle log diameter measurement and inkjet printing method according to any one of claims 1 to 4.
6. A whole vehicle log diameter measurement and marking system, characterized in that, include: Frame columns; A three-axis movable truss is installed above the frame columns to drive the scanning camera, the photographing camera, and the inkjet printer to move. The computer device as described in claim 5.
Citation Information
Patent Citations
Charger scanner system
CA2933490A1
Load scanning apparatus
CA3127866A1