Hole scanning method and device and three-dimensional scanning system

By using back projection technology in three-dimensional scanning technology to detect and eliminate hole interference in hole scanning, the problem of low accuracy of hole scanning is solved, and the reliability and accuracy of scanning results are improved.

CN119468979APending Publication Date: 2025-02-18SCANTECH (HANGZHOU) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411388638.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

In the existing three-dimensional scanning technology, the accuracy of hole scanning is low, especially when there is a sleeve hole on the surface of the workpiece, it is susceptible to interference from small holes on the back, affecting the accuracy of the scanning results.

Method used

By acquiring the first scan image of the object to be scanned, the hole relationship is detected; a second scan image of the hole is obtained; based on the first scan image, the pixel points in the second scan image are back-projected to both sides of the object, and the pixels in the second scan image are determined to belong to The pixel points of the second hole are removed to avoid interference.

Benefits of technology

The relationship between holes is clearly distinguished through back projection technology, and the interfering hole position is accurately identified and eliminated, which improves the accuracy of hole scanning and the reliability of results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119468979A_ABST
    Figure CN119468979A_ABST
Patent Text Reader

Abstract

The invention relates to a hole scanning method and device and a three-dimensional scanning system, and the method comprises the steps: obtaining a first scanning image of a scanned object; detecting a sleeve hole of the scanned object according to the first scanning image; the sleeve hole comprises a first hole located in the first surface and a second hole located in the second surface, the first hole is a hole to be detected, and the first surface and the second surface are two opposite surfaces of a scanned object; acquiring a second scanning image of the trepan boring; based on the first scanning image, performing back projection on each pixel point in the second scanning image to the first surface and the second surface to obtain a first projection point and a second projection point; and according to the position relationship between the first projection point and the second projection point, determining pixel points belonging to the second hole and removing the pixel points. According to the invention, the problem of low accuracy of hole scanning is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of three-dimensional scanning technology, and in particular to a hole scanning method, device and three-dimensional scanning system. Background Art

[0002] With the development and maturity of digital image processing, digital projection display and computer processing technology, three-dimensional scanning technology has developed rapidly. The three-dimensional scanning system can project light onto the surface of an object, and the camera device can capture the image under the projection of light, and reconstruct the three-dimensional size information of the surface of the object based on the image. In the related technology, when scanning objects such as workpieces, since there may be a hole with a small hole inside the large hole on the surface, the scanning of the hole is easily interfered by the small hole on the back, which in turn affects the accuracy of scanning the holes on the surface of the scanned object.

[0003] Currently, no effective solution has been proposed for the problem of low accuracy of hole scanning in related technologies. Summary of the invention

[0004] The embodiments of the present application provide a hole scanning method, device and three-dimensional scanning system to at least solve the problem of low accuracy of hole scanning in the related art.

[0005] In a first aspect, an embodiment of the present application provides a method for acquiring a first scanned image of a scanned object; detecting a hole on the scanned object according to the first scanned image; the hole comprises a first hole located on a first surface, and a second hole located on a second surface, wherein the first hole is a hole to be detected, and the first surface and the second surface are two oppositely disposed surfaces on the scanned object;

[0006] Acquire a second scan image of the trocar;

[0007] Based on the first scanned image, each pixel point in the second scanned image is back-projected onto the first surface and the second surface respectively to obtain a first projection point and a second projection point;

[0008] According to the positional relationship between the first projection point and the second projection point, the pixel points belonging to the second hole are determined and eliminated.

[0009] In some embodiments, detecting the trepanation of the scanned object according to the first scanned image includes:

[0010] Traversing the holes of the scanned object;

[0011] The currently traversed hole is taken as the first hole; based on the first scanned image, a second hole adjacent to the first hole is determined, and based on the positional relationship between the first hole and the second hole, whether the first hole and the second hole constitute the set of holes is detected.

[0012] In some embodiments, determining a second hole adjacent to the first hole according to the first scanned image includes:

[0013] Based on the first scanned image, acquiring hole feature data of all holes in the scanned object;

[0014] A tree structure is constructed according to the hole feature data, and the second hole adjacent to the first hole is searched using the tree structure.

[0015] In some embodiments, the detecting whether the first hole and the second hole constitute the set hole based on the positional relationship between the first hole and the second hole includes:

[0016] Based on the first scanned image, acquiring hole feature data of all holes in the scanned object; the hole feature data includes a hole normal and a hole center;

[0017] Determining a reference ray based on the hole center and the acquired optical center of the camera device;

[0018] According to the angle between the hole normal and the reference ray, determine whether the positional relationship between the first hole and the second hole is on non-colateral sides; if determined to be on non-colateral sides, detect whether the first hole and the second hole are the serrated holes based on the hole feature data.

[0019] In some embodiments, the detecting whether the first hole and the second hole are the trepanning holes based on the hole feature data includes:

[0020] Projecting the hole feature data of the second hole onto the plane where the first hole is located to obtain a projected hole and the hole feature data of the projected hole;

[0021] According to the hole feature data of the first hole and the hole feature data of the projected hole, it is determined whether there is an overlapping area between the projected hole and the first hole, and based on the determination result of the overlapping area, it is detected whether the trepanning hole exists.

[0022] In some embodiments, based on the first scanned image, each pixel point in the second scanned image is back-projected onto the first surface and the second surface, respectively, to obtain a first projection point and a second projection point, including:

[0023] Calculating, according to the first scanned image, a first plane constraint condition where the first surface is located, and a second plane constraint condition where the second surface is located;

[0024] Based on the first plane constraint condition, the pixel point is back-projected onto the first surface to obtain the first projection point; based on the second plane constraint condition, the pixel point is back-projected onto the second surface to obtain the second projection point.

[0025] In some embodiments, determining and removing pixels belonging to the second hole according to the positional relationship between the first projection point and the second projection point includes:

[0026] Calculating a first distance between a position of the first projection point and a position of the first hole, and a second distance between a position of the second projection point and a position of the second hole;

[0027] According to the first distance and the second distance, the pixel points belonging to the second hole are determined and eliminated.

[0028] In some embodiments, determining and removing pixels belonging to the second hole according to the first distance and the second distance includes:

[0029] calculating a difference between the first distance and the second distance;

[0030] When the difference is less than or equal to a preset distance threshold, retaining the pixel points corresponding to the first projection point and / or the second projection point in the second scanned image;

[0031] In the case where the difference is greater than the distance threshold, if the first distance is greater than the second distance, the pixel point is determined to be a pixel point of the second hole, and the pixel point of the second hole is eliminated.

[0032] In a second aspect, an embodiment of the present application provides a hole scanning device, the device comprising:

[0033] A hole detection module is used to obtain a first scanned image of the scanned object; and detect the holes of the scanned object according to the first scanned image; the holes include a first hole located on a first surface, and a second hole located on a second surface, wherein the first hole is a hole to be detected, and the first surface and the second surface are two oppositely disposed surfaces on the scanned object;

[0034] A scanning module, used for acquiring a second scanning image of the trepanation hole;

[0035] A back-projection module, configured to back-project each pixel point in the second scanned image onto the first surface and the second surface, respectively, based on the first scanned image, to obtain a first projection point and a second projection point;

[0036] A removal module is used to determine and remove the pixel points belonging to the second hole according to the positional relationship between the first projection point and the second projection point.

[0037] In a third aspect, an embodiment of the present application provides a three-dimensional scanning system, the system comprising: a scanning device and a main control device;

[0038] The main control device is connected to the scanning device and is used to execute the hole scanning method as described in the first aspect above.

[0039] Compared with the related art, the hole scanning method, device and three-dimensional scanning system provided in the embodiment of the present application obtain a first scanning image of the scanned object; based on the first scanning image, detect the holes of the scanned object; the holes include a first hole located on the first surface, and a second hole located on the second surface, wherein the first hole is the hole to be measured, and the first surface and the second surface are two opposite surfaces of the scanned object; obtain the second scanning image of the holes; based on the first scanning image, each pixel point in the second scanning image is back-projected to the first surface and the second surface, respectively, to obtain a first projection point and a second projection point; according to the positional relationship between the first projection point and the second projection point, the pixel points belonging to the second hole are determined and eliminated. Based on this, by back-projecting the detected holes, the pixel points in the two-dimensional image can be converted into three-dimensional space and compared with the known hole positions. This conversion makes the hole-to-hole relationship that was originally difficult to distinguish in a two-dimensional image clearly discernible in three-dimensional space; and by comparing the spatial distance between the projection point and the hole, it is possible to accurately identify which pixels belong to the interfering hole positions and eliminate them, thereby avoiding the influence of the interfering hole positions, effectively solving the problem of low hole scanning accuracy caused by the presence of holes on the workpiece, and improving the reliability and accuracy of the scanning results.

[0040] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0042] Figure 1 is a hardware structure block diagram of a terminal of a hole scanning method according to an embodiment of the present application;

[0043] Figure 2 is a structural schematic diagram of a trepanning hole according to an embodiment of the present application;

[0044] Figure 3 is a flow chart of a hole scanning method according to an embodiment of the present application;

[0045] Figure 4 is a flow chart of another hole scanning method according to an embodiment of the present application;

[0046] Figure 5 is a structural block diagram of a hole scanning device according to an embodiment of the present application;

[0047] Figure 6 It is a structural block diagram of a three-dimensional scanning system according to an embodiment of the present application. DETAILED DESCRIPTION

[0048] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments provided in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application. In addition, it can also be understood that although the efforts made in this development process may be complex and lengthy, for ordinary technicians in the field related to the contents disclosed in the present application, some changes such as design, manufacturing or production based on the technical contents disclosed in the present application are only conventional technical means, and should not be understood as insufficient contents disclosed in the present application.

[0049] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those of ordinary skill in the art that the embodiments described in this application may be combined with other embodiments without conflict.

[0050] Unless otherwise defined, the technical terms or scientific terms involved in this application should be understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "a", "a", "the" and the like involved in this application do not indicate a quantitative limitation, and may represent the singular or plural. The terms "include", "comprise", "have" and any of their variations involved in this application are intended to cover non-exclusive inclusions; for example, a process, method, system, product or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may also include steps or units that are not listed, or may also include other steps or units inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in this application refers to greater than or equal to two. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships, for example, "A and / or B" can represent: A exists alone, A and B exist at the same time, and B exists alone. The terms "first", "second", "third" and the like involved in the present application are merely used to distinguish similar objects and do not represent a specific ordering of the objects.

[0051] The method embodiment provided in this embodiment can be executed in a terminal, a computer or a similar computing device. Taking running on a terminal as an example, Figure 1 is a hardware structure block diagram of a terminal of a hole scanning method according to an embodiment of the present application. Figure 1 As shown, the terminal 10 may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Optionally, the terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0052] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the hole scanning method in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the terminal 10 via a network. Examples of the above network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0053] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by the communication provider of the terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0054] In practical applications, in addition to single-hole surfaces (i.e., no small holes inside), the surfaces of objects such as car doors and workpieces may also have overlapping holes with small holes inside large holes; the overlapping hole relationship specifically refers to a hole (interference hole) located inside another hole (hole to be measured), and the two have overlapping parts in three-dimensional space. Please refer to Figure 2 , a small slot indicated by a dotted line appears out of thin air inside the large hole. In the prior art, for single-faced surfaces, precise scanning can quickly obtain scanning results. However, for the case of holes such as those shown in the figure, it is difficult to obtain precise scanning results, and the precise scanning results of holes are also difficult to eliminate the interference of holes on different sides, which makes it easy to make mistakes and it is difficult to reconstruct an object model with accurate surface information.

[0055] In order to improve the above problems, this embodiment provides a hole scanning method. Figure 3 is a flow chart of a hole scanning method according to an embodiment of the present application. Figure 3 As shown, the process includes the following steps:

[0056] Step S310, obtaining a first scanned image of the scanned object; detecting the holes of the scanned object according to the first scanned image; the holes include a first hole located on the first surface, and a second hole located on the second surface, wherein the first hole is the hole to be detected, and the first surface and the second surface are two oppositely disposed surfaces on the scanned object.

[0057] In this step, the entire surface of the scanned object is first scanned, so as to identify all holes on the surface of the object based on the scanned image and obtain prior information of all holes. Among them, the detection of whether all holes in the first scanned image constitute a set of holes can be determined by analyzing the geometric relationship of each hole. Alternatively, if the embodiment allows, it can also be obtained based on manual assisted search, for example, multiple hole positions can be manually marked on the surface of the object in advance, so that based on the manual marks in the scanned image, the set of holes on the surface of the scanned object can also be identified.

[0058] Step S320, obtaining a second scanning image of the perforations. When it is detected that there are perforations on the surface of the scanned object, further scanning is performed on the perforations to obtain a second scanning image of the perforations.

[0059] Step S330: Based on the first scanned image, each pixel point in the second scanned image is back-projected onto the first surface and the second surface respectively to obtain a first projection point and a second projection point.

[0060] Step S340: Determine and remove the pixel points belonging to the second hole according to the positional relationship between the first projection point and the second projection point.

[0061] It should be noted that, for the above-mentioned second scanned image, it is impossible to distinguish which hole each pixel in the image belongs to, and the pixel of the second hole located on the other side of the first hole that forms a hole is removed to avoid interference. Based on this, in the above-mentioned steps S330 to S340, when the existence of a hole is detected, the sub-pixel edge information of the hole to be measured, that is, the first hole searched, is respectively back-projected onto the planes corresponding to the holes on both sides, and the information of the interfering vacant position is removed by judging the distance between the projection point and the spatial hole, and only the sub-pixel edge information of the hole to be measured is retained. More specifically, based on the first scanned image, the plane where the holes on both sides are located can be determined, and each pixel in the second scanned image taken for the hole is projected onto the two planes where the holes on both sides are located. Next, according to the distance between the respective projection points on the two planes and the spatial positions of the two holes known through the above steps, the pixel points belonging to the second hole in the second scanned image are determined, and each of the determined pixel points belongs to the interfering hole position, so the identified interfering hole position can be automatically removed.

[0062] In the above hole scanning method, by back-projecting the detected holes, the pixels in the two-dimensional image can be converted into three-dimensional space and compared with the known hole positions. This conversion makes the hole relationship that was originally difficult to distinguish in the two-dimensional image become clear and discernible in three-dimensional space; and by comparing the spatial distance between the projection point and the hole, it is possible to accurately identify which pixels belong to the interfering hole position and eliminate them, thereby avoiding the influence of the interfering hole position, effectively solving the problem of low hole scanning accuracy caused by the existence of holes on the workpiece, and improving the reliability and accuracy of the scanning results.

[0063] In some of these examples, see Figure 4 , the above-mentioned detecting the trepanning holes of the scanned object according to the first scanned image may also include the following steps:

[0064] Step S410, traversing the holes of the scanned object.

[0065] Step S420, taking the currently traversed hole as the first hole; determining the second hole adjacent to the first hole according to the first scanned image, and detecting whether the first hole and the second hole constitute a nested hole based on the positional relationship between the first hole and the second hole.

[0066] Among them, according to the first scanned image, multiple holes located on the surface of the scanned object are identified in the image, and at this time, it is still impossible to distinguish whether there are nested holes in each hole. In this step, it is necessary to first traverse each hole in the image; the hole currently traversed is used as the first hole to be tested, so that interference needs to be eliminated in the subsequent detection of whether the current first hole has a nested hole. Specifically, for the first hole currently traversed, the hole closest to it is searched from all holes, that is, the second hole adjacent to the first hole currently traversed is determined. Then, the positional relationship between the two holes is detected to determine whether there is an overlapping part between the two holes. If there is an overlapping part, it means that the two holes are in a nested structure and constitute a nested hole. Traverse the remaining holes until all holes in the first scanned image are traversed, so that all the nested holes are detected.

[0067] Through the above embodiment, a detection method of searching adjacent holes of the hole to be tested through an image and automatically detecting whether a trepanning hole is formed is realized, and the whole process does not require manual auxiliary marking, thereby effectively improving the accuracy and efficiency of trepanning hole detection.

[0068] In some embodiments, the step of determining the second hole adjacent to the first hole according to the first scanned image may further include the following steps:

[0069] Based on the first scanned image, hole feature data of all holes in the scanned object are obtained; a tree structure is constructed according to the hole feature data, and a second hole adjacent to the first hole is searched using the tree structure.

[0070] Among them, after the scanned object is roughly scanned to obtain the first scanned image, the prior information of each hole can be determined based on all the holes identified in the first scanned image. For example, for circular holes, feature data such as hole center, normal, radius, etc. can be identified and determined; for slot-shaped or rectangular holes, feature data such as hole center, normal, long axis normal, height, width, etc. can be identified. Next, based on the hole center data determined a priori, a tree structure is established for all holes for rapid search in the subsequent judgment of the hole situation. Specifically, for each hole on the same side, the tree structure is used to search for adjacent holes near the hole to exclude the same measured holes.

[0071] Exemplarily, a KD tree (k-dimensional tree) can be used to manage the data of the hole center and quickly search for adjacent holes near a given hole while excluding holes on the same side. More specifically, first for the two-dimensional hole center, the x or y coordinate can be selected as the initial dimension for building the KD tree. All hole centers are sorted according to the selected dimension, and the median is selected as the root node. Then, all holes are divided into two parts according to the dimension, and the left subtree and the right subtree are constructed respectively. For each subtree, the next dimension is selected (usually a circular selection, such as x->y->x->...), and the process of sorting, splitting and building subtrees is repeated until all holes are added to the tree. After the KD tree is built, in order to search for adjacent holes near a given hole, the nearest neighbor search algorithm of the KD tree (such as the best first search algorithm) can be used to exclude holes on the same side. For example, starting from a given hole, the nearest neighbor search algorithm of the KD tree is used to find the nearest hole. Check whether the nearest hole found belongs to the same side as the given hole. If so, continue to search for the next nearest hole. Repeat the above search steps until all holes are searched. According to the above embodiment, the second hole is searched by constructing a tree structure for all holes to search for neighboring values, which effectively improves the search efficiency and thus helps to improve the scanning efficiency.

[0072] In some embodiments, the detecting whether the first hole and the second hole form a set of holes based on the positional relationship between the first hole and the second hole may further include the following steps:

[0073] Based on the first scanned image, hole feature data of all holes in the scanned object are obtained; the hole feature data include the hole normal and the hole center; based on the hole center and the acquired optical center of the camera device, a reference ray is determined; based on the angle between the hole normal and the reference ray, it is determined whether the positional relationship between the first hole and the second hole is not on the same side; in the case of being determined not to be on the same side, based on the hole feature data, it is detected whether the first hole and the second hole are nested holes.

[0074] Among them, the hole normal refers to the normal direction of the surface of each hole, which describes the direction of the hole opening. The hole center refers to the coordinates of the center point of each hole, which is used to locate the position of the hole in three-dimensional space. The optical center of the camera device is the emission point of the light or ray during the scanning process, and is usually located at the center of the scanning device. For each hole, a ray can be drawn from the optical center of the camera device through the hole center, and this ray is the reference ray of the hole. Afterwards, the positional relationship between the holes can be judged based on the angle between the hole normal and the reference ray. Specifically, the angles between the reference rays of two holes (the first hole and the second hole) and their respective hole normals can be compared. If the two angles are in opposite directions, for example, one angle is less than 90 degrees and the other angle is greater than 90 degrees, or both are close to 0 degrees but in opposite directions, it can be judged that the two holes are on different sides of the object, that is, the two holes are not on the same side. After determining that the two holes are not on the same side, whether there is a overlapping hole relationship between them is further detected based on the hole feature data; for example, comparing the distance between the hole centers of the two holes, or comparing the hole sizes.

[0075] Through the above-mentioned embodiments, in the process of hole-traversing detection, the geometric relationship of the holes is first used to find out whether each hole belongs to the same measurement hole as the first hole currently traversed, and the non-same-side holes found are further checked to see whether they constitute hole-traversing, thereby avoiding the problem of reduced efficiency caused by checking all holes in turn, and effectively improving the efficiency of hole-traversing detection.

[0076] In some embodiments, the above-mentioned detecting whether the first hole and the second hole are trepanning holes based on the hole feature data may further include the following steps:

[0077] Project the hole feature data of the second hole onto the plane where the first hole is located to obtain the projected hole and the hole feature data of the projected hole. Specifically, in this step, it is first necessary to determine the equation of the plane where the first hole is located. For example, it can be solved by three non-collinear points of the first hole (such as the center of the hole and two points on the edge of the hole). Then project the hole feature data of the second hole (including points on the edge of the hole, the center of the hole, etc.) onto the determined plane.

[0078] Next, after the projected hole is obtained, it is determined whether there is an overlapping area between the projected hole and the first hole based on the hole feature data of the first hole and the hole feature data of the projected hole, and whether there is a trepanation hole is detected based on the determination result of the overlapping area.

[0079] After obtaining the projected hole, it is necessary to compare the hole feature data of the projected hole (mainly the boundary of the projected hole) with the hole feature data of the first hole. This usually involves a comparison of geometric shapes. For example, the hole center of the first hole can be compared to see whether the distance between the hole center of the projected hole and the hole center of the projected hole is less than the radius of the first hole. If so, it is determined that there is an overlap area between the projected hole and the first hole, and the first hole and the second hole form a nesting relationship.

[0080] Through the above-mentioned embodiments, a hole detection method is provided for projecting the second hole onto the plane where the first hole is located, and quickly judging whether there is a hole-piercing situation through the projected hole information and the information of the first hole currently to be tested, thereby ensuring the accuracy of hole-piercing detection based on the projection method, and further improving the accuracy of hole scanning.

[0081] In some embodiments, the above-mentioned back-projecting each pixel point in the second scanned image onto the first surface and the second surface based on the first scanned image to obtain the first projection point and the second projection point may also include the following steps:

[0082] According to the first scanned image, a first plane constraint condition where the first surface is located and a second plane constraint condition where the second surface is located are calculated; based on the first plane constraint condition, the pixel point is back-projected to the first surface to obtain a first projection point; based on the second plane constraint condition, the pixel point is back-projected to the second surface to obtain a second projection point.

[0083] Among them, it is necessary to calculate the plane constraints of the first surface and the second surface based on the first scanned image (usually containing the depth information of the two types of holes or some form of geometric information, such as the hole center, normal, etc.). Once the center point, normal and depth information of the hole are obtained, the equation of the plane where the hole is located can be calculated. The plane equation can usually be expressed as Ax+By+Cz+D=0, where (A, B, C) is the normal vector of the plane and D is the distance from the plane to the origin.

[0084] Next, considering that the second scanned image contains pixel information of the holes, and it is impossible to distinguish which hole each pixel belongs to at this time, each pixel point (or sub-pixel point) in the image can be back-projected onto the planes corresponding to the holes on both sides, that is, the first surface and the second surface mentioned above, based on the above-mentioned plane constraints, to obtain the corresponding first projection point and second projection point.

[0085] Through the above embodiments, a spatial back-projection solution for each pixel point of the image is provided. By mapping the pixel points from the two-dimensional image space to a specific plane in the three-dimensional space, the back-projection process is made more precise, thereby further improving the accuracy of hole scanning.

[0086] In some embodiments, the above-mentioned determining and removing the pixel points belonging to the second hole according to the positional relationship between the first projection point and the second projection point may further include the following steps:

[0087] A first distance between the position of the first projection point and the position of the first hole, and a second distance between the position of the second projection point and the position of the second hole are calculated; and pixels belonging to the second hole are determined and removed according to the first distance and the second distance.

[0088] More specifically, after projecting each pixel point in the second scanned image onto the first surface and the second surface respectively through the above steps to obtain the corresponding first projection point and second projection point, the distance between the first projection point and the first hole is compared to obtain the first distance, and the distance between the second projection point and the second hole is compared to obtain the second distance. If the value of the first distance is smaller than the value of the second distance, it means that the pixel point of the current back projection is relatively close to the first hole, and it can be considered that the pixel point belongs to the first hole; otherwise, it is considered that the pixel point belongs to the second hole. The pixel point information of the holes in the second scanned image is traversed, and the hole to which the pixel point currently traversed belongs is determined by the above method, and finally the pixel point information detected belonging to the second hole is determined as the information of the interfering hole position and eliminated, and only the sub-pixel edge information of the first hole as the hole to be measured is retained, thereby eliminating the edge information of the interfering hole position and ensuring the accuracy of the hole scanning.

[0089] In some embodiments, the above-mentioned step of determining and removing the pixel points belonging to the second hole according to the first distance and the second distance may further include the following steps:

[0090] Calculate the difference between the first distance and the second distance; when the difference is less than or equal to a preset distance threshold, retain the pixel points corresponding to the first projection point and / or the second projection point in the second scanned image; when the difference is greater than the distance threshold, if the first distance is greater than the second distance, determine that the pixel point is the pixel point of the second hole, and eliminate the pixel point of the second hole.

[0091] The above distance threshold can be pre-set by the staff according to the actual situation; the distance threshold is used to judge whether the difference between the first distance and the second distance is obvious. It should be noted that in the process of determining the interfering hole position by the above spatial back-projection method, the difference between the first distance and the second distance may not be obvious. At this time, if the corresponding pixel point is hastily judged to which hole it belongs, it is easy to make a misjudgment.

[0092] Based on this, when it is detected that the difference between the first distance and the second distance is less than or equal to the distance threshold, it means that the difference between the two distances is not obvious. Therefore, in order to avoid misjudgment, the pixel point is retained, that is, it is not removed from the second scanned image. If the difference is greater than the preset distance threshold, it means that the difference between the two distances is significant enough to further determine the ownership of the pixel point. At this time, if it is detected that the first distance is greater than the second distance, it means that the pixel point is relatively close to the second hole, then the pixel point can be considered to belong to the second hole, and then the pixel point is determined to be an interference point and removed; otherwise, the corresponding pixel point can be determined as a pixel point of the first hole and retained.

[0093] Through the above embodiment, when the difference between the two distances is not obvious, the corresponding pixel points are retained, thereby avoiding the problem of mistakenly deleting pixel points and effectively improving the accuracy and reliability of hole scanning.

[0094] It should be noted that the steps shown in the above process or the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0095] This embodiment also provides a hole scanning device, which is used to implement the above embodiments and preferred implementations, and will not be repeated here. As used below, the terms "module", "unit", "subunit", etc. can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0096] Figure 5 is a structural block diagram of a hole scanning device according to an embodiment of the present application, such as Figure 5As shown, the device includes: a hole detection module 51, which is used to obtain a first scanned image of the scanned object; based on the first scanned image, the holes of the scanned object are detected; the holes include a first hole located on the first surface, and a second hole located on the second surface, wherein the first hole is a hole to be detected, and the first surface and the second surface are two opposite surfaces of the scanned object; a scanning module 52, which is used to obtain a second scanned image of the holes; a back-projection module 53, which is used to back-project each pixel point in the second scanned image to the first surface and the second surface respectively based on the first scanned image to obtain a first projection point and a second projection point; and a removal module 54, which is used to determine and remove the pixel points belonging to the second hole according to the positional relationship between the first projection point and the second projection point.

[0097] In some of the embodiments, the above-mentioned hole detection module 51 is also used to traverse the holes of the scanned object and take the currently traversed hole as the first hole; determine the second hole adjacent to the first hole according to the first scanned image, and based on the positional relationship between the first hole and the second hole.

[0098] In some of the embodiments, the above-mentioned hole detection module 51 is also used to obtain hole feature data of all holes in the scanned object based on the first scanned image; construct a tree structure according to the hole feature data, and use the tree structure to search for a second hole adjacent to the first hole.

[0099] In some of the embodiments, the above-mentioned hole detection module 51 is also used to obtain hole feature data of all holes in the scanned object based on the first scanned image; the hole feature data includes the hole normal and the hole center; the hole detection module determines the reference ray based on the hole center and the acquired optical center of the camera device; the hole detection module 51 determines whether the positional relationship between the first hole and the second hole is not on the same side according to the angle between the hole normal and the reference ray; in the case of determining that they are not on the same side, based on the hole feature data, detect whether the first hole and the second hole are hole-in-place.

[0100] In some of the embodiments, the above-mentioned hole detection module 51 is also used to project the hole feature data of the second hole to the plane where the first hole is located to obtain the projected hole and the hole feature data of the projected hole; the hole detection module 51 determines whether there is an overlapping area between the projected hole and the first hole based on the hole feature data of the first hole and the hole feature data of the projected hole, and detects whether there is a hole based on the judgment result of the overlapping area.

[0101] In some of the embodiments, the back projection module 53 is further used to calculate, based on the first scanned image, a first plane constraint condition where the first surface is located, and a second plane constraint condition where the second surface is located; the back projection module 53 back projects the pixel points to the first surface based on the first plane constraint condition to obtain a first projection point; and back projects the pixel points to the second surface based on the second plane constraint condition to obtain a second projection point.

[0102] In some embodiments, the above-mentioned elimination module 54 is also used to calculate a first distance between the position of the first projection point and the position of the first hole, and a second distance between the position of the second projection point and the position of the second hole; the elimination module 54 determines the pixel points belonging to the second hole based on the first distance and the second distance and eliminates them.

[0103] In some of the embodiments, the above-mentioned elimination module 54 is also used to calculate the difference between the first distance and the second distance; when the difference is less than or equal to a preset distance threshold, the elimination module 54 retains the pixel points corresponding to the first projection point and / or the second projection point in the second scanned image; when the difference is greater than the distance threshold, if the first distance is greater than the second distance, the elimination module 54 determines that the pixel point is the pixel point of the second hole, and eliminates the pixel point of the second hole.

[0104] It should be noted that the above modules can be functional modules or program modules, and can be implemented by software or hardware. For modules implemented by hardware, the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.

[0105] This embodiment also provides a three-dimensional scanning system. Figure 6 is a structural block diagram of a three-dimensional scanning system according to an embodiment of the present application, such as Figure 6 As shown, the system includes: a scanning device 61 and a main control device 62. The main control device 62 is connected to the scanning device 61 and is used to execute the hole scanning method as described in any of the above embodiments.

[0106] This embodiment further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0107] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0108] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0109] S1, acquiring a first scanned image of the scanned object; detecting the holes of the scanned object according to the first scanned image; the holes include a first hole located on a first surface, and a second hole located on a second surface, wherein the first hole is a hole to be detected, and the first surface and the second surface are two oppositely disposed surfaces on the scanned object.

[0110] S2, obtaining a second scanning image of the trepanation hole.

[0111] S3, based on the first scanned image, back-projecting each pixel point in the second scanned image onto the first surface and the second surface respectively to obtain a first projection point and a second projection point.

[0112] S4, according to the positional relationship between the first projection point and the second projection point, determine the pixel points belonging to the second hole and remove them.

[0113] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.

[0114] In addition, in combination with the hole scanning method in the above embodiment, the embodiment of the present application can provide a storage medium for implementation. The storage medium stores a computer program; when the computer program is executed by a processor, any one of the hole scanning methods in the above embodiment is implemented.

[0115] Those skilled in the art should understand that the technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0116] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A hole scanning method, characterized in that: The method comprises: Acquire a first scanned image of the scanned object; detect the holes of the scanned object according to the first scanned image; the holes include a first hole located on a first surface and a second hole located on a second surface, wherein the first hole is a hole to be detected, and the first surface and the second surface are two oppositely disposed surfaces of the scanned object; Acquire a second scan image of the trocar; Based on the first scanned image, each pixel point in the second scanned image is back-projected onto the first surface and the second surface respectively to obtain a first projection point and a second projection point; According to the positional relationship between the first projection point and the second projection point, the pixel points belonging to the second hole are determined and eliminated.

2. The hole scanning method according to claim 1, characterized in that: The detecting the trepanning holes of the scanned object according to the first scanned image comprises: Traversing the holes of the scanned object; The currently traversed hole is taken as the first hole; based on the first scanned image, a second hole adjacent to the first hole is determined, and based on the positional relationship between the first hole and the second hole, whether the first hole and the second hole constitute the set of holes is detected.

3. The hole scanning method according to claim 2, characterized in that: The step of determining a second hole adjacent to the first hole according to the first scanned image includes: Based on the first scanned image, acquiring hole feature data of all holes in the scanned object; A tree structure is constructed according to the hole feature data, and the second hole adjacent to the first hole is searched using the tree structure.

4. The hole scanning method according to claim 2, characterized in that: The detecting whether the first hole and the second hole constitute the set hole based on the positional relationship between the first hole and the second hole comprises: Based on the first scanned image, acquiring hole feature data of all holes in the scanned object; the hole feature data includes a hole normal and a hole center; Determining a reference ray based on the hole center and the acquired optical center of the camera device; According to the angle between the hole normal and the reference ray, determine whether the positional relationship between the first hole and the second hole is on non-colateral sides; if determined to be on non-colateral sides, detect whether the first hole and the second hole are the serrated holes based on the hole feature data.

5. The hole scanning method according to claim 4, characterized in that: The detecting whether the first hole and the second hole are the trepanning holes based on the hole feature data comprises: Projecting the hole feature data of the second hole onto the plane where the first hole is located to obtain a projected hole and the hole feature data of the projected hole; According to the hole feature data of the first hole and the hole feature data of the projected hole, it is determined whether there is an overlapping area between the projected hole and the first hole, and based on the determination result of the overlapping area, it is detected whether the trepanning hole exists.

6. The hole scanning method according to claim 1, characterized in that: The method of back-projecting each pixel point in the second scanned image onto the first surface and the second surface based on the first scanned image to obtain a first projection point and a second projection point comprises: Calculating, according to the first scanned image, a first plane constraint condition where the first surface is located, and a second plane constraint condition where the second surface is located; Based on the first plane constraint condition, the pixel point is back-projected onto the first surface to obtain the first projection point; based on the second plane constraint condition, the pixel point is back-projected onto the second surface to obtain the second projection point.

7. The hole scanning method according to any one of claims 1 to 6, characterized in that: The step of determining and removing pixel points belonging to the second hole according to the positional relationship between the first projection point and the second projection point includes: Calculating a first distance between a position of the first projection point and a position of the first hole, and a second distance between a position of the second projection point and a position of the second hole; According to the first distance and the second distance, the pixel points belonging to the second hole are determined and eliminated.

8. The hole scanning method according to claim 7, characterized in that: The step of determining and removing pixels belonging to the second hole according to the first distance and the second distance includes: calculating a difference between the first distance and the second distance; When the difference is less than or equal to a preset distance threshold, retaining the pixel points corresponding to the first projection point and / or the second projection point in the second scanned image; In the case where the difference is greater than the distance threshold, if the first distance is greater than the second distance, the pixel point is determined to be a pixel point of the second hole, and the pixel point of the second hole is eliminated.

9. A hole scanning device, characterized in that: The device comprises: A hole detection module is used to obtain a first scanned image of the scanned object; and detect the holes of the scanned object according to the first scanned image; the holes include a first hole located on a first surface, and a second hole located on a second surface, wherein the first hole is a hole to be detected, and the first surface and the second surface are two oppositely disposed surfaces on the scanned object; A scanning module, used for acquiring a second scanning image of the trepanation hole; A back-projection module, configured to back-project each pixel point in the second scanned image onto the first surface and the second surface, respectively, based on the first scanned image, to obtain a first projection point and a second projection point; A removal module is used to determine and remove the pixel points belonging to the second hole according to the positional relationship between the first projection point and the second projection point.

10. A three-dimensional scanning system, characterized in that: The system comprises: a scanning device and a main control device; The main control device is connected to the scanning device and is used to execute the hole scanning method as described in any one of claims 1 to 8.