Non-contact space perimeter detection method, apparatus, device, and medium
By acquiring the initial point set of the target object in a 3D image, generating an intermediate point set according to preset rules, and finally determining the spatial perimeter of the target point set, the problem of accuracy in detecting the spatial perimeter of objects in 3D images is solved, and the accuracy of detection is improved.
Patent Information
- Application Number
- CN202111484509.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-07
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2041-12-07
AI Technical Summary
Existing technologies suffer from insufficient accuracy in detecting the spatial perimeter of objects in 3D images due to occlusion, exceeding the field of view, and changes in lighting, resulting in loss or error of image information.
By obtaining the initial point set of the target object in the three-dimensional image, determining the intermediate point set according to the preset rules, and generating the target point set, the spatial perimeter of the target contour is finally determined based on the target point set, avoiding errors caused by the unclear or missing initial point set.
It improves the accuracy of spatial perimeter detection of target contours, avoids errors caused by unclear or missing initial point sets, and enhances detection precision.
Smart Images

Figure CN114419128B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a non-contact space perimeter detection method, device, equipment and medium. Background Art
[0002] In recent years, with the development of hardware such as depth cameras, laser sensors, and image processors, as well as deep neural networks, 3D vision technology has been widely used in industrial robots. However, when determining the 3D image of an object, problems such as occlusion, out-of-field-of-view, and lighting variations may arise. These issues can cause loss of image information or errors in the image, leading to errors or even failure in 3D image recognition or detection. Summary of the Invention
[0003] The main purpose of the present invention is to provide a non-contact spatial perimeter detection method, device, equipment and medium, aiming to solve the problem of how to improve the accuracy of spatial perimeter detection of objects in three-dimensional images.
[0004] To achieve the above object, the present invention provides a non-contact space perimeter detection method, which includes the following steps:
[0005] Obtaining an initial point set of a target contour of a target object in a three-dimensional image;
[0006] Determine the intermediate point set corresponding to the initial point set according to a preset rule;
[0007] generating a target point set according to the intermediate point set, wherein the number of points in the target point set is greater than the number of points in the intermediate point set;
[0008] The spatial perimeter of the target contour is determined based on the target point set.
[0009] In one embodiment, the preset rule includes: determining a median point corresponding to each point in the initial point set; and determining the intermediate point set based on the median point corresponding to each point in the initial point set.
[0010] In one embodiment, the step of determining the median point corresponding to each point in the initial point set includes:
[0011] determining a plurality of points within a predetermined spatial range of each point in the initial point set;
[0012] Determining the median of a plurality of points within the preset spatial range;
[0013] The median is used as the median point corresponding to each point in the initial point set.
[0014] In an embodiment, the step of generating the target point set according to the intermediate point set comprises:
[0015] acquiring adjacent points in the intermediate point set;
[0016] generating a preset number of points between the adjacent points in the intermediate point set;
[0017] determining the target point set according to the median point and the preset number of points.
[0018] In an embodiment, before the step of generating the preset number of points between the adjacent points in the intermediate point set, the method further comprises:
[0019] determining a first spatial distance of the adjacent points in the intermediate point set;
[0020] determining the preset number according to the first spatial distance.
[0021] In an embodiment, the step of determining the spatial perimeter of the target contour according to the target point set comprises:
[0022] determining a second spatial distance between each adjacent point of the target point set;
[0023] determining the spatial perimeter of the target contour according to a sum value of the second spatial distances.
[0024] In an embodiment, before the step of acquiring the initial point set of the target contour of the target object in the three-dimensional image, the method further comprises:
[0025] controlling a camera to scan the target object a preset number of times;
[0026] acquiring a point cloud image corresponding to each scan, and generating a three-dimensional image of the target object from the point cloud image;
[0027] determining the target contour of the target object in the three-dimensional image.
[0028] To achieve the above object, the application further provides a non-contact spatial perimeter detection device, which comprises:
[0029] an acquisition module, configured to acquire an initial point set of a target contour of a target object in a three-dimensional image;
[0030] a determination module, configured to determine an intermediate point set corresponding to the initial point set according to a preset rule;
[0031] a generation module, configured to generate a target point set according to the intermediate point set, wherein the number of points in the target point set is greater than the number of points in the intermediate point set;
[0032] detecting a spatial perimeter of the target contour according to the target point set.
[0033] To achieve the above object, the present application provides a non-contact spatial perimeter detection device, which comprises a memory, a processor and a non-contact spatial perimeter detection program stored in the memory and executable on the processor, and the non-contact spatial perimeter detection program implements each step of the non-contact spatial perimeter detection method when executed by the processor.
[0034] To achieve the above object, the present application provides a computer readable storage medium, which stores a non-contact spatial perimeter detection program, and the non-contact spatial perimeter detection program implements each step of the non-contact spatial perimeter detection method when executed by a processor.
[0035] The present application provides a non-contact spatial perimeter detection method, device, equipment and medium, obtaining an initial point set of a target contour of a target object in a three-dimensional image; determining a middle point set corresponding to the initial point set according to a preset rule; generating a target point set according to the middle point set; and determining a spatial perimeter of the target contour according to the target point set. By determining the target point set, the spatial perimeter of the target contour is determined according to the target point set, which avoids errors caused by unclearness or absence of the initial point set, and improves the accuracy of the spatial perimeter detection of the target contour. BRIEF DESCRIPTION OF DRAWINGS
[0036] Figure 1 The figure is a hardware structure schematic diagram of the non-contact spatial perimeter detection device involved in the embodiment of the present application.
[0037] Figure 2 The figure is a flow schematic diagram of the first embodiment of the non-contact spatial perimeter detection method of the present application.
[0038] Figure 3 The figure is a flow schematic diagram of the second embodiment of the non-contact spatial perimeter detection method of the present application.
[0039] Figure 4 The figure is a logic structure schematic diagram of the non-contact spatial perimeter detection device of the present application.
[0040] The implementation, functional features and advantages of the present application will be further explained with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION
[0041] It should be understood that the specific embodiments described herein are only used to explain the present application, and are not used to limit the present application.
[0042] The main solution of the embodiment of the present application is: obtaining an initial point set of a target contour of a target object in a three-dimensional image; determining a middle point set corresponding to the initial point set according to a preset rule; generating a target point set according to the middle point set; and determining a spatial perimeter of the target contour according to the target point set.
[0043] By determining the target point set and determining the spatial perimeter of the target contour according to the target point set, the error caused by the unclearness or absence of the initial point set is avoided, and the accuracy of the spatial perimeter detection of the target contour is improved.
[0044] As an implementation scheme, the non-contact spatial perimeter detection device can be as shown in the following figure. Figure 1
[0045] The embodiment scheme of the present application relates to a non-contact spatial perimeter detection device, which can be a server or a terminal device. The terminal device can be a mobile phone, a tablet computer or a notebook computer, etc. The non-contact spatial perimeter detection device comprises a processor 101, such as a CPU, a memory 102 and a communication bus 103. The communication bus 103 is used to realize the connection and communication between these components.
[0046] The memory 102 can be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. As shown in the following figure, the memory 102 as a computer readable storage medium can include a non-contact spatial perimeter detection program; and the processor 101 can be used to call the non-contact spatial perimeter detection program stored in the memory 102 and perform the following operations: Figure 1
[0047] obtaining an initial point set of a target contour of a target object in a three-dimensional image;
[0048] determining a middle point set corresponding to the initial point set according to a preset rule;
[0049] generating a target point set according to the middle point set, wherein the number of points in the target point set is greater than the number of points in the middle point set;
[0050] determining a spatial perimeter of the target contour according to the target point set.
[0051] In an embodiment, the processor 101 can be used to call the non-contact spatial perimeter detection program stored in the memory 102 and perform the following operations:
[0052] determining a middle point corresponding to each point in the initial point set; and determining the middle point set according to the middle point corresponding to each point in the initial point set.
[0053] In an embodiment, the processor 101 can be configured to invoke a non-contact space perimeter detection program stored in the memory 102, and perform the following operations:
[0054] determining a plurality of points within a preset spatial range of each point in the initial point set;
[0055] determining a median of the plurality of points within the preset spatial range;
[0056] taking the median as the corresponding median point of each point in the initial point set.
[0057] In an embodiment, the processor 101 can be configured to invoke a non-contact space perimeter detection program stored in the memory 102, and perform the following operations:
[0058] obtaining adjacent points in the intermediate point set;
[0059] generating a preset number of points between the adjacent points in the intermediate point set;
[0060] determining the target point set according to the median point and the preset number of points.
[0061] In an embodiment, the processor 101 can be configured to invoke a non-contact space perimeter detection program stored in the memory 102, and perform the following operations:
[0062] determining a first spatial distance of the adjacent points in the intermediate point set;
[0063] determining the preset number according to the first spatial distance.
[0064] In an embodiment, the processor 101 can be configured to invoke a non-contact space perimeter detection program stored in the memory 102, and perform the following operations:
[0065] determining a second spatial distance between each adjacent point in the target point set;
[0066] determining the spatial perimeter of the target contour according to a sum value of the second spatial distance.
[0067] In an embodiment, the processor 101 can be configured to invoke a non-contact space perimeter detection program stored in the memory 102, and perform the following operations:
[0068] controlling the camera to scan the target object a preset number of times;
[0069] obtaining a point cloud image corresponding to each scan, and generating a three-dimensional image of the target object from the point cloud image;
[0070] determining a target contour of the target object in the three-dimensional image.
[0071] Based on the hardware architecture of the non-contact space perimeter detection device, embodiments of the non-contact space perimeter detection method are provided.
[0072] Referring to Figure 2 , Figure 2 For the first embodiment of the non-contact space perimeter detection method, the non-contact space perimeter detection method comprises the following steps:
[0073] Step S10, obtaining an initial point set of a target contour of a target object in a three-dimensional image;
[0074] Specifically, before obtaining the initial point set of the target contour of the target object in the three-dimensional image, the camera is controlled to scan the target object a preset number of times; a point cloud image corresponding to each scan is obtained, and the point cloud image generates a three-dimensional image of the target object; and a target contour of the target object in the three-dimensional image is determined. Before determining the target contour of the target object in the three-dimensional image, the three-dimensional image can be preprocessed, and the preprocessing includes removing a preset object region in the three-dimensional image, such as a jig, and / or filtering the three-dimensional image.
[0075] The target contour of the target object is the contour of the object to be measured, for example, the contour of the frame of the metal glasses. The target contour can be the contour of the object corresponding to a certain plane selected by the user. The initial point set of the target contour of the target object in the three-dimensional image is obtained, wherein the initial point set includes a plurality of points, and each point corresponds to a spatial coordinate.
[0076] Step S20, determining an intermediate point set corresponding to the initial point set according to a preset rule;
[0077] Specifically, the preset rule can be to determine the median of each point in the initial point set, and the median is the median point; and the intermediate point set is determined according to the median point corresponding to each point in the initial point set. The number of points in the intermediate point set is equal to the number of points in the initial point set, but the spatial coordinates of the points in the intermediate point set are different from the spatial coordinates of the points in the initial point set. The preset rule can also be to determine the average of each point in the initial point set, and the average is the median point; and the intermediate point set is determined according to the median point corresponding to each point in the initial point set.
[0078] Step S30, generating a target point set according to the intermediate point set, the number of points in the target point set being greater than the number of points in the intermediate point set;
[0079] Specifically, the target point set is generated according to the intermediate point set, a preset number of points are added between adjacent points in the intermediate point set to obtain the target point set, and the number of points in the target point set is greater than the number of points in the intermediate point set.
[0080] Step S40, determining the spatial perimeter of the target contour according to the target point set.
[0081] Specifically, the second spatial distance between each adjacent point in the target point set is determined, and the spatial perimeter of the target contour is determined according to the sum value of the second spatial distance.
[0082] In the technical scheme of the embodiment, an initial point set of a target contour of a target object in a three-dimensional image is obtained, an intermediate point set corresponding to the initial point set is determined according to a preset rule, a target point set is generated according to the intermediate point set, and the spatial perimeter of the target contour is determined according to the target point set. By determining the target point set and determining the spatial perimeter of the target contour according to the target point set, errors caused by unclearness or absence of the initial point set are avoided, and the accuracy of the detection of the spatial perimeter of the target contour is improved.
[0083] Reference Figure 3 , Figure 3 For a second embodiment of the non-contact spatial perimeter detection method of the application, based on the first embodiment, the step S30 comprises:
[0084] Step S31, obtaining adjacent points in the intermediate point set;
[0085] Step S32, generating a preset number of points between the adjacent points in the intermediate point set;
[0086] Step S33, determining the target point set according to the median point and the preset number of points.
[0087] Specifically, the preset number of points can be generated between the adjacent points in the intermediate point set, for example, the adjacent points a1 are (1, 1, 1), a2 are (3, 3, 3), and the preset number is 1, then the preset number of points is (2, 2, 2). In fact, the range of the preset number can be 500-3000.
[0088] The preset number can be set artificially, or the first spatial distance of the adjacent points in the intermediate point set can be determined, and the preset number can be determined according to the first spatial distance. When the spatial distance is small, the preset number is small, and when the spatial distance is large, the preset number is large.
[0089] In the technical scheme of the embodiment, a plurality of points within a preset spatial range of each point in the initial point set are determined, a median of the plurality of points within the preset spatial range is determined, and the median is taken as a median point corresponding to each point in the initial point set. The intermediate point set is generated by determining the median point corresponding to each point in the initial point set, errors caused by unclearness or absence of the initial point set are avoided, and the accuracy of the detection of the spatial perimeter of the target contour is improved.
[0090] ReferenceFigure 4 The application further provides a non-contact space perimeter detection device, which comprises:
[0091] An acquisition module 100 is configured to acquire an initial point set of a target contour of a target object in a three-dimensional image.
[0092] A determination module 200 is configured to determine a middle point set corresponding to the initial point set according to a preset rule.
[0093] A generation module 300 is configured to generate a target point set according to the middle point set, wherein the number of points in the target point set is greater than the number of points in the middle point set.
[0094] A detection module 400 is configured to determine a space perimeter of the target contour according to the target point set.
[0095] In an embodiment, the preset rule comprises: determining a median point corresponding to each point in the initial point set; and determining the middle point set according to the median point corresponding to each point in the initial point set.
[0096] In an embodiment, in the step of determining the median point corresponding to each point in the initial point set, the determination module 200 is specifically configured to:
[0097] determine a plurality of points within a preset space range of each point in the initial point set;
[0098] determine a median of the plurality of points within the preset space range;
[0099] and take the median as the median point corresponding to each point in the initial point set.
[0100] In an embodiment, in the step of generating a target point set according to the middle point set, the generation module 300 is specifically configured to:
[0101] acquire adjacent points in the middle point set;
[0102] generate a preset number of points between the adjacent points in the middle point set;
[0103] determine the target point set according to the median point and the preset number of points.
[0104] In an embodiment, before the step of generating a preset number of points between the adjacent points in the middle point set, the generation module 300 is specifically configured to:
[0105] determine a first space distance of the adjacent points in the middle point set;
[0106] determine the preset number according to the first space distance.
[0107] In an embodiment, in determining the spatial perimeter of the target contour according to the target point set, the detecting module 100 is specifically configured to:
[0108] determine a second spatial distance between each adjacent point of the target point set;
[0109] determine the spatial perimeter of the target contour according to a sum value of the second spatial distances.
[0110] In an embodiment, before acquiring an initial point set of a target contour of a target object in a three-dimensional image, the acquiring module 100 is specifically configured to:
[0111] controlling a camera to scan the target object for a preset number of times;
[0112] acquiring a point cloud image corresponding to each time of scanning, and generating a three-dimensional image of the target object according to the point cloud image;
[0113] determining a target contour of the target object in the three-dimensional image.
[0114] The present application also provides a non-contact spatial perimeter detection device, which comprises a memory, a processor, and a non-contact spatial perimeter detection program stored in the memory and executable on the processor, and each step of the non-contact spatial perimeter detection method as described in the above embodiments is implemented when the non-contact spatial perimeter detection program is executed by the processor.
[0115] The present application also provides a computer readable storage medium, which stores a non-contact spatial perimeter detection program, and each step of the non-contact spatial perimeter detection method as described in the above embodiments is implemented when the non-contact spatial perimeter detection program is executed by a processor.
[0116] The above-mentioned serial numbers of the embodiments of the present application are only for description, and do not represent the advantages or disadvantages of the embodiments.
[0117] It should be noted that, in this document, the terms "comprising", "including", or any other variant thereof are intended to cover non-exclusive inclusion, so that processes, systems, articles or apparatuses that include a series of elements not only include those elements, but also include other elements not explicitly listed, or further include elements inherent to such processes, systems, articles or apparatuses. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, system, article or apparatus that includes the element.
[0118] Through the above description of the embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment system can be realized by means of software and the necessary general hardware platform, of course, it can also be realized by hardware, but in many cases the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a computer readable storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a plurality of instructions for making a terminal to be tested device (which can be a mobile phone, a computer, a parking management device to be tested, an air conditioner, or a network device to be tested, etc.) execute the system described in each embodiment of the present application.
[0119] The above is only the preferred embodiment of the present application, and does not limit the patent scope of the present application, and any equivalent structure or equivalent flow transformation made by using the content of the specification and drawings of the present application, or directly or indirectly applied to other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A non-contact spatial perimeter detection method, characterized in that: The non-contact spatial perimeter detection method comprises: Obtaining an initial point set of a target contour of a target object in a three-dimensional image; Determine the intermediate point set corresponding to the initial point set according to a preset rule; generating a target point set according to the intermediate point set, wherein the number of points in the target point set is greater than the number of points in the intermediate point set; determining a spatial perimeter of the target contour based on the target point set; Wherein, the preset rule includes: determining the median point corresponding to each point in the initial point set; determining the intermediate point set according to the median point corresponding to each point in the initial point set; The step of generating a target point set according to the intermediate point set includes: Obtaining adjacent points in the intermediate point set; generating a preset number of points between adjacent points in the intermediate point set; Determine the target point set according to the median point and the preset number of points; Before the step of generating a preset number of points between adjacent points in the intermediate point set, the method further includes: determining a first spatial distance between adjacent points in the intermediate point set; determining the preset number according to the first spatial distance; The step of determining the spatial perimeter of the target contour according to the target point set includes: Determining a second spatial distance between adjacent points of the target point set; The spatial perimeter of the target contour is determined according to the sum of the second spatial distances.
2. The non-contact spatial perimeter detection method according to claim 1, wherein: The step of determining the median point corresponding to each point in the initial point set includes: determining a plurality of points within a predetermined spatial range of each point in the initial point set; Determining the median of a plurality of points within the preset spatial range; The median is used as the median point corresponding to each point in the initial point set.
3. The non-contact spatial perimeter detection method according to claim 1, wherein: Before the step of obtaining an initial point set of a target contour of a target object in a three-dimensional image, the method further includes: Control the camera to scan the target object for a preset number of times; Obtaining a point cloud image corresponding to each scan, and generating a three-dimensional image of the target object from the point cloud image; A target contour of the target object in the three-dimensional image is determined.
4. A non-contact space perimeter detection device, characterized in that: A non-contact space perimeter detection method according to any one of claims 1 to 3 is used, wherein the non-contact space perimeter detection device comprises: An acquisition module, used for acquiring an initial point set of a target contour of a target object in a three-dimensional image; A determination module, configured to determine an intermediate point set corresponding to the initial point set according to a preset rule; A generating module, configured to generate a target point set according to the intermediate point set, wherein the number of points in the target point set is greater than the number of points in the intermediate point set; A detection module is used to determine the spatial perimeter of the target contour based on the target point set.
5. A non-contact space perimeter detection device, characterized in that: The non-contact space perimeter detection device includes a memory, a processor, and a non-contact space perimeter detection program stored in the memory and executable on the processor. When the non-contact space perimeter detection program is executed by the processor, it implements the various steps of the non-contact space perimeter detection method as described in any one of claims 1 to 3.
6. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a non-contact space perimeter detection program, which, when executed by a processor, implements the various steps of the non-contact space perimeter detection method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Device for measuring length around outer circumference and device for measuring cross section area
JP2008145321A