A MIM gear shaft feature recognition method and device based on Hu invariant moment
By constructing the recognition coordinate system and using the scaling Hu invariant moment algorithm, the inclusive core plane set image features of the gear shaft are obtained, which solves the problem of insufficient robustness in the gear shaft feature recognition in the prior art, and achieves higher recognition accuracy and stability.
Patent Information
- Application Number
- CN202411696428.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2044-11-25
AI Technical Summary
The gear shaft feature recognition method based on Hu invariant moment in the prior art cannot maintain good rotation, scaling and translation invariance during three-dimensional conversion, resulting in insufficient robustness of the recognition results.
By constructing the recognition coordinate system, intercept the inclusive core plane set of the gear to be tested, obtain the scaling Hu invariant moment of each inclusive core image, use the triangular grid and the image subblocks in the two-dimensional plane to form a mapping relationship, and calculate the scaling Hu invariant moment of the inclusive core image for feature recognition.
It improves the robustness and accuracy of gear shaft feature recognition results, ensures the stability and matching accuracy of image feature extraction, and significantly improves the accuracy of feature detection.
Smart Images

Figure CN119672356B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image recognition, and in particular to a method and device for MIM gear shaft feature recognition based on Hu invariant moments. Background Art
[0002] With the rapid development of computer software and hardware technology, its widespread application in machinery manufacturing enterprises has led to widespread and urgent practical demand for computer-aided process design. In this context, the machinery design and manufacturing industry, with the help of computer-aided technology, can make up for the shortcomings of traditional machinery design and manufacturing, greatly enhancing the market competitiveness of enterprises.
[0003] The Chinese patent publication number CN111652925B discloses a method for extracting the global feature Hu invariant moment of a target using single pixel imaging. By constructing a (p+q) order two-dimensional function G(x,y), the two-dimensional function satisfies: G pq (x, y) = x p y q , and then adjust the parameter values of p,q to generate the corresponding two-dimensional function G pq (x, y) modulation information; the generated two-dimensional modulation information is sent to the light modulation system to modulate the illumination light of the target object to generate structured modulated light, and the modulated light is used to illuminate the target. Finally, the intensity value of the target transmitted or reflected light is obtained by using the single-pixel detection and acquisition system, and the intensity value obtained by detection is used to invert the Hu invariant moment of the target global feature. However, the above method is based on the two-dimensional function G pq The Hu invariant moment of (x, y) cannot maintain good rotation, scaling and translation invariance when converting three dimensions to two dimensions, resulting in the robustness of the output results failing to meet the requirements. Therefore, it is very necessary to provide a MIM gear shaft feature recognition method and device based on Hu invariant moment to improve the robustness of the gear shaft feature recognition results. Summary of the Invention
[0004] In view of this, the present invention proposes a MIM gear shaft feature recognition method and device based on Hu invariant moment, which intercepts the inclusive core plane set of the digital model of the gear to be tested in the constructed recognition coordinates to obtain the scaled Hu invariant moment of each inclusive core image in the inclusive core plane set, thereby improving the robustness of the gear shaft feature recognition results.
[0005] The present invention provides a method and device for MIM gear shaft feature recognition based on Hu invariant moment, the method comprising:
[0006] Obtaining a digital model of the gear to be tested, wherein the digital model includes a main tooth profile surface;
[0007] Based on the characteristic information of the main tooth profile surface, an identification coordinate system is constructed, wherein the characteristic information includes the normal direction of the main tooth profile surface, the midpoint of the tooth profile area, and the center of the circle;
[0008] intercepting an inclusive core plane set according to the identified coordinate system and the preset cross section, wherein the inclusive core plane set includes a plurality of inclusive core images;
[0009] Obtaining a scaled Hu invariant moment of the inclusion kernel image based on a scaled Hu invariant moment algorithm;
[0010] The scaled Hu invariant moments of all the inclusion kernel images in the inclusion kernel plane set are compared, and inclusion kernel features are identified.
[0011] On the basis of the above technical solution, preferably, the method for obtaining the main tooth profile includes:
[0012] Acquiring surface data of the gear to be tested, wherein the surface data includes a gear surface and the number of gear surfaces connected to the gear surface;
[0013] determining whether the number of connected gear surfaces of the gear surface is equal to the number of preset surface types;
[0014] If the number of the connected gear surfaces is equal to the preset number of surface profiles, the gear surface is selected as the main tooth profile surface.
[0015] On the basis of the above technical solution, preferably, constructing an identification coordinate system based on the feature information of the main tooth profile specifically includes:
[0016] The normal direction of the main tooth surface is used as the Z axis, and the line between the central axis of the gear to be measured and the rotation center axis of the gear shaft to be measured is used as the X axis to construct the identification coordinate system, wherein the gear to be measured includes the gear shaft to be measured.
[0017] More preferably, the scaled Hu invariant moment algorithm based on the scaled Hu invariant moment sequentially calculates the scaled Hu invariant moments in the inclusion kernel image, specifically including:
[0018] Acquire a triangular mesh of the main tooth profile, wherein the triangular mesh includes a plurality of triangular node coordinates;
[0019] Performing region segmentation on the inclusion core image so that the inclusion core image forms M×N image sub-blocks;
[0020] Based on the identification coordinate system and the image sub-block, obtaining the plane node coordinates of the image sub-block;
[0021] Acquire a mapping relationship between the triangular mesh and the inclusion kernel image according to the triangular node coordinates and the plane node coordinates, wherein the mapping relationship includes a scaling factor;
[0022] Based on the scaling factors, the scaled Hu invariant moments of the inclusion kernel image are calculated in sequence.
[0023] More preferably, the step of sequentially calculating the scaled Hu invariant moments of the inclusion kernel image based on the scaling factor specifically includes:
[0024] Obtaining the p+q order origin moment of the two-dimensional distribution function of the inclusive kernel image;
[0025] The p+q order origin moment of the two-dimensional distribution function of the inclusive kernel image is scaled by a scaling factor to obtain an i order scaled Hu invariant moment.
[0026] More preferably, obtaining the p+q-order origin moment of the two-dimensional distribution function of the inclusive kernel image specifically includes:
[0027]
[0028] Among them, m pq It represents the p+q-order origin moment of the two-dimensional distribution function of the inclusive kernel image, where p and q are both natural numbers and the 0-order origin moment m 00 represents the total volume of the main tooth surface in the triangular mesh, f(x, y) represents the two-dimensional distribution function of the inclusion kernel image, (x, y) represents the two-dimensional coordinates of any point in the inclusion kernel image, u pq represents the geometric center moment of the inclusion kernel image, and Respectively represent the horizontal and vertical coordinates of the centroid of the main tooth profile.
[0029] More preferably, scaling the p+q order origin moment of the two-dimensional distribution function of the inclusive kernel image by a scaling factor to obtain the i order scaled Hu invariant moment specifically includes:
[0030]
[0031] Among them, η pq represents the normalized central moment, γ=(p+q) / 2+1, M1 to M7 are scaled Hu invariant moments of order 1 to 7, respectively. represents the scaling factor, μ 00 Represents the zero-order origin moment m 00 The corresponding 0th-order normalized central moment.
[0032] In a second aspect of the present application, a MIM gear shaft feature recognition device based on Hu invariant moment is provided, wherein the feature recognition device includes an acquisition module, a processing module and an analysis module, wherein:
[0033] The acquisition module is used to obtain a digital model of the gear to be tested, wherein the digital model includes a main tooth profile surface;
[0034] The processing module is configured to construct an identification coordinate system based on feature information of the main tooth profile surface, wherein the feature information includes a normal direction of the main tooth profile surface, a midpoint of a tooth profile region, and a center of a circle; intercept an inclusive core plane set according to the identification coordinate system and a preset cross section; wherein the inclusive core plane set includes a plurality of inclusive core images; and obtain scaled Hu invariant moments of the inclusive core images based on a scaled Hu invariant moment algorithm;
[0035] The analysis module is used to compare the scaled Hu invariant moments of all inclusive kernel images in the inclusive kernel plane set and perform inclusive kernel feature recognition.
[0036] In a third aspect of the present application, an electronic device is provided, comprising a processor, a memory, a user interface and a network interface, wherein the memory is used to store instructions, the user interface and the network interface are used to communicate with other devices, and the processor is used to execute the instructions stored in the memory.
[0037] In a fourth aspect of the present application, a computer-readable storage medium is provided, on which a computer program is stored. The computer program is executed by a processor to implement the steps of a MIM gear shaft feature recognition method based on Hu invariant moments.
[0038] The present invention provides a method and device for MIM gear shaft feature recognition based on Hu invariant moment, which has the following advantages over the prior art:
[0039] (1) The inclusive core plane set of the digital model of the gear to be tested is intercepted in the constructed recognition coordinates to obtain each inclusive core image in the inclusive core plane set. The inclusive core image is segmented into blocks using a sliding window and the scaled Hu invariant moment of the segmented blocks is calculated. Finally, the scaled Hu invariant moment of the inclusive core image is used for inclusive core feature recognition. By selecting image features with translation, rotation and scale invariance, the effectiveness and stability of the image sub-block feature extraction in the inclusive core plane set are guaranteed, thereby improving the robustness of the gear shaft feature recognition results.
[0040] (2) A mapping relationship is formed between the triangular mesh and the image sub-blocks in the two-dimensional plane, which makes the connectivity of each image qualitatively improved, and can significantly improve the accuracy of feature detection. At the same time, in order to avoid the incomplete image information caused by the inconsistent rotation angle between the collected inclusion kernel plane set and the image sub-block, the inclusion kernel image in the inclusion kernel plane set is divided into image sub-blocks one by one to improve the stability of feature extraction and ensure the accuracy of matching. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0042] Figure 1 A schematic flow chart of the MIM gear shaft feature recognition method based on Hu invariant moments provided by the present invention;
[0043] Figure 2 A schematic diagram of the distance between the main tooth profile and the inclusion core in the current coordinate system provided by the present invention;
[0044] Figure 3 A schematic diagram of the homogenized normal vector provided by the present invention;
[0045] Figure 4 A schematic diagram of a grid after region segmentation of the inclusion kernel image provided by the present invention;
[0046] Figure 5 A schematic structural diagram of the identification device provided by the present invention;
[0047] Figure 6 This is a schematic structural diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0048] The following will be combined with the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0049] The present application embodiment discloses a method for identifying a characteristic model of an injection molded gear, such as Figure 1 As shown, the method includes steps S1-S5.
[0050] Step S1: obtaining a digital model of the gear to be tested, wherein the digital model includes a main tooth profile surface.
[0051] In this step, the digital model of the gear to be measured is traversed to obtain the tooth profile of the gear to be measured, and the identification coordinate system is determined according to the selected tooth profile.
[0052] Step S1 includes steps S11-S13, wherein:
[0053] Step S11 , obtaining surface data of the gear to be tested, wherein the surface data includes the gear surface and the number of gear surfaces connected to the gear surface.
[0054] In this step, the surface data is obtained by traversing the digital model of the gear to be tested.
[0055] Step S12: determining whether the number of adjacent gear surfaces of the gear surface is equal to the number of preset surface types.
[0056] In this step, the preset number of surface profiles is the maximum number of adjacent surfaces in the gear to be tested.
[0057] In step S13 , if the number of connected gear surfaces is equal to the preset number of surface profiles, the gear surface is selected as the main tooth profile surface.
[0058] In this step, the number of adjacent surfaces on each gear surface of the gear to be tested is calculated. The two gear surfaces with the largest number of adjacent surfaces are identified as the tooth profile surfaces. One gear surface is selected as the primary tooth profile surface, and the other tooth profile surface is selected as the secondary tooth profile surface. The primary tooth profile surface is used as the identification coordinate system (the Z-axis coordinates of the secondary tooth profile surface are all negative numbers). After the tooth profile surfaces are determined, the tooth profile contours are extracted.
[0059] In one example, if Figure 2 As shown, in the current coordinate system, calculate the distance h1 from the main tooth profile surface to the top of the containing core and the distance h2 from the auxiliary tooth profile surface to the bottom of the containing core. If h2>h1, create a new coordinate system newCSYS, which is opposite to the current coordinate system. The original coordinate system is hidden and the marks of the main tooth profile surface and the auxiliary tooth profile surface are swapped. Calculate the distance between the two surfaces, which is the parameter tooth thickness b.
[0060] Step S2: constructing an identification coordinate system based on the feature information of the main tooth profile surface, wherein the feature information includes the normal direction of the main tooth profile surface, the midpoint of the tooth profile area, and the center of the circle.
[0061] In this step, the normal direction of the main tooth profile surface is used as the Z axis, and the line between the center axis of the gear to be measured and the rotation center axis of the gear shaft to be measured is used as the X axis to construct an identification coordinate system, wherein the gear to be measured includes the gear shaft to be measured, and the straight line perpendicular to the line connecting the midpoint of the tooth profile area and the center of the main tooth profile surface and passing through the intersection of the Z axis and the X axis is used as the Y axis of the identification coordinate system.
[0062] Furthermore, by calculating Figure 2 The number of adjacent surfaces of each gear is calculated, and the two surfaces with the largest number of adjacent surfaces are taken as tooth profile surfaces, which are respectively recorded as surface A (upper surface) and surface B (lower surface). The contour lines of the two tooth profile surfaces are extracted, and the distance h1 from the main tooth profile surface to the top of the inclusive core and the distance h2 from the auxiliary tooth profile surface to the bottom of the inclusive core are calculated under the normal direction of the tooth profile surface. If h2>h1, then surface A is the main tooth profile surface, otherwise surface B is the main tooth profile surface. The center of the main tooth profile surface is the coordinate origin, the normal direction of the main tooth profile surface is the coordinate Z direction, and the line connecting the gear center axis to the rotation center axis is the X axis to construct the identification coordinate system.
[0063] Step S3 , intercepting an inclusive core plane set according to the identified coordinate system and the preset cross section, wherein the inclusive core plane set includes a plurality of inclusive core images.
[0064] In this step, the primary tooth profile is constructed with the XOZ plane as the reference plane in the identification coordinate system. Faces with a normal angle less than 90° to the primary plane are extracted as the primary plane set, and faces with a normal angle less than 90° to the secondary plane are extracted as the secondary plane set. Surface continuity is considered based on the topological relationship, and discontinuous surfaces are eliminated. If a surface is eliminated, it indicates that the mold has a slider structure.
[0065] Step S4: obtaining the scaled Hu invariant moment of the inclusion kernel image based on the scaled Hu invariant moment algorithm.
[0066] Step S4 includes steps S41-S45, wherein:
[0067] Step S41: Obtain a triangular mesh of the main tooth profile surface, where the triangular mesh includes coordinates of several triangular nodes. The main tooth profile surface must meet the following requirements: the main tooth profile surface is a smooth continuous surface; the surfaces have no overlap in the Z direction; the cover drawing surface is invariant to translation, rotation, and symmetry; and the cover drawing surface is not invariant to scaling.
[0068] In this step, the digital model of the gear to be tested can be divided into several subdomains by using the adaptive octree space segmentation method. It should be noted that the specific process of dividing the subdomains in this step is as follows: calculate the minimum and maximum values of the point cloud data set in the entire digital model in three directions (x, y, z); and based on these minimum and maximum value data, construct an initial rectangular bounding box containing the digital model of the entire gear to be tested, and use it as the root node of the octree; the root node is evenly divided into eight equal-sized cuboids according to the division conditions, and the obtained child nodes are further divided into eight sub-cubic blocks, and the division is stopped until the number of point clouds in the subdomain is less than the adaptive parameter K, where K satisfies f(x)=N 2 / K+N×K, N represents the number of point clouds, and The value of the adaptive parameter K is determined when the above formula reaches an extreme value.
[0069] Using the graph cut method, a triangular mesh is constructed in each subdomain. It can be understood that a Delaunay triangulation can be constructed through a point-by-point insertion algorithm. When a new Delaunay node is added, its distance to the nearest node in the Delaunay triangle is calculated. If this distance is less than a threshold, the node's position is updated. If the distance is greater than the threshold, the original structure is retained and the new node is inserted. The resulting vertices of the Delaunay triangulation store not only the 3D coordinates but also the visual information of the point. Each tetrahedron in the Delaunay triangulation is labeled. All Delaunay tetrahedrons that are passed by a ray from a tetrahedron vertex to the camera center of the corresponding view are labeled as external. Tetrahedrons that are passed by the ray in the opposite direction are labeled as internal. Due to noise in the point cloud, labeled tetrahedrons can exhibit islanding and other issues. Therefore, starting from the vertex, the tetrahedrons in the neighborhood of each vertex are relabeled to ensure that the vertex satisfies the manifold characteristics, thereby ensuring the manifold characteristics of the edges, which facilitates the accuracy and speed of subsequent mesh optimization. Tetrahedrons in the vertex neighborhood are identified and clustered based on the label value and spatial adjacency. When the number of clusters is 1, the vertex is not a reconstructed surface vertex; when the number of clusters is 2, the vertex is a reconstructed surface vertex and satisfies the manifold characteristics; if the number of clusters is greater than 2, the vertex is relabeled so that the number of clusters is 2. The triangular faces shared by the two tetrahedrons obtained by the final labeling are approximated as the surface of the object. The denser the Delaunay triangulation, the better the surface fit.
[0070] The specific process of optimizing the obtained triangular mesh is as follows: Delete duplicate triangles. Since the subdomains obtained by dividing the point cloud space generate overlapping point sets, there will be a certain number of duplicate triangles (triangles ABC, ACB, and BAC, etc.) when forming the triangular mesh. Find one of the triangles and all triangles with the same three vertices, keep one of them, and delete all the remaining triangles. Normalize the triangular mesh. For non-standard meshes, if the spatial quadrilateral has two diagonals, keep the diagonal that divides the maximum angle. If there is only one diagonal, and the diagonal does not divide the maximum angle of the quadrilateral, discard this diagonal and connect the other diagonal. Then, the plane where the optimized triangular mesh is located is homogenized using the homogenized normal vector.
[0071] See also Figure 3 The specific process of normalizing is as follows: select triangle T1, with vertices labeled A, B, and C in the order of ABC; locate triangle T2 with the same sides as triangle T1, and the vertices should be labeled A, B, and D (or A, C, E or B, C, F); regardless of the original order of A, B, and D, their vertex order is changed to BAD (or ACE or CBF). In this way, expand with the seed triangle until all triangles are traversed and the normal vector is normalized.
[0072] Step S42 : performing region segmentation on the inclusion core image so that the inclusion core image forms M×N image sub-blocks.
[0073] In this step, appropriate segmentation parameters M and N are determined so that the size of the segmented sub-blocks is moderate and convenient for subsequent processing. The inclusion kernel image is preprocessed, including denoising, contrast enhancement and other operations to improve the segmentation quality. A regular grid segmentation method is used to evenly divide the image into M×N sub-blocks, ensuring that the segmentation boundaries are consistent with the image feature lines and that there is a certain overlap between adjacent sub-blocks to avoid information loss. Figure 4 As shown, the step length a of each image sub-block can be expressed as the X-direction side length of the inclusive core image / M, and the step length b can be expressed as the Y-direction side length of the inclusive core image / N, wherein the horizontal and vertical coordinates of each node can be expressed as (X-X0) / a and (Y-Y0) / b, respectively.
[0074] Step S43: obtaining the plane node coordinates of the image sub-block based on the identified coordinate system and the image sub-block.
[0075] In this step, the lower left corner of the image is selected as the default origin (point O), the image centroid is calculated as an alternative origin, the optimal origin position is determined based on image features, the pixel coordinates of the origin are recorded, and the Canny operator is used for edge detection. Appropriate high and low thresholds are set for edge refinement to remove noise edges. The Harris corner detector is used to calculate corner response values, and a corner detection threshold is set for non-maximum suppression. A contour tracking algorithm is used to extract contour key points. Curvature features are calculated to select significant feature points. A node density threshold is set to merge overcrowded nodes, supplement sparse area nodes, and optimize node distribution. The image coordinates are converted to plane coordinates, the (x, y) coordinates of each node are calculated, and coordinate correction is performed based on the image resolution.
[0076] Step S44 : obtaining a mapping relationship between the triangular mesh and the encompassing kernel image according to the triangular node coordinates and the plane node coordinates, wherein the mapping relationship includes a scaling factor.
[0077] In this step, a node correspondence table must first be established, containing the following key information: triangular mesh node identifiers, plane node identifiers, inter-node distances, and correspondence confidence. For spatial distance calculation, the distance formula between two points in three-dimensional space is used to calculate the coordinates of the triangular mesh nodes and the projected coordinates of the plane nodes. For nearest neighbor node matching, the KD tree algorithm is primarily used to improve search efficiency. A maximum matching distance threshold is set, with a focus on handling many-to-one and one-to-many matching conflicts.
[0078] To calculate the local scaling factor, each pair of adjacent nodes must be processed: first, the distance between the node pairs on the triangular mesh is calculated, then the distance between the corresponding pair of plane nodes is calculated. The ratio of the two is the local scaling factor. A distance-based weighting factor is also introduced, and the weight calculation is performed using an exponential decay function. To optimize the global scaling factor, an iterative approach is used: first, all weighted local scaling factors are accumulated, and then the weights are normalized to obtain the global scaling factor. The local scaling factors are then updated through a linear combination method to achieve global optimization.
[0079] Point error calculation primarily involves recording the original and mapped positions, and calculating positional and angular deviations. Shape preservation assessment focuses on three key aspects: changes in side length ratio, angle, and area. The degree of shape preservation is assessed by comparing the changes in these geometric features before and after mapping. Multiple metrics are used to comprehensively evaluate mapping quality. The mean squared error (MSE) is used to calculate the mean of the sum of squares of all node mapping errors. A topology preservation metric is used to assess the degree of topological structure preservation by checking whether adjacency relationships between nodes are maintained. Scaling consistency is used to evaluate scaling uniformity by calculating the variance of the local scaling factor relative to the global scaling factor.
[0080] Step S45 : Based on the scaling factors, the scaled Hu invariant moments of the inclusive kernel image are calculated in sequence.
[0081] In this step, the p+q-order origin moment of the two-dimensional distribution function of the inclusive kernel image is obtained.
[0082]
[0083] Among them, m pq It represents the p+q-order origin moment of the two-dimensional distribution function of the inclusive kernel image, where p and q are both natural numbers and the 0-order origin moment m 00 represents the total volume of the main tooth surface in the triangular mesh, f(x, y) represents the two-dimensional distribution function of the inclusive kernel image, (x, y) represents the two-dimensional coordinates of any point in the inclusive kernel image, u pq represents the geometric center moment of the enclosing kernel image, and Respectively represent the horizontal and vertical coordinates of the centroid of the main tooth profile,
[0084] The p+q-order origin moment of the two-dimensional distribution function of the inclusive kernel image is scaled by a scaling factor to obtain the i-order scaled Hu invariant moment, specifically including:
[0085] The p+q order origin moment is scaled by the factor The scaling origin moment obtained after scaling is:
[0086]
[0087] Perform the scaling height H corresponding to the p+q order pq Specifically, it can be expressed as:
[0088]
[0089] According to the invariant moment polynomial space basis theorem (derived from the invariant moment algebraic invariant construction method), as well as the TS (shift and constrained scaling invariant moment polynomial space basis) and TScR (translation, constrained scaling and rotation invariant moment polynomial space basis) invariance theorem, we can obtain 7 scaled Hu invariant moments, as shown below:
[0090]
[0091]
[0092] Among them, η pq represents the normalized central moment, γ=(p+q) / 2+1, M1 to M7 are scaled Hu invariant moments of order 1 to 7, respectively. represents the scaling factor, μ 00 Represents the zero-order origin moment m 00 The corresponding 0th-order normalized central moment.
[0093] The use of triangular meshes and image sub-blocks in the two-dimensional plane to form a mapping relationship has qualitatively improved the connectivity of each image, which can significantly improve the accuracy of feature detection. At the same time, in order to avoid incomplete image information caused by inconsistent rotation angles between the collected inclusion kernel plane set and the image sub-blocks, the inclusion kernel image in the inclusion kernel plane set is divided into image sub-blocks one by one to improve the stability of feature extraction and ensure matching accuracy.
[0094] Step S5: comparing the scaled Hu invariant moments of all inclusive kernel images in the inclusive kernel plane set, and performing inclusive kernel feature recognition.
[0095] Based on the above method, the embodiment of the present application discloses a MIM gear shaft feature recognition device based on Hu invariant moment, referring to Figure 5 The feature recognition device 1 includes a collection module 11, a processing module 12 and an analysis module 13, wherein:
[0096] The acquisition module 11 is used to obtain a digital model of the gear to be tested, wherein the digital model includes a main tooth profile surface;
[0097] The processing module 12 is configured to construct an identification coordinate system based on feature information of the main tooth profile surface, wherein the feature information includes the normal direction of the main tooth profile surface, the midpoint of the tooth profile area, and the center of the circle; intercept an inclusive core plane set according to the identification coordinate system and a preset cross section; wherein the inclusive core plane set includes a plurality of inclusive core images; and obtain scaled Hu invariant moments of the inclusive core images based on a scaled Hu invariant moment algorithm;
[0098] The analysis module 13 is used to compare the scaled Hu invariant moments of all inclusive kernel images in the inclusive kernel plane set and perform inclusive kernel feature recognition.
[0099] In one example, the acquisition module 11 is used to obtain the surface profile data of the gear to be tested, wherein the surface profile data includes the gear surface and the number of gear surfaces connected to the gear surface; determine whether the number of connected gear surfaces of the gear surface is equal to the preset surface profile number; if the number of connected gear surfaces is equal to the preset surface profile number, the gear surface is selected as the main tooth profile surface.
[0100] In one example, the processing module 12 is configured to construct an identification coordinate system using the normal direction of the main tooth profile as the Z axis and the line connecting the midpoint of the tooth profile area of the main tooth profile and the center of the main tooth profile as the X axis.
[0101] In one example, the processing module 12 is used to obtain a triangular mesh of the main tooth profile, wherein the triangular mesh includes a number of triangular node coordinates; perform sliding window segmentation on the inclusion kernel image so that the inclusion kernel image forms M×N image sub-blocks; obtain the plane node coordinates of the image sub-block based on the identification coordinate system and the image sub-block; obtain the mapping relationship between the triangular mesh and the inclusion kernel image based on the triangular node coordinates and the plane node coordinates, wherein the mapping relationship includes a scaling factor; and calculate the scaled Hu invariant moment of the inclusion kernel image based on the scaling factor.
[0102] In one example, the processing module 12 is configured to obtain the p+q order origin moment of the two-dimensional distribution function of the inclusive kernel image; and scale the p+q order origin moment of the two-dimensional distribution function of the inclusive kernel image by a scaling factor to obtain the i-th order scaled Hu invariant moment.
[0103] In one example, the processing module 12 is configured to obtain the p+q-order origin moment of the two-dimensional distribution function of the inclusive kernel image, specifically including:
[0104]
[0105] Among them, m pq It represents the p+q-order origin moment of the two-dimensional distribution function of the inclusive kernel image, where p and q are both natural numbers and the 0-order origin moment m 00 represents the total volume of the main tooth surface in the triangular mesh, f(x, y) represents the two-dimensional distribution function of the inclusive kernel image, (x, y) represents the two-dimensional coordinates of any point in the inclusive kernel image, upq represents the geometric center moment of the enclosing kernel image, and They represent the horizontal and vertical coordinates of the centroid of the main tooth profile respectively.
[0106] In one example, the processing module 12 is configured to scale the p+q order origin moment of the two-dimensional distribution function of the inclusive kernel image by a scaling factor to obtain the i order scaled Hu invariant moment, specifically including:
[0107]
[0108] Among them, η pq represents the normalized central moment, γ=(p+q) / 2+1, M1 to M7 are scaled Hu invariant moments of order 1 to 7, respectively. represents the scaling factor, μ 00 Represents the zero-order origin moment m 00 The corresponding 0th-order normalized central moment.
[0109] See Figure 6 , is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 5 As shown, the electronic device 2 may include: at least one processor 21 , at least one network interface 24 , a user interface 23 , a memory 25 , and at least one communication bus 22 .
[0110] The communication bus 22 is used to realize the connection and communication between these components.
[0111] The user interface 23 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 23 may also include a standard wired interface and a wireless interface.
[0112] The network interface 24 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0113] The processor 21 may include one or more processing cores. The processor 21 utilizes various interfaces and lines to connect various parts of the entire server. By running or executing instructions, programs, code sets, or instruction sets stored in the memory 25, and calling data stored in the memory 25, the processor 21 performs various server functions and processes data. Optionally, the processor 21 may be implemented in at least one hardware form selected from digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 21 may integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. The CPU primarily processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display; and the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 21 and may be implemented separately on a single chip.
[0114] Among them, the memory 25 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 25 includes a non-transitory computer-readable storage medium. The memory 25 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 25 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 25 may also be optionally at least one storage device located away from the aforementioned processor 21. As Figure 6 As shown, the memory 25 as a computer storage medium may include an operating system, a network communication module, a user interface module, and an application program for the method for identifying the injection molded gear feature model.
[0115] exist Figure 6In the electronic device 2 shown, the user interface 23 is mainly used to provide an input interface for the user and obtain data input by the user; and the processor 21 can be used to call the application program for the identification method of the injection molded gear feature model stored in the memory 25. When executed by one or more processors, the electronic device executes one or more methods as in the above-mentioned embodiments.
[0116] A computer-readable storage medium stores instructions, which, when executed by one or more processors, cause the computer to execute one or more methods in the above-mentioned embodiments.
[0117] It should be noted that for the aforementioned method embodiments, for simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required for this application.
[0118] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0119] In the several embodiments provided in this application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are merely schematic, such as the division of units, which is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interface, and the indirect coupling or communication connection of devices or units can be electrical or other forms.
[0120] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0121] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0122] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a memory and includes several instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned memory includes various media that can store program codes, such as USB flash drives, mobile hard drives, magnetic disks or optical disks.
[0123] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A MIM gear shaft feature recognition method based on Hu invariant moment, characterized in that: The method comprises: Obtaining a digital model of the gear to be tested, wherein the digital model includes a main tooth profile surface; Based on the characteristic information of the main tooth profile surface, an identification coordinate system is constructed, wherein the characteristic information includes the normal direction of the main tooth profile surface, the midpoint of the tooth profile area, and the center of the circle; intercepting an inclusive core plane set according to the identified coordinate system and the preset cross section, wherein the inclusive core plane set includes a plurality of inclusive core images; Obtaining a scaled Hu invariant moment of the inclusion kernel image based on a scaled Hu invariant moment algorithm; The obtaining of the scaled Hu invariant moment of the inclusion kernel image specifically includes: Acquire a triangular mesh of the main tooth profile, wherein the triangular mesh includes a plurality of triangular node coordinates; Performing region segmentation on the inclusion core image so that the inclusion core image forms M×N image sub-blocks; Based on the identification coordinate system and the image sub-block, obtaining the plane node coordinates of the image sub-block; Acquire a mapping relationship between the triangular mesh and the inclusion kernel image according to the triangular node coordinates and the plane node coordinates, wherein the mapping relationship includes a scaling factor; Based on the scaling factor, sequentially calculating the scaled Hu invariant moments of the inclusion kernel image; The step of sequentially calculating the scaled Hu invariant moments of the inclusion kernel image based on the scaling factor specifically includes: Obtaining the p+q order origin moment of the two-dimensional distribution function of the inclusive kernel image; Scaling the p+q order origin moment of the two-dimensional distribution function of the inclusive kernel image by a scaling factor to obtain an i order scaled Hu invariant moment; The scaled Hu invariant moments of all the inclusion kernel images in the inclusion kernel plane set are compared, and inclusion kernel features are identified.
2. The method according to claim 1, wherein The method for obtaining the main tooth profile includes: Acquiring surface data of the gear to be tested, wherein the surface data includes a gear surface and the number of gear surfaces connected to the gear surface; determining whether the number of connected gear surfaces of the gear surface is equal to the number of preset surface types; If the number of the connected gear surfaces is equal to the preset number of surface profiles, the gear surface is selected as the main tooth profile surface.
3. The method according to claim 1, wherein The constructing of the recognition coordinate system based on the feature information of the main tooth profile specifically includes: The normal direction of the main tooth surface is used as the Z axis, and the line between the central axis of the gear to be measured and the rotation center axis of the gear shaft to be measured is used as the X axis to construct the identification coordinate system, wherein the gear to be measured includes the gear shaft to be measured.
4. The method according to claim 1, wherein The obtaining of the p+q order origin moment of the two-dimensional distribution function of the inclusive kernel image specifically includes: ; ; in, It represents the p+q-order origin moment of the two-dimensional distribution function of the inclusive kernel image, where p and q are both natural numbers and the 0-order origin moment represents the total volume of the main tooth surface in the triangular mesh, represents the two-dimensional distribution function of the inclusive kernel image, represents the two-dimensional coordinates of any point in the inclusion kernel image, represents the geometric center moment of the inclusion kernel image, and Respectively represent the horizontal and vertical coordinates of the centroid of the main tooth profile.
5. The method according to claim 4, wherein Scaling the p+q order origin moment of the two-dimensional distribution function of the inclusive kernel image by a scaling factor to obtain an i order scaled Hu invariant moment specifically includes: ; ; ; ; ; ; ; ; ; in, represents the normalized central moment, Represents the zero-order origin moment The corresponding 0th-order normalized central moment is, , to The scaled Hu invariant moments are from 1 to 7 orders, Represents the scaling factor.
6. A MIM gear shaft feature recognition device based on Hu invariant moment, characterized in that: The feature recognition device (1) comprises a collection module (11), a processing module (12) and an analysis module (13), wherein: The acquisition module (11) is used to obtain a digital model of the gear to be tested, wherein the digital model includes a main tooth profile surface; The processing module (12) is used to construct an identification coordinate system based on feature information of the main tooth profile surface, wherein the feature information includes the normal direction of the main tooth profile surface, the midpoint of the tooth profile area, and the center of the circle; according to the identification coordinate system and a preset cross section, an inclusive core plane set is intercepted; wherein the inclusive core plane set includes a plurality of inclusive core images; based on a scaled Hu invariant moment algorithm, a scaled Hu invariant moment of the inclusive core image is obtained; The obtaining of the scaled Hu invariant moment of the inclusion kernel image specifically includes: Acquire a triangular mesh of the main tooth profile, wherein the triangular mesh includes a plurality of triangular node coordinates; Performing region segmentation on the inclusion core image so that the inclusion core image forms M×N image sub-blocks; Based on the identification coordinate system and the image sub-block, obtaining the plane node coordinates of the image sub-block; Acquire a mapping relationship between the triangular mesh and the inclusion kernel image according to the triangular node coordinates and the plane node coordinates, wherein the mapping relationship includes a scaling factor; Based on the scaling factor, sequentially calculating the scaled Hu invariant moments of the inclusion kernel image; The step of sequentially calculating the scaled Hu invariant moments of the inclusion kernel image based on the scaling factor specifically includes: Obtaining the p+q order origin moment of the two-dimensional distribution function of the inclusive kernel image; Scaling the p+q order origin moment of the two-dimensional distribution function of the inclusive kernel image by a scaling factor to obtain an i order scaled Hu invariant moment; The analysis module (13) is used to compare the scaled Hu invariant moments of all inclusive kernel images in the inclusive kernel plane set and perform inclusive kernel feature recognition.
7. An electronic device, characterized in that: The electronic device (2) comprises a processor (21), a memory (25), a user interface (23) and a network interface (24), wherein the memory (25) is used to store instructions, the user interface (23) and the network interface (24) are used to communicate with other devices, and the processor (21) is used to execute the instructions stored in the memory (25) so that the electronic device (2) executes the method according to any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the MIM gear shaft feature recognition method based on Hu invariant moment according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
A method for extracting global features of a target using single-pixel imaging and Hu invariant moments
CN111652925B