CN115358918A - Projection-based scanning track fitting method, device, equipment and storage medium - Google Patents
Projection-based scanning track fitting method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN115358918A CN115358918A CN202210961244.0A CN202210961244A CN115358918A CN 115358918 A CN115358918 A CN 115358918A CN 202210961244 A CN202210961244 A CN 202210961244A CN 115358918 A CN115358918 A CN 115358918A
- Authority
- CN
- China
- Prior art keywords
- projection
- grid
- workpiece
- scanning track
- target
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 49
- 240000004282 Grewia occidentalis Species 0.000 claims description 62
- 238000004140 cleaning Methods 0.000 abstract description 21
- 230000000694 effects Effects 0.000 abstract description 10
- 239000006185 dispersion Substances 0.000 abstract description 4
- 239000011159 matrix material Substances 0.000 description 24
- 238000004891 communication Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 4
- 238000013519 translation Methods 0.000 description 3
- 239000000047 product Substances 0.000 description 2
- 239000000126 substance Substances 0.000 description 2
- 230000009466 transformation Effects 0.000 description 2
- 238000005452 bending Methods 0.000 description 1
- 239000011230 binding agent Substances 0.000 description 1
- 230000003749 cleanliness Effects 0.000 description 1
- 239000000356 contaminant Substances 0.000 description 1
- 239000000428 dust Substances 0.000 description 1
- 238000009713 electroplating Methods 0.000 description 1
- 238000003912 environmental pollution Methods 0.000 description 1
- 239000004519 grease Substances 0.000 description 1
- JEIPFZHSYJVQDO-UHFFFAOYSA-N iron(III) oxide Inorganic materials O=[Fe]O[Fe]=O JEIPFZHSYJVQDO-UHFFFAOYSA-N 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000004806 packaging method and process Methods 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 239000013557 residual solvent Substances 0.000 description 1
- 230000011218 segmentation Effects 0.000 description 1
- 238000005507 spraying Methods 0.000 description 1
- 239000000758 substrate Substances 0.000 description 1
- 239000013589 supplement Substances 0.000 description 1
- 238000004381 surface treatment Methods 0.000 description 1
- 238000003466 welding Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/06—Topological mapping of higher dimensional structures onto lower dimensional surfaces
- G06T3/067—Reshaping or unfolding 3D tree structures onto 2D planes
-
- B—PERFORMING OPERATIONS; TRANSPORTING
- B08—CLEANING
- B08B—CLEANING IN GENERAL; PREVENTION OF FOULING IN GENERAL
- B08B7/00—Cleaning by methods not provided for in a single other subclass or a single group in this subclass
- B08B7/0035—Cleaning by methods not provided for in a single other subclass or a single group in this subclass by radiant energy, e.g. UV, laser, light beam or the like
- B08B7/0042—Cleaning by methods not provided for in a single other subclass or a single group in this subclass by radiant energy, e.g. UV, laser, light beam or the like by laser
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F17/00—Digital computing or data processing equipment or methods, specially adapted for specific functions
- G06F17/10—Complex mathematical operations
- G06F17/16—Matrix or vector computation, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/60—Analysis of geometric attributes
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/60—Analysis of geometric attributes
- G06T7/66—Analysis of geometric attributes of image moments or centre of gravity
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/70—Determining position or orientation of objects or cameras
- G06T7/73—Determining position or orientation of objects or cameras using feature-based methods
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/40—Extraction of image or video features
- G06V10/44—Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10028—Range image; Depth image; 3D point clouds
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30241—Trajectory
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Mathematical Physics (AREA)
- Mathematical Optimization (AREA)
- Computational Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Mathematical Analysis (AREA)
- Optics & Photonics (AREA)
- Geometry (AREA)
- Pure & Applied Mathematics (AREA)
- Algebra (AREA)
- Computing Systems (AREA)
- Databases & Information Systems (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Numerical Control (AREA)
Abstract
The invention relates to the technical field of laser cleaning, and discloses a projection-based scanning track fitting method, device, equipment and storage medium. The method has the advantages that the minimum directed bounding box is calculated by obtaining and according to the workpiece grids of the workpiece to be scanned, the initial scanning track is generated according to the minimum directed bounding box, the efficiency is high, and the calculation amount is small; the method comprises the steps of projecting a workpiece grid onto the upper surface of a minimum bounding box to obtain a projection grid, dispersing an initial scanning track into a point set, searching a target projection grid surface with the shortest distance of each point in the dispersion point set of the initial scanning track according to the projection grid, recording a target serial number of the target projection grid surface, projecting the dispersion points in the point set to a target grid corresponding to the target serial number in the workpiece grid to obtain a scanning track projection point set, fitting an actual scanning track of a workpiece to be scanned according to the scanning track projection point set, enabling laser to completely cover the surface of the scanned object through the actual scanning track, enabling energy to uniformly act on a scanning area, and improving the cleaning effect.
Description
Technical Field
The invention relates to the technical field of laser cleaning, in particular to a projection-based scanning track fitting method, device, equipment and storage medium.
Background
Laser cleaning is a common surface treatment technique in industry, and is used to remove grease, dust, rust, residual solvent, binder, and other contaminants on the surface of a workpiece to ensure the quality of the next process, such as electroplating, phosphating, spraying, welding, packaging, and integrated circuit assembly, and the surface stains must be removed first. The laser cleaning is a 'dry' cleaning, does not need cleaning solution or other chemical solution, has cleanliness far higher than a chemical cleaning process, can adapt to the cleaning of various surface dirt, has little environmental pollution, and can not damage a substrate. The method is a supplement and an extension of the traditional cleaning method at present, and has a wide application prospect due to a plurality of inherent advantages.
However, in the existing laser cleaning, the cleaning path is usually identified and planned manually, and although the surface of the scanned object can be completely covered, the longitudinal distance from the surface of the workpiece to the laser beam light source is not consistent due to the limitation of the shape and the placing posture of the workpiece to be cleaned, so that the cleaning effect difference may occur. Therefore, how to improve the laser cleaning effect is an urgent technical problem to be solved.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The invention mainly aims to provide a projection-based scanning track fitting method, a projection-based scanning track fitting device, projection-based scanning track fitting equipment and a computer storage medium, and aims to solve the technical problem of poor laser cleaning effect in the prior art.
In order to achieve the above object, the present invention provides a projection-based scan trajectory fitting method, which includes the following steps:
acquiring a workpiece grid of a workpiece to be scanned, and calculating a minimum directed bounding box according to the workpiece grid;
generating an initial scanning track according to the minimum directional bounding box;
projecting the workpiece grid to the upper surface of the minimum bounding box to obtain a projected grid;
discretizing the initial scan trajectory into a set of points;
searching a target projection grid surface with the shortest distance between each point in the discrete point set of each initial scanning track according to the projection grid, and recording a target serial number of the target projection grid surface;
projecting the discrete points in the point set to a target grid corresponding to the target sequence number in the workpiece grid to obtain a scanning track projection point set;
and fitting the actual scanning track of the workpiece to be scanned according to the scanning track projection point set.
Preferably, the projecting the workpiece grid onto the upper surface of the minimum bounding box to obtain a projected grid comprises:
converting the workpiece grid from a camera coordinate system to a workpiece coordinate system;
and projecting the workpiece grid under the workpiece coordinate system to the upper surface of the minimum bounding box to obtain a projection grid.
Preferably, after the projecting the workpiece grid in the workpiece coordinate system onto the upper surface of the minimum bounding box to obtain the projection grid, the method further includes:
calculating the centers of the four corner patches of each four corner patch in the projection grid;
searching the four-corner surface patch intersected with the initial scanning track according to the center of the four-corner surface patch to obtain a candidate projection surface patch set;
correspondingly, the searching for a target projection grid surface with a closest distance between each point in the discrete point set of each initial scanning track and recording a target sequence number of the target projection grid surface according to the projection grid includes:
and searching a target projection grid surface with the shortest distance of each point in the discrete point set of each initial scanning track in the candidate projection patch set, and recording a target sequence number of the target projection grid surface.
Preferably, the searching for the four corner patches intersected with the initial scanning trajectory according to the centers of the four corner patches to obtain a candidate projection patch set includes:
setting a distance threshold from the center of the four corner patches to the initial scanning track for any initial scanning track;
calculating a direction vector of the initial scanning track;
calculating a target vector from a certain point on the initial scanning track to the center of the four-corner surface patch;
calculating the target distance from the center of any four-corner patch to the initial scanning track according to the direction vector and the target vector;
if the target distance is smaller than the distance threshold, the corresponding four corner patches are candidate projection patches, and all the candidate projection patches form a candidate projection patch set.
Preferably, the discretizing the initial scan trajectory into a set of points comprises:
setting discrete step length;
calculating discrete point numbers of the initial scanning track according to the discrete step length and the direction vector;
and calculating a discrete point coordinate value of the initial scanning track according to the discrete point number, the starting point coordinate of the initial scanning track, the discrete step length and the direction vector.
Preferably, the projecting the discrete points in the point set to a target grid corresponding to the target sequence number in the workpiece grid to obtain a scanning trajectory projection point set includes:
calculating the coordinate values of a projection point X and a projection point Y after the discrete points in the point set are projected to a target grid corresponding to the target sequence number in the workpiece grid according to the coordinate values of the discrete points in the point set;
calculating the Z coordinate value of the projection point according to the Z coordinate values of the four vertexes of the projection plane;
and obtaining a scanning track projection point set according to the X coordinate value, the Y coordinate value and the Z coordinate value of the projection point.
Preferably, the fitting the actual scanning track of the workpiece to be scanned according to the set of projection points of the scanning track includes:
fitting the projection points in the projection point set of the scanning track with the actual scanning track of the workpiece to be scanned within a preset error range in the Z direction;
and converting the fitted actual scanning track coordinate from the workpiece coordinate system to a camera coordinate system to obtain the actual scanning track of the workpiece to be scanned in the camera coordinate system.
In addition, in order to achieve the above object, the present invention further provides a projection-based scan trajectory fitting device, including:
the calculation module is used for acquiring a workpiece grid of a workpiece to be scanned and calculating a minimum directed bounding box according to the workpiece grid;
the generating module is used for generating an initial scanning track according to the minimum directed bounding box;
the projection module is used for projecting the workpiece grid to the upper surface of the minimum bounding box to obtain a projection grid;
a discretization module for discretizing the initial scan trajectory into a set of points;
the searching module is used for searching a target projection grid surface with the shortest distance between each point in the discrete point set of each initial scanning track according to the projection grid and recording a target serial number of the target projection grid surface;
the projection module is further configured to project discrete points in the point set to a target grid corresponding to the target sequence number in the workpiece grid, so as to obtain a scanning trajectory projection point set;
and the fitting module is used for fitting the actual scanning track of the workpiece to be scanned according to the scanning track projection point set.
In addition, to achieve the above object, the present invention further provides a projection-based scan trajectory fitting apparatus, including: a memory, a processor and a projection-based scan trajectory fitting program stored on the memory and executable on the processor, the projection-based scan trajectory fitting program when executed by the processor implementing the steps of the projection-based scan trajectory fitting method as described above.
Furthermore, to achieve the above object, the present invention further provides a storage medium having a projection-based scan trajectory fitting program stored thereon, which when executed by a processor implements the steps of the projection-based scan trajectory fitting method as described above.
According to the method, the workpiece grid of the workpiece to be scanned is obtained, the minimum directed bounding box is calculated according to the workpiece grid, the initial scanning track is generated according to the minimum directed bounding box, automatic operation is achieved, efficiency is high, and calculated amount is small; the workpiece grids are projected to the upper surface of the minimum bounding box to obtain projection grids, the initial scanning tracks are scattered into point sets, a target projection grid surface with the closest distance between each point in the discrete point set of each initial scanning track is searched according to the projection grids, the target serial numbers of the target projection grid surfaces are recorded, the discrete points in the point sets are projected to the target grids corresponding to the target serial numbers in the workpiece grids, the scanning track projection point sets are obtained, the limitation of the shape and the placing posture of the workpiece to be cleaned can be overcome, the actual scanning tracks of the workpiece to be scanned are fitted according to the scanning track projection point sets, the laser beams completely cover the surfaces of the scanned objects in the actual scanning tracks, the energy is uniformly acted on a scanning area, the energy of the laser beams is utilized to the maximum extent, and the cleaning effect is improved.
Drawings
FIG. 1 is a schematic diagram of a projection-based scan trajectory fitting apparatus for a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a schematic flowchart of a first embodiment of a projection-based scan trajectory fitting method according to the present invention;
FIG. 3 is a projection effect diagram of a projection point set of a scanning trajectory in an embodiment of the projection-based scanning trajectory fitting method of the present invention;
fig. 4 is a block diagram of a first embodiment of a projection-based scan trajectory fitting apparatus according to the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a projection-based scan trajectory fitting apparatus for a hardware operating environment according to an embodiment of the present invention.
As shown in fig. 1, the projection-based scan trajectory fitting apparatus may include: a processor 1001, such as a Central Processing Unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), and the optional user interface 1003 may further include a standard wired interface and a wireless interface, and the wired interface for the user interface 1003 may be a USB interface in the present invention. The network interface 1004 may optionally include a standard wired interface, a WIreless interface (e.g., a WIreless-FIdelity (WI-FI) interface). The Memory 1005 may be a Random Access Memory (RAM) Memory or a Non-volatile Memory (NVM), such as a disk Memory. The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the configuration shown in FIG. 1 does not constitute a limitation of projection-based scan trajectory fitting apparatus and may include more or fewer components than shown, or some components in combination, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a type of computer storage medium, may include an operating system, a network communication module, a user interface module, and a projection-based scan trajectory fitting program therein.
In the projection-based scanning trajectory fitting device shown in fig. 1, the network interface 1004 is mainly used for connecting to a background server and performing data communication with the background server; the user interface 1003 is mainly used for connecting user equipment; the projection-based scan trajectory fitting device calls a projection-based scan trajectory fitting program stored in the memory 1005 through the processor 1001 and executes the projection-based scan trajectory fitting method provided by the embodiment of the present invention.
Based on the hardware structure, the embodiment of the projection-based scanning track fitting method is provided.
Referring to fig. 2, fig. 2 is a schematic flow chart of a first embodiment of the projection-based scan trajectory fitting method of the present invention, and proposes the first embodiment of the projection-based scan trajectory fitting method of the present invention.
In a first embodiment, the projection-based scan trajectory fitting method comprises the steps of:
step S10: and acquiring a workpiece grid of the workpiece to be scanned, and calculating the minimum directed bounding box according to the workpiece grid.
It should be understood that the main body of the embodiment is the projection-based scan trajectory fitting device, and the projection-based scan trajectory fitting device may be an electronic device such as a personal computer, an industrial personal computer, a robot, or a server, which is not limited in this embodiment. And acquiring ordered point clouds of the workpiece to be scanned, and generating a four-corner grid according to the ordered point clouds. And fixing the 3D camera right above the workpiece to be welded, and triggering photographing to obtain the ordered point cloud of the workpiece to be scanned. For any point v in the ordered point cloud i,j Looking up v according to the index rule of row-column ordering i,j Of adjacent points v i,j+1 ,v i+1,j+1 ,v i+1,j . Wherein, the ith row and j column, the ith row and j +1 column, the ith +1 row and j +1 column and the ith +1 row and j column in the ordered point cloud data respectively correspond to the v i,j ,v i,j+1 ,v i+1,j+1 ,v i+1,j Four points, which form a four-corner patch, the points forming the four-corner patch are called mesh vertices. And adding the four-corner surface patches according to the index relation until all vertexes in the ordered point cloud are searched, wherein the vertexes and the four-corner surface patches jointly form a four-corner grid. Wherein each vertex v i,j Is noted as (x, y, z). According to the vertex position coordinates of the four-corner surface patches, the normal vector of each four-corner surface patch, the normal directions of all the four-corner surface patches and a surface normal direction set forming the four-corner grid are calculatedWherein N is F The number of the quadrangular patches included in the quadrangular grid.
It should be noted that, the four-corner grids are subjected to plane segmentation to obtain workpiece grids to be scanned; extracting the four-corner grid outline of the workpiece grid to be scanned; and calculating the minimum directed bounding box according to the four-corner grid outline. From the topological relation between the vertices of the quadrilateral meshes, the inner vertex v of any one mesh i,j Its adjacent vertex number must be four, otherwise vertex v i,j Are edge points. Thereby extracting the grid outline of the workpiece to be scanned. In order to accurately identify the pose of an object with any shape, the pose of the workpiece to be scanned under the minimum envelope is calculated according to the four-corner grid contour point cloud, and the minimum directed bounding box is obtained.
Further, calculating the mass center of the workpiece grid to be scanned under a camera coordinate system according to the four-corner grid profile; calculating an inertia tensor matrix of the workpiece grid to be scanned relative to the center of mass under the camera coordinate system; calculating a preliminary pose matrix of the workpiece grid to be scanned in the coordinate system of the center of mass according to the inertia tensor matrix; and calculating the minimum directed bounding box of the workpiece to be scanned according to the preliminary pose matrix.
The centroid refers to the center of mass, which is considered to be the imaginary point at which the mass of the object is centered. Object centroid coordinate P c The calculation formula is as follows:
wherein M is the total mass of the object, M i To divide the object into i parts, i-th part mass, r i Is m i The coordinates of (a). And calculating the centroid of the workpiece grid to be scanned in the camera coordinate system according to an object centroid coordinate calculation formula.
The inertia tensor is a physical quantity for describing the magnitude of inertia of the fixed-point rotation of the rigid body, and only one point of the rigid body is always kept still when the rigid body rotates at the fixed point. In addition, the inertia tensor is a real-valued three-dimensional symmetric matrix, and for any reference point Q in a three-dimensional space and a rectangular coordinate system Q taking the reference point as an origin xyz The inertia tensor representation method is as follows:
wherein, the diagonal element I xx ,I yy ,I zz The moments of inertia for the x, y, and z axes, respectively. Moment of inertia generally refers to the property of a cross-section to resist bending, given (x, y, z) as a small mass d m Relative position to point Q. The calculation of these moments of inertia is then as follows:
instead of diagonal elements, the product of inertia, which can be defined as:
solving an inertia tensor matrix of the four-corner grid outline relative to the mass center, and enabling the four-corner grid outline to be in accordance with the theorem of parallel axes
x i '=x i -p x
y i '=y i -p y
z i '=z i -p z
Wherein (p) x ,p y ,p z ) Is the coordinate of the centroid of the four-corner grid profile in the camera coordinate system, (x) i ,y i ,z i ) Is the coordinate of the point cloud under the camera coordinate system. The inertia tensor matrix of the four-corner grid outline relative to the mass center can be obtained, and the final calculation formula is as follows:
and traversing all the four-corner grid outlines, substituting the formula, and calculating to obtain an inertia tensor matrix I of the four-corner grid outlines relative to the mass center under a camera coordinate system.
And (3) adopting a diagonal method to enable the inertia product to be zero and enable the inertia tensor to be a diagonal matrix. And the main elements of the symmetric matrix are positive numbers, the obtained three eigenvalues are necessarily positive real numbers, and the three eigenvectors are necessarily orthogonal to each other, so that the eigenvalue lambda of the inertia tensor matrix is obtained by calculation 1 、λ 2 、λ 3 。
According to the eigenvalue of the inertia tensor matrix, solving an eigenvector formula of the inertia tensor matrix as follows: i ω = λ ω. According to the inertia tensor matrixThe characteristic vector is also an inertia main shaft, and a coordinate system of the four-corner grid outline at the centroid is defined according to the inertia main shaft, so that a rotation matrix R of the four-corner grid outline to the centroid rotation main shaft under a camera coordinate system is obtained o2c According to the rotation matrix and the mass center in the camera coordinate system, calculating a rotation translation matrix from the camera coordinate system to a point cloud mass center coordinate system to obtain a preliminary position and orientation matrix T of the workpiece to be scanned o2c I.e. the smallest directed bounding box. Wherein, the translation matrix t from the camera coordinate system to the cloud centroid of the point o2c Is equal to the centroid P c And (4) coordinates.
Step S20: and generating an initial scanning track according to the minimum directional bounding box.
In a specific implementation, the minimum point B of the minimum directed bounding box is searched min And maximum point B max . From B min And B max The coordinates of the vertex of the upper surface of the directed bounding box can be respectively given as A (x) min ,y min ,z min ),B(x min ,y max ,z min ),C(x max ,y max ,z min ),D(x max ,y min ,z min ) The four vertices are arranged in a counterclockwise direction. And generating a scanning track in a mode that a single track is scanned along the X axis in the positive direction and a plurality of tracks are arranged along the Y axis in the positive direction. Alternatively, the four vertices may be arranged in a clockwise direction, and the scanning trajectory may be generated in such a manner that a single trajectory scans in the X-axis direction and a plurality of trajectories are arranged in the Y-axis direction. This embodiment is not limited.
Step S30: and projecting the workpiece grid to the upper surface of the minimum bounding box to obtain a projection grid.
It can be understood that, due to the limitation of the shape and the placing posture of the workpiece to be cleaned, the longitudinal distance from the surface of the workpiece to the laser beam light source is inconsistent, so that the cleaning effect difference may occur in the initial scanning track. The mesh is projected onto the minimum bounding box upper surface. The minimum bounding box upper surface vertex coordinates areA(x min ,y min ,z min ),B(x min ,y max ,z min ),C(x max ,y max ,z min ),D(x max ,y min ,z min ) Then to any v oi (x oi ,y oi ,z oi ) Let z be oi =z min And obtaining the projection grid.
Step S40: the initial scan trajectory is discretized into a set of points.
It is to be understood that the discrete steps are set to Δ t = R res ,R res The resolution of the point cloud is obtained; the initial scanning track T i Set of points discretized into a directed arrangement
Step S50: and searching a target projection grid surface with the shortest distance between each point in the discrete point set of each initial scanning track according to the projection grid, and recording the target serial number of the target projection grid surface.
Note that, for the scanning track T i Set of directionally arranged points composed of discrete pointsAt any point in itFinding and in projection gridNearest target projection grid surfaceRecordingId number of (2), i.e. the object number, the sequence pair of component points and projection plane
Step S60: and projecting the discrete points in the point set to a target grid corresponding to the target sequence number in the workpiece grid to obtain a scanning track projection point set.
Understandably, the initial scanning track T i Each point inProjecting to a grid surface with serial number id in a 3D workpiece grid along a z axis to obtain a scanning track projection point setWhereinRepresenting a projection along the z-axis.
Step S70: and fitting the actual scanning track of the workpiece to be scanned according to the scanning track projection point set.
In a specific implementation, the actual scanning trajectory may be fitted within a preset error range in the z direction according to the set of projection points of the scanning trajectory, where the preset error range is set according to an empirical value, for example, 1 mm.
In this embodiment, by obtaining a workpiece grid of a workpiece to be scanned, calculating a minimum directed bounding box according to the workpiece grid, and generating an initial scanning track according to the minimum directed bounding box, an automatic operation is realized, efficiency is high, and a calculation amount is small; projecting the workpiece grid to the upper surface of the minimum bounding box to obtain a projection grid, dispersing the initial scanning track into a point set, searching a target projection grid surface with the shortest distance of each point in the dispersion point set of each initial scanning track according to the projection grid, recording a target serial number of the target projection grid surface, projecting the dispersion points in the point set to a target grid corresponding to the target serial number in the workpiece grid to obtain a scanning track projection point set, overcoming the limitation of the shape and the placing posture of a workpiece to be cleaned, fitting the actual scanning track of the workpiece to be scanned according to the scanning track projection point set, and enabling the laser beam to completely cover the surface of the scanned object in the finally obtained actual scanning track, wherein the energy of the laser beam is uniformly applied to a scanning area, so that the cleaning effect is improved by utilizing the energy of the laser beam.
With continued reference to fig. 2, a second embodiment of the projection-based scan trajectory fitting method of the present invention is proposed based on the above-mentioned first embodiment.
In the second embodiment, the step S30 includes:
converting the workpiece grid from a camera coordinate system to a workpiece coordinate system;
and projecting the workpiece grid under the workpiece coordinate system to the upper surface of the minimum bounding box to obtain a projection grid.
In this embodiment, the workpiece grid is converted from the camera coordinate system to the workpiece coordinate system. The pose transformation matrix from the workpiece coordinate system to the camera coordinate system is T o2c And then, converting the pose of the camera coordinate system to the workpiece coordinate system by a matrix:
for any vertex v in the grid under the camera coordinate system i (x i ,y i ,z i ) Having coordinates v in the object coordinate system oi (x oi ,y oi ,z oi )。
v oi =R c2o v i +t c2o ;
Wherein R is o2c A rotation matrix of the main axis of mass center rotation of the four-corner grid outline under a camera coordinate system; t is a unit of o2c The initial pose matrix of the workpiece to be scanned is the minimum directed bounding box; camera coordinate system to point cloud centroid translation matrix t o2c Is equal to the centroid P c And (4) coordinates.
Further, in this embodiment, after the projecting the workpiece grid in the workpiece coordinate system onto the upper surface of the minimum bounding box to obtain a projected grid, the method further includes:
calculating the centers of the four corner patches of each four corner patch in the projection grid;
searching the four-corner surface patch intersected with the initial scanning track according to the center of the four-corner surface patch to obtain a candidate projection surface patch set;
correspondingly, the searching for a target projection grid surface with a closest distance between each point in the discrete point set of each initial scanning track and recording a target sequence number of the target projection grid surface according to the projection grid includes:
and searching a target projection grid surface with the shortest distance of each point in the discrete point set of each initial scanning track in the candidate projection patch set, and recording a target sequence number of the target projection grid surface.
It should be noted that the centers of the four corner patches of the projection grid are calculated. For any four corner patch F oi Its center is
Further, in this embodiment, the searching, according to the center of the four corner patches, the four corner patches intersected with the initial scanning trajectory to obtain a candidate projection patch set includes:
setting a distance threshold from the center of the four corner patches to the initial scanning track for any initial scanning track;
calculating a direction vector of the initial scanning track;
calculating a target vector from a certain point on the initial scanning track to the centers of the four corner patches;
calculating the target distance from the center of any four-corner surface patch to the initial scanning track according to the direction vector and the target vector;
if the target distance is smaller than the distance threshold, the corresponding four corner patches are candidate projection patches, and all the candidate projection patches form a candidate projection patch set.
In a specific implementation, for any scanning track T i Calculating the side length of the directional bounding box along the X-axis directionThe number of laser cleaning traces is
WhereinTo round down the symbol, i ∈ [0, N), find and T i The crossed four-corner patches specifically comprise:
setting the center of the four-corner patch to the track T i Distance threshold d of FT =R res (ii) a Wherein R is res Is the point cloud resolution. Calculating the initial scanning track T i From the starting point to the end pointWherein P is si For the initial scanning track T i Of starting point, P ei For the initial scanning track T i The end point coordinates of (a). Calculating and calculating according to the vertex coordinates of the minimum bounding boxAndthe direction vector of (a) is:
for any of the initial scanning tracks T i I belongs to [0, N), and the coordinates of the starting point and the ending point of the track are as follows:
wherein p _ a is the coordinate of vertex a, p _ B is the coordinate of vertex B, and d is a given laser width threshold.
Calculating the initial scanning track T i From a certain point to the center C of the four-corner patch oi The target vector of (a) is:
calculating the center C of any four-corner patch oi To track T i The target distance of (2) is:
if d is CT <d FT Recording four corner patch F oi All the four corner patches meeting the condition form a track T i Set of candidate projected patches P Fi ,i∈[0,N)。
Further, in this embodiment, the discretizing the initial scanning trajectory into a set of points includes:
setting discrete step length;
calculating discrete point numbers of the initial scanning track according to the discrete step length and the direction vector;
and calculating the discrete point coordinate value of the initial scanning track according to the discrete point number, the starting point coordinate of the initial scanning track, the discrete step length and the direction vector.
Note that the discrete step size is set to Δ t = R res The initial scanning track T is i Set of points discretized into a directed arrangement
Calculating the discrete points of the track as follows:
whereinIn order to round up the symbol in the upper direction,for the initial scanning track T i Is directed from the starting point to the end point, at is a discrete step.
Calculating the coordinate values of the discrete points as follows:
whereinP si For the initial scanning track T i At is a discrete step size. At this time, the discrete points are alongFrom the starting point to the end point, there is a directional arrangement.
For the scanning track T i Set of directionally arranged points of discrete pointsAt any point in itAt P Fi In search andthe closest surfaceNamely recordingId number of (2), sequence pairs of component points and projection planes
Further, in this embodiment, the projecting the discrete points in the point set to the target grid corresponding to the target sequence number in the workpiece grid to obtain a scan trajectory projection point set includes:
calculating the coordinate values of a projection point X and a projection point Y after the discrete points in the point set are projected to a target grid corresponding to the target sequence number in the workpiece grid according to the coordinate values of the discrete points in the point set;
calculating the Z coordinate value of the projection point according to the Z coordinate values of the four vertexes of the projection plane;
and obtaining a scanning track projection point set according to the X coordinate value, the Y coordinate value and the Z coordinate value of the projection point.
Understandably, the track T will be scanned i Each point inProjecting to a grid surface with serial number id in a 3D workpiece grid along a z axis to obtain a scanning track projection point setWhereinRepresenting a projection along the z-axis. The method specifically comprises the following steps:
calculating the x, y coordinates of the projection point:
calculating the z coordinate of the projection point:
that is, the z-coordinate value of the actual projection point is estimated from the mean value of the z-coordinates of the four vertices of the projection plane.
Further, in this embodiment, the fitting the actual scanning trajectory of the workpiece to be scanned according to the set of projection points of the scanning trajectory includes:
fitting the projection points in the projection point set of the scanning track with the actual scanning track of the workpiece to be scanned within a preset error range in the Z direction;
and converting the fitted actual scanning track coordinate from the workpiece coordinate system to a camera coordinate system to obtain the actual scanning track of the workpiece to be scanned in the camera coordinate system.
It should be understood that the predetermined error range may be set according to an empirical value, for example, 1 mm. The actual scan trajectory can be fit within 1 mm of z-error. Scanning track projection point setThe projection effect of (2) is shown in fig. 3.
For any scanning track T i Projecting the scanning track into a set of pointsThe coordinates are converted from the object coordinate system to the camera coordinate system. The transformation matrix from the workpiece coordinate system to the camera coordinate system is:
then the track T is scanned arbitrarily i Projection point setThe coordinates in the camera coordinate system are:
in this embodiment, the workpiece grid in the workpiece coordinate system is converted from the camera coordinate system to the workpiece coordinate system, the workpiece grid in the workpiece coordinate system is projected onto the upper surface of the minimum bounding box to obtain a projection grid, and a curve is projected onto the grid, so that a laser cleaning track generated based on the minimum bounding box is projected onto the workpiece grid surface as an actual scanning track, thereby allowing the laser beam to be uniformly distributed on the surface of the object to be scanned while completely covering the surface of the object to be scanned, and improving the cleaning effect.
Furthermore, the present invention also provides a storage medium, on which a projection-based scan trajectory fitting program is stored, which when executed by a processor implements the steps of the projection-based scan trajectory fitting method as described above.
In addition, referring to fig. 4, an embodiment of the present invention further provides a projection-based scan trajectory fitting apparatus, where the projection-based scan trajectory fitting apparatus includes:
the calculation module 10 is configured to obtain a workpiece grid of a workpiece to be scanned, and calculate a minimum directed bounding box according to the workpiece grid;
a generating module 20, configured to generate an initial scanning trajectory according to the minimum directional bounding box;
a projection module 30, configured to project the workpiece grid onto an upper surface of the minimum bounding box to obtain a projection grid;
a discretization module 40 for discretizing the initial scanning trajectory into a set of points;
the searching module 50 is configured to search, according to the projection grid, a target projection grid surface where each point in the discrete point set of each initial scanning track is closest to, and record a target serial number of the target projection grid surface;
the projection module 30 is further configured to project the discrete points in the point set to a target grid corresponding to the target sequence number in the workpiece grid, so as to obtain a scanning trajectory projection point set;
and a fitting module 60, configured to fit the actual scanning trajectory of the workpiece to be scanned according to the set of scanning trajectory projection points.
Other embodiments or specific implementation manners of the projection-based scanning trajectory fitting device according to the present invention may refer to the above method embodiments, and are not described herein again.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of other like elements in a process, method, article, or system comprising the element.
The above-mentioned serial numbers of the embodiments of the present invention are only for description, and do not represent the advantages and disadvantages of the embodiments. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The use of the words first, second, third, etc. do not denote any order, but rather the words first, second, etc. are to be interpreted as indicating.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention or portions thereof that contribute to the prior art may be embodied in the form of a software product, where the computer software product is stored in a storage medium (e.g., a Read Only Memory image (ROM)/Random Access Memory (RAM), a magnetic disk, an optical disk), and includes several instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.
Claims (10)
1. A projection-based scan trajectory fitting method is characterized by comprising the following steps:
acquiring a workpiece grid of a workpiece to be scanned, and calculating a minimum directed bounding box according to the workpiece grid;
generating an initial scanning track according to the minimum directional bounding box;
projecting the workpiece grid to the upper surface of the minimum bounding box to obtain a projection grid;
discretizing the initial scan trajectory into a set of points;
searching a target projection grid surface with each point in the discrete point set of each initial scanning track closest to the point according to the projection grid, and recording a target serial number of the target projection grid surface;
projecting the discrete points in the point set to a target grid corresponding to the target serial number in the workpiece grid to obtain a scanning track projection point set;
and fitting the actual scanning track of the workpiece to be scanned according to the scanning track projection point set.
2. The projection-based scan trajectory fitting method of claim 1, wherein said projecting the workpiece grid onto the upper surface of the minimum bounding box to obtain a projection grid, comprises:
converting the workpiece grid from a camera coordinate system to a workpiece coordinate system;
and projecting the workpiece grid under the workpiece coordinate system to the upper surface of the minimum bounding box to obtain a projection grid.
3. The projection-based scan trajectory fitting method of claim 2, wherein after the projecting the workpiece grid in the workpiece coordinate system onto the upper surface of the minimum bounding box to obtain the projected grid, further comprising:
calculating the centers of the four corner patches of each four corner patch in the projection grid;
searching the four-corner surface patch intersected with the initial scanning track according to the center of the four-corner surface patch to obtain a candidate projection surface patch set;
correspondingly, the searching for a target projection grid surface with a closest distance between each point in the discrete point set of each initial scanning track according to the projection grid and recording a target sequence number of the target projection grid surface includes:
and searching a target projection grid surface with the shortest distance of each point in the discrete point set of each initial scanning track in the candidate projection patch set, and recording a target sequence number of the target projection grid surface.
4. The projection-based scan trajectory fitting method of claim 3, wherein the finding a four-corner patch intersecting the initial scan trajectory according to the four-corner patch center to obtain a candidate set of projection patches comprises:
setting a distance threshold from the center of the four corner patches to the initial scanning track for any initial scanning track;
calculating a direction vector of the initial scanning track;
calculating a target vector from a certain point on the initial scanning track to the centers of the four corner patches;
calculating the target distance from the center of any four-corner patch to the initial scanning track according to the direction vector and the target vector;
if the target distance is smaller than the distance threshold, the corresponding four corner patches are candidate projection patches, and all the candidate projection patches form a candidate projection patch set.
5. The projection-based scan trajectory fitting method of claim 4, wherein said discretizing the initial scan trajectory into a set of points comprises:
setting discrete step length;
calculating discrete point numbers of the initial scanning track according to the discrete step length and the direction vector;
and calculating a discrete point coordinate value of the initial scanning track according to the discrete point number, the starting point coordinate of the initial scanning track, the discrete step length and the direction vector.
6. The projection-based scan trajectory fitting method according to any one of claims 1 to 5, wherein the projecting discrete points in the point set to a target grid corresponding to the target sequence number in the workpiece grid to obtain a scan trajectory projection point set comprises:
calculating the coordinate values of a projection point X and a projection point Y after the discrete points in the point set are projected to a target grid corresponding to the target sequence number in the workpiece grid according to the coordinate values of the discrete points in the point set;
calculating the Z coordinate value of the projection point according to the Z coordinate values of the four vertexes of the projection plane;
and acquiring a projection point set of the scanning track according to the X coordinate value, the Y coordinate value and the Z coordinate value of the projection point.
7. The projection-based scan trajectory fitting method of claim 2, wherein said fitting an actual scan trajectory of the workpiece to be scanned from the set of scan trajectory projection points comprises:
fitting the projection points in the projection point set of the scanning track with the actual scanning track of the workpiece to be scanned within a preset error range in the Z direction;
and converting the fitted actual scanning track coordinate from the workpiece coordinate system to a camera coordinate system to obtain the actual scanning track of the workpiece to be scanned in the camera coordinate system.
8. A projection-based scan trajectory fitting apparatus, comprising:
the calculation module is used for acquiring a workpiece grid of a workpiece to be scanned and calculating a minimum directed bounding box according to the workpiece grid;
the generating module is used for generating an initial scanning track according to the minimum directional bounding box;
the projection module is used for projecting the workpiece grid to the upper surface of the minimum bounding box to obtain a projection grid;
a discretization module for discretizing the initial scanning trajectory into a set of points;
the searching module is used for searching a target projection grid surface with the shortest distance between each point in the discrete point set of each initial scanning track according to the projection grid and recording a target serial number of the target projection grid surface;
the projection module is further configured to project the discrete points in the point set to a target grid corresponding to the target sequence number in the workpiece grid, so as to obtain a scanning trajectory projection point set;
and the fitting module is used for fitting the actual scanning track of the workpiece to be scanned according to the scanning track projection point set.
9. A projection-based scan trajectory fitting device, characterized in that the projection-based scan trajectory fitting device comprises: memory, a processor and a projection-based scan trajectory fitting program stored on the memory and executable on the processor, the projection-based scan trajectory fitting program when executed by the processor implementing the steps of the projection-based scan trajectory fitting method of any one of claims 1 to 7.
10. A storage medium having stored thereon a projection-based scan trajectory fitting program which, when executed by a processor, carries out the steps of the projection-based scan trajectory fitting method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210961244.0A CN115358918A (en) | 2022-08-11 | 2022-08-11 | Projection-based scanning track fitting method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210961244.0A CN115358918A (en) | 2022-08-11 | 2022-08-11 | Projection-based scanning track fitting method, device, equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115358918A true CN115358918A (en) | 2022-11-18 |
Family
ID=84001402
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210961244.0A Pending CN115358918A (en) | 2022-08-11 | 2022-08-11 | Projection-based scanning track fitting method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115358918A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118218328A (en) * | 2024-05-21 | 2024-06-21 | 三峡金沙江云川水电开发有限公司 | DOA positioning-based laser processing method and system with programmable beam tracking and zooming functions |
-
2022
- 2022-08-11 CN CN202210961244.0A patent/CN115358918A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118218328A (en) * | 2024-05-21 | 2024-06-21 | 三峡金沙江云川水电开发有限公司 | DOA positioning-based laser processing method and system with programmable beam tracking and zooming functions |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9704248B2 (en) | Position and orientation measuring apparatus, information processing apparatus and information processing method | |
CN113096094B (en) | Three-dimensional object surface defect detection method | |
TWI672207B (en) | Posture positioning system for machine and the method thereof | |
CN113781622A (en) | Three-dimensional model texture mapping conversion method, device, equipment and medium | |
CN112102375B (en) | Point cloud registration reliability detection method and device and mobile intelligent equipment | |
US20230015214A1 (en) | Planar contour recognition method and apparatus, computer device, and storage medium | |
CN115358918A (en) | Projection-based scanning track fitting method, device, equipment and storage medium | |
Kinnell et al. | Autonomous metrology for robot mounted 3D vision systems | |
CN115330836A (en) | Laser cleaning track compression method, device, equipment and storage medium | |
CN113048886B (en) | Method and apparatus for measuring size of irregular body of workpiece | |
Li et al. | Automatic programming for robotic grinding using real time 3D measurement | |
JP5673489B2 (en) | Point cloud data processing apparatus, processing method, processing program, and recording medium | |
JP5762099B2 (en) | Posture recognition apparatus, work robot, posture recognition method, program, and recording medium | |
CN115375763A (en) | Method, device and equipment for fitting laser cleaning track and storage medium | |
CN114998381A (en) | Welding track fitting method, device, equipment and storage medium in tube plate welding | |
CN114581328B (en) | Material pile point cloud data interpolation method, device, equipment and medium | |
JP2007034964A (en) | Method and device for restoring movement of camera viewpoint and three-dimensional information and estimating lens distortion parameter, and program for restoring movement of camera viewpoint and three-dimensional information and estimating lens distortion parameter | |
CN115359068A (en) | Laser cleaning track generation method, device, equipment and storage medium | |
CN114581607A (en) | Complex curved surface part reconstruction method based on mechanical arm | |
JP2022166662A (en) | Method for setting reference coordinate of workpiece and machine tool | |
Chen et al. | Precise 6dof localization of robot end effectors using 3D vision and registration without referencing targets | |
JP2820894B2 (en) | Convex polyhedron generator for interference check system | |
JP5938201B2 (en) | Position / orientation measuring apparatus, processing method thereof, and program | |
CN115008092A (en) | Tube plate welding track generation method, device, equipment and computer storage medium | |
CN114723812B (en) | Method, device, equipment and storage medium for determining pose of robot grinding tool |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |