CN115984354A - Shape detection method and object shape detection system - Google Patents

Shape detection method and object shape detection system Download PDF

Info

Publication number
CN115984354A
CN115984354A CN202310018769.5A CN202310018769A CN115984354A CN 115984354 A CN115984354 A CN 115984354A CN 202310018769 A CN202310018769 A CN 202310018769A CN 115984354 A CN115984354 A CN 115984354A
Authority
CN
China
Prior art keywords
detection
shape
data
detected object
points
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
Application number
CN202310018769.5A
Other languages
Chinese (zh)
Inventor
盛文波
魏海永
丁有爽
邵天兰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Mech Mind Robotics Technologies Co Ltd
Original Assignee
Mech Mind Robotics Technologies Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Mech Mind Robotics Technologies Co Ltd filed Critical Mech Mind Robotics Technologies Co Ltd
Priority to CN202310018769.5A priority Critical patent/CN115984354A/en
Publication of CN115984354A publication Critical patent/CN115984354A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Length Measuring Devices With Unspecified Measuring Means (AREA)

Abstract

The invention provides a shape detection method, an object shape detection system and a computer-readable storage medium, wherein the shape detection method comprises the following steps: scanning to obtain point cloud data; dividing a scanning space into a plurality of partitions of a plurality of levels according to a preset method; selecting a point from the point cloud data as a detection point; selecting a preset number of detection points in the same subarea of different levels where the detection points are located as a group of detection data; selecting a plurality of groups of detection data, and establishing a RANSAC candidate model set; and in the RANSAC candidate model set, point cloud data of detection points in the detection data are substituted into a shape detection formula, and the shape of the detected object is detected. The embodiment of the invention establishes the candidate model set by using the detection points in the same subarea in different levels, can improve the probability that the detection points are positioned on the same detected object, can be used for carrying out conventional shape detection, and simultaneously provides a screening method of the detection points, thereby improving the efficiency of the shape detection.

Description

Shape detection method and object shape detection system
Technical Field
The present invention relates generally to the field of machine vision technology, and more particularly to a shape detection method and an object shape detection system.
Background
With the development of technology, artificial intelligence is more and more widely applied in production and life, wherein machine vision is an important branch of artificial intelligence, and can be applied to the fields of object identification, screening, detection and the like to obtain information such as the shape, the pose and the like of a detected object, for example, screening materials in the production and transfer process or detecting shape defects of products and the like.
At present, a shape detection and identification method, especially high-precision shape detection, needs to use a large amount of point cloud data for calculation after point cloud data of a detected object is obtained, wherein point cloud random selection involved in calculation needs to be subjected to a large amount of calculation and is limited by hardware, and application efficiency of machine vision in the aspect of shape detection is low. Moreover, when the number of detected objects in the scanning range is uncertain, the random selection mode further affects the shape detection efficiency and accuracy, taking a plane as an example, according to the mathematical definition of the plane, three points which are not on the same straight line can determine a plane, when the three points are located on different detected objects, the plane defined by the three points has no meaning due to the absence of a solid plane, and even the detection result can be affected; if three points are selected within a small range to improve the probability that the three points are on the same detected object, the detection accuracy is reduced due to the too close distance between the three points, and therefore, the shape detection method needs to be improved.
The statements in the background section are merely prior art as they are known to the inventors and do not, of course, represent prior art in the field.
Disclosure of Invention
In view of one or more of the drawbacks of the prior art, the present invention provides a shape detection method, including:
scanning to obtain point cloud data;
dividing a scanning space into a plurality of partitions of a plurality of levels according to a preset method;
selecting a point from the point cloud data as a detection point;
selecting a preset number of detection points in the same subarea of different levels where the detection points are located as a group of detection data;
selecting a plurality of groups of detection data, and establishing a RANSAC (Random Sample Consensus) candidate model set;
and in the RANSAC candidate model set, point cloud data of detection points in the detection data are substituted into a shape detection formula, and the shape of the detected object is detected.
According to an aspect of the present invention, in the step of dividing the scanning space into the plurality of partitions of the plurality of levels according to the preset method, the first level is divided into eight partitions according to an octree method, a next level of the first level divides one partition in the first level into eight partitions according to the octree method, and so on, the plurality of partitions are obtained by dividing the plurality of levels.
According to one aspect of the invention, wherein the number of levels are 5-8 levels.
According to an aspect of the invention, wherein the number of the detection points and the shape detection formula are selected according to a desired shape of the detected object.
According to an aspect of the invention, the shape detection method further comprises:
in the RANSAC candidate model set, carrying out shape validity check on detection data according to the space coordinates and the normal direction of detection points;
discarding the detection data with unqualified shape validity check.
According to an aspect of the present invention, the step of detecting the shape of the detected object includes: and continuously acquiring detection data in the RANSAC candidate model set until the stopping probability is triggered.
According to an aspect of the present invention, the shape detection method further includes:
and performing shape fitting according to the point cloud data of the detection points in the detection data triggering the stopping probability, wherein the fitted shape is the same as the ideal shape of the detected object.
According to an aspect of the present invention, the step of performing shape fitting according to point cloud data of detection points in the detection data of trigger stop probability includes: the shape fit is modified using an optimizer, wherein the optimizer includes one or more of newton's method, gaussian-newton iterative algorithm, levenberg-marquardt algorithm.
According to an aspect of the present invention, the step of detecting the shape of the detected object includes:
judging whether the deviation of the point cloud data of the detection point in the current detection data and the ideal shape of the detected object exceeds a threshold value;
and triggering the stopping probability when the deviation of the point cloud data of the detection point in the current detection data and the ideal shape of the detected object does not exceed a threshold value.
According to an aspect of the invention, wherein the selecting the plurality of sets of test data, the establishing a RANSAC candidate model set comprises:
calculating the minimum number of detection data in the RANSAC candidate model set according to the super-geometric distribution model and the probability that the fitting shape of the detection point in the detection data is the same as the ideal shape of the detected object or within an error threshold;
and extracting a plurality of groups of detection data with specific quantity according to the calculation result, and establishing a RANSAC candidate model set.
According to one aspect of the invention, the invention also includes an object shape detection system comprising:
an information acquisition module configured to be able to acquire point cloud data of a detected object; and
a control system in signal connection with the information acquisition module and capable of performing the shape detection method as described above.
According to one aspect of the invention, the invention also includes a computer-readable storage medium comprising computer-executable instructions stored thereon which, when executed by a processor, implement the shape detection method as described above.
Compared with the prior art, the embodiment of the invention provides the shape detection method, the candidate model set is established by using the detection points in the same partition in different levels, the probability that the detection points in the candidate model set are positioned on the same detected object can be improved, the influence of the uncertain number of the detected objects on the shape detection precision is reduced, the shape detection method can be used for carrying out conventional shape detection, the shape detection precision is improved, and meanwhile, the detection point screening method is provided, and the shape detection efficiency is improved. The invention also comprises an object shape detection system, which can improve the efficiency and the precision of shape detection by using the shape detection method to detect the shape of the object. The invention also includes a computer readable storage medium capable, when executed, of implementing the aforementioned shape detection method.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention and not to limit the invention. In the drawings:
FIG. 1 is a schematic diagram of a prior art linear shape detection;
FIG. 2 is a flow chart illustrating a method for shape detection according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a plurality of partitions whose scanning space is divided into layers according to an embodiment of the present invention;
FIG. 4 is a schematic flow chart diagram of a method of shape detection including shape validity checking in one embodiment of the present invention;
FIG. 5 is a flow diagram of a method of shape detection including triggering a stopping probability in one embodiment of the invention;
FIG. 6 is a flow diagram of a shape detection method including a process of building a RANSAC candidate model set in one embodiment of the invention;
fig. 7 is a block diagram of the structure of an object shape detection system in an embodiment of the present invention.
Detailed Description
In the following, only certain exemplary embodiments are briefly described. As those skilled in the art will recognize, the described embodiments may be modified in various different ways, all without departing from the spirit or scope of the present invention. Accordingly, the drawings and description are to be regarded as illustrative in nature, and not as restrictive.
In the description of the present invention, it is to be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", and the like, indicate orientations and positional relationships based on those shown in the drawings, and are used only for convenience of description and simplicity of description, and do not indicate or imply that the device or element being referred to must have a particular orientation, be constructed and operated in a particular orientation, and thus, should not be considered as limiting the present invention. Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, features defined as "first", "second", may explicitly or implicitly include one or more of the described features. In the description of the present invention, "a plurality" means two or more unless specifically defined otherwise.
In the description of the present invention, it should be noted that unless otherwise explicitly stated or limited, the terms "mounted," "connected" and "connected" are to be construed broadly, e.g., as being fixed or detachable or integral, either mechanically, electrically or communicatively coupled; either directly or indirectly through intervening media, either internally or in any other relationship. The specific meanings of the above terms in the present invention can be understood according to specific situations by those of ordinary skill in the art.
In the present invention, unless otherwise expressly stated or limited, "above" or "below" a first feature means that the first and second features are in direct contact, or that the first and second features are not in direct contact but are in contact with each other via another feature therebetween. Also, the first feature being "on," "above" and "over" the second feature includes the first feature being directly on and obliquely above the second feature, or merely indicating that the first feature is at a higher level than the second feature. "beneath," "under" and "beneath" a first feature includes the first feature being directly beneath and obliquely beneath the second feature, or simply indicating that the first feature is at a lesser elevation than the second feature.
The following disclosure provides many different embodiments or examples for implementing different features of the invention. To simplify the disclosure of the present invention, specific example components and arrangements are described below. Of course, they are merely examples and are not intended to limit the present invention. Moreover, the present invention may repeat reference numerals and/or reference letters in the various examples, which have been repeated for purposes of simplicity and clarity and do not in themselves dictate a relationship between the various embodiments and/or configurations discussed. In addition, the present invention provides examples of various specific processes and materials, but one of ordinary skill in the art may recognize applications of other processes and/or uses of other materials.
The preferred embodiments of the present invention will be described in conjunction with the accompanying drawings, and it should be understood that they are presented herein only to illustrate and explain the present invention and not to limit the present invention.
When the machine vision is used for shape detection, after point cloud data is obtained, part of detection points are randomly selected for shape detection, for example, according to the straight line detection shown in fig. 1, a straight line can be determined by two points according to the mathematical definition of the straight line, two points are randomly selected from the point cloud data shown in fig. 1, a determined straight line is obtained, the pose of the straight line in the space can be obtained after calculation, for example, the pose of the straight line is represented by the expression of the straight line in the coordinate system after a coordinate system is established, then the straight line is compared and judged with an ideal straight line (a continuous straight line in the coordinate system in fig. 1), when the deviation of the straight line and the ideal straight line is large, the straight line is abandoned, two points are newly selected, and the operation is repeated. And finally completing the shape detection process by selecting a large number of detection points and calculating. However, the above shape detection method needs to satisfy the requirement that the detection points are located on the same detected object, and still take linear shape detection as an example, if two detection points selected in one detection calculation are located on different straight lines, the two points can also determine one straight line, but the straight line entity does not exist in the scanning space, and therefore, the calculation process of using the two points to perform shape detection is invalid calculation. The calculation process of the linear shape detection is relatively simple, and for the plane curved surface shape detection with a more complicated calculation process, the probability that the selected detection point is positioned on different detected objects is higher, the number of invalid calculation processes is higher, and the accuracy and the efficiency of the shape detection are influenced.
Fig. 2 shows a detailed flow of the shape detection method 100 according to an embodiment of the invention, and the shape detection method 100 is described below with reference to fig. 2.
As shown in fig. 2, in step S101, point cloud data is obtained by scanning, for example, the detected object is located in a fixed space, the point cloud data in the field of view can be obtained by a scanning device, the point cloud data may be uniformly distributed in the scanning space, or a rule may be preset, and denser point cloud data is obtained in a partial area in the scanning space, so as to improve the detection accuracy.
In step S102, a scanning space is divided into a plurality of partitions of several levels according to a preset method, wherein the scanning space is a field of view range of a scanning device or a part of the field of view range of the scanning device. In this embodiment, the point cloud data can represent the spatial position of the point, so that the scanning space is a three-dimensional space, and the scanning space may be a preset spatial range in the shape of a rectangular solid, a circular truncated cone, or a truncated pyramid according to the specific differences of the scanning devices.
The scanning space is divided into a plurality of partitions of a plurality of levels, that is, the scanning space is divided into a plurality of levels, each level further comprises a plurality of partitions, the specific levels and partition dividing method can be divided according to the shape of the scanning space, in a preferred embodiment of the present invention, as shown in fig. 3, the scanning space is roughly in a square shape, a first level divides the complete scanning space into eight partitions according to an octree method, the scanning space is divided into eight partitions of 4 × 2 as shown in fig. 3 in three pairwise perpendicular planes at a spatial center position of the scanning space, further, a next level of the first level divides each partition in the first level into eight partitions again according to the octree method, one partition faces forward at the upper left corner as shown in fig. 3, and so on, and finally the scanning space is divided into a plurality of partitions of a plurality of levels.
Of course, according to various embodiments of the present invention, the method of partitioning the scanning space is not limited to that shown in fig. 3, and for example, for a scanning space of a flat shape with a small height, the hierarchy and the partition may be divided only in a plane without layering in the height direction. Meanwhile, the partition dividing modes in different levels can also be different, and the invention is not limited in the invention. According to the preferred embodiment of the present invention, the number of the layers for dividing the scanning space can be adjusted according to the conditions of the shape detection precision, the ideal shape of the detected object, and the like, for example, 5-8 layers, and specifically, 6 layers.
In step S103, one point in the point cloud data is selected as a detection point, and at least two detection points are needed in the shape detection, where the first detection point may be selected arbitrarily or according to other optimization methods, for example, the selection probability of the point cloud data located at the edge position in the scanning space is lower than that of the point cloud data located at the middle position, thereby reducing the calculation amount.
In step S104, a preset number of inspection points are selected as a set of inspection data in the same partition of different levels where the inspection points are located. According to the mathematical definition of the ideal shape of the detected object, at least one detection point needs to be selected again, in this embodiment, the selected detection point and the detection point selected in step S103 are located in the same partition of different levels, for example, the scanning space is divided into eight partitions of 4 × 2 per level in the manner shown in fig. 3, and the number of the partitions can be distinguished by the number of the levels of the layer and the number of the partitions. The detection point selected in step S103 has a corresponding partition in each hierarchy, for example, the detection point selected in step S103 is located in partition No. 3 in the first hierarchy, and the detection point is also located in one partition in the corresponding second hierarchy in partition No. 3 in the first hierarchy. When other detection points are selected in step S104, according to this embodiment, the other detection points are located in the same partition as the detection points selected in step S103, for example, in the first hierarchy, the other detection points also select point cloud data in partition No. 3, and so on, and the detection points are selected in the same manner in other hierarchies.
The number of the detection points is determined by the ideal shape of the shape detection, for example, three non-collinear detection points are required to be obtained when the plane shape detection is carried out, and two detection points with different normal directions are required to be obtained when the cylindrical surface shape detection is carried out. Therefore, after one detection point is selected in step S103, a sufficient number of detection points need to be selected in step S104, the detection points selected in step S104 may be in the same hierarchy, for example, two detection points need to be acquired, the two detection points may be in the same hierarchy, and the detection point selected in step S103 is selected in the partition; it is also possible to select a sufficient number of detection points within different levels.
After a sufficient number of detection points are acquired, for example, in the plane shape detection, three non-collinear detection points are acquired, and the three detection points are used as a set of detection data for subsequent shape detection calculation.
In step S105, selecting multiple sets of detection data, establishing a RANSAC candidate model set, and obtaining multiple sets of detection data according to the foregoing method, specifically, after selecting a detection point in step S103, obtaining multiple sets of detection data having the detection point according to a partition where the detection point is located, that is, repeating step S104 multiple times to obtain multiple sets of detection data; preferably, step S103 may be repeated multiple times to reselect a detection point, and then step S104 is performed to obtain multiple sets of detection data.
The RANSAC candidate model set is a sample data set containing abnormal data, wherein detection data form a plurality of groups of candidate shape detection models for carrying out shape detection in subsequent steps, in the shape detection, the possibility that the shape of a detected object does not conform to an ideal shape exists, namely the abnormal data, and after the plurality of groups of detection data are obtained, the abnormal data are included, and subsequent shape detection calculation can be carried out by depending on the RANSAC candidate model set.
In step S106, point cloud data of detection points in the detection data is substituted into a shape detection formula in the RANSAC candidate model set, and shape detection is performed on the detected object. The shape detection formula is selected according to the specific ideal shape of the detected object, taking a cylindrical bar as an example, the ideal shape of the detected object is a fixed diameter and a cylindrical surface, the detection data is obtained according to the steps, the cylindrical surface determined by the detection points in the group of detection data can be obtained by combining the cylindrical surface shape formula, the cylindrical surface is compared with the cylindrical surface with the ideal shape of the detected object to obtain a deviation value, and the accuracy of the group of detection data can be judged by setting a threshold value for the deviation value. And carrying out shape detection on the multiple groups of detection data to obtain the shape of the detected object, and further obtaining the pose information of the detected object according to the space coordinates of the detection points.
When the number of detected objects in a scanning space is uncertain, selecting detection points with a short distance to form detection data can cause reduction of detection precision, surface information of the detected objects cannot be comprehensively reflected, the distance of the detection points is not limited, the detection points are randomly selected, the detection points on different detected objects cannot be distinguished, the probability that the detection points in the same group of detection data are located on the same detected object cannot be guaranteed, and a partially invalid detection result can be generated. For the probability that the check point is located same detected object in the improvement detection data, the utility model provides a carry out the method of level subregion to scanning space, utilize the method in step S104 to obtain the check point, the check point that is located same subregion in different levels has avoided the check point distance too near to lead to the problem that can't fully reflect detected object surface shape, simultaneously, have the continuity in detected object' S shape, the method that utilizes in step S104 selects the check point can improve the check point and the check point that selects in step S103 is located the probability on same detected object, reduce invalid calculation, improve the accuracy and the detection efficiency that the shape detected.
Fig. 4 shows a specific flow of the shape detection method 200 according to the preferred embodiment of the present invention, and step S201 in the shape detection method 200 is substantially the same as step S101 in the shape detection method 100, and is not repeated herein. The embodiment specifically includes a process of checking the shape validity, which is explained below with reference to fig. 4.
In step S202, a plurality of sets of detection data are selected to build a RANSAC candidate model set, wherein the selection of the detection points in the detection data can be randomly selected, and further, according to the preferred embodiment of the present invention, the detection data are selected according to the aforementioned shape detection method 100 to improve the probability that the detection points are located on the same detected object. The RANSAC candidate model set in this embodiment is also a sample data set including abnormal data, and subsequent shape detection calculation can be performed by relying on the RANSAC candidate model set.
In step S203, in the RANSAC candidate model set, shape validity check is performed on the detection points according to the spatial coordinates and the normal direction of the detection points. Taking a planar shape as an example, three non-collinear points can define a plane, but at the same time, for a plane, three points also have other geometrical constraints, such as the normals of the three points being parallel to each other. In this embodiment, the detection data is point cloud data of the detection points, which includes spatial coordinates and a normal direction, and in order to further reduce the calculation complexity of the shape detection, the present embodiment proposes to perform shape validity check on the detection data. Still taking plane detection as an example, the spatial coordinates of the three detection points can determine a plane, before performing plane shape detection calculation, it is determined whether normal directions of the three detection points are parallel or whether a deviation angle exceeds a threshold value, if the normal deviation of the three detection points is large, it is indicated that the three detection points are not located on the same plane entity, in step S204, detection data that is unqualified in shape validity check is discarded, and subsequent calculation is not needed.
For the process of carrying out shape detection on different ideal shapes, different geometric constraint conditions can be selected to carry out shape validity check on detection points in detection data, further, according to the preferred embodiment of the invention, when the detection data is obtained, redundant data exceeding the minimum number of the detection points can be obtained and used for shape validity check, for example, cylindrical surface shape detection, only one cylindrical surface can be determined by needing at least two detection points with different normal directions, when the detection points are selected, one detection point can be additionally selected as redundant data, the cylindrical surface can be determined by using any two detection points in the three detection points, the other detection point can be used for carrying out shape validity check on the cylindrical surface, the detection data with unqualified shape validity check is abandoned, and invalid calculation amount is reduced. Further, according to the preferred embodiment of the present invention, the redundant data may not be limited to the complete point cloud data of the detection points, but may be any data capable of providing a geometric constraint check, such as only including the spatial coordinates of the detection points, or only including the normal direction of the detection points.
Fig. 5 shows a specific flow of the shape detection method 300 in the preferred embodiment of the present invention, wherein the case of triggering the stop probability is included, and specifically, steps S301, S302, S303, S304, and S305 in the shape detection method 300 are substantially the same as steps S101, S102, S103, S104, and S105 in the shape detection method 100, and are not described again here.
In step S306, detection data is continuously acquired within the RANSAC candidate model set for performing shape detection on the detected object. In step S307, it is determined whether to trigger the stop probability, and when the stop probability is not triggered, the process returns to step S306 to continue to acquire the detection data and perform the shape detection calculation; when the stop probability is triggered, according to the preferred embodiment of the present invention, in step S308, the point cloud data of the detection points in the detection data is selected for shape fitting, and the fitted shape is the same as the ideal shape of the detected object, for example, the ideal shape of the detected object is a plane, when the shape fitting is performed, the fitted shape is a plane, and the other shapes are the same.
The embodiment provides that when the stopping probability is triggered, the shape detection calculation is stopped according to the detection data, and the fitting shape is obtained according to the acquired detection data, so that the fitting shape can be used for reflecting the surface shape of the detected object. According to the foregoing, a large amount of data needs to be calculated when shape detection is performed, and in practical application, it is impossible to know which group of detection data completely conforms to the surface real shape of the detected object, and meanwhile, it is impossible to obtain detection data completely free of errors, so that the stop probability is set in this embodiment, and after the stop probability is triggered, shape fitting is preferentially performed, and a shape detection process is completed.
Preferably, the shape fitting according to the point cloud data of the detection points in the detection data may specifically be to modify the shape fitting by using an optimizer, where the optimizer includes one or more of newton method, gaussian-newton iterative algorithm, and levenberg-marquardt algorithm, and according to a preferred embodiment of the present invention, the levenberg-marquardt algorithm is selected, and compared with other algorithms, the levenberg-marquardt algorithm can improve stability of the shape fitting on the premise of ensuring speed, and is suitable for shape detection of a cylindrical shape, and for shape detection of other shapes, a person skilled in the art can select a suitable optimization algorithm, which is not limited in the present invention. The above algorithms can be applied to shape fitting, and the shape fitting or verification optimization by using a plurality of algorithms can improve the fineness of the shape fitting.
According to a preferred embodiment of the present invention, the stopping probability may be set according to a deviation between the ideal shape of the detected object and the shape detection calculation, specifically, for example, after performing the shape detection calculation on a set of detection data in the RANSAC candidate model set, a deviation between the point cloud data of the detection point in the set of detection data and the ideal shape of the detected object is determined. In the actual detection process, the point cloud data of the detection points in the detection data often cannot be completely matched with the ideal shape of the detected object, no matter the actual error of the surface shape of the detected object or the error of the point cloud data acquired by scanning equipment, the point cloud data of the detection points in the detection data may have a deviation from the ideal shape of the detected object, the deviation is quantified, such as an angle deviation and a distance deviation, a proper threshold value can be set according to the detection precision, under the condition that the deviation between the point cloud data of the detection points in the current detection data and the ideal shape of the detected object does not exceed the threshold value, a stopping probability is triggered, further, an average deviation threshold value can be added, the surface shape determined by the point cloud data of the detection points in the current detection data and the ideal shape of the detected object are within an error allowable range, under the condition, the stopping probability can be triggered, and in the subsequent steps, the point cloud data of the detection points in the current detection data group is used for shape fitting.
FIG. 6 shows a detailed flow of a shape detection method 400 according to another preferred embodiment of the present invention, which includes a method for calculating a stopping probability using a hypergeometric distribution model. Steps S401, S402, S403, S404, S407, and S408 in the shape detection method 400 are substantially the same as steps S301, S302, S303, S304, S306, and S308 in the shape detection method 300, and are not described again.
In this embodiment, in step S405, the minimum number of detection data in the RANSAC candidate model set is calculated according to the probability that the fitting shape of the detection points in the hyper-geometric distribution model and the detection data is the same as the ideal shape of the detected object or within the error threshold, specifically, at least x number of detection data needs to be generated by using the hyper-geometric distribution model to satisfy the probability that the ideal shape of the detected object is within the error threshold, which may be set to 99.9% according to an embodiment of the present invention. The specific formula of the super-geometric distribution can be summarized as follows:
Figure BDA0004041043530000121
assuming that N samples are included in a finite population, where the number of qualified samples is m and the remaining N-m are the number of unqualified samples, N samples, out of which there are k probabilities of being qualified, need to be extracted from a total of N data setsCan be obtained by the calculation of the above formula. In the formula C n N Representing the number of methods of extracting N samples from N total samples, C k m Representing the number of methods by which k samples are extracted from m qualifying samples, C m-k N-m Representing the number of methods for extracting N-k samples from N-m samples with a poor quality. As can be seen from the above equation, the hyper-geometric distribution is determined by the total number of samples N, the number of qualified samples m, and the number of extractions N.
Further, where k is the expected value and variance of the qualification, the expected value and variance can be calculated by:
Figure BDA0004041043530000131
Figure BDA0004041043530000132
in this embodiment, a scanning device scans a detected object to obtain a large amount of point cloud data, where N detection points exist in a scene, N represents the minimum number of candidate detection points, k represents the size of a minimum set defining an ideal shape of the detected object, k sets of detection data need to be obtained to obtain a set of detection data that is the same as the ideal shape of the detected object or within an error threshold, and the probability of obtaining a set of detection data that is the same as the ideal shape of the detected object or within the error threshold in one detection is:
Figure BDA0004041043530000133
after the s sets of inspection data are selected, the probability P (n, s) of successfully inspecting the ideal shape of the inspected object is complementary to the probability of inspecting the s sets of inspection data consecutively, i.e. the inspection is performed
P(n,s)=1-(1-P(n)) s
Solving s to obtain the minimum detection times which are needed to be carried out, wherein the minimum detection needed to be carried out is T,P(n,T)≥P t in which P is t In order to set the probability according to the shape detection accuracy to, for example, 99.9%, according to the above equation:
Figure BDA0004041043530000134
the above formula can be used to calculate and obtain the minimum number of detection times, i.e. a group of detection data which is the same as the ideal shape of the detected object or within the error threshold value can be obtained after completing the shape detection for T times. In step S406, according to the calculation result in step S405, not less than the minimum number of detection data is extracted, and a RANSAC candidate model set is established.
Further, in step S408, a group of detection data may be preferentially selected for shape fitting, and the shape detection process is completed, for example, the detection data meeting the error threshold and having the shape detection result with the minimum error from the ideal shape of the detected object in the RANSAC candidate model set are selected for shape fitting.
As shown in fig. 7, the present invention further includes an embodiment of an object shape detection system 1, where the object shape detection system 1 includes an information acquisition module 10 and a control system 20, the information acquisition module 10 is in signal connection with the control system 20, the information acquisition module 10 can acquire point cloud data of a detected object, and specifically, the information acquisition module 10 may be a scanning device such as an industrial camera. The control system 20 can perform the shape detection method described in the foregoing embodiment, and further, the control system 20 can be connected to a device for controlling the subsequent operations, such as performing grabbing sorting after completing the shape detection, or outputting the shape detection result.
The present invention also includes an embodiment of a computer-readable storage medium, wherein the computer-readable storage medium comprises computer-executable commands stored thereon, which when executed by a processor implement the shape detection method as described in the previous embodiments. In particular, the computer readable storage medium may be any form of storage medium for an application, such as a magnetic disk, hard disk, magnetic tape, optical disk, and so forth.
Finally, it should be noted that: although the present invention has been described in detail with reference to the foregoing embodiments, it will be apparent to those skilled in the art that changes may be made in the embodiments and/or equivalents thereof without departing from the spirit and scope of the invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (12)

1. A shape detection method, comprising:
scanning to obtain point cloud data;
dividing a scanning space into a plurality of partitions of a plurality of levels according to a preset method;
selecting a point from the point cloud data as a detection point;
selecting a preset number of detection points in the same subareas of different levels where the detection points are located as a group of detection data;
selecting a plurality of groups of detection data, and establishing a RANSAC candidate model set;
and in the RANSAC candidate model set, point cloud data of detection points in the detection data are substituted into a shape detection formula, and the shape of the detected object is detected.
2. The shape detection method according to claim 1, wherein in the step of dividing the scanning space into the plurality of partitions of the plurality of levels according to the preset method, the first level is divided into eight partitions according to an octree method, a next level of the first level divides one partition in the first level into eight partitions according to the octree method, and so on, the plurality of partitions are obtained by dividing the plurality of levels.
3. The shape detection method of claim 2, wherein the number of levels are 5-8 levels.
4. The shape detection method according to claim 1, wherein the number of the detection points and the shape detection formula are selected in accordance with an ideal shape of the detected object.
5. The shape detection method according to claim 1, further comprising:
in the RANSAC candidate model set, carrying out shape validity check on detection data according to the space coordinates and the normal direction of detection points;
discarding detection data with unqualified shape validity check.
6. The shape detection method according to any one of claims 1 to 5, wherein the step of performing shape detection on the detected object includes: and continuously acquiring detection data in the RANSAC candidate model set until the stopping probability is triggered.
7. The shape detection method according to claim 6, further comprising:
and performing shape fitting according to the point cloud data of the detection points in the detection data triggering the stopping probability, wherein the fitted shape is the same as the ideal shape of the detected object.
8. The shape detection method according to claim 7, wherein the step of performing shape fitting according to point cloud data of detection points in the detection data of the trigger stop probability includes: the shape fit is modified using an optimizer, wherein the optimizer includes one or more of newton's method, gaussian-newton iterative algorithm, levenberg-marquardt algorithm.
9. The shape detection method according to claim 6, wherein the step of performing shape detection on the detected object includes:
judging whether the deviation of the point cloud data of the detection point in the current detection data and the ideal shape of the detected object exceeds a threshold value;
and triggering the stopping probability when the deviation of the point cloud data of the detection point in the current detection data and the ideal shape of the detected object does not exceed a threshold value.
10. The shape detection method according to any one of claims 1 to 5, wherein the selecting a plurality of sets of detection data, the establishing a RANSAC candidate model set comprises:
calculating the minimum number of detection data in the RANSAC candidate model set according to the super-geometric distribution model and the probability that the fitting shape of the detection point in the detection data is the same as the ideal shape of the detected object or within an error threshold;
and extracting a plurality of groups of detection data with specific quantity according to the calculation result, and establishing a RANSAC candidate model set.
11. An object shape detection system comprising:
an information acquisition module configured to be able to acquire point cloud data of a detected object; and
a control system in signal connection with the information acquisition module and capable of performing the shape detection method of any one of claims 1-10.
12. A computer-readable storage medium comprising computer-executable instructions stored thereon, which when executed by a processor implement the shape detection method of any one of claims 1-10.
CN202310018769.5A 2023-01-06 2023-01-06 Shape detection method and object shape detection system Pending CN115984354A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310018769.5A CN115984354A (en) 2023-01-06 2023-01-06 Shape detection method and object shape detection system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310018769.5A CN115984354A (en) 2023-01-06 2023-01-06 Shape detection method and object shape detection system

Publications (1)

Publication Number Publication Date
CN115984354A true CN115984354A (en) 2023-04-18

Family

ID=85972167

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310018769.5A Pending CN115984354A (en) 2023-01-06 2023-01-06 Shape detection method and object shape detection system

Country Status (1)

Country Link
CN (1) CN115984354A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112891945A (en) * 2021-03-26 2021-06-04 腾讯科技(深圳)有限公司 Data processing method and device, electronic equipment and storage medium
CN114898043A (en) * 2022-05-19 2022-08-12 中国南方电网有限责任公司超高压输电公司检修试验中心 Laser point cloud data tile construction method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112891945A (en) * 2021-03-26 2021-06-04 腾讯科技(深圳)有限公司 Data processing method and device, electronic equipment and storage medium
CN114898043A (en) * 2022-05-19 2022-08-12 中国南方电网有限责任公司超高压输电公司检修试验中心 Laser point cloud data tile construction method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
R. SCHNABEL等: "Efficient RANSAC for Point-Cloud Shape Detection", 《COMPUTER GRAPHIC FORUM》, vol. 26, no. 2, pages 214 - 226, XP009150551 *

Similar Documents

Publication Publication Date Title
AU2010286429B2 (en) Method and apparatus for simultaneous localization and mapping of mobile robot environment
CN102818523B (en) Vision measurement method and measurement system of small workpiece
CN115731165B (en) Detection system and method for on-line size spot inspection of lithium battery
CN112233248A (en) Surface flatness detection method, system and medium based on three-dimensional point cloud
CN111859772A (en) Power line extraction method and system based on cloth simulation algorithm
CN111932669A (en) Deformation monitoring method based on slope rock mass characteristic object
JP2010256053A (en) Shape defect inspection device, shape modeling device, and shape defect inspection program
JPH10187991A (en) Method and device for pattern detection
CN116342718A (en) Calibration method, device, storage medium and equipment of line laser 3D camera
CN112033385A (en) Pier pose measuring method based on mass point cloud data
CN116150861A (en) Intelligent processing system for construction data of shear wall in high-intensity area
CN108008353B (en) Method for ensuring anchor position stability by utilizing anchor point mutual ranging
CN107966702B (en) construction method and device of environment map
CN115984354A (en) Shape detection method and object shape detection system
CN112597662A (en) Method and system for checking correctness and mistakes of building model
CN111609849B (en) Multi-station rendezvous positioning method and system
CN110458780A (en) 3D point cloud data de-noising method, apparatus, computer equipment and readable storage medium storing program for executing
CN112665530B (en) Light plane recognition device corresponding to projection line, three-dimensional measurement system and method
CN109816677A (en) A kind of information detecting method and device
CN115685127A (en) Method and device for analyzing settlement risk of target object based on point cloud data
CN115223882A (en) Method, device and equipment for determining dislocation of wafer test mapping map and storage medium
CN114638789A (en) Method and system for hole site detection
CN111415878B (en) Wafer-level automatic detection method, equipment and system
CN110968656B (en) Topographic map processing method and device
CN105719310B (en) Collision detection method and device

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