Slab surface point cloud data leveling and rendering method
By leveling and rendering the slab surface point cloud data collected by 3D cameras, global and local renderings are generated, and the problem of insufficient accuracy and details in the detection of slab surface defects is solved, and efficient and accurate defects are achieved Test.
Patent Information
- Application Number
- CN202410929899.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-11
- Publication Date
- 2024-11-29
AI Technical Summary
Traditional point cloud rendering technology is not applicable in the field of slab surface defect detection, and cannot meet the requirements of measurement accuracy and rendering details, resulting in inaccuracy and inefficiency of defect detection.
By obtaining the slab surface point cloud data matrix collected by the 3D camera, the PCA algorithm is used to calculate the principal component direction and level it, and render it based on the relative depth data to generate global and local renderings to improve the accuracy and detailed performance of the rendering technology.
Convert complex point cloud data into easy-to-analyze image data, simplify processing flow, improve the accuracy and reliability of defect detection, significantly improve detection capabilities, and is suitable for detection of micro defects.
Smart Images

Figure CN119048658A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of machine vision detection, and in particular to a method for leveling and rendering point cloud data on a slab surface. Background Art
[0002] When using 3D technology to detect slab surface defects, the collected point cloud data is based on its own spatial coordinate system, rather than depth data relative to the slab plane. Therefore, in order to ensure the accuracy and reliability of the subsequent defect recognition model, the point cloud data must be normalized, leveled, and rendered. These operations can not only provide high-quality input data for the defect recognition model, but also provide a more accurate metric for quantifying the defect depth.
[0003] Through fine point cloud data rendering, the original point cloud data can be converted into an image form that is easier to analyze and process. This not only simplifies the data processing process, but also enables the point cloud data to be directly input into the target detection model, thereby achieving efficient and accurate detection of defects. However, traditional point cloud rendering technology is mostly used for large objects, and the requirements for measurement accuracy and rendering details are not strict. In the field of defect detection, since the measured targets are small and complex, the requirements for rendering technology are naturally higher. Therefore, in the field of defect detection, traditional point cloud rendering technology is not applicable. Therefore, optimizing the processing flow of point cloud data, especially improving the accuracy and detail expression of rendering technology, is of great significance to improving the accuracy and efficiency of slab surface defect detection. Summary of the invention
[0004] The present invention provides a method for leveling and rendering point cloud data of a slab surface, so as to solve the technical problem that the traditional point cloud rendering technology is not applicable in the field of defect detection.
[0005] In order to solve the above technical problems, the present invention provides the following technical solutions:
[0006] In one aspect, the present invention provides a method for leveling and rendering point cloud data of a slab surface, comprising:
[0007] Acquire a point cloud data matrix of the slab surface collected by a 3D camera, represent the point cloud data matrix in a three-dimensional space, and then level the data in the point cloud data matrix to obtain leveled point cloud data;
[0008] For the leveled point cloud data, obtain the corresponding relative depth data matrix;
[0009] The relative depth data matrix is rendered to obtain a rendering image.
[0010] Furthermore, the slab surface point cloud data matrix Z collected by the 3D camera H×WIt is a two-dimensional matrix with H rows and W columns. The data in the matrix is of floating-point type, which represents the distance value from the captured target surface to the camera calibration plane. When the point cloud data matrix is represented in three-dimensional space, the column direction of the point cloud data matrix is used as the horizontal direction, the row direction of the point cloud data matrix is used as the vertical direction, and the data size in the matrix is used as the vertical direction.
[0011] Furthermore, the data in the point cloud data matrix is leveled to obtain the leveled point cloud data, including:
[0012] The PCA algorithm is used to calculate the principal component direction of the point cloud data matrix;
[0013] The data in the point cloud data matrix is basically leveled with reference to the principal component direction.
[0014] Furthermore, the data in the point cloud data matrix is basically leveled with reference to the principal component direction, including:
[0015] Calculate the angle θ between the principal component direction and the xoy plane;
[0016] Project the principal component direction on the xoy plane to obtain the projection line l 1 ;
[0017] Draw a line l through the origin perpendicular to the projection 1 The straight line l 2 ;
[0018] The data in the point cloud data matrix is basically leveled, and the formula is:
[0019] z′ i,j =z i,j -d i,j tanθ
[0020] Among them, z i,j Represents the data with row and column index values i, j in the point cloud data matrix; z′ i,j Indicates z i,j The corresponding leveled data; d i,j Indicates z i,j From the current position to the straight line l 2 The vertical distance.
[0021] Furthermore, for the leveled point cloud data, the corresponding relative depth data matrix is obtained, including:
[0022] Traverse each column of data along the horizontal axis in the point cloud data matrix, and for the current column of data traversed, cut out the current column of data on both sides along the horizontal axis, with the current column of data as the center and the width as the preset width value W 0 , a matrix of length H And take The median value of is used as the reference value, and the current column data is subtracted from the reference value to obtain the relative depth data of the current column data. After traversing the entire point cloud data matrix, the relative depth data matrix Z′ composed of the relative depth data corresponding to each column data is obtained. H×W .
[0023] Furthermore, the preset width value W 0 It is 2 to 3 times the width of the maximum defect on the slab surface.
[0024] Furthermore, the relative depth data matrix is rendered to obtain a rendering image, including:
[0025] For the relative depth data matrix Z′ H×W Amplify the data to obtain the amplified data
[0026] right Rendering Convert to RGB pseudo-color image as global rendering;
[0027] For Z′ H×W Over-rendering technology is used to enhance the representation of defects. Over-rendering is performed in the direction of the principal component at a set distance interval to obtain a local rendering image.
[0028] Combine global rendering and local rendering Figure 1 It also serves as the basic data for subsequent slab surface defect detection.
[0029] Furthermore, the relative depth data matrix Z′ H×W Amplify the data to obtain the amplified data The formula is:
[0030]
[0031] Among them, λ is the data expansion factor.
[0032] Furthermore, the Rendering Convert to RGB pseudocolor image, including:
[0033] right Performs 3 separate transforms to produce a composite RGB image.
[0034] Furthermore, the pair Z′ H×W Over-rendering technology is used to enhance the representation of defects. By over-rendering in the direction of the principal component at a set distance interval, a local rendering image is obtained, including:
[0035] For Z′ H×W, within its data range, draw multiple lines parallel to l at a fixed preset interval μ in the horizontal direction 2 The straight line Z′ H×W Divide into multiple regions; perform separate rendering calculations for data between the linear equation y-tan(90+α)x+kμ≥0 and y-tan(90+α)x+(k+1)μ≤0; where x and y represent the horizontal and vertical coordinates of the data, respectively; α represents the projection line l 1 The angle relative to the horizontal axis in the xoy plane; individual rendering is to magnify the data according to the maximum and minimum data values in the corresponding area. The formula is:
[0036]
[0037] Among them, Z′ k Represents the data in the kth region; Represents Z′ k The corresponding enlarged data;
[0038] After completing the data amplification of each interval, the amplified data is rendered as a pseudo-color image.
[0039] On the other hand, the present invention further provides an electronic device, comprising a processor and a memory; wherein the memory stores at least one instruction, and the instruction is loaded and executed by the processor to implement the above method.
[0040] In yet another aspect, the present invention further provides a computer-readable storage medium, wherein at least one instruction is stored in the storage medium, and the instruction is loaded and executed by a processor to implement the above method.
[0041] The beneficial effects brought about by the technical solution provided by the present invention include at least:
[0042] The slab surface point cloud data leveling and rendering method provided by the present invention successfully converts the complex and difficult to directly process point cloud data into conventional image data through a series of technical means. This conversion makes it possible to use mature image processing algorithm models to deeply explore the defect information hidden in the data. It not only simplifies the data processing process and reduces the complexity, but also makes the processing method more universal, and can be compatible with and apply more defect detection methods. Through global and local rendering methods, not only can defects be presented more intuitively and clearly, but also tiny defect features can be deeply excavated. The refined processing method greatly improves the defect detection capability and brings revolutionary progress to slab surface defect detection. In general, the present invention not only optimizes the data processing process and improves the processing efficiency, but also significantly improves the accuracy and reliability of defect detection through innovative rendering technology, providing strong support for defect detection tasks in actual application scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0044] Figure 1 is a flow chart of a method for leveling and rendering slab surface point cloud data provided by an embodiment of the present invention;
[0045] Figure 2 is a schematic diagram of principal component vectors obtained after principal component analysis of point cloud data provided by an embodiment of the present invention;
[0046] Figure 3 It is a schematic diagram of a matrix slicing method for a principal component vector projection and over-rendering process provided by an embodiment of the present invention;
[0047] Figure 4 It is a system block diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0048] In order to make the objectives, technical solutions and advantages of the present invention more clear, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
[0049] First of all, it should be noted that in the embodiments of the present invention, words such as "exemplarily" and "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" in the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of the word "exemplarily" is intended to present the concept in a concrete way. In addition, in the embodiments of the present invention, the meaning expressed by "and / or" can be both, or it can be either of the two.
[0050] First embodiment
[0051] This embodiment provides a method for leveling and rendering point cloud data of a slab surface, which mainly processes point cloud data collected by a 3D camera. The method can be implemented by an electronic device, which can be a terminal or a server. The execution flow of the method is as follows: Figure 1 As shown, the following steps are included:
[0052] S1, obtaining a point cloud data matrix of the slab surface collected by a 3D camera, representing the point cloud data matrix in a three-dimensional space, and then leveling the data in the point cloud data matrix to obtain leveled point cloud data;
[0053] It should be noted that the slab surface point cloud data matrix Z collected by the 3D camera is H×W It is a two-dimensional matrix with H rows and W columns. The data in the matrix is of floating-point type, which represents the distance value from the captured target surface to the camera calibration plane. When the point cloud data matrix is represented in three-dimensional space, the column direction of the point cloud data matrix is used as the x direction, the row direction of the point cloud data matrix is used as the y direction, and the data size in the matrix is used as the z direction.
[0054] Furthermore, in this embodiment, if Figure 2 As shown, the data in the matrix are leveled to obtain the leveled point cloud data in the following manner: the principal component directions of the point cloud data matrix are calculated using the PCA algorithm; and the data in the point cloud data matrix are basically leveled with reference to the principal component directions of the point cloud data matrix.
[0055] The specific leveling steps are as follows: 1) Calculate the angle θ between the principal component direction of the point cloud data matrix and the xoy plane; 2) Project the principal component direction of the point cloud data matrix on the xoy plane, and the resulting projection line l 1 The angle relative to the x-axis in the xoy plane is α; 3) Calculate the projection line l 1 The unit adjustment amount of the data in the matrix when the unit distance is in the direction is tanθ. Draw a straight line l perpendicular to the projection line through the origin. 2 , for the data in the matrix, according to its row and column index (i, j) to the straight line l 2 The vertical distance d i,j Corrected corresponding matrix data is: i ' ,j =z i,j -d i,j tanθ. Where z i,j Represents the data with row and column index values i, j in the point cloud data matrix; z i ' ,j Indicates z i,j The corresponding leveled data; d i,j Indicates z i,j From the current position to the straight line l 2 The vertical distance.
[0056] S2, obtaining the corresponding relative depth data matrix for the leveled point cloud data;
[0057] It should be noted that, in this embodiment, the method of obtaining the relative depth data matrix is: determine the reference value of the point cloud from the leveled point cloud data, and obtain the surface relative depth data matrix based on this. The specific steps are: traverse along the x direction in the point cloud data matrix, take the jth column data Cut out a width of W on both sides around it 0 The matrix And take the median value as the reference value, Subtract the reference value to get the relative depth data of the jth column. After the traversal is completed, the entire relative depth data matrix Z′ is obtained. H×W , where the data in the jth column must satisfy the requirement that the width W can be intercepted on both sides 0 Matrix data; intercept width W 0 It is set according to the width range of defects in the actual production site, and its set width is 2-3 times the maximum defect width.
[0058] S3, rendering the relative depth data matrix to obtain a rendering image;
[0059] It should be noted that, in this embodiment, the process of rendering the relative depth data matrix includes: rendering the relative depth data matrix, converting the matrix data into an RGB pseudo-color image as a global rendering image; using over-rendering technology to enhance the representation of tiny defects, by over-rendering in a set distance interval in the main component direction as a local rendering image; two rendering Figure 1 It also serves as the basic data for subsequent defect detection. The specific rendering steps are as follows:
[0060] S31, relative depth data matrix Z′ H×W Amplify the data to obtain the amplified data
[0061]
[0062] Among them, λ is the data expansion factor, which can be set according to the accuracy to be detected at the production site;
[0063] S32, yes Rendering Convert to RGB pseudo-color image as the global rendering image; wherein the steps of rendering to pseudo-color image are: The data is transformed three times independently to generate a composite RGB image. The color content of the composite image is modulated by the characteristics of the transformation function, as shown below; i,j , G i,j , B i,j Represents the color values of R, G, and B channels respectively. express The value of the data.
[0064]
[0065] S33, for Z′ H×WThe over-rendering technique is used to enhance the representation of defects. The local rendering image is obtained by over-rendering in the set distance interval in the main component direction. The steps of the over-rendering technique are as follows: within the matrix range, multiple parallel l lines are drawn in the x direction at a fixed interval μ. 2 For the straight line, the data between the straight line equation y-tan(90+α)x+kμ≥0 and y-tan(90+α)x+(k+1)μ≤0 are rendered separately. Separate rendering is to enlarge the data according to the maximum and minimum values.
[0066]
[0067] Among them, Z′ k Represents the data in the kth region; Represents Z′ k The corresponding enlarged data;
[0068] After the data of each interval is amplified, it is rendered into a pseudo-color image in the manner of step S32.
[0069] S34, global rendering and local rendering Figure 1 The global rendering image and the local rendering image are used as the basic data for subsequent defect detection. The specific method is as follows: the global rendering image and the local rendering image are input into the defect detection model (such as yolov5) in sequence to detect the location and category of the defect. The detection results of the corresponding outputs of the two are processed by non-maximum suppression to obtain the final detection result. Among them, the global rendering image is used to characterize the conventional depth information of the defect, while the local rendering image can make the slight (shallow depth) defects more obvious, which is conducive to reducing the risk of missing the detection of slight defects in the subsequent detection process.
[0070] In summary, this embodiment provides a method for leveling and rendering point cloud data of a slab surface, which plays a key role in the preliminary preprocessing process of slab surface defect detection. This method mainly processes the point cloud data collected by a 3D camera, and through core steps such as leveling, data normalization, and rendering, effectively enhances the representation of defects in the data, thereby improving the ability to resolve defects. This method can convert complex point cloud matrix data into intuitive pseudo-color images. This conversion not only makes the data easier to analyze and interpret, but also can be directly used as input for a deep target detection model, and efficiently and accurately detects hidden defects in point cloud data through image processing. The implementation of this method not only significantly improves the defect detection performance, but also greatly shortens the data processing time, thereby showing important practical value in actual application scenarios.
[0071] Second embodiment
[0072] This embodiment provides an electronic device, such as Figure 4 As shown, the electronic device includes: a processor and a memory; wherein the processor and the memory can be connected via a communication bus; the memory stores at least one instruction, and the instruction is loaded and executed by the processor to implement the method of the first embodiment. In addition, the electronic device may also include a transceiver, the processor and the transceiver can be connected via a communication bus, and the transceiver is used to communicate with other devices.
[0073] Next, combine Figure 4 The following is a detailed introduction to the various components of the electronic device:
[0074] Among them, the processor is the control center of the electronic device, and the electronic device may include multiple processors, each of which may be a single-core processor (single-CPU) or a multi-core processor (multi-CPU). The processor here may be a processor or a general term for multiple processing elements. For example, the processor is one or more central processing units (CPUs), or other general-purpose processors, application specific integrated circuits (ASICs), or one or more integrated circuits configured to implement an embodiment of the present invention, such as one or more microprocessors (digital signal processors, DSPs), or one or more field programmable gate arrays (field programmable gate arrays, FPGAs), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor may execute various functions of the electronic device by running or executing software programs stored in the memory and calling data stored in the memory.
[0075] In a specific implementation, as an embodiment, the processor may include one or more CPUs, such as Figure 4 The CPU0 and CPU1 shown in the figure are, of course, only exemplary.
[0076] The memory is used to store the software program for executing the solution of the present invention, and the execution is controlled by the processor. The specific implementation method can refer to the above method embodiment and will not be repeated here.
[0077] Optionally, the memory may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory may be integrated with the processor or exist independently and accessed through the interface circuit ( Figure 4 (not shown) is coupled to the processor, which is not specifically limited in this embodiment of the present invention.
[0078] The transceiver may include a receiver and a transmitter ( Figure 4 The receiver is used to implement the receiving function, and the transmitter is used to implement the sending function. The transceiver can be integrated with the processor or exist independently and communicate with the electronic device through the interface circuit ( Figure 4 (not shown) is coupled to the processor, which is not specifically limited in this embodiment of the present invention.
[0079] In addition, it should be noted that Figure 4 The structure of the electronic device shown in the figure does not constitute a limitation on the device, and the actual device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. In addition, the technical effects achieved by the electronic device when executing the method of the first embodiment above can refer to the technical effects described in the first embodiment above, so they are not repeated here.
[0080] Third embodiment
[0081] This embodiment provides a computer-readable storage medium, which stores at least one instruction, and the instruction is loaded and executed by a processor to implement the method of the first embodiment. The computer-readable storage medium may be a ROM, a random access memory, a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc. The instructions stored therein may be loaded by a processor in a terminal to execute the method.
[0082] In addition, it should be noted that the present invention can be provided as a method, an apparatus or a computer program product. Therefore, the embodiment of the present invention can be in the form of a full or partial hardware embodiment, a full or partial software embodiment or an embodiment combining software and hardware. Moreover, when implemented using software, the embodiment of the present invention can be in the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program codes. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center containing one or more available media sets. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium. The semiconductor medium may be a solid state hard disk.
[0083] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0084] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device, so that a series of operation steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable terminal device provide for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0085] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. The terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of more restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements. In addition, the term "and / or" is only an association relationship describing the associated objects, indicating that there can be three relationships, for example, A and / or B, which can represent: A exists alone, A and B exist at the same time, and B exists alone, wherein A and B can be singular or plural. In addition, the character " / " in this article generally indicates that the objects before and after are in an "or" relationship, but it may also indicate an "and / or" relationship. Please refer to the context for specific understanding. "At least one" means one or more, and "plurality" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can be represented by: a, b, c, ab, ac, bc or abc, where a, b, c can be single or plural.
[0086] In addition, it can be understood that in various embodiments of the present invention, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0087] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0088] In several embodiments provided by the present invention, it should be understood that the disclosed equipment, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of functional modules / units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point, the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms. The unit described as a separate component may or may not be physically separated, and the component displayed as a unit may or may not be a physical unit, that is, it may be located in one place, or it may be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit.
[0089] If the method is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0090] Finally, it should be noted that the above is only a preferred embodiment of the present invention. It should be pointed out that although the preferred embodiment of the present invention has been described, for ordinary technicians in this technical field, once the basic creative concept of the present invention is known, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the protection scope of the present invention. Therefore, the attached claims are intended to be interpreted as including the preferred embodiment and all changes and modifications that fall within the scope of the embodiments of the present invention.
Claims
1. A method for leveling and rendering point cloud data of a slab surface, characterized in that: include: Acquire a point cloud data matrix of the slab surface collected by a 3D camera, represent the point cloud data matrix in a three-dimensional space, and then level the data in the point cloud data matrix to obtain leveled point cloud data; For the leveled point cloud data, obtain the corresponding relative depth data matrix; The relative depth data matrix is rendered to obtain a rendering image.
2. The method for leveling and rendering slab surface point cloud data according to claim 1, characterized in that: The slab surface point cloud data matrix Z collected by the 3D camera H×W It is a two-dimensional matrix with H rows and W columns. The data in the matrix is of floating point type, which represents the distance value from the captured target surface to the camera calibration plane. When the point cloud data matrix is represented in three-dimensional space, the column direction of the point cloud data matrix is used as the horizontal direction, the row direction of the point cloud data matrix is used as the longitudinal direction, and the data size in the point cloud data matrix is used as the vertical direction.
3. The method for leveling and rendering slab surface point cloud data according to claim 2, characterized in that: The step of leveling the data in the point cloud data matrix to obtain the leveled point cloud data includes: The PCA algorithm is used to calculate the principal component direction of the point cloud data matrix; The data in the point cloud data matrix is basically leveled with reference to the principal component direction.
4. The method for leveling and rendering slab surface point cloud data according to claim 3, characterized in that: Taking the principal component direction as a reference, basic leveling is performed on the data in the point cloud data matrix, including: Calculate the angle θ between the principal component direction and the xoy plane; Project the principal component direction on the xoy plane to obtain a projection line l1; Draw a straight line l2 through the origin that is perpendicular to the projected straight line l1; The data in the point cloud data matrix is basically leveled, and the formula is: With i ′ ,j =from i,j -d i,j tanθ Among them, z i,j Represents the data with row and column index values i, j in the point cloud data matrix; z i ' ,j Indicates z i,j The corresponding leveled data; d i,j Indicates z i,j The vertical distance from the current position to the line l2.
5. The method for leveling and rendering slab surface point cloud data according to claim 2, characterized in that: The step of obtaining a relative depth data matrix corresponding to the leveled point cloud data includes: Traverse each column of data along the horizontal axis in the point cloud data matrix, and for the current column of data traversed, cut out a matrix with the current column of data as the center, a width of the preset width value W0, and a length of H on both sides around it along the horizontal axis. And take The median value of is used as the reference value, and the current column data is subtracted from the reference value to obtain the relative depth data of the current column data. After traversing the entire point cloud data matrix, the relative depth data matrix Z′ composed of the relative depth data corresponding to each column data is obtained. H×W .
6. The method for leveling and rendering slab surface point cloud data according to claim 5, characterized in that: The preset width value W0 is 2 to 3 times the maximum defect width on the slab surface.
7. The method for leveling and rendering slab surface point cloud data according to claim 4, characterized in that: Rendering the relative depth data matrix to obtain a rendering image includes: For the relative depth data matrix Z′ H×W Amplify the data to obtain the amplified data right Rendering Convert to RGB pseudo-color image as global rendering; For Z′ H×W Over-rendering technology is used to enhance the representation of defects. Over-rendering is performed in the direction of the principal component at a set distance interval to obtain a local rendering image. The global rendering and the local rendering are used together as the basic data for subsequent slab surface defect detection.
8. The method for leveling and rendering slab surface point cloud data according to claim 7, characterized in that: For the relative depth data matrix Z′ H×W Amplify the data to obtain the amplified data The formula is: Among them, λ is the data expansion factor.
9. The method for leveling and rendering slab surface point cloud data according to claim 7, characterized in that: The pair Rendering Convert to RGB pseudo-color image, including: right Performs 3 separate transforms to produce a composite RGB image.
10. The method for leveling and rendering slab surface point cloud data according to claim 7, characterized in that: The pair Z′ H×W Over-rendering technology is used to enhance the representation of defects. By over-rendering in the direction of the principal component at a set distance interval, a local rendering image is obtained, including: For Z′ H×W , within its data range, draw multiple straight lines parallel to l2 at a fixed preset interval μ in the horizontal direction, and Z′ H×W Divide into multiple regions; perform separate rendering calculations on the data between the linear equation y-tan(90+α)x+kμ≥0 and y-tan(90+α)x+(k+1)μ≤0; where x and y represent the horizontal and vertical coordinates of the data, respectively; α represents the angle between the projection line l1 and the horizontal axis in the xoy plane; separate rendering is to amplify the data based on the maximum and minimum values of the data in the corresponding region, and the formula is: Among them, Z′ k Represents the data in the kth region; Represents Z′ k The corresponding enlarged data; After completing the data amplification of each interval, the amplified data is rendered as a pseudo-color image.
