A production quality detection method for magnetic materials

By obtaining the degree of edge regularity and edge possibilities of chromatic aberration regions in magnetic material detection, and combining position information to calculate the degree of defects of magnetic material, the impact of edge detection algorithm on chromatic aberration and texture edges is solved, and the accuracy of production quality detection is improved .

CN118864472BActive Publication Date: 2024-12-06XIANYANG QINDU DISTRICT XINBAO MAGNETISM MATERIALS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411348179.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2024-12-06
Estimated Expiration
2044-09-26

AI Technical Summary

Technical Problem

In the production process of magnetic materials, edge detection algorithms can easily extract the edges of color difference and processed textures, which affects the detection of material collapse and thus affects the accuracy of production quality detection.

Method used

By performing edge detection on the magnetic material image, we can obtain the degree of regularity of each edge and the possibility of the edge of the chromatic aberration area, combine position information to calculate the degree of defects of the magnetic material, eliminate the influence of texture and edges of the chromatic aberration area, and improve the detection accuracy.

Benefits of technology

It improves the accuracy of magnetic material production quality inspection, accurately eliminates the edges of texture and color difference areas, and more accurate degree of defects obtained, ensuring the correct judgment of the quality of magnetic material.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118864472B_ABST
    Figure CN118864472B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of image processing, and more specifically, to a method for detecting the production quality of magnetic materials. The method comprises: collecting a magnetic material image, performing edge detection on the image, obtaining each edge in the edge image, obtaining the regularity of each edge, corresponding the circumscribed rectangle of each edge to the magnetic material image, obtaining the corresponding circumscribed rectangle of each edge, obtaining the possibility that each edge is a color difference region edge according to the standard deviation of the gradient value of the pixel points in the corresponding circumscribed rectangle of each edge and the regularity of each edge; obtaining the defect degree of the magnetic material based on the possibility that each edge is a color difference region edge, the regularity of each edge and the position information of each edge on the magnetic material, and judging the quality of the magnetic material according to the defect degree of the magnetic material. The present invention can accurately obtain the defect degree of the magnetic material and avoid the influence of the color difference region edge and the texture edge.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology. More specifically, the present invention relates to a method for detecting the production quality of magnetic materials. Background Art

[0002] Magnetic materials play an important role in new energy vehicles, wind power generation, industrial motors and other fields. In the production process of magnetic materials, the raw materials need to be crushed and pressed into the required shape and size. The formed magnetic materials also need to undergo sintering, machining and surface treatment. In this process, defects such as chips and cracks often appear on the formed magnetic materials.

[0003] The patent application document with the publication number CN118552746A discloses an image edge detection method based on the Canny algorithm. First, the image is grayed, the gray image is smoothed, the image gradient is calculated, and non-maximum suppression is performed. The optimal threshold of the image is obtained by introducing an improved gray wolf optimization algorithm. The improved gray wolf optimization algorithm introduces a nonlinear convergence factor and an adaptive weight strategy on the basis of the original gray wolf optimization algorithm. For points with gradient strength greater than the high threshold in the optimal threshold range, they are determined as strong edge points; for points with gradient strength less than the low threshold in the optimal threshold range, they are excluded.

[0004] The Canny edge detection algorithm in the above method is used to identify the edges of the chipping in the magnetic material. However, due to the inherent characteristics of the magnetic material production process, the formed magnetic material often contains a certain color difference and processing texture (normal) throughout the entire magnetic material. Edge detection sometimes extracts these color difference areas and processing texture edges, affecting the detection of material chipping, and further affecting the production quality inspection of the magnetic material. Summary of the invention

[0005] In order to solve the problem that the edge detection algorithm extracts the edges of the color difference parts and the processed texture, which affects the detection of material defects and further affects the production quality detection of magnetic materials, the present invention proposes a production quality detection method for magnetic materials, which includes the following steps:

[0006] Perform edge detection on the magnetic material image to obtain each edge in the edge image; obtain the circumscribed rectangle and corresponding circumscribed rectangle of each edge; obtain the regularity of each edge, which is negatively correlated with the mean curvature of all pixels on each edge; obtain the possibility that each edge is a color difference area edge, which is negatively correlated with the standard deviation of the gradient values ​​of all pixels in the corresponding circumscribed rectangle of each edge; obtain the defect degree of the magnetic material:

[0007] , Represents the degree of defects in magnetic materials; Represents the possibility that the i-th edge is the edge of the color difference area; represents the regularity of the ith edge; N represents the number of edges in the edge image; w represents the width of the edge image; h represents the height of the edge image; Represents the mean of the horizontal coordinates of all pixels on the i-th edge; Represents the width of the edge image minus the mean value of the horizontal coordinates of all pixels on the i-th edge; Represents the mean of the ordinates of all pixels on the i-th edge; Represents the value of the height of the edge image minus the average of the ordinates of all pixels on the i-th edge; min() represents the minimum function; exp() represents the exponential function with a natural constant as the base;

[0008] The quality of the magnetic material is judged according to the degree of defects in the magnetic material.

[0009] The innovation of the present invention lies in obtaining the defect degree of the magnetic material according to the regularity of each edge, the possibility that each edge is the edge of the color difference area and the position information of each edge in the magnetic material, and finally judging the quality of the magnetic material based on the defect degree of the magnetic material, eliminating the influence of the texture edge and the color difference area edge on the edge of the chipping area, so that the defect degree of the magnetic material obtained is more accurate, and the accuracy of the production quality inspection of the magnetic material is improved.

[0010] Preferably, obtaining the bounding rectangle of each edge and the corresponding bounding rectangle includes:

[0011] The circumscribed rectangle of each edge is obtained, and the circumscribed rectangle of each edge is matched to the magnetic material image to obtain the corresponding circumscribed rectangle of each edge.

[0012] Preferably, obtaining the regularity of each edge includes:

[0013] Get each edge of the local area of ​​each edge;

[0014] ;

[0015] In the formula, Represents the regularity of the i-th edge; Represents the mean curvature of the pixels on the i-th edge; Represents the maximum value of the mean curvature of all pixels on the edge; N represents the number of edges in the edge image; Represents the mean number of pixels of all edges in the local area of ​​the i-th edge; exp() represents an exponential function with a natural constant as the base.

[0016] The greater the degree of regularity, the more it indicates a texture edge, which makes it easier to exclude the texture edge later.

[0017] Preferably, the obtaining each edge of the local area of ​​each edge includes:

[0018] The mean number of pixels of all edges in the edge image is recorded as M. Taking any edge as an example, the circumscribed rectangle of the edge and the center point of the circumscribed rectangle of the edge are obtained, and the local area of ​​the edge is constructed with the center point as the center and M as the radius to obtain each edge of the local area of ​​the edge.

[0019] Preferably, the obtaining the possibility that each edge is a color difference area edge includes:

[0020] ;

[0021] In the formula, Represents the possibility that the i-th edge is the edge of the color difference area; Represents the regularity of the i-th edge; Represents the standard deviation of the gradient values ​​of all pixels in the corresponding circumscribed rectangle of the i-th edge; exp() represents an exponential function with a natural constant as the base.

[0022] The greater the possibility that the edge is the edge of the color difference area, the more it indicates that it is the edge of the color difference area, which is convenient for subsequent exclusion of the edge of the color difference area.

[0023] Preferably, obtaining the height of the edge image includes:

[0024] Taking the pixel point in the lower left corner of the edge image as the coordinate origin, a rectangular coordinate system is constructed to obtain the horizontal and vertical coordinates of all pixels on each edge in the edge image, and the vertical coordinate of the pixel point in the upper left corner of the edge image is marked as the height of the edge image.

[0025] This facilitates the subsequent analysis of the location information of each edge.

[0026] Preferably, the acquisition of the width of the edge image includes:

[0027] The horizontal coordinate of the lower right pixel of the edge image is marked as the width of the edge image.

[0028] Preferably, judging the quality of the magnetic material according to the degree of defects of the magnetic material includes:

[0029] A defect level threshold T is preset. If the defect level of the magnetic material is greater than or equal to the defect level threshold T, the magnetic material is a defective product. At this time, the conveyor belt conveys the magnetic material to the defective product storage area.

[0030] The obtained defect degree of the magnetic material is highly accurate, which improves the accuracy of production quality inspection of the magnetic material.

[0031] The present invention has the following beneficial effects: the purpose of the present invention is to obtain the defect degree of the magnetic material according to the regularity of each edge, the possibility that each edge is the edge of the color difference area and the position information of each edge in the magnetic material, and finally judge the quality of the magnetic material based on the defect degree of the magnetic material, thereby eliminating the influence of the texture edge and the color difference area edge on the edge of the chipping area, so that the defect degree of the obtained magnetic material is more accurate, and the accuracy of the production quality inspection of the magnetic material is improved. Furthermore, the acquisition of the regularity of each edge takes into account the striped feature of the texture edge, and the texture edge can be accurately removed. The acquisition of the possibility that each edge is the edge of the color difference area takes into account the gradual effect of the grayscale value of the color difference area, and the edge of the color difference area can be accurately removed. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] By reading the following detailed description with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:

[0033] Figure 1 It is a flow chart of the steps of a method for detecting production quality of a magnetic material according to an embodiment of the present invention. DETAILED DESCRIPTION

[0034] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are 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 those skilled in the art without creative work are within the scope of protection of the present invention.

[0035] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0036] See also Figure 1 , which shows a flowchart of a method for detecting the production quality of a magnetic material provided by an embodiment of the present invention, the method comprising the following steps:

[0037] S001. Collect images of magnetic materials.

[0038] It should be noted that the purpose of the present invention is to detect the chipped edges in the magnetic material image, so it is necessary to collect the magnetic material image.

[0039] In an embodiment of the present invention, a camera is installed above the conveyor belt of the production line to capture an RGB image of the magnetic material. In order to avoid the influence of the background area in the RGB image of the magnetic material on the subsequent defect detection, semantic segmentation is used to segment the magnetic material area in the RGB image of the magnetic material, and grayscale processing is performed on it to obtain the magnetic material image. It should be noted that semantic segmentation is a prior art and will not be described in detail in the embodiment of the present invention.

[0040] S002. Perform edge detection on the magnetic material image to obtain each edge in the edge image and acquire the regularity of each edge.

[0041] It should be noted that due to the inherent characteristics of the magnetic material production process, the formed magnetic material often contains certain color differences and processing textures throughout the entire magnetic material. These are normal phenomena. However, when using the canny edge detection algorithm to detect the chipped area on the magnetic material, the color difference area edges and texture edges on the magnetic material will affect the identification of the chipped area, thereby affecting the production quality inspection of the magnetic material.

[0042] It should be further explained that the edges caused by different reasons in the magnetic material image have different shapes. For example, the edges of the collapsed area of ​​the magnetic material are random and uncertain, and the edges of the chromatic aberration area are also irregular. Therefore, the edges of the collapsed area and the chromatic aberration area have a certain curvature, while the texture edges are mostly stripe-shaped. Since the collapsed area generally occurs at the edge of the magnetic material and the grayscale value in the chromatic aberration area is gradual, the edges of the collapsed area and the chromatic aberration area are multiple discontinuous shorter edges, while the texture edges are multiple continuous longer edges. Therefore, edge detection is first performed to obtain each edge for analysis; the regularity of each edge is obtained based on the curvature of the pixel points on each edge and the average number of pixel points of all edges in the local area of ​​each edge.

[0043] In the embodiment of the present invention, the canny edge detection algorithm is used to perform edge detection on the magnetic material image to obtain each edge in the edge image.

[0044] The mean number of pixels of all edges in the edge image is denoted as M. Taking any edge as an example, the circumscribed rectangle of the edge and the center point of the circumscribed rectangle of the edge are obtained, and the local area of ​​the edge is constructed with the center point as the center of the circle and M as the radius to obtain each edge of the local area of ​​the edge and the number of pixels of each edge of the local area of ​​the edge. It should be noted that in the local area of ​​each edge, there may be only half of the edge, but when obtaining the number of pixels of each edge in the local area of ​​the edge, the number of pixels of the complete edge is obtained.

[0045] Get the regularity of each edge:

[0046] ;

[0047] In the formula, Represents the regularity of the i-th edge; Represents the mean curvature of the pixels on the i-th edge; Represents the maximum value of the mean curvature of all pixels on the edge; N represents the number of edges in the edge image; represents the mean value of the number of pixels of all edges in the local area of ​​the i-th edge; exp() represents an exponential function with a natural constant as the base; The larger the value is, the more irregular the i-th edge is, indicating that the edge may be the edge of the chipping area or the edge of the color difference area. The smaller the value is, the more regular the i-th edge is, which means that the edge is likely to be a texture edge; The larger the value is, the larger the mean number of pixels of all edges in the local area of ​​the i-th edge is, which means that the i-th edge is more likely to be a texture edge. The smaller the value is, the smaller the average number of pixels of all edges in the local area of ​​the i-th edge is, which means that the i-th edge is more likely to be the edge of the chipping area or the edge of the color difference area; The larger the value of , the more likely the i-th edge is to be a texture edge.

[0048] S003. The circumscribed rectangle of each edge is mapped to the magnetic material image to obtain the corresponding circumscribed rectangle of each edge, and the possibility that each edge is a color difference region edge is obtained according to the standard deviation of the gradient values ​​of the pixel points in the corresponding circumscribed rectangle of each edge and the regularity of each edge; based on the possibility that each edge is a color difference region edge, the regularity of each edge and the position information of each edge on the magnetic material, the defect degree of the magnetic material is obtained.

[0049] It should be noted that in the magnetic material image, the edge of the chromatic aberration area and the edge of the chipping area have similar characteristics, and their regularity is relatively low. However, the edge of the chromatic aberration area and the edge of the chipping area cannot be distinguished only based on the regularity of each edge. In addition, since the distribution of pixels in the chipping area is relatively uniform and the grayscale value at the chipping edge mutates, the gradient values ​​of the pixels in the circumscribed rectangle of the chipping edge are relatively different. Therefore, the larger the standard deviation of the gradient values ​​of the pixels in the circumscribed rectangle of the chipping edge, the grayscale at the texture edge mutates and the surrounding area of ​​the texture edge is more likely to be a normal area with a relatively uniform grayscale value distribution. Therefore, the larger the standard deviation of the gradient values ​​of the pixels in the circumscribed rectangle of the texture edge is, the larger the standard deviation of the gradient values ​​of the pixels in the circumscribed rectangle of the texture edge is. The grayscale values ​​of the chromatic aberration area are gradually distributed, so there is no mutation in the grayscale values ​​of the pixels in the circumscribed rectangle of the chromatic aberration area edge. Therefore, the standard deviation of the gradient values ​​of the pixels in the circumscribed rectangle of the chromatic aberration area edge is smaller. Therefore, it is also necessary to obtain the possibility of each edge being the edge of the chromatic aberration area based on the standard deviation of the gradient values ​​of all pixels in the circumscribed rectangle of each edge.

[0050] In the embodiment of the present invention, the circumscribed rectangle of each edge is mapped to the magnetic material image to obtain the corresponding circumscribed rectangle of each edge.

[0051] Get the probability that each edge is an edge of a color difference region:

[0052] ;

[0053] In the formula, Represents the possibility that the i-th edge is the edge of the color difference area; Represents the regularity of the i-th edge; Represents the standard deviation of the gradient values ​​of all pixels in the corresponding bounding rectangle of the i-th edge; The smaller the value of , the more likely the i-th edge is the edge of the color difference area; The larger the value of is, the more likely the i-th edge is to be the edge of the color difference area; The larger it is, the more likely the i-th edge is to be the edge of a chipping area or a texture edge; The smaller it is, the more likely the i-th edge is the edge of the color difference area. The value pair Make corrections, The closer the value is to 0, the The larger the correction, The larger the value, the greater the possibility that the i-th edge is the edge of the color difference area; exp() represents an exponential function with a natural constant as the base.

[0054] It should be noted that the possibility that the edge is the edge of the color difference area and the smaller the regularity of the edge, the more likely the edge is the edge of the chipping area. At this time, the greater the degree of defect of the magnetic material, and due to the characteristics of the structure of the magnetic material itself, chipping is more likely to occur near the edge of the magnetic material. Therefore, the present invention combines the position information of each edge to obtain the degree of defect of the magnetic material.

[0055] In the embodiment of the present invention, a rectangular coordinate system is constructed with the pixel point at the lower left corner of the edge image as the coordinate origin, the horizontal and vertical coordinates of all the pixel points on each edge in the edge image are obtained, and the vertical coordinate of the pixel point at the upper left corner of the edge image is marked as the height of the edge image; the horizontal coordinate of the pixel point at the lower right corner of the edge image is marked as the width of the edge image;

[0056] Obtain the degree of defects in magnetic materials:

[0057] ;

[0058] In the formula, Represents the degree of defects in magnetic materials; Represents the possibility that the i-th edge is the edge of the color difference area; represents the regularity of the ith edge; N represents the number of edges in the edge image; The larger the value of is, the more likely the i-th edge is to be the edge of the chipping region, and the degree of defect of the magnetic material is relatively large. w represents the width of the edge image; h represents the height of the edge image. Represents the mean of the horizontal coordinates of all pixels on the i-th edge; Represents the width of the edge image minus the mean value of the horizontal coordinates of all pixels on the i-th edge; Represents the mean of the ordinates of all pixels on the i-th edge; Represents the value of the height of the edge image minus the average of the ordinates of all pixels on the i-th edge; min() represents the minimum function; exp() represents the exponential function with a natural constant as the base; The smaller the value of is, the closer the i-th edge is to the left or right side of the magnetic material; The smaller the value of is, the closer the i-th edge is to the upper or lower side of the magnetic material; It represents the shortest distance between the ith edge and the edge of the magnetic material. The smaller the value, the more likely the ith edge is to be the edge of the chipping area. At this time, the degree of defect of the magnetic material is greater.

[0059] S004. Determine the quality of the magnetic material based on the degree of defects in the magnetic material.

[0060] It should be noted that the quality of the magnetic material is judged according to the degree of defects in the magnetic material.

[0061] In the embodiment of the present invention, a defect level threshold T is preset. If the defect level of the magnetic material is greater than or equal to the defect level threshold T, it means that the magnetic material is a defective product. At this time, the conveyor belt conveys the magnetic material to the defective product storage area. In the embodiment of the present invention, the defect level threshold T is preset to 0.3. In other embodiments, the implementer can preset the value of the defect level threshold according to the specific implementation situation.

[0062] 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 method for detecting the production quality of magnetic materials, characterized in that: include: Perform edge detection on the magnetic material image to obtain each edge in the edge image; Get the bounding rectangle of each edge and the corresponding bounding rectangle, including: Obtain the circumscribed rectangle of each edge, correspond the circumscribed rectangle of each edge to the magnetic material image, and obtain the corresponding circumscribed rectangle of each edge; Get the regularity of each edge, including: Get each edge of the local area of ​​each edge; ; In the formula, Represents the regularity of the i-th edge; Represents the mean curvature of the pixels on the i-th edge; Represents the maximum value of the mean curvature of all pixels on the edge; N represents the number of edges in the edge image; represents the mean value of the number of pixels of all edges in the local area of ​​the i-th edge; exp() represents an exponential function with a natural constant as the base; Get the possibility that each edge is the edge of the color difference area, including: ; In the formula, Represents the possibility that the i-th edge is the edge of the color difference area; Represents the regularity of the i-th edge; Represents the standard deviation of the gradient values ​​of all pixels in the corresponding circumscribed rectangle of the i-th edge; exp() represents an exponential function with a natural constant as the base; Obtain the degree of defects in magnetic materials: , Represents the degree of defects in magnetic materials; Represents the possibility that the i-th edge is the edge of the color difference area; represents the regularity of the i-th edge; N represents the number of edges in the edge image; w represents the width of the edge image; h represents the height of the edge image; Represents the mean of the horizontal coordinates of all pixels on the i-th edge; Represents the width of the edge image minus the mean value of the horizontal coordinates of all pixels on the i-th edge; Represents the mean of the ordinates of all pixels on the i-th edge; Represents the value of the height of the edge image minus the average of the ordinates of all pixels on the i-th edge; min() represents the minimum function; exp() represents the exponential function with a natural constant as the base; The quality of the magnetic material is judged according to the degree of defects in the magnetic material.

2. A method for detecting production quality of magnetic materials according to claim 1, characterized in that: The step of obtaining each edge of the local area of ​​each edge includes: The mean number of pixels of all edges in the edge image is recorded as M. Taking any edge as an example, the circumscribed rectangle of the edge and the center point of the circumscribed rectangle of the edge are obtained, and the local area of ​​the edge is constructed with the center point as the center and M as the radius to obtain each edge of the local area of ​​the edge.

3. A method for detecting production quality of magnetic materials according to claim 1, characterized in that: The acquisition of the height of the edge image includes: Taking the pixel point in the lower left corner of the edge image as the coordinate origin, a rectangular coordinate system is constructed to obtain the horizontal and vertical coordinates of all pixels on each edge in the edge image, and the vertical coordinate of the pixel point in the upper left corner of the edge image is marked as the height of the edge image.

4. A method for detecting production quality of magnetic materials according to claim 3, characterized in that: The acquisition of the width of the edge image includes: The horizontal coordinate of the lower right pixel of the edge image is marked as the width of the edge image.

5. The method for detecting the production quality of magnetic materials according to claim 1, characterized in that: The quality of the magnetic material is judged according to the degree of defects of the magnetic material, including: A defect level threshold T is preset. If the defect level of the magnetic material is greater than or equal to the defect level threshold T, the magnetic material is a defective product. At this time, the conveyor belt conveys the magnetic material to the defective product storage area.