Intelligent detection and identification method for metal mold parts
By employing an intelligent detection and discrimination method for metal mold parts, and utilizing arbitrary circumscribed quadrilateral correction and N-section cutting and matching image algorithms, the problems of low efficiency in manual quality inspection and weight differences in glass bottles have been solved, achieving rapid, accurate detection and consistency.
Patent Information
- Application Number
- CN202010353384.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-04-29
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2040-04-29
AI Technical Summary
In the existing technology, the inspection of metal mold parts relies on manual quality inspection, which is inefficient, has large errors, and different mold design schemes lead to differences in the weight of glass bottles.
A smart detection and discrimination method for metal mold parts is adopted, which combines an image correction algorithm based on arbitrary circumscribed quadrilaterals and an N-segmentation method for cutting and matching images to achieve fast and accurate detection.
It improves the efficiency of mold drawing design and inspection, reduces manual intervention, and ensures the consistency of glass bottle weight.
Smart Images

Figure QLYQS_1 
Figure QLYQS_2 
Figure RE-GDA0002640724110000021
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of metal mold quality detection, and in particular to an intelligent detection and discrimination method for metal mold parts. Background Art
[0002] A mold is a tool used to make molded objects. This tool is composed of various parts, and different molds are composed of different parts. It mainly realizes the processing of the shape of the object by changing the physical state of the molded material. It is known as the "mother of industry". Glass molds are an important part of the production process of daily glass products and one of the key factors in the molding of glass products. The quality inspection of glass mold parts is a key process in mold production. The key technical issues of mold part quality inspection are drawing design and inspection. At present, the quality inspection of mold parts is mainly carried out manually, but the efficiency of manual quality inspection is low and the error is large; different mold design schemes will lead to the problem of different weights of glass bottles. How to realize intelligent detection and discrimination of mold parts has become a key research topic in the industry. Summary of the invention
[0003] The present invention provides an intelligent detection and identification method for metal mold parts to solve the problems in the prior art of low manual quality inspection efficiency and large errors, and different mold design schemes leading to differences in glass bottle weights.
[0004] The technical solution adopted by the present invention to solve its technical problem is:
[0005] An intelligent detection and discrimination method for metal mold parts includes a comprehensive algorithm for judging the quality of metal mold parts; an algorithm for correcting images based on arbitrary external quadrilaterals and an algorithm for cutting and matching images based on the N-division method. The specific method steps are as follows:
[0006] a Take a photo and read the picture;
[0007] b After graying, binarization, boundary extraction, and obtaining the minimum bounding rectangle, a perspective transformation operation is performed;
[0008] c After the image periphery is expanded, grayed, binarized, and the poles are obtained, preparation is made to obtain an arbitrary circumscribed quadrilateral;
[0009] d Draw the mold boundary at the location of the pole through the pole to obtain the vertices of the circumscribed arbitrary quadrilateral. The specific steps are: (1) obtain the upper boundary point: (t0, t1), (2) determine whether the point is on the left or right side of the image: t0 < 0.5xmax?, (3) obtain the point on the right side of the image: (xmax, n), (4) obtain the straight line equation based on the two-point straight line equation:
[0010]
[0011] (5) Substitute the horizontal coordinate of the point on the right side of the image into the line equation to get the coordinate of the point: (x, y), (6) Get the gray value of the image at point (x, y): g(x, y), (7) Determine whether the point belongs to the background or the part: g(x, y) = 255?, (8) Until the point belonging to the part is found, the iteration ends: g(x, y) = 255, if g(x, y) = 0: Jump back to step (3), (9) Get the line equation of the contour:
[0012]
[0013] (10) Obtain the four sides and vertices of any circumscribed quadrilateral:
[0014] (xlt,ylt),(xrt,yrt),(xlb,ylb),(xrb,yrb)
[0015] (11) perspective correcting the image based on the four vertices obtained above;
[0016] e After perspective correction, the front image of the mold is obtained;
[0017] f uses N (N=2, 3, ...) division method to cut the image, and sequentially matches the sub-images of the two images until the position where the two images have the largest difference is found.
[0018] The algorithm process of matching the image to be detected with the standard image in the above step f is to set the number of cuts and the N value, cut the sub-image into N parts horizontally and vertically evenly, match the sub-images, determine the mismatching positions, mark the mismatching positions, and the coordinates of the upper left point of the marked rectangle are as follows:
[0019] X lt =x lt (I,C min , W)
[0020] y lt =y lt (J, C min , H)
[0021] Among them, x lt With y lt Respectively represent the horizontal and vertical coordinates of the upper left point of the marked rectangle; I and J represent the horizontal and vertical index vectors respectively; H and W represent the vectors containing the height and width data of the rectangle corresponding to each cut sub-image respectively; C min Represents a vector containing the sub-image position data with the smallest cosine value each time the sub-image is matched. The coordinates of the other three points of the marked rectangle are as follows:
[0022] x lb =x lb (xlt ), y lb =y rb [y lt , H(K)]
[0023] x rt =x rt [x lt , W(K)],y rt =y rt (y lt )
[0024] x rb =x rb [x lt , W(K)],y rb =y rb [y lt , H(K)]
[0025] Where K is the number of image cuts.
[0026] The present invention integrates the image correction algorithm based on arbitrary external quadrilateral and the image cutting and matching algorithm based on N-division method as sub-algorithms into the comprehensive algorithm for judging the quality of metal mold parts, thereby realizing the rapid detection of defects in metal mold parts, effectively improving the efficiency of mold drawing design and detection, and having the advantages of fast, accurate and labor-saving. DETAILED DESCRIPTION
[0027] An intelligent detection and discrimination method for metal mold parts includes a comprehensive algorithm for judging the quality of metal mold parts; an algorithm for correcting images based on arbitrary external quadrilaterals and an algorithm for cutting and matching images based on the N-division method. The specific method steps are as follows:
[0028] a Take a photo and read the picture;
[0029] b After graying, binarization, boundary extraction, and obtaining the minimum bounding rectangle, a perspective transformation operation is performed;
[0030] c After the image periphery is expanded, grayed, binarized, and the poles are obtained, preparation is made to obtain an arbitrary circumscribed quadrilateral;
[0031] d Draw the mold boundary at the location of the pole through the pole to obtain the vertices of the circumscribed arbitrary quadrilateral. The specific steps are: (1) obtain the upper boundary point: (t0, t1), (2) determine whether the point is on the left or right side of the image: t0 < 0.5xmax?, (3) obtain the point on the right side of the image: (xmax, n), (4) obtain the straight line equation based on the two-point straight line equation:
[0032]
[0033] (5) Substitute the horizontal coordinate of the point on the right side of the image into the line equation to get the coordinate of the point: (x, y), (6) Get the gray value of the image at point (x, y): g(x, y), (7) Determine whether the point belongs to the background or the part: g(x, y) = 255?, (8) Until the point belonging to the part is found, the iteration ends: g(x, y) = 255, if g(x, y) = 0: Jump back to step (3), (9) Get the line equation of the contour:
[0034]
[0035] (10) Obtain the four sides and vertices of any circumscribed quadrilateral:
[0036] (xlt,ylt),(xrt,yrt),(xlb,ylb),(xrb,yrb)
[0037] (11) perspective correcting the image based on the four vertices obtained above;
[0038] e After perspective correction, the front image of the mold is obtained;
[0039] f uses N (N=2, 3, ...) division method to cut the image, and sequentially matches the sub-images of the two images until the position where the two images have the largest difference is found.
[0040] The algorithm process of matching the image to be detected with the standard image in the above step f is to set the number of cuts and the N value, cut the sub-image into N parts horizontally and vertically evenly, match the sub-images, determine the mismatching positions, mark the mismatching positions, and the coordinates of the upper left point of the marked rectangle are as follows:
[0041] X lt =x lt (I,C min , W)
[0042] y lt =y lt (J, C min , H)
[0043] Among them, x lt With y lt Respectively represent the horizontal and vertical coordinates of the upper left point of the marked rectangle; I and J represent the horizontal and vertical index vectors respectively; H and W represent the vectors containing the height and width data of the rectangle corresponding to each cut sub-image respectively; C min Represents a vector containing the sub-image position data with the smallest cosine value each time the sub-image is matched. The coordinates of the other three points of the marked rectangle are as follows:
[0044] x lb =x lb (xlt ), y lb =y rb [y lt , H(K)]
[0045] x rt =x rt [x lt , W(K)],y rt =y rt (y lt )
[0046] x rb =x rb [x lt , W(K)],y rb =y rb [y lt , H(K)]
[0047] Where K is the number of image cuts.
Claims
1. A method for intelligent detection and identification of metal mold parts, characterized in that It includes a comprehensive algorithm for judging the quality of metal mold parts; an algorithm for correcting images based on arbitrary external quadrilaterals and an algorithm for cutting and matching images based on the N-division method. The specific steps are as follows: a Take a photo and read the picture; b is processed by grayscale, binarization, boundary extraction, and obtaining the minimum bounding rectangle, and then a perspective transformation operation is performed; c After the image periphery is expanded, grayed, binarized, and the poles are obtained, preparation is made to obtain an arbitrary circumscribed quadrilateral; d Draw the mold boundary at the location of the pole through the pole to obtain the vertices of the circumscribed arbitrary quadrilateral. The specific steps are: (1) obtain the upper boundary point: (t0, t1), (2) determine whether the point is on the left or right side of the image: t0 < 0.5xmax?, (3) obtain the point on the right side of the image: (xmax, n), (4) obtain the straight line equation based on the two-point straight line equation: (5) Substitute the horizontal coordinate of the point on the right side of the image into the line equation to get the coordinate of the point: (x, y), (6) Get the gray value of the image at point (x, y): g(x, y), (7) Determine whether the point belongs to the background or the part: g(x, y) = 255?, (8) Until the point belonging to the part is found, the iteration ends: g(x, y) = 255, if g(x, y) = 0: Jump back to step (3), (9) Get the line equation of the contour: (10) Obtain the four sides and vertices of any circumscribed quadrilateral: (xlt,ylt),(xrt,yrt),(xlb,ylb),(xrb,yrb) (11) perspective correcting the image based on the four vertices obtained above; e After perspective correction, the front image of the mold is obtained; f Use the N-division method to cut the image and match the sub-images of the two images in sequence until the position N=2,3,... where the difference between the two images is the largest is found; The algorithm process of matching the image to be detected with the standard image in the above step f is to set the number of cuts and the N value, cut the sub-image into N parts horizontally and vertically evenly, match the sub-images, determine the mismatching positions, mark the mismatching positions, and the coordinates of the upper left point of the marked rectangle are as follows: X lt =x lt (I,C min ,W) y lt =y lt (J,C min ,H) Among them, x lt With y lt Respectively represent the horizontal and vertical coordinates of the upper left point of the marked rectangle; I and J represent the horizontal and vertical index vectors respectively; H and W represent the vectors containing the height and width data of the rectangle corresponding to each cut sub-image respectively; C min Represents a vector containing the sub-image position data with the smallest cosine value each time the sub-image is matched. The coordinates of the other three points of the marked rectangle are as follows: x lb =x lb (x lt ),and lb =and rb [and lt ,H(K)] x rt =x rt [x lt ,W(K)],y rt =y rt (y lt ) x rb =x rb [x lt ,W(K)],y rb =y rb [y lt ,H(K)] Where K is the number of image cuts.
