Detection method and device, electronic equipment and storage medium
By using a triangular mesh model in a 3D coordinate system and pixel rendering technology, the problem of inaccurate detection of concave areas caused by manual operation was solved, and accurate marking and detection of concave areas were achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 北京瑞医博科技有限公司
- Filing Date
- 2023-02-27
- Publication Date
- 2026-07-03
Smart Images

Figure CN116228718B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a detection method, apparatus, electronic device, and storage medium. Background Technology
[0002] In the field of medical applications, doctors usually use surgical guides during surgery. A surgical guide is an auxiliary device used during surgery to make the operation accurate, safe and convenient. Different surgeries use different surgical guides. The key issue in the manufacture and use of surgical guides is whether the surgical guide can be accurately positioned on the patient's body surface to assist in the surgery.
[0003] For example, in dental applications, due to the unique shape of teeth, the crown is generally wider than the root, forming a shape that is wider at the top and narrower at the bottom, and also has undercut areas. If the surgical guide for the maxilla or mandible is directly fabricated according to the internal structure of the oral cavity, the surgical guide may get stuck in the undercut areas after being inserted into the tooth and cannot be easily removed. Therefore, before fabricating the surgical guide for the maxilla or mandible, these undercut areas that are likely to get stuck should usually be marked and filled in.
[0004] In existing technologies, undercut detection requires manual operation by medical staff. Due to the poor observation effect of manual operation, it is impossible to accurately locate the undercut area, resulting in inaccurate detection results for the undercut area. Summary of the Invention
[0005] In view of this, embodiments of the present invention provide a detection method and apparatus, an electronic device, and a storage medium to solve the above problems.
[0006] According to a first aspect of the present invention, a detection method is provided, comprising: acquiring a triangular mesh model of a mold model in a three-dimensional coordinate system, and each pixel point of the window where the mold model is located; performing image rendering processing on the triangular facets on the triangular mesh model to obtain a first rendering layer; determining a target triangular facet and its neighboring triangular facets in the first rendering layer based on the correspondence between each pixel point and the triangular facet; rendering the portion of the target triangular facet and its neighboring triangular facets that is mapped to the same pixel point as it into a second rendering layer, until no neighboring triangular facet is mapped to the same pixel point as its corresponding target triangular facet; and marking the remaining portion of the neighboring triangular facets in the first rendering layer as the concave region of the mold model.
[0007] In another implementation of the present invention, obtaining the triangular mesh model of the mold model in a three-dimensional coordinate system includes: obtaining the modeling parameters of the mold model in a three-dimensional coordinate system; and constructing the triangular mesh model of the mold model based on the modeling parameters.
[0008] In another implementation of the present invention, the target triangle and its neighboring triangles in the first rendering layer are determined based on the correspondence between each pixel and the triangle. This includes: establishing rays perpendicular to a preset reference plane based on each pixel; and determining the target triangle and its neighboring triangles in the first rendering layer based on the intersections of each ray with the triangular mesh model.
[0009] In another implementation of the present invention, before rendering the target triangle and the portion of the neighboring triangle that is mapped to the same pixel as it into the second rendering layer, the method further includes: performing calculation processing on the neighboring triangles of the target triangle to obtain the centroid of the neighboring triangles; and determining the portion of the neighboring triangles that is mapped to the same pixel as the target triangle based on the correspondence between the centroid and each pixel.
[0010] In another implementation of the present invention, determining the portion of the neighboring triangular facet that maps to the same pixel as the target triangular facet based on the correspondence between the centroid and each pixel includes: mapping the centroid of the neighboring triangular facet to the window where the triangular mesh model is located to obtain the neighboring pixel corresponding to the neighboring triangular facet; and determining the portion of the neighboring triangular facet that maps to the same pixel as the target triangular facet based on the positional relationship between the neighboring pixel and the pixel corresponding to the target triangular facet in the window where the triangular mesh model is located.
[0011] In another implementation of the present invention, mapping the centroid of the neighboring triangular facet to the window where the triangular mesh model is located to obtain the neighboring pixel point corresponding to the neighboring triangular facet includes: establishing a ray perpendicular to a preset reference plane based on the centroid of the neighboring triangular facet; and determining the neighboring pixel point corresponding to the neighboring triangular facet according to the intersection of the ray and the window where the mold model is located.
[0012] In another implementation of the present invention, before marking the neighboring triangular facets of the remaining portion in the first rendering layer as the recessed area of the mold model, the method further includes: calculating the angle between the normal of the triangular facet in the second rendering layer and each ray; if the angle is an acute angle or a right angle, then the triangular facet is re-rendered as the first rendering layer.
[0013] According to a second aspect of the present invention, a detection device is provided, comprising: an acquisition module for acquiring a triangular mesh model of a mold model in a three-dimensional coordinate system and each pixel point of the window where the mold model is located; a processing module for performing image rendering processing on the triangular facets on the triangular mesh model to obtain a first rendering layer; determining a target triangular facet and its neighboring triangular facets in the first rendering layer based on the correspondence between each pixel point and the triangular facet; and further for rendering the portion of the target triangular facet and its neighboring triangular facets that is mapped to the same pixel point as it into a second rendering layer, until no neighboring triangular facet is mapped to the same pixel point as its corresponding target triangular facet; and a marking module for marking the remaining portion of the neighboring triangular facets in the first rendering layer as the concave region of the mold model.
[0014] According to a third aspect of the present invention, an electronic device is provided, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the detection method as described above.
[0015] According to a fourth aspect of the present invention, a computer storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the detection method as described in any of the above claims.
[0016] In the detection method of this invention, a triangular mesh model of the mold model in a three-dimensional coordinate system is used for detection, avoiding the poor observation effect of manual operation. At the same time, according to the correspondence between each pixel point of the window where the mold model is located and the triangular facets on the triangular mesh model, the triangular facets on the triangular mesh model are mapped and analyzed. Triangular facets in non-recessed areas are excluded by secondary rendering. Since the position of each triangular facet on the mold model is fixed, the remaining triangular facets in the recessed areas in the first rendering layer can be accurately mapped to the mold model, thus determining the recessed areas of the mold model and improving the accuracy of the recessed area detection results. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. By reading the detailed description of the embodiments below, the advantages and benefits of the solutions will become clear to those skilled in the art. The accompanying drawings are only for illustrating preferred embodiments and are not intended to limit the present invention. In the accompanying drawings:
[0018] Figure 1 This is a flowchart illustrating the steps of a detection method according to an embodiment of the present invention.
[0019] Figure 2This is a schematic diagram of the rendering layer structure in the detection method of another embodiment of the present invention.
[0020] Figure 3 This is a structural block diagram of a detection device according to another embodiment of the present invention.
[0021] Figure 4 This is a schematic diagram of the structure of an electronic device according to another embodiment of the present invention. Detailed Implementation
[0022] To enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the technical solutions in the embodiments of the present invention will be clearly and thoroughly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art should fall within the protection scope of the present invention.
[0023] Figure 1 A flowchart illustrating the steps of a detection method provided in an embodiment of the present invention is shown below. Figure 1 As shown, this embodiment mainly includes the following steps:
[0024] S101. Obtain the triangular mesh model of the mold model in the three-dimensional coordinate system, as well as each pixel point of the window where the mold model is located.
[0025] For example, scanning data of the user's upper or lower jaw is obtained through methods such as laser scanning or CT scanning. A three-dimensional mold model of the user's upper or lower jaw is constructed based on the scanning data. The modeling parameters of the three-dimensional mold model of the upper or lower jaw are retrieved. A triangular mesh model of the upper or lower jaw is constructed based on the modeling parameters. The pixels of the rendering window where the mold model is located are traversed.
[0026] S102. Perform image rendering processing on the triangular facets of the triangular mesh model to obtain the first rendering layer.
[0027] For example, the triangular faces on the triangular mesh model are traversed, and the GPU hardware is used to perform image rendering processing on all the triangular faces. Figure 2 This is a schematic diagram of the rendering layer structure in the detection method of the present invention, as shown below. Figure 2 As shown, 201 represents the first rendering layer obtained through the first rendering. For example, all triangular faces can be rendered as red, with the red area serving as the first rendering layer, and a color mapping table can be established based on the color corresponding to the first rendering layer. Other colors such as yellow and blue can also be used during image rendering; there are no restrictions on the colors used for rendering.
[0028] S103. Based on the correspondence between each pixel and the triangular facet, determine the target triangular facet and its neighboring triangular facets in the first rendering layer.
[0029] For example, a parallel algorithm is used to traverse each pixel in the window where the mold model is located. At the same time, the triangular mesh model is picked up by the ray method. It is determined whether each pixel in the window where the mold model is located is on the triangular mesh model. If the current pixel is on the triangular mesh model, the triangular facet corresponding to the current pixel on the triangular mesh model is found as the target triangular facet, and the triangular facets connected to the target triangular facet are its neighboring triangular facets.
[0030] S104. Render the target triangle and the parts of the neighboring triangles that are mapped to the same pixel as it into the second rendering layer until no neighboring triangle is mapped to the same pixel as its corresponding target triangle.
[0031] For example, the target triangle is rendered as a second rendering layer using GPU hardware. Based on the mapping relationship between the neighboring triangles and the pixels of the window where the mold model is located, the neighboring triangles corresponding to the target triangle are identified as being able to map to the same pixel as the target triangle. The portion of the neighboring triangles that maps to the same pixel as the target triangle is rendered as the second rendering layer. The same processing is performed on all the neighboring triangles of the target triangle until no neighboring triangle maps to the same pixel as its corresponding target triangle.
[0032] like Figure 2 As shown, the light-colored area corresponding to 202 represents the second rendering layer obtained through the second rendering. For example, green can be used to represent the second rendering layer. The target triangle and the part of the neighboring triangle that is mapped to the same pixel point are rendered as green. The color corresponding to the second rendering layer is filled into the color mapping table. The color used by the first rendering layer and the color used by the second rendering layer are different colors.
[0033] S105. Mark the neighboring triangular facets of the remaining part of the first rendering layer as the recessed area of the mold model.
[0034] For example, the concave direction is perpendicular to the direction pointing inward from the window where the mold model is located. The remaining part of the first rendering layer, that is, the neighboring triangles that cannot be mapped to the same pixel as their corresponding target triangles, is an invisible area when viewed from the concave direction, and is marked as the concave area of the mold model, such as... Figure 2 As shown, the dark area corresponding to 203 represents the concave area, which is the remaining part of the first rendering layer after the second rendering is performed on the basis of the first rendering layer.
[0035] In the detection method of this invention, a triangular mesh model of the mold model in a three-dimensional coordinate system is used for detection, avoiding the poor observation effect of manual operation. At the same time, according to the correspondence between each pixel point of the window where the mold model is located and the triangular facets on the triangular mesh model, the triangular facets on the triangular mesh model are mapped and analyzed. Triangular facets in non-recessed areas are excluded by secondary rendering. Since the position of each triangular facet on the mold model is fixed, the remaining triangular facets in the recessed areas in the first rendering layer can be accurately mapped to the mold model, thus determining the recessed areas of the mold model and improving the accuracy of the recessed area detection results.
[0036] In another implementation of the present invention, obtaining the triangular mesh model of the mold model in a three-dimensional coordinate system includes: obtaining the modeling parameters of the mold model in a three-dimensional coordinate system; and constructing the triangular mesh model of the mold model based on the modeling parameters.
[0037] For example, scanning data of the user's upper or lower jaw is obtained by means of laser scanning, CT scanning, etc. A mold model of the upper or lower jaw is modeled in a three-dimensional coordinate system based on the scanning data of the user's upper or lower jaw. A triangular mesh model is constructed on the surface of the mold model of the upper or lower jaw based on the modeling parameters of the mold model of the upper or lower jaw.
[0038] In the embodiment of the present invention, a mold model of the user's upper or lower jaw is modeled based on the scanning data. The modeled mold model has a good correspondence with the user's upper or lower jaw. At the same time, the operation is performed on the mold model, without the need to operate inside the user's mouth, making the field of view clearer.
[0039] In another implementation of the present invention, the target triangle and its neighboring triangles in the first rendering layer are determined based on the correspondence between each pixel and the triangle. This includes: establishing rays perpendicular to a preset reference plane based on each pixel; and determining the target triangle and its neighboring triangles in the first rendering layer based on the intersections of each ray with the triangular mesh model.
[0040] For example, when using GPU hardware to perform image rendering on a triangular mesh model, the depth information of each triangular facet on the triangular mesh model is saved. Rays perpendicular to a preset reference plane are established, with each pixel as the origin. The preset reference plane can be the plane of the window where the model is located; that is, rays perpendicular to the screen and pointing inwards are established at each pixel. Each ray intersects the triangular mesh model, and the triangular facet at each intersection point is taken as the target triangular facet. If a ray intersects the triangular mesh model at multiple points, the triangular facet corresponding to the intersection point with the smallest depth value along the concave direction is taken as the target triangular facet, and the surrounding triangular facets connected to the target triangular facet are its neighboring triangular facets. For example, if a ray intersects the triangular mesh model at 3 points with depth values of 0, 0.5, and 1 respectively, the triangular facet corresponding to the intersection point with a depth value of 0 is taken as the target triangular facet.
[0041] In the embodiment of the present invention, since the number of visible triangular faces on the surface of the triangular mesh model changes during the scaling up and down of the model, at a certain fixed ratio, the pixel points and the three-dimensional mesh model are mapped. The determined target triangular faces are only a part of the triangular faces in the triangular mesh model. The triangular faces that are not displayed at this ratio are used as neighboring triangular faces for detection and rendering, so as to avoid missing triangular faces during the processing and improve the accuracy of the rendering results.
[0042] In another implementation of the present invention, before rendering the target triangle and the portion of the neighboring triangle that is mapped to the same pixel as it into the second rendering layer, the method further includes: performing calculation processing on the neighboring triangles of the target triangle to obtain the centroid of the neighboring triangles; and determining the portion of the neighboring triangles that is mapped to the same pixel as the target triangle based on the correspondence between the centroid and each pixel.
[0043] For example, the neighboring triangular faces corresponding to the target triangular facet are traversed, and the centroid of each neighboring triangular facet is calculated using the centroid calculation formula. The centroid is then mapped to the window where the triangular mesh model is located. The intersection of the centroid and the window where the triangular mesh model is located is the neighboring pixel corresponding to that neighboring triangular facet. Based on the positional relationship between the neighboring pixels and the pixels corresponding to the target triangular facet, the triangular facets among the neighboring triangular facets that can be mapped to the same pixel as the target triangular facet are determined.
[0044] In the embodiment of the present invention, by performing mapping analysis on the neighboring triangular facets and the window where the triangular mesh model is located, the accuracy of the neighboring pixels corresponding to the neighboring triangular facets is ensured, thereby improving the accuracy of the matching results between the neighboring pixels and the pixels corresponding to the target triangular facets.
[0045] In another implementation of the present invention, determining the portion of the neighboring triangular facet that maps to the same pixel as the target triangular facet based on the correspondence between the centroid and each pixel includes: mapping the centroid of the neighboring triangular facet to the window where the triangular mesh model is located to obtain the neighboring pixel corresponding to the neighboring triangular facet; and determining the portion of the neighboring triangular facet that maps to the same pixel as the target triangular facet based on the positional relationship between the neighboring pixel and the pixel corresponding to the target triangular facet in the window where the triangular mesh model is located.
[0046] For example, the pixels of the neighboring triangular facets and the window containing the triangular mesh model are mapped. The neighboring pixels corresponding to the neighboring triangular facets are determined based on the mapping results. If the neighboring pixels and the pixels corresponding to the target triangular facets are in the same position in the window containing the triangular mesh model, it means that the neighboring triangular facets and their corresponding target triangular facets are mapped to the same pixel.
[0047] In another implementation of the present invention, mapping the centroid of the neighboring triangular facet to the window where the triangular mesh model is located to obtain the neighboring pixel point corresponding to the neighboring triangular facet includes: establishing a ray perpendicular to a preset reference plane based on the centroid of the neighboring triangular facet; and determining the neighboring pixel point corresponding to the neighboring triangular facet according to the intersection of the ray and the window where the mold model is located.
[0048] For example, with the centroid of the neighborhood triangle as the origin, a ray perpendicular to a preset reference plane is established. The preset reference plane can be the plane of the window where the mold model is located. That is, a ray perpendicular to the screen and pointing out of the screen is established at each centroid. Each ray has an intersection point with the window where the mold model is located. The pixel at the intersection point is the neighborhood pixel corresponding to the neighborhood triangle.
[0049] In the embodiment of the present invention, by establishing a ray perpendicular to a preset reference plane, the neighboring pixel points are determined based on the intersection of the ray and the window where the mold model is located, making the neighboring pixel points corresponding to the found neighboring triangular facets more accurate.
[0050] In another implementation of the present invention, before marking the neighboring triangular facets of the remaining portion in the first rendering layer as the recessed area of the mold model, the method further includes: calculating the angle between the normal of the triangular facet in the second rendering layer and each ray; if the angle is an acute angle or a right angle, then the triangular facet is re-rendered as the first rendering layer.
[0051] For example, all triangular faces are rendered a second time until no neighboring triangular faces are mapped to the same pixel as their corresponding target triangular face. The second rendering result is then checked to determine if there are any errors. The concave direction is the direction perpendicular to the window containing the mold model and pointing into the window. The normal of the triangular face in the second rendering layer is calculated, and the angle between the normal of the triangular face and each ray corresponding to each pixel is calculated. If the angle is acute or right angle, it indicates that the rendering result is incorrect, and the triangular face is re-rendered as the first rendering layer.
[0052] In the embodiment of the present invention, the angle between the normal of the triangle in the second rendering layer and the vector perpendicular to the screen pointing into the screen is calculated. The rendering result is checked based on the size of the angle to detect whether there is an error. The triangle with an error is re-rendered. By checking the rendering result and re-rendering the triangle with an error, the accuracy of the rendering result is improved.
[0053] Figure 3 This is a structural block diagram of a detection device 300 provided in an embodiment of the present invention, as shown below. Figure 3 As shown, this embodiment mainly includes:
[0054] Acquisition module 301: used to acquire the triangular mesh model of the mold model in the three-dimensional coordinate system, as well as each pixel point of the window where the mold model is located.
[0055] Processing module 302: is used to perform image rendering processing on the triangular facets on the triangular mesh model to obtain the first rendering layer; based on the correspondence between each pixel and the triangular facet, it determines the target triangular facet and its neighboring triangular facets in the first rendering layer; it is also used to render the part of the target triangular facet and its neighboring triangular facets that are mapped to the same pixel as it into the second rendering layer, until no neighboring triangular facet is mapped to the same pixel as its corresponding target triangular facet.
[0056] Marking module 303: Used to mark the neighboring triangular facets of the remaining part in the first rendering layer as the recessed area of the mold model.
[0057] In the detection device 300 of this invention embodiment, a triangular mesh model of the mold model in a three-dimensional coordinate system is used for detection, avoiding the poor observation effect of manual operation. At the same time, according to the correspondence between each pixel point of the window where the mold model is located and the triangular facets on the triangular mesh model, the triangular facets on the triangular mesh model are mapped and analyzed. Triangular facets in non-recessed areas are excluded through secondary rendering. Since the position of each triangular facet on the mold model is fixed, the remaining triangular facets in the recessed areas in the first rendering layer can be accurately mapped to the mold model, thus determining the recessed areas of the mold model and improving the accuracy of the recessed area detection results.
[0058] In another implementation of the present invention, the acquisition module 301 is further configured to acquire the triangular mesh model of the mold model in a three-dimensional coordinate system, including: acquiring the modeling parameters of the mold model in a three-dimensional coordinate system; and constructing the triangular mesh model of the mold model based on the modeling parameters.
[0059] In another implementation of the present invention, the processing module 302 is further configured to determine the target triangle and its neighboring triangles in the first rendering layer based on the correspondence between each pixel and the triangle, including: establishing each ray perpendicular to the preset reference plane based on each pixel; and determining the target triangle and its neighboring triangles in the first rendering layer based on the intersection of each ray and the triangle mesh model.
[0060] In another implementation of the present invention, before rendering the target triangle and the portion of the neighboring triangle that is mapped to the same pixel as it into the second rendering layer, the processing module 302 further includes: performing calculation processing on the neighboring triangles of the target triangle to obtain the centroid of the neighboring triangles; and determining the portion of the neighboring triangles that is mapped to the same pixel as the target triangle based on the correspondence between the centroid and each pixel.
[0061] In another implementation of the present invention, the processing module 302 is further configured to determine the portion of the neighboring triangular facet that is mapped to the same pixel as the target triangular facet based on the correspondence between the centroid and each pixel, including: mapping the centroid of the neighboring triangular facet to the window where the triangular mesh model is located to obtain the neighboring pixel corresponding to the neighboring triangular facet; and determining the portion of the neighboring triangular facet that is mapped to the same pixel as the target triangular facet based on the positional relationship between the neighboring pixel and the pixel corresponding to the target triangular facet in the window where the triangular mesh model is located.
[0062] In another implementation of the present invention, the processing module 302 is further configured to map the centroid of the neighboring triangular facet to the window where the triangular mesh model is located, to obtain the neighboring pixel point corresponding to the neighboring triangular facet, including: establishing a ray perpendicular to a preset reference plane based on the centroid of the neighboring triangular facet; and determining the neighboring pixel point corresponding to the neighboring triangular facet according to the intersection of the ray and the window where the mold model is located.
[0063] In another implementation of the present invention, before marking the neighboring triangular facets of the remaining portion in the first rendering layer as the recessed area of the mold model, the processing module 302 further includes: calculating the angle between the triangular facets in the second rendering layer and each ray; if the angle is an acute angle or a right angle, then re-rendering the triangular facet as the first rendering layer.
[0064] The apparatus of this embodiment is used to implement the corresponding methods in the foregoing method embodiments and has the beneficial effects of the corresponding method embodiments, which will not be repeated here. Furthermore, the functional implementation of each module in the apparatus of this embodiment can be referred to the description of the corresponding part in the foregoing method embodiments, which will also not be repeated here.
[0065] like Figure 4 As shown, the electronic device 400 may include: a processor 401, a memory 403, a communication bus 404, and a communication interface 405.
[0066] in:
[0067] The processor 401, memory 403, and communication interface 405 communicate with each other via communication bus 404.
[0068] Communication interface 405 is used for communication with other electronic devices or servers.
[0069] The processor 401 is used to execute the program 402, which can specifically execute the steps of any of the detection methods in the above embodiments.
[0070] Specifically, program 402 may include program code that includes computer operation instructions.
[0071] Processor 401 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application. The smart device includes one or more processors, which may be processors of the same type, such as one or more CPUs; or they may be processors of different types, such as one or more CPUs and one or more ASICs.
[0072] Memory 403 is used to store program 402. Memory 403 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.
[0073] Specifically, program 402 can be used to cause processor 401 to execute steps to implement any of the detection methods described in the embodiments. The specific implementation of each step in program 402 can be found in the corresponding descriptions of the steps and units executed by any of the detection methods described above, and will not be repeated here. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the devices and modules described above can be referred to the corresponding process descriptions in the foregoing method embodiments.
[0074] An exemplary embodiment of this application also provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to perform the methods of various embodiments of this application.
[0075] The methods described above according to embodiments of the present invention can be implemented in hardware, firmware, or as software or computer code that can be stored in a recording medium (such as a CD-ROM, RAM, floppy disk, hard disk, or magneto-optical disk), or as computer code originally stored on a remote recording medium or a non-transitory machine-readable medium and subsequently stored on a local recording medium, downloaded via a network. Thus, the methods described herein can be processed by software stored on a recording medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware (such as an ASIC or FPGA). It is understood that the computer, processor, microprocessor controller, or programmable hardware includes storage components (e.g., RAM, ROM, flash memory, etc.) capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods described herein. Furthermore, when a general-purpose computer accesses code used to implement the methods shown herein, the execution of the code transforms the general-purpose computer into a dedicated computer for executing the methods shown herein.
[0076] Specific embodiments of the invention have now been described. Other embodiments are within the scope of the appended claims. In some cases, the actions described in the claims can be performed in a different order and still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing can be advantageous.
[0077] It should be noted that all directional indicators (such as up, down, left, right, back, etc.) in the embodiments of the present invention are only used to explain the relative positional relationship and movement of each component in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indicator will also change accordingly.
[0078] In the description of this invention, the terms "first" and "second" are used only for convenience in describing different components or names, and should not be construed as indicating or implying a sequential relationship, relative importance, or implicitly specifying the number of technical features indicated. Thus, a feature defined with "first" and "second" may explicitly or implicitly include at least one of that feature.
[0079] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention.
[0080] It should be noted that although specific embodiments of the present invention have been described in detail with reference to the accompanying drawings, this should not be construed as limiting the scope of protection of the present invention. Various modifications and variations that can be made by those skilled in the art without inventive effort within the scope described in the claims still fall within the scope of protection of the present invention.
[0081] The examples of the embodiments of the present invention are intended to concisely illustrate the technical features of the embodiments of the present invention, so that those skilled in the art can intuitively understand the technical features of the embodiments of the present invention, and are not intended to be an improper limitation of the embodiments of the present invention.
[0082] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A detection method, characterized in that, include: Obtain the triangular mesh model of the mold model in a three-dimensional coordinate system, and the images of the window containing the mold model. plain point; The triangular faces on the triangular mesh model are subjected to image rendering processing to obtain the first rendering layer; Based on the correspondence between each pixel and the triangular facet, the target triangular facet and its neighboring triangular facets in the first rendering layer are determined. The neighboring triangles of the target triangle are processed to obtain the centroid of the neighboring triangles. Based on the correspondence between the centroid and each pixel, the part of the neighboring triangle that is mapped to the same pixel as the target triangle is determined. The target triangle and the portion of the neighboring triangle that is mapped to the same pixel are rendered as the second rendering layer until no neighboring triangle is mapped to the same pixel as its corresponding target triangle. The neighboring triangular facets of the remaining portion of the first rendering layer are marked as the recessed areas of the mold model.
2. The method as described in claim 1, characterized in that, The process of obtaining the triangular mesh model of the mold model in a three-dimensional coordinate system includes: Obtain the modeling parameters of the mold model in the three-dimensional coordinate system; Based on the modeling parameters, a triangular mesh model of the mold model is constructed.
3. The method as described in claim 1, characterized in that, The step of determining the target triangle and its neighboring triangles in the first rendering layer based on the correspondence between each pixel and the triangle includes: Based on each pixel, establish rays perpendicular to the preset reference plane; Based on the intersection points of each ray with the triangular mesh model, the target triangular facet and its neighboring triangular facets corresponding to each pixel in the first rendering layer are determined.
4. The method as described in claim 1, characterized in that, The step of determining the portion of the neighboring triangular facet that maps to the same pixel as the target triangular facet based on the correspondence between the centroid and each pixel includes: Map the centroid of the neighborhood triangle to the window where the triangular mesh model is located to obtain the neighborhood pixel corresponding to the neighborhood triangle. Based on the positional relationship between the neighboring pixels and the corresponding pixels of the target triangle in the window where the triangular mesh model is located, determine the portion of the neighboring triangle that is mapped to the same pixel as the target triangle.
5. The method as described in claim 4, characterized in that, The step of mapping the centroid of the neighboring triangular facet to the window containing the triangular mesh model to obtain the neighboring pixel points corresponding to the neighboring triangular facet includes: Based on the centroid of the neighborhood triangular facet, a ray perpendicular to the preset reference plane is established; Based on the intersection of the ray and the window where the mold model is located, the neighboring pixel points corresponding to the neighboring triangular facet are determined.
6. The method as described in claim 3, characterized in that, Before marking the neighboring triangular facets of the remaining portion in the first rendering layer as the recessed area of the mold model, the method further includes: Calculate the angle between the normal of the triangular facet in the second rendering layer and each ray; If the angle is an acute angle or a right angle, then the triangular facet is re-rendered as the first rendering layer.
7. A detection device, characterized in that, include: Acquisition module: used to acquire the triangular mesh model of the mold model in the three-dimensional coordinate system, as well as each pixel point of the window where the mold model is located; Processing module: This module performs image rendering on the triangular faces of the triangular mesh model to obtain a first rendering layer; based on the correspondence between each pixel and the triangular face, it determines the target triangular face and its neighboring triangular face in the first rendering layer; it performs calculations on the neighboring triangular face of the target triangular face to obtain the centroid of the neighboring triangular face; based on the correspondence between the centroid and each pixel, it determines the portion of the neighboring triangular face that maps to the same pixel as the target triangular face; and it further renders the target triangular face and the portion of the neighboring triangular face that maps to the same pixel as it into a second rendering layer, until no neighboring triangular face maps to the same pixel as its corresponding target triangular face. Marking module: used to mark the neighboring triangular facets of the remaining part in the first rendering layer as the recessed area of the mold model.
8. An electronic device, characterized in that, include: Memory, processor, and other components stored in the memory and accessible to the user. A computer program running on the processor, wherein the processor executes the computer program to implement the steps of the detection method as described in any one of claims 1 to 6.
9. A computer storage medium, characterized in that, The computer storage medium stores a computer program, which, when executed by a processor, implements the steps of the detection method as described in any one of claims 1 to 6.