Die casting mold fit detection method and system based on three-dimensional model
Through the die-casting mold fitness detection method based on the three-dimensional model, combined with the intact coefficients of edge continuity, staggeredness and grayscale distribution, the sampling points are adaptively selected, which solves the detection accuracy caused by inappropriate selection of sampling points in the existing technology. Reduces problems and improves detection accuracy and maintenance efficiency.
Patent Information
- Application Number
- CN202410832000.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-26
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2044-06-26
AI Technical Summary
In the existing technology, when testing the fit of die-casting molds, improper selection of sampling points results in low detection accuracy and affects subsequent maintenance.
A method based on three-dimensional models is used to obtain working images and production images of die-casting molds from multiple viewing angles. The integrity coefficient is calculated through edge continuity, edge jaggedness and grayscale distribution, and the sampling points of the BRISK algorithm are adaptively selected for matching detection. .
It improves the matching accuracy of die-casting molds, avoids feature matching errors caused by insufficient sampling points in complex areas, and improves the accuracy and maintenance efficiency of fitness detection.
Smart Images

Figure CN118396994B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of image registration, and in particular to a die-casting mold fit detection method and system based on a three-dimensional model. Background Art
[0002] Die casting molds are molds used in the die casting process. Molten metal or alloy is injected into the mold cavity and the required casting is formed after solidification. During the use of die casting molds, due to factors such as the flow of die casting metal raw materials and the influence of temperature, traces are left on the surface, resulting in deviations in the size and shape of the castings produced using the mold, reducing the fit between the casting and other castings. Therefore, it is very important to test the fit of the die casting mold.
[0003] When the existing technology uses the Binary Robust Invariant Scalable Keypoints (BRISK) algorithm for fitness detection, a fixed number of sampling points are usually selected. If the number of sampling points is not selected appropriately, the image feature information of more complex areas in the image cannot be accurately obtained, which affects the subsequent matching effect, resulting in a low accuracy rate of die-casting mold fitness detection and affecting the subsequent maintenance of the die-casting mold. Summary of the invention
[0004] In order to solve the technical problem that the sampling point selection in the BRISK algorithm is inappropriate, resulting in a low accuracy rate in the die-casting mold fit detection, the purpose of the present invention is to provide a die-casting mold fit detection method and system based on a three-dimensional model. The technical scheme adopted is as follows:
[0005] In a first aspect, an embodiment of the present invention provides a method for detecting the fitness of a die casting mold based on a three-dimensional model, the method comprising:
[0006] Acquire die-casting mold working images of the three-dimensional working model of the die-casting mold at at least two viewing angles, and die-casting mold production images of the three-dimensional production model of the die-casting mold at the same viewing angle; record the die-casting mold working image at each viewing angle as a die-casting mold analysis image;
[0007] The die-casting mold analysis image is divided into a preset number of image blocks, and edge lines in each image block are obtained; according to the position distribution of edge pixels on each edge line in the image block, the edge continuity of each edge line in the image block of the die-casting mold analysis image is obtained; according to the difference between the brightness changes of edge pixels on each edge line in the image block and the curvature of the edge line, the edge jaggedness of each edge line in the image block of the die-casting mold analysis image is obtained;
[0008] Combining the edge continuity and edge jaggedness of the edge line in the image block and the grayscale distribution of the pixel points in the image block, the die-casting mold integrity coefficient of the image block of the die-casting mold analysis image is obtained;
[0009] The BRISK algorithm is used to match the die-casting mold working image and the die-casting mold production image under the same viewing angle to obtain the position of the feature points. The sampling points selected based on the die-casting mold integrity coefficient of the image block where the feature points are located are used to detect the fitness of the die-casting mold.
[0010] Furthermore, the method for obtaining edge continuity includes:
[0011] For each edge line in each image block in the die-casting mold analysis image, the pixel point corresponding to any endpoint of the edge line is used as the analysis pixel point, the analysis pixel point is used as the growth point for regional growth, and the edge pixel point in the preset window of the growth point is used as the new growth point for regional growth, until there is no edge pixel point in the preset window of all new growth points;
[0012] For each region growing process, the growth point in the region growing process is used as the target pixel point. For each edge pixel point in the preset window of the target pixel point, the angle corresponding to the direction from the target pixel point to the edge pixel point in its preset window is used as the expansion angle corresponding to the new growth point in the next region growing process.
[0013] The seed points obtained when the pixel points are analyzed for the first regional growth are used as directional pixel points, and the set consisting of the extension angles of each directional pixel point and the seed points grown thereafter is used as the angle feature set; the number of growths of each directional pixel point for regional growth is used as the number of expansions of each directional pixel point; the maximum number of expansions is used as the feature expansion value; the angle feature set of the directional pixel points corresponding to the feature expansion value is used as the angle feature reference set of the edge line;
[0014] The standard deviation of the elements in the angle feature benchmark set is used as the angle discrete value; the edge continuity of each edge line in the image block in the die-casting mold analysis image is obtained according to the feature extension value and the angle discrete value of the edge line; the feature extension value and the edge continuity are positively correlated; the angle discrete value and the edge continuity are negatively correlated.
[0015] Furthermore, the method for obtaining the edge jaggedness of each edge line in the image block of the die-casting mold analysis image according to the difference between the brightness changes of the edge pixels on each edge line in the image block and the curvature of the edge line includes:
[0016] For each edge line in the image block of the die-casting mold analysis image, the number of corner points obtained by performing corner point detection on the edge line is used as the bending feature value of the edge line; the gradient direction and gradient value of each edge pixel point on the edge line are obtained;
[0017] According to the difference between the gradient directions and the gradient values of the edge pixels on the edge line, and the bending characteristic value, the edge jaggedness of each edge line in the image block of the die-casting mold analysis image is obtained.
[0018] Furthermore, the calculation formula of the edge jitter is as follows:
[0019]
[0020] Where mes is the edge jitter of each edge line in the image block of the die-casting mold analysis image; p is the bending eigenvalue of each edge line in the image block of the die-casting mold analysis image; q is the number of edge pixels on each edge line in the image block of the die-casting mold analysis image; The gradient direction of the j-th edge pixel point on each edge line in the image block of the die-casting mold analysis image; The gradient direction of the j+1th edge pixel point on each edge line in the image block of the die-casting mold analysis image; The gradient value of the j-th edge pixel point on each edge line in the image block of the die-casting mold analysis image; The gradient value of the j+1th edge pixel point on each edge line in the image block of the die-casting mold analysis image; is the absolute value function.
[0021] Furthermore, the method for obtaining the integrity coefficient of the die-casting mold includes:
[0022] Obtaining the mold surface unevenness of each image block of the die-casting mold analysis image according to the grayscale distribution of the pixel points in the image block;
[0023] For each image block of the die-casting mold analysis image, the average of the edge continuity of all edge lines in the image block is used as the edge comprehensive continuity value of the image block; the average of the edge variability of all edge lines in the image block is used as the edge comprehensive variability value of the image block;
[0024] The die-casting mold integrity coefficient of each image block of the die-casting mold analysis image is obtained by combining the edge comprehensive continuity value, the edge comprehensive variability value and the mold surface variability of the image block.
[0025] Furthermore, the calculation formula of the mold surface unevenness is as follows:
[0026]
[0027] Where, mss is the mold surface unevenness of each image block of the die-casting mold analysis image; The maximum gray value of the pixel points in each image block of the die-casting mold analysis image, except for the edge pixel points on the edge line; The minimum gray value of the pixels in each image block of the die-casting mold analysis image except the edge pixels on the edge line; The variance of the grayscale values of the pixels in each image block of the die-casting mold image is analyzed.
[0028] Furthermore, the calculation formula of the die-casting mold integrity coefficient of each image block of the die-casting mold analysis image is as follows:
[0029]
[0030] Wherein, dmi is the die-casting mold integrity coefficient of each image block of the die-casting mold analysis image; An edge integrated continuous value of each image block of the die-casting mold analysis image; Further, the method of using the BRISK algorithm to match the die-casting mold working image and the die-casting mold production image under the same viewing angle to obtain the position of the feature point, and detecting the adaptability of the die-casting mold based on the sampling point selected by the die-casting mold integrity coefficient of the image block where the feature point is located, includes:
[0031] For the die-casting mold working image and the die-casting mold production image under the same viewing angle, the BRISK algorithm is used to match the die-casting mold working image and the die-casting mold production image to obtain the position of the key point in the die-casting mold working image; the image block within a preset radius centered on the key point in the die-casting mold working image is used as a sampling image block;
[0032] Obtaining sampling adaptive values of key points in the die-casting mold working image according to the die-casting mold integrity coefficient of the sampling image block corresponding to the key points;
[0033] Select sampling points of adaptive value in the area of preset radius with the key point as the center in the die-casting mold working image, and use BRISK algorithm to take the matching pixel points of each sampling point in the die-casting mold working image in the die-casting mold production image as matching pixel points; the sampling points correspond to the matching pixel points one by one;
[0034] The matching pixel points in the die-casting mold production image are projected into the die-casting mold working image to obtain the projected pixel points of each sampling point in the die-casting mold working image; the average of the Euclidean distances between the sampling points in the die-casting mold working image and their corresponding projected pixel points is used as the matching degree;
[0035] When the matching degree of the die-casting mold working images under all viewing angles is less than or equal to the matching threshold, the die-casting mold is qualified.
[0036] Furthermore, the calculation formula for the sampling adaptive number of key points in the die-casting mold working image is as follows:
[0037]
[0038] Where sw is the adaptive number of key points sampled in the die-casting mold working image at each viewing angle; A preset initial sampling number of key points in the die-casting mold working image at each viewing angle; It is the mean value of the integrity coefficient of the die-casting mold of all sampled image blocks corresponding to the key points in the die-casting mold working image at each viewing angle; int is the rounding down function.
[0039] In the second aspect, another embodiment of the present invention provides a die-casting mold fit detection system based on a three-dimensional model, the system comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the steps of any one of the above methods are implemented.
[0040] The present invention has the following beneficial effects:
[0041] In an embodiment of the present invention, a die-casting mold working image and a die-casting mold production image of the die-casting mold at multiple viewing angles are obtained to improve the matching accuracy of the die-casting mold, and the die-casting mold working image at each viewing angle is used as a die-casting mold analysis image; according to the position distribution of edge pixel points on the edge line of the image block of the die-casting mold analysis image, the edge continuity that measures the possibility that the edge line is the edge line of the die-casting mold itself is obtained, and the edge jaggedness that presents the possibility of deformation of the edge line is obtained, and the discrete degree of the gray value of the pixel point in the image block presents the concave-convex degree of the image block surface, and the three parameters are comprehensively analyzed to make the die-casting mold integrity coefficient that measures the quality of the die-casting mold more accurate; when the die-casting mold working image and the die-casting mold production image at the same viewing angle are matched using the BRISK algorithm, based on the number of edge feature information contained in the image, that is, whether the die-casting mold is intact, the number of sampling points around the feature point is adaptively selected, thereby avoiding the problem of feature matching errors caused by fewer sampling points in areas with more complex edge information, improving the accuracy of die-casting mold fitness detection, and improving the efficiency of subsequent maintenance of the die-casting mold. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. 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 creative work.
[0043] Figure 1 A flowchart of a method for detecting the fitness of a die casting mold based on a three-dimensional model provided by an embodiment of the present invention;
[0044] Figure 2 is a schematic diagram of a region growing process provided by an embodiment of the present invention;
[0045] Figure 3 It is a schematic diagram of a preset window of pixels provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0046] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the specific implementation method, structure, features and effects of a die-casting mold fit detection method and system based on a three-dimensional model proposed by the present invention in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0047] Unless defined otherwise, 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 belongs.
[0048] The following is a detailed description of a three-dimensional model-based die-casting mold fit detection method and system provided by the present invention in conjunction with the accompanying drawings.
[0049] See also Figure 1 , which shows a flow chart of the steps of a die-casting mold fit detection method based on a three-dimensional model provided by an embodiment of the present invention, the method comprising:
[0050] Step S1: Obtain die-casting mold working images of the three-dimensional working model of the die-casting mold at at least two viewing angles, and die-casting mold production images of the three-dimensional production model of the die-casting mold at the same viewing angle; and record the die-casting mold working image at each viewing angle as a die-casting mold analysis image.
[0051] Specifically, the material of the die-casting mold is usually aluminum alloy. The mold made of aluminum alloy is easily damaged during use, resulting in deviations in the size and shape of the castings produced using the mold, thereby reducing the compatibility between the castings and other castings.
[0052] When producing die-casting molds through CNC machining, it is necessary to first obtain the design requirements of the mold, then create a model for it, and finally produce and process it through CNC machine tools. Therefore, each die-casting mold has its corresponding 3D production model. Obtain the 3D production model of the die-casting mold, and perform orthogonal projection from five perspectives: top, front, back, left side, and right side, to obtain the initial production image of the die-casting mold at each perspective of the 3D production model of the die-casting mold, grayscale it, and obtain the production image of the die-casting mold at each perspective of the 3D production model of the die-casting mold.
[0053] The die-casting mold may be damaged after working, that is, there is a difference between the 3D model of the die-casting mold after working and the 3D production model of the die-casting mold, resulting in a low degree of compatibility between the castings produced by the damaged die-casting mold and other castings. Therefore, it is necessary to compare the difference between the 3D model of the die-casting mold after working and the 3D production model of the die-casting mold. The specific method for obtaining the 3D model of the die-casting mold after working is:
[0054] The three-dimensional model obtained by scanning can provide more comprehensive and detailed geometric shape information, with higher geometric accuracy, can achieve sub-millimeter level accuracy, and can more accurately capture the shape and details of the object. In the embodiment of the present invention, a 3D scanner is used to perform non-contact scanning on the die-casting mold after working to obtain the three-dimensional point cloud data of the die-casting mold after working; the median filter is selected to perform denoising on the three-dimensional point cloud data, and the denoised three-dimensional point cloud data is aligned using the iterative closest point (ICP) algorithm. The aligned data is reconstructed into a point cloud, and the aligned three-dimensional point cloud data is reconstructed using the voxel grid method to generate a surface topological structure; the Poisson reconstruction algorithm is used to obtain a smooth triangular facet mesh for the acquired topological structure to form a complete three-dimensional model, and the three-dimensional model is used as the three-dimensional working model of the die-casting mold.
[0055] Among them, median filtering, ICP algorithm, voxel grid method and Poisson reconstruction algorithm are well-known technologies to those skilled in the art and will not be described in detail here.
[0056] The three-dimensional working model of the die-casting mold after working is also orthogonally projected from the top, front, back, left and right sides to obtain the initial working image of the die-casting mold at each viewing angle of the three-dimensional working model of the die-casting mold, which is grayed to obtain the die-casting mold working image of the three-dimensional production model of the die-casting mold at each viewing angle. The die-casting mold working images at the five viewing angles are recorded as die-casting mold analysis images for subsequent analysis.
[0057] In the embodiment of the present invention, a weighted average grayscale algorithm is selected for grayscale processing, which is a technical means well known to those skilled in the art, that is, the die-casting mold working image and the die-casting mold production image at each viewing angle are both grayscale images.
[0058] Step S2: Divide the die-casting mold analysis image into a preset number of image blocks, and obtain edge lines in each image block; obtain edge continuity of each edge line in the image block of the die-casting mold analysis image according to the position distribution of edge pixel points on each edge line in the image block; obtain edge jaggedness of each edge line in the image block of the die-casting mold analysis image according to the difference between the brightness changes of the edge pixel points on each edge line in the image block and the curvature of the edge line.
[0059] In order to accurately analyze the information in the die-casting mold analysis image, the die-casting mold analysis image is divided into a preset number of image blocks using superpixel segmentation. The Canny edge detection operator is used to perform edge detection on each image block to obtain the edge line within each image block. Among them, superpixel segmentation and Canny edge detection operator are well-known technologies for those skilled in the art and will not be described in detail here. In the embodiment of the present invention, the preset value is an empirical value of 20, and the implementer can set it according to the specific situation.
[0060] During the use of die-casting molds, irregular linear traces are left on the die-casting molds due to factors such as the flow of die-casting metal raw materials and the influence of temperature. The edge continuity of the edge line is obtained based on the position distribution of pixel points on the edge line. The specific method is:
[0061] For each edge line in each image block in the die-casting mold analysis image, the pixel point corresponding to any endpoint of the edge line is used as the analysis pixel point, the analysis pixel point is used as the growth point for regional growth, and the edge pixel point in the preset window of the growth point is used as the new growth point for regional growth until there is no edge pixel point in the preset window of all new growth points; for each regional growth process, the growth point in the regional growth process is used as the target pixel point, and for each edge pixel point in the preset window of the target pixel point, the angle corresponding to the direction of the target pixel point pointing to the edge pixel point in its preset window is used as the expansion angle corresponding to the new growth point in the next regional growth process; the seed point obtained when the analysis pixel point is subjected to the first regional growth is used as the direction pixel point, and the set consisting of the expansion angles of each direction pixel point and the seed point grown thereafter is used as the angle feature set; the number of growth times of each direction pixel point for regional growth is used as the expansion number of each direction pixel point; the maximum number of expansion times is used as the feature expansion value; the angle feature set of the direction pixel point corresponding to the feature expansion value is used as the angle feature benchmark set of the edge line.
[0062] It should be noted that each edge line has two endpoints, and the region growth from the pixel point corresponding to any one of the endpoints of the edge line can obtain the exact trace on the surface of the die-casting mold. , the implementer can set it according to the specific situation. The preset window of the pixel point is established with the pixel point as the center, that is, the pixel point is located at the center of its preset window. The pixels on the edge line are all edge pixels. Among them, the region growing is a well-known technology for those skilled in the art and will not be described here.
[0063] As an example, the process of region growing is analyzed by taking the first region growing as an example. Figure 2 is a schematic diagram of a region growing process provided by an embodiment of the present invention, such as Figure 2 As shown, the pixel point Ir is the edge pixel point corresponding to any endpoint of the edge line. The pixel point Ir is used as the growth point for regional growth. The pixel points Ir11 and Ir12 are the pixel points Ir with a size of The edge pixels in the preset window are selected, and the pixel points Ir11 and Ir12 are used as new seed points for region growing. The above process is the first region growing.
[0064] The angle corresponding to the direction from pixel point Ir to pixel point Ir11 is taken as the extended angle of pixel point Ir11, and the angle corresponding to the direction from pixel point Ir to pixel point Ir12 is taken as the extended angle of pixel point Ir12. The specific method for obtaining the extended angle is as follows: Figure 3 is a schematic diagram of a preset window of pixels provided by an embodiment of the present invention, such as Figure 3As shown, pixel points I1, I2, I3, I4, I5, I6, I7, and I8 are pixel points within the preset window of pixel point Ii, and the expansion angles of pixel points I1, I2, I3, I4, I5, I6, I7, and I8 are respectively , , , , , and .
[0065] The expansion angle of the pixel Ir11 of the first region growth is , the expansion angle of pixel Ir12 is The subsequent process takes pixel Ir11 as an example to perform the second region growing. The pixel Ir21 is the size of pixel Ir11. The edge pixel points in the preset window are taken as the pixel point Ir21 as the new seed point, and the expansion angle of the pixel point Ir21 is The size of pixel Ir31 is the size of pixel Ir21. The edge pixel points in the preset window are taken as the pixel point Ir31 as the new seed point, and the expansion angle of the pixel point Ir31 is Until there are no edge pixels in the preset window of the new growth point.
[0066] Assuming that there is no edge pixel in the preset window of pixel Ir31, the set consisting of the extended angles of pixel Ir11, pixel Ir21 and pixel Ir31 , as the angle feature set. Pixel point Ir11 is subsequently grown twice, and the number of expansions of pixel point Ir11 is 2. The same growth operation is performed on pixel point Ir12, and the expansion angle of each new growth point in the growth process of pixel point Ir12 is obtained, and then the angle feature set and the number of expansions are obtained. The maximum value of the number of expansions is used as the feature expansion value, and the angle feature set corresponding to the feature expansion value is used as the angle feature benchmark set.
[0067] The standard deviation of the elements in the angle feature benchmark set is taken as the angle discrete value; the edge continuity of each edge line in the image block in the die-casting mold analysis image is obtained according to the feature extension value and the angle discrete value of the edge line; the feature extension value and the edge continuity are positively correlated; the angle discrete value and the edge continuity are negatively correlated.
[0068] The calculation formula for the edge continuity of each edge line in the image block of the die-casting mold analysis image is as follows:
[0069]
[0070] In the formula, Analyzing edge continuity of each edge line within an image block of the image for the die casting mold; The feature extension value of each edge line in the image block of the die-casting mold analysis image; The angle discrete value of each edge line in the image block of the die casting mold analysis image; It is a preset positive number with an empirical value of 0.1, which is used to prevent the fraction from being meaningless.
[0071] During the processing of die-casting molds, various processing marks will be formed on their surfaces. When edge detection is performed on the surface of die-casting molds, the detected edge lines may be surface marks caused by processing or the edges of the die-casting molds themselves. The edge lines of the die-casting molds themselves are smooth and continuous, the number of edge line growth is large, and the expansion angle is relatively consistent. That is, the larger the feature expansion value T, the smaller the angle discrete value. The smaller the edge is, the more likely it is that the edge is the edge of the die-casting mold itself. The edge is smooth and continuous, and the edge continuity is The larger the value, the smaller the feature expansion value T. The larger the angle discrete value. The larger the value, the more likely it is that the edge line is a mark produced during the die casting mold production process. The smaller.
[0072] During the processing of the die-casting mold, its edge will be deformed, warping and burrs will occur, and the edge jaggedness of the edge line will be obtained.
[0073] Preferably, the specific method for obtaining the edge jaggedness of the edge line is: for each edge line in the image block of the die-casting mold analysis image, the number of corner points obtained by corner point detection of the edge line is used as the bending feature value of the edge line; the gradient direction and gradient value of each edge pixel point on the edge line are obtained; according to the difference between the gradient directions and the difference between the gradient values of the edge pixels on the edge line, as well as the bending feature value, the edge jaggedness of each edge line in the image block of the die-casting mold analysis image is obtained.
[0074] If the edge line is an edge line of the die-casting mold that has not been deformed, the gradient direction of the pixel points on the edge line shows a regular change, the gradient size is relatively close, and the number of corner points on the edge line is small; if the edge line is an edge line of the die-casting mold that has been deformed, the edge line is relatively uneven, the gradient direction of the pixel points on the edge line is relatively different, the gradient size changes greatly, and the number of corner points on the edge line is large.
[0075] Each edge line in the image block of the die-casting mold analysis image is analyzed, and the Sobel operator is used to obtain the gradient direction and gradient value of each pixel point on the edge line; the Harris corner point extraction algorithm is used to obtain the corner points on the edge line, and the number of corner points on the edge line is used as the bending feature value of the edge line. Among them, the Sobel operator and the Harris corner point extraction algorithm are both well-known technologies for those skilled in the art, and will not be repeated here.
[0076] Combining the difference between the gradient directions of the pixels on the edge line, the difference between the gradient values and the bending eigenvalue, the edge jaggedness of each edge line in the image block of the die-casting mold analysis image is obtained. The calculation formula of the edge jaggedness is as follows:
[0077]
[0078] Where mes is the edge jitter of each edge line in the image block of the die-casting mold analysis image; p is the bending eigenvalue of each edge line in the image block of the die-casting mold analysis image; q is the number of edge pixels on each edge line in the image block of the die-casting mold analysis image; The gradient direction of the j-th edge pixel point on each edge line in the image block of the die-casting mold analysis image; The gradient direction of the j+1th edge pixel point on each edge line in the image block of the die-casting mold analysis image; The gradient value of the j-th edge pixel point on each edge line in the image block of the die-casting mold analysis image; The gradient value of the j+1th edge pixel point on each edge line in the image block of the die-casting mold analysis image; is the absolute value function.
[0079] It should be noted that when the bending eigenvalue p is larger, the edge line is warped and deformed to a greater extent, and the edge unevenness mes is larger; The larger the value, the more irregular the distribution of the gradient direction of the pixels on the edge line. The larger it is, the greater the change in the gradient value of the pixel point on the edge line is, the greater the possibility of deformation and warping of the edge of the mold is, and the greater the edge variance mes is.
[0080] Step S3: Acquire the die-casting mold integrity coefficient of the image block of the die-casting mold analysis image by combining the edge continuity and edge jaggedness of the edge lines in the image block and the grayscale distribution of the pixels in the image block.
[0081] Edge continuity measures the possibility that the edge line is the edge line of the die-casting mold itself, and edge jaggedness shows the possibility of deformation of the edge line; the discrete degree of the grayscale value of the pixel points in the image block shows the degree of concavity and convexity of the image block surface. Comprehensive analysis of the three parameters can obtain the die-casting mold integrity coefficient that measures the quality of the die-casting mold.
[0082] The mold surface unevenness of each image block of the die-casting mold analysis image is obtained according to the grayscale distribution of the pixel points in the image block; for each image block of the die-casting mold analysis image, the mean of the edge continuity of all edge lines in the image block is used as the edge comprehensive continuity value of the image block; the mean of the edge unevenness of all edge lines in the image block is used as the edge comprehensive unevenness value of the image block; the die-casting mold integrity coefficient of each image block of the die-casting mold analysis image is obtained by combining the edge comprehensive continuity value, the edge comprehensive unevenness value and the mold surface unevenness of the image block.
[0083] During the processing of die-casting molds, not only will the edges of the die-casting molds deform, warp and burr, but the die-casting metal raw materials will produce friction on the surface of the die-casting mold, resulting in uneven surfaces. According to the grayscale distribution of the pixels in the image block, the mold surface unevenness, which measures the degree of unevenness of the mold surface, is obtained.
[0084] The calculation formula of the mold surface unevenness of each image block of the die-casting mold analysis image is as follows:
[0085]
[0086] Where, mss is the mold surface unevenness of each image block of the die-casting mold analysis image; The maximum gray value of the pixel points in each image block of the die-casting mold analysis image, except for the edge pixel points on the edge line; The minimum gray value of the pixels in each image block of the die-casting mold analysis image except the edge pixels on the edge line; The variance of the grayscale values of the pixels in each image block of the die-casting mold image is analyzed.
[0087] When the surface of the die-casting mold is relatively smooth, the grayscale values of the pixels in the image block are relatively uniform, and there will be no extreme large grayscale values or small grayscale values. Close to 0, while the variance of the grayscale value of the pixel in each image block of the die casting mold analysis image If the surface of the die-casting mold is uneven, the grayscale value of the pixel in the image block varies greatly, and there may be extreme large grayscale values and small grayscale values. Close to 1, while the variance of the grayscale value of the pixel in each image block of the die casting mold analysis image The larger the value is, the larger the mold surface unevenness mss of the image block is.
[0088] The mean of the edge continuity of all edge lines in the image block is taken as the edge comprehensive continuity value of the image block; the mean of the edge variability of all edge lines in the image block is taken as the edge comprehensive variability value of the image block. The calculation formula of the die-casting mold integrity coefficient of each image block of the die-casting mold analysis image is as follows:
[0089]
[0090] Wherein, dmi is the die-casting mold integrity coefficient of each image block of the die-casting mold analysis image; An edge integrated continuous value of each image block of the die-casting mold analysis image; An edge comprehensive variance value of each image block of the die-casting mold analysis image; Analyzing the mold surface unevenness of each image block of the die-casting mold image; It is a preset positive number with an empirical value of 1, which is used to prevent the fraction from being meaningless.
[0091] It should be noted that when the edge integrated continuous value When the value is larger, the possibility that the edge line in the image block is the edge line of the die-casting mold itself is greater, and the possibility that it is an edge line caused by processing and the direction of the trace is uncertain is smaller, indicating that the die-casting mold has fewer traces after processing, and the possibility that the die-casting mold is damaged is smaller, and the die-casting mold integrity coefficient dmi is larger; when the edge comprehensive variance value is The smaller the value, the lower the possibility of deformation of the edge of the die-casting mold, the smaller the possibility of damage to the die-casting mold, and the larger the die-casting mold integrity coefficient dmi; when the mold surface is uneven The smaller it is, the smoother the surface of the die-casting mold is, the less likely the die-casting mold is to be damaged, and the larger the die-casting mold integrity coefficient DMI is.
[0092] Step S4: Use the BRISK algorithm to match the die-casting mold working image and the die-casting mold production image under the same viewing angle to obtain the position of the feature point, and detect the fitness of the die-casting mold based on the sampling points selected based on the die-casting mold integrity coefficient of the image block where the feature point is located.
[0093] Specifically, the present invention uses the BRISK algorithm to match the die-casting mold working image and the die-casting mold production image under the same viewing angle to achieve the adaptability detection of the die-casting mold. Among them, the BRISK algorithm is a well-known technology for those skilled in the art and will not be described in detail here.
[0094] When sampling, the BRISK algorithm usually selects a fixed number of sampling points. In more complex areas of the image, if there are fewer sampling points, the image features of the corresponding area cannot be obtained, which affects the subsequent matching effect; if there are more sampling points, the amount of calculation will increase and the efficiency of calculation will be reduced. Therefore, when matching the die-casting mold working image and the die-casting mold production image under the same viewing angle of the die-casting mold, the number of sampling points is adaptively selected. In the area with more information in the die-casting mold working image, more sampling points are obtained to increase the matching accuracy; in the area with less information in the die-casting mold working image, fewer sampling points are obtained to reduce the amount of calculation of the algorithm.
[0095] For the die-casting mold working image and the die-casting mold production image under the same viewing angle, the BRISK algorithm is used to match the die-casting mold working image and the die-casting mold production image to obtain the position of the key points in the die-casting mold working image; the image block within a preset radius centered on the key point in the die-casting mold working image is used as the sampling image block; the sampling adaptive value of the key point in the die-casting mold working image is obtained according to the die-casting mold integrity coefficient of the sampling image block corresponding to the key point; and the sampling adaptive value sampling points are selected in the area of the preset radius centered on the key point in the die-casting mold working image.
[0096] It should be noted that the area formed by the preset radius with the key as the center uses the image blocks that overlap with the area as the sampling image blocks of the feature points. In the embodiment of the present invention, the preset radius takes an empirical value of 10, and the implementer can set it according to the specific situation.
[0097] The calculation formula for the adaptive number of key points in the die-casting mold working image at each viewing angle is as follows:
[0098]
[0099] Where sw is the adaptive number of key points sampled in the die-casting mold working image at each viewing angle; The preset initial sampling number of key points in the die-casting mold working image under each viewing angle is taken as an empirical value of 10; It is the mean value of the integrity coefficient of the die-casting mold of all sampled image blocks corresponding to the key points in the die-casting mold working image at each viewing angle; int is the rounding down function.
[0100] when The larger the value, the better the surface image of the die casting mold, and the less feature information it contains. To reduce the amount of calculation of the algorithm, fewer sampling points are needed, and the smaller the adaptive number of key point sampling sw is. The smaller the value, the more damaged information there is on the surface image of the die-casting mold after processing. In order to improve the accuracy of feature matching, more sampling points are needed, and the larger the adaptive number of key point sampling sw is.
[0101] For the die-casting mold working image under each viewing angle, sampling adaptive value sampling points are selected in the area of preset radius centered on the key point in the die-casting mold working image; the pixel points matched by each sampling point of the die-casting mold working image in the die-casting mold production image are used as matching pixel points by using the BRISK algorithm. The matching pixel points in the die-casting mold production image are mapped to the die-casting mold working image by rotation and translation, and the projected pixel points corresponding to each sampling point in the die-casting mold working image are obtained. The sampling points, matching pixel points and projected pixel points are all in one-to-one correspondence.
[0102] The mean of the Euclidean distances between the sampling points in the die-casting mold working image and their corresponding projected pixel points is taken as the matching degree. When the matching degrees of the die-casting mold working images under all viewing angles are less than or equal to the matching threshold, the die-casting mold is qualified.
[0103] So far, the present invention is completed.
[0104] In summary, in an embodiment of the present invention, a die-casting mold working image and a die-casting mold production image of the die-casting mold under multiple viewing angles are obtained, and the die-casting mold working image is recorded as a die-casting mold analysis image; the edge continuity and edge jaggedness of the edge line in the data block of the die-casting mold analysis image are obtained, and the die-casting mold integrity coefficient of the image block of the die-casting mold analysis image is obtained in combination with the grayscale distribution of the pixel points in the image block; the die-casting mold working image and the die-casting mold production image under the same viewing angle are matched using the BRISK algorithm to obtain the position of the feature point, and the sampling point selected based on the die-casting mold integrity coefficient of the image block where the feature point is located detects the fitness of the die-casting mold. The present invention adaptively selects the number of sampling points to improve the accuracy of the die-casting mold fitness detection.
[0105] Based on the same inventive concept as the above method embodiment, the embodiment of the present invention further provides a die-casting mold fit detection system based on a three-dimensional model, the system comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps in the above die-casting mold fit detection method embodiment based on a three-dimensional model are implemented, for example Figure 1 The steps shown in the figure. The die-casting mold fit detection method based on the three-dimensional model has been described in detail in the above embodiment and will not be repeated here.
[0106] It should be noted that the sequence of the above embodiments of the present invention is for description only and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0107] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
[0108] 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 principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A die casting mold fit detection method based on a three-dimensional model, characterized in that: The method includes: Obtain die-casting mold working images of the three-dimensional working model of the die-casting mold at least two viewing angles, and die-casting mold production images of the three-dimensional production model of the die-casting mold at the same viewing angle; and record the die-casting mold working image at each viewing angle as a die-casting mold analysis image; The die-casting mold analysis image is divided into a preset number of image blocks, and edge lines in each image block are obtained; according to the position distribution of edge pixels on each edge line in the image block, the edge continuity of each edge line in the image block of the die-casting mold analysis image is obtained; according to the difference between the brightness changes of edge pixels on each edge line in the image block and the curvature of the edge line, the edge jaggedness of each edge line in the image block of the die-casting mold analysis image is obtained; Combining the edge continuity and edge jaggedness of the edge line in the image block and the grayscale distribution of the pixel points in the image block, the die-casting mold integrity coefficient of the image block of the die-casting mold analysis image is obtained; The BRISK algorithm is used to match the die-casting mold working image and the die-casting mold production image under the same viewing angle to obtain the position of the feature points. The sampling points selected based on the die-casting mold integrity coefficient of the image block where the feature points are located are used to detect the fitness of the die-casting mold. The method of using the BRISK algorithm to match the die-casting mold working image and the die-casting mold production image under the same viewing angle to obtain the position of the feature point, and detecting the adaptability of the die-casting mold based on the sampling point selected based on the die-casting mold integrity coefficient of the image block where the feature point is located, includes: For the die-casting mold working image and the die-casting mold production image under the same viewing angle, the BRISK algorithm is used to match the die-casting mold working image and the die-casting mold production image to obtain the position of the key point in the die-casting mold working image; the image block within a preset radius centered on the key point in the die-casting mold working image is used as a sampling image block; Obtaining sampling adaptive values of key points in the die-casting mold working image according to the die-casting mold integrity coefficient of the sampling image block corresponding to the key points; Select sampling points of adaptive value in the area of preset radius with the key point as the center in the die-casting mold working image, and use BRISK algorithm to take the matching pixel points of each sampling point in the die-casting mold working image in the die-casting mold production image as matching pixel points; the sampling points correspond to the matching pixel points one by one; The matching pixel points in the die-casting mold production image are projected into the die-casting mold working image to obtain the projected pixel points of each sampling point in the die-casting mold working image; the average of the Euclidean distances between the sampling points in the die-casting mold working image and their corresponding projected pixel points is used as the matching degree; When the matching degree of the die-casting mold working images under all viewing angles is less than or equal to the matching threshold, the die-casting mold is qualified.
2. A die-casting mold fit detection method based on a three-dimensional model according to claim 1, characterized in that: The method for obtaining edge continuity comprises: For each edge line in each image block in the die-casting mold analysis image, the pixel point corresponding to any endpoint of the edge line is used as the analysis pixel point, the analysis pixel point is used as the growth point for regional growth, and the edge pixel point in the preset window of the growth point is used as the new growth point for regional growth, until there is no edge pixel point in the preset window of all new growth points; For each region growing process, the growth point in the region growing process is used as the target pixel point. For each edge pixel point in the preset window of the target pixel point, the angle corresponding to the direction from the target pixel point to the edge pixel point in its preset window is used as the expansion angle corresponding to the new growth point in the next region growing process. The seed points obtained when the pixel points are analyzed for the first regional growth are used as directional pixel points, and the set consisting of the extension angles of each directional pixel point and the seed points grown thereafter is used as the angle feature set; the number of growths of each directional pixel point for regional growth is used as the number of expansions of each directional pixel point; the maximum number of expansions is used as the feature expansion value; the angle feature set of the directional pixel points corresponding to the feature expansion value is used as the angle feature reference set of the edge line; The standard deviation of the elements in the angle feature benchmark set is used as the angle discrete value; the edge continuity of each edge line in the image block in the die-casting mold analysis image is obtained according to the feature extension value and the angle discrete value of the edge line; the feature extension value and the edge continuity are positively correlated; the angle discrete value and the edge continuity are negatively correlated.
3. The die-casting mold fit detection method based on a three-dimensional model according to claim 1, characterized in that: The method for obtaining the edge jaggedness of each edge line in the image block of the die-casting mold analysis image according to the difference between the brightness changes of the edge pixels on each edge line in the image block and the curvature of the edge line comprises: For each edge line in the image block of the die-casting mold analysis image, the number of corner points obtained by performing corner point detection on the edge line is used as the bending feature value of the edge line; the gradient direction and gradient value of each edge pixel point on the edge line are obtained; According to the difference between the gradient directions and the gradient values of the edge pixels on the edge line, and the bending characteristic value, the edge jaggedness of each edge line in the image block of the die-casting mold analysis image is obtained.
4. The method for detecting the fitness of a die casting mold based on a three-dimensional model according to claim 3, characterized in that: The calculation formula of the edge variance is as follows: Where mes is the edge jitter of each edge line in the image block of the die-casting mold analysis image; p is the bending eigenvalue of each edge line in the image block of the die-casting mold analysis image; q is the number of edge pixels on each edge line in the image block of the die-casting mold analysis image; The gradient direction of the j-th edge pixel point on each edge line in the image block of the die-casting mold analysis image; The gradient direction of the j+1th edge pixel point on each edge line in the image block of the die-casting mold analysis image; The gradient value of the j-th edge pixel point on each edge line in the image block of the die-casting mold analysis image; The gradient value of the j+1th edge pixel point on each edge line in the image block of the die-casting mold analysis image; is the absolute value function.
5. The method for detecting the fitness of a die casting mold based on a three-dimensional model according to claim 1, characterized in that: The method for obtaining the integrity coefficient of the die-casting mold includes: Obtaining the mold surface unevenness of each image block of the die-casting mold analysis image according to the grayscale distribution of the pixel points in the image block; For each image block of the die-casting mold analysis image, the average of the edge continuity of all edge lines in the image block is used as the edge comprehensive continuity value of the image block; the average of the edge variability of all edge lines in the image block is used as the edge comprehensive variability value of the image block; The die-casting mold integrity coefficient of each image block of the die-casting mold analysis image is obtained by combining the edge comprehensive continuity value, the edge comprehensive variability value and the mold surface variability of the image block.
6. A die-casting mold fit detection method based on a three-dimensional model according to claim 5, characterized in that: The calculation formula of the mold surface unevenness is as follows: Where, mss is the mold surface unevenness of each image block of the die-casting mold analysis image; The maximum gray value of the pixel points in each image block of the die-casting mold analysis image, except for the edge pixel points on the edge line; The minimum gray value of the pixels in each image block of the die-casting mold analysis image except the edge pixels on the edge line; The variance of the grayscale values of the pixels in each image block of the die-casting mold image is analyzed.
7. The method for detecting the fitness of a die casting mold based on a three-dimensional model according to claim 5, characterized in that: The calculation formula of the die-casting mold integrity coefficient of each image block of the die-casting mold analysis image is as follows: Wherein, dmi is the die-casting mold integrity coefficient of each image block of the die-casting mold analysis image; An edge integrated continuous value of each image block of the die-casting mold analysis image; An edge comprehensive variance value of each image block of the die-casting mold analysis image; Analyzing the mold surface unevenness of each image block of the die-casting mold image; The default value is a positive number.
8. The method for detecting the fitness of a die casting mold based on a three-dimensional model according to claim 1, characterized in that: The calculation formula for the sampling adaptive number of key points in the die-casting mold working image is as follows: Where sw is the adaptive number of key points sampled in the die-casting mold working image at each viewing angle; A preset initial sampling number of key points in the die-casting mold working image at each viewing angle; is the mean value of the die-casting mold integrity coefficient of all sampled image blocks corresponding to the key points in the die-casting mold working image at each viewing angle; int is the floor function.
9. A die casting mold fit detection system based on a three-dimensional model, characterized in that: The system includes: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of a die-casting mold fit detection method based on a three-dimensional model as described in any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Mold monitoring method based on FAST-9 image characteristic rapid registration algorithm
CN102837406A
Binary descriptor construction method based on simple sampling method and three-valued strategy
CN106408022A
Feature matching method based on quadtree in combination with ORB and SIFT
CN110334762A
Image processing device and method for producing in real-time a digital composite image from a sequence of digital images
US20190279338A1
