Titanium electrode block burr defect identification method based on machine vision
By using multi-view imaging and perspective transformation, combined with mismatch frequency and angle similarity analysis, the problem of distinguishing between burrs and reflective interference in the burr identification of titanium electrode blocks was solved, realizing all-round defect identification and quantitative assessment of burrs in titanium electrode blocks.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BAOJI BOYUTAI SPECIAL METAL CO LTD
- Filing Date
- 2026-05-18
- Publication Date
- 2026-06-12
Smart Images

Figure CN122199555A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and more specifically to a machine vision-based method for identifying burr defects in titanium electrode blocks. Background Technology
[0002] Titanium electrodes are electrolytic anodes with titanium as the base material and a metal oxide coating on the surface. They are widely used in industries such as chemical engineering, metallurgy, water treatment, environmental protection, and electroplating. During the stamping process of titanium electrode blocks, edge burrs are generated due to material shearing and fracture. These burrs significantly reduce the electrochemical performance of the electrode plate, shorten its service life, and pose safety hazards.
[0003] Currently, methods for identifying burrs on titanium electrode surfaces mainly fall into two categories. One category is based on 3D scanning, which identifies burrs by acquiring the 3D morphology of the electrode plate. While this method can obtain burr height information, it is computationally intensive and inefficient, making it difficult to meet the needs of rapid online detection. The other category is based on 2D images, which acquires planar images of the titanium electrode block and uses feature extraction or machine learning algorithms to identify burrs. However, the surface of the titanium electrode block contains reflections, noise, and complex 2D textures, which can easily lead to false positives and false negatives of burrs. In particular, 2D image methods struggle to effectively distinguish the essential differences between burrs (3D protrusions) and reflections (2D phenomena), resulting in limited detection accuracy. Summary of the Invention
[0004] This invention provides a machine vision-based method for identifying burr defects in titanium electrode blocks to solve existing problems.
[0005] The present invention provides a machine vision-based method for identifying burr defects in titanium electrode blocks, which employs the following technical solution: One embodiment of the present invention provides a machine vision-based method for identifying burr defects in titanium electrode blocks, the method comprising the following steps: Acquire a standard view image and at least three non-standard view images of the top surface of the titanium electrode block, wherein each non-standard view image corresponds to a non-standard view. Using the standard viewpoint image as a reference, perspective transformation is performed on each non-standard viewpoint image to obtain the transformed image, and the mismatch area between each transformed image and the standard viewpoint image is obtained. The binary images of each mismatch region are superimposed to obtain a mismatch frequency distribution map. The closed connected region formed by the pixels whose mismatch frequency is equal to the number of non-standard viewpoint images is extracted as the suspected spur region. For each suspected burr region, in each mismatch region of each non-standard view, match the mismatch region that belongs to the same burr as the suspected burr region, and use it as the associated mismatch region under that non-standard view. Calculate the angle between the camera orientation of each non-standard viewpoint and the main direction of the associated mismatch region under that viewpoint, and select the associated mismatch region corresponding to the non-standard viewpoint with the smallest angle as the reference mismatch region of the suspected burr region. The associated mismatched regions corresponding to the adjacent viewpoints on both sides of the non-standard viewpoint where the baseline mismatched region is located are paired in clockwise and counterclockwise order. The similarity between the angle between the two associated mismatched regions in each pair and the camera orientation of their respective non-standard viewpoints is calculated, and the average of all similarities is taken as the spur mismatched region similarity of the suspected spur region. Suspected burr regions with a similarity to the burr mismatch region greater than a preset threshold are identified as real burr regions. The identified real burr regions are then marked on the standard view image, and a burr defect distribution map of the top surface of the titanium electrode block is output.
[0006] Furthermore, using the standard viewpoint image as a reference, perspective transformation is performed on each non-standard viewpoint image to obtain the transformed image, and the mismatch region between each transformed image and the standard viewpoint image is obtained, specifically including: The four corner points of the top surface of the titanium electrode block are extracted from each non-standard viewpoint image. Based on the matching relationship between the four corner points and the corresponding corner points in the standard viewpoint image, the perspective transformation matrix from each non-standard viewpoint image to the standard viewpoint image is calculated by the direct linear transformation algorithm. The corresponding non-standard viewpoint image is projected onto the standard viewpoint image using a perspective transformation matrix to obtain the transformed image. Calculate the normalized cross-correlation coefficients within the neighborhood window of corresponding pixels in the transformed image and the standard viewpoint image; The mismatch degree is calculated based on the normalized cross-correlation coefficient, and the region with a mismatch degree greater than the threshold is identified as the mismatch region. Among them, the mismatch degree is negatively correlated with the matching degree of the two images in each neighborhood window. The threshold is the mean and standard deviation of the mismatch degree based on the pre-labeled spur regions, and the value is obtained by subtracting twice the standard deviation from the mean.
[0007] Furthermore, the binary images of each mismatched region are superimposed to obtain a mismatch frequency distribution map. Closed connected components formed by pixels whose mismatch frequency equals the number of non-standard viewpoint images are extracted as suspected spur regions, specifically including: Each mismatched region corresponding to each non-standard viewpoint image is converted into a binary image. In the binary image, the pixel value inside each mismatched region is 1, and the pixel value of the other regions is 0. By accumulating the binary images corresponding to all mismatched regions pixel by pixel in the same spatial coordinate system, a mismatch frequency distribution map is obtained. The value of each pixel in the mismatch frequency distribution map represents the number of times that pixel is marked in different mismatched regions. Extract all pixels in the mismatch frequency distribution map whose pixel value is equal to the number of non-standard viewpoint images. Form closed connected regions from the extracted pixels and treat each closed connected region as a suspected spur region.
[0008] Furthermore, in each mismatched region from each non-standard viewpoint, mismatched regions belonging to the same burr as the suspected burr region are matched and designated as associated mismatched regions under that non-standard viewpoint, specifically including: For each non-standard viewpoint, calculate the overlap ratio between each mismatched region and the suspected burr region under that non-standard viewpoint, and determine the mismatched region with the highest overlap ratio as the associated mismatched region corresponding to the same burr as the suspected burr region.
[0009] Furthermore, the angle between the camera orientation and the principal direction of the associated mismatch region at each non-standard viewpoint is calculated. The associated mismatch region corresponding to the non-standard viewpoint with the smallest angle is selected as the reference mismatch region for the suspected burr region. Specifically, this includes: For each non-standard viewpoint, obtain the camera orientation corresponding to that non-standard viewpoint, and extract the principal direction of the associated mismatch region under that non-standard viewpoint using principal component analysis. Calculate the angle between the camera orientation of each non-standard viewpoint and the principal direction of the associated mismatch region under that non-standard viewpoint; Among all non-standard viewpoints, the associated mismatch region corresponding to the non-standard viewpoint with the smallest included angle value is selected as the benchmark mismatch region for the suspected burr region.
[0010] Furthermore, the associated mismatched regions corresponding to the adjacent viewpoints on both sides of the non-standard viewpoint where the baseline mismatched region is located are paired in clockwise and counterclockwise order. The similarity between the angles between the two associated mismatched regions in each pair and the camera orientation of their respective non-standard viewpoints is calculated, specifically including: Determine the non-standard viewpoint where the baseline mismatch region is located, and obtain the associated mismatch regions corresponding to the adjacent non-standard viewpoints on both sides of the non-standard viewpoint. The associated mismatch regions corresponding to the adjacent non-standard viewpoints on both sides are paired up in clockwise and counterclockwise order. The first associated mismatch region in the clockwise order is paired with the first associated mismatch region in the counterclockwise order, the second associated mismatch region in the clockwise order is paired with the second associated mismatch region in the counterclockwise order, and so on. For each pair of associated mismatch regions, calculate the first angle between the principal direction of the first associated mismatch region and the camera orientation of the non-standard view where the first associated mismatch region is located, and the second angle between the principal direction of the second associated mismatch region and the camera orientation of the non-standard view where the second associated mismatch region is located. Divide the absolute value of the difference between the first and second included angles by the sum of the first and second included angles to obtain the dissimilarity. Subtract this dissimilarity from the constant 1 to obtain the similarity of the pair of associated mismatched regions.
[0011] Furthermore, the method also includes: For any real spur region, the insignificant spur bias of each pair of associated mismatched regions is calculated based on the similarity of each pair of associated mismatched regions. Combined with the length weight of the associated mismatched regions, the severity index of the spur region is calculated.
[0012] Furthermore, for any real spur region, based on the similarity of each pair of associated mismatched regions, the insignificant spur bias of each pair of associated mismatched regions is calculated, specifically including: Obtain the similarity of each pair of associated mismatched regions corresponding to the real burr region, sort all similarities from largest to smallest, take the first half of the similarities after sorting and calculate the average to obtain the average high-order similarity. Calculate the average of all similarities, and denote it as the average similarity. For each pair of associated mismatched regions, calculate the difference between the mean high-order similarity and the similarity of the pair of associated mismatched regions, take the maximum value between the difference and zero, and determine the insignificant spurious bias of the pair of associated mismatched regions as the ratio of the maximum value to the difference between the mean high-order similarity and the average similarity.
[0013] Furthermore, by combining the length weights of the associated mismatched regions, the severity index of the glitch region is calculated, specifically including: Obtain the lengths of the two associated mismatched regions in the principal direction for each pair of associated mismatched regions, and calculate the sum of the two lengths; Determine the reference length, where the reference length is the maximum length of all associated mismatch regions in the principal direction within the actual burr region; The ratio of the sum of the two lengths of each pair of associated mismatched regions to twice the baseline length is determined as the length weight of that pair of associated mismatched regions. Multiply the insignificant spur bias of each pair of associated mismatch regions by its length weight to obtain the weighted bias value of that pair of associated mismatch regions; The severity index of the true spurious region is obtained by summing all the weighted deviation values of the associated mismatch regions.
[0014] This invention proposes a machine vision-based titanium electrode block burr defect identification system, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, it implements the steps of the machine vision-based titanium electrode block burr defect identification method described above.
[0015] The beneficial effects of the technical solution of the present invention are: This invention utilizes multi-view imaging and perspective transformation to exploit the fundamental difference between burrs (three-dimensional protrusions) and planar homography constraints, which are satisfied by 2D interferences such as reflections. It extracts suspected burr regions by accumulating mismatch frequencies and analyzes the similarity of the angles between the associated mismatch regions and the camera orientation from different viewpoints to effectively distinguish burrs from reflection interference. Furthermore, it calculates a severity index of the burr region using similarity distribution deviation and length weighting to achieve quantitative assessment of burrs. Moreover, through flipping recognition, it can monitor burrs on all surfaces of the titanium electrode block, achieving comprehensive defect identification of the titanium electrode block. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 A flowchart illustrating a machine vision-based method for identifying burr defects in titanium electrode blocks, as provided in one embodiment of the present invention. Figure 2 This is a structural diagram of a machine vision-based titanium electrode block burr defect recognition system provided in one embodiment of the present invention. Detailed Implementation
[0018] To further illustrate the technical means and effects adopted by the present invention to achieve its intended purpose, the following, in conjunction with the accompanying drawings and preferred embodiments, details the specific implementation, structure, features, and effects of a machine vision-based method for identifying burr defects in titanium electrode blocks according to the present invention. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.
[0019] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0020] The following description, in conjunction with the accompanying drawings, details a specific scheme for a machine vision-based method for identifying burr defects in titanium electrode blocks provided by the present invention.
[0021] This invention provides a machine vision-based method for identifying burr defects in titanium electrode blocks. Please refer to [link to relevant documentation]. Figure 1 The diagram illustrates a flowchart of a machine vision-based method for identifying burr defects in titanium electrode blocks, according to an embodiment of the present invention. The method includes the following steps: S101. Obtain a standard view image and at least three non-standard view images of the top surface of the titanium electrode block, wherein each non-standard view image corresponds to a non-standard view.
[0022] In this embodiment, the top surface of the titanium electrode block is simultaneously captured by multiple industrial-grade high-resolution cameras at fixed positions under the illumination of a fixed ring light source.
[0023] One camera faces the titanium electrode block from the top, capturing a top-down view of the block, which is then used as the standard view image. At least three other cameras are evenly distributed around the titanium electrode block, equidistant from its center. The angle difference between any two adjacent cameras is consistent, and each camera faces the center of the top surface of the titanium electrode block at the same tilt angle, ranging from 20 to 40 degrees, capturing a corresponding number of non-standard view images.
[0024] For example, the specific number of cameras can be selected based on the required detection accuracy and computing resources. For instance, in scenarios with high accuracy requirements, five or six cameras can be deployed; in scenarios where detection efficiency is prioritized, three or four cameras can be deployed. Each non-standard viewpoint image corresponds to one non-standard viewpoint.
[0025] Since the titanium electrode block is a standard cuboid or cube, any one face can be selected as the top face for image acquisition. After image acquisition is complete, any other unidentified face can be selected as the top face for re-image acquisition, until every face of the titanium electrode block has been image acquired.
[0026] After acquiring multiple frames of images of the top surface of the titanium electrode block, each image was sequentially processed by grayscale conversion, distortion correction, and background removal. Only the top surface area of the titanium electrode block was retained for subsequent processing to eliminate background interference. The preprocessed images were stored in 8-bit grayscale format for subsequent perspective transformation processing.
[0027] S102. Using the standard viewpoint image as a reference, perform perspective transformation on each non-standard viewpoint image to obtain the transformed image, and obtain the mismatch area between each transformed image and the standard viewpoint image.
[0028] In this embodiment, using the standard viewpoint image as a reference, perspective transformation is performed on each non-standard viewpoint image to obtain the transformed image, and the mismatch region between each transformed image and the standard viewpoint image is obtained, specifically including: The four corner points of the top surface of the titanium electrode block are extracted from each non-standard viewpoint image. Based on the matching relationship between the four corner points and the corresponding corner points in the standard viewpoint image, the perspective transformation matrix from each non-standard viewpoint image to the standard viewpoint image is calculated by the direct linear transformation algorithm. The corresponding non-standard viewpoint image is projected onto the standard viewpoint image using a perspective transformation matrix to obtain the transformed image. Calculate the normalized cross-correlation coefficients within the neighborhood window of corresponding pixels in the transformed image and the standard viewpoint image; The mismatch degree is calculated based on the normalized cross-correlation coefficient, and the region with a mismatch degree greater than the threshold is identified as the mismatch region. Among them, the mismatch degree is negatively correlated with the matching degree of the two images in each neighborhood window. The threshold is the mean and standard deviation of the mismatch degree based on the pre-labeled spur regions, and the value is obtained by subtracting twice the standard deviation from the mean.
[0029] For example, the top surface of the titanium electrode block is a two-dimensional plane. Images taken from different angles satisfy the homography constraint, meaning that a planar region captured at one angle can be accurately mapped to the viewpoint of another image through perspective transformation, and the features on the two-dimensional plane completely overlap after the transformation. However, burrs, as protrusions on the top surface of the titanium electrode block, are three-dimensional features and exhibit parallax in multi-angle images, thus not satisfying the homography constraint. Therefore, after performing perspective transformation on non-standard viewpoint images based on the planar assumption, the transformed burr image will not completely overlap with the image of the same burr in the standard viewpoint image, but will instead produce ghosting or residual differences. This allows for the identification of burr defects on the top surface of the titanium electrode block.
[0030] Based on the above logic, after obtaining the top surface image of the titanium electrode block from multiple perspectives, the perspective transformation matrix is first calculated.
[0031] Specifically, in each non-standard viewpoint image, the Canny edge detection algorithm is used to extract image edges, and then Hough transform is used to detect straight line segments in the image. Based on the angle and distance information of each straight line segment, four straight lines belonging to the top surface border of the titanium electrode block are selected. The intersection points of two adjacent straight lines are calculated to obtain the four corner points of the top surface of the titanium electrode block.
[0032] The four corner points extracted from each non-standard viewpoint image are matched with the corresponding four corner points in the standard viewpoint image. Based on the matching point pairs, the perspective transformation matrix from each non-standard viewpoint image to the standard viewpoint image is calculated using the direct linear transformation algorithm.
[0033] After obtaining the perspective transformation matrix, each non-standard viewpoint image is projected onto the standard viewpoint image through the corresponding perspective transformation matrix to obtain the transformed image. The transformed image has the same viewpoint and scale as the standard viewpoint image. The two-dimensional features (such as textures and printed patterns) on the top surface of the titanium electrode block completely overlap with the standard viewpoint image after transformation, while three-dimensional features such as burrs differ from the standard viewpoint image after transformation because they do not satisfy the plane homography constraint.
[0034] The above steps have transformed the multi-angle images of the top surface of the titanium electrode block to a standard viewing angle through perspective transformation. Based on the aforementioned logic, since burrs are three-dimensional features, the area around them after transformation differs from the standard viewing angle image and cannot be perfectly superimposed. Therefore, the burr area can be identified.
[0035] For a single non-standard viewpoint image after perspective transformation, the mismatch degree is used. The degree of mismatch represents the difference between the transformed image and the standard viewpoint image. The calculation method is as follows:
[0036] Among them, mismatch degree The range of values is , Represents the neighborhood of the corresponding pixel. Normalized cross-correlation coefficients within the window.
[0037] First, calculate the normalized cross-correlation coefficient between the transformed image and the standard view image within the neighborhood window of the corresponding pixel. The range of values for this coefficient is: The closer the value is to 1, the more similar the image structures are within the two windows. Then take... The maximum value between 0 and 1 is used to ensure non-negativity. Finally, the maximum value is subtracted from the constant 1 to obtain the degree of mismatch. .
[0038] This formula represents the degree of incoherence between a single-viewpoint image and a standard-viewpoint image at the same location after perspective transformation. It also represents the degree of incoherence between the two images in the neighborhood of a given pixel. The smaller the value, the lower the degree of matching between the perspective-transformed image and the standard view image at this point, and the higher the calculated mismatch degree. The larger the value, the more likely the match will fail due to external interference, indicating the presence of glitches in that area. Conversely, if the two images are completely identical in this region, then... , , indicates a complete match.
[0039] After performing perspective transformation and calculating the mismatch degree for each non-standard viewpoint image, a mismatch degree distribution map is obtained for each. In this distribution map, The location with the larger value is the mismatch region.
[0040] The threshold is determined as follows: Beforehand, manually mark the locations of burrs and defects in several (e.g., 10) perspective-transformed images, statistically analyze the distribution of mismatch values within these burr regions, and calculate the mean. with standard deviation Then calculate the segmentation threshold. Using this threshold The mismatch distribution map is segmented, and regions with a mismatch degree greater than a threshold are identified as mismatch regions. .
[0041] The mismatch distribution of puncture regions follows a certain statistical law. By statistically analyzing the mean and standard deviation of pre-labeled puncture regions, a reasonable segmentation threshold can be determined. Using the mean minus twice the standard deviation as the threshold ensures that approximately 95% of puncture regions are correctly identified under the assumption of a normal distribution, while effectively suppressing noise interference. The identified mismatch regions... This refers to the region that does not match the standard viewpoint image after perspective transformation of the corresponding non-standard viewpoint image.
[0042] For the identified mismatch areas Morphological processing is performed by first using erosion to remove isolated noisy pixels, then using dilation to fill the small holes inside the mismatched regions and smoothing the region boundaries. Each mismatched region is then converted into a binary image, where the pixel value inside the mismatched region is set to 1, and the pixel value in the remaining regions is set to 0.
[0043] The original mismatched region may contain isolated points or small breaks due to noise or slight registration errors. Morphological processing can remove these artifacts, making the mismatched region more complete and continuous, which is convenient for subsequent overlay analysis and feature extraction.
[0044] Thus, the mismatch regions between the non-standard viewpoint images after perspective transformation and the standard viewpoint images were obtained. The binary image. In addition to the mismatch caused by burrs, these mismatch regions also include the mismatch caused by the difference in reflection due to different angles. Therefore, it is necessary to further analyze the shape and distribution of the mismatch regions of each multi-view image after perspective transformation in order to distinguish between burrs and reflection interference.
[0045] S103. Overlay the binary images of each mismatch region to obtain a mismatch frequency distribution map, and extract the closed connected region formed by the pixels whose mismatch frequency is equal to the number of non-standard viewpoint images as the suspected spur region.
[0046] In this embodiment, the binary images of each mismatch region are superimposed to obtain a mismatch frequency distribution map. The closed connected components formed by pixels whose mismatch frequency is equal to the number of non-standard viewpoint images are extracted as suspected spur regions, specifically including: Each mismatched region corresponding to each non-standard viewpoint image is converted into a binary image. In the binary image, the pixel value inside each mismatched region is 1, and the pixel value of the other regions is 0. By accumulating the binary images corresponding to all mismatched regions pixel by pixel in the same spatial coordinate system, a mismatch frequency distribution map is obtained. The value of each pixel in the mismatch frequency distribution map represents the number of times that pixel is marked in different mismatched regions. Extract all pixels in the mismatch frequency distribution map whose pixel value is equal to the number of non-standard viewpoint images. Form closed connected regions from the extracted pixels and treat each closed connected region as a suspected spur region.
[0047] For example, in multi-view images after perspective transformation, the mismatch region caused by differences in specular reflection distribution is not related to the actual physical undulations of the top surface of the titanium electrode block, but rather to the angle between the camera and the top surface of the titanium electrode block, and their relative positions to the light source. Therefore, the reflected areas in multi-camera images of the top surface of the titanium electrode block are inconsistent; after perspective transformation, the mismatch regions caused by these reflection differences are not in the same location. However, since the burrs on the top surface of the titanium electrode block are fixed in position, the mismatch region caused by the burrs is always located around the burrs. When the mismatch regions obtained after perspective transformation of the top surface images of the titanium electrode block from different viewpoints are compared with those from a standard viewpoint and then superimposed, the mismatch regions caused by the burrs overlap within a certain range, and the overlapping position is always located at one end of their respective mismatch regions. This overlapping area is the location of the burrs under the standard viewpoint.
[0048] By accumulating the binary images of the mismatched regions corresponding to each non-standard viewpoint image pixel by pixel in the same spatial coordinate system, a total distribution map of the mismatched regions from multiple views is obtained. In this distribution map, the value of each pixel is defined as the mismatch frequency. This indicates the number of times the pixel is identified as a mismatched region in images from different non-standard viewpoints.
[0049] Mismatch frequency This reflects the degree of consistency in whether the same location belongs to a mismatched region from different perspectives. If a location is identified as a mismatched region from multiple perspectives, then... The value is relatively large; if it is only judged as a mismatch region from a few perspectives, then The value is relatively small. Since the location of reflective interference is random at different viewing angles, while burrs will cause mismatch at all viewing angles, the location corresponding to the burr usually has a high [value / value]. value.
[0050] Overall distribution map of mismatched areas from multiple perspectives Extracting the frequency of mismatch Value equals The area, in which This represents the number of images taken from non-standard viewpoints (i.e., the number of cameras other than those using standard viewpoint cameras). These areas are referred to as suspected spurious regions.
[0051] For each pixel, determine whether its mismatch frequency is equal to If equal to If a pixel is found to be a candidate pixel, it is then marked as a candidate pixel. All connected pixels among the candidate pixels are grouped into closed connected components; each closed connected component is a suspected spur region.
[0052] Mismatch frequency equals The region defined represents the area where, after perspective transformation, all non-standard viewpoint images do not match the standard viewpoint image. This condition effectively eliminates mismatches caused by randomly distributed reflective areas in multi-camera viewpoints. Because reflective areas are not located at the same position under different viewpoints, it is difficult for them to appear at the same position simultaneously under all viewpoints. Therefore, regions satisfying this condition are highly likely to be caused by fixed-position three-dimensional features such as burrs.
[0053] Overall distribution map of mismatched regions from multiple perspectives In addition to the 3D parallax of burrs creating suspected burr areas, another situation exists: if a reflective point exists at a certain location on the top surface of the titanium electrode block under a standard viewing angle, images from other viewing angles may also mismatch with the standard viewing angle after perspective transformation. This mismatch will also create suspected burr areas. Therefore, the suspected burr areas extracted through the above steps may still contain some false areas caused by reflections from the standard viewing angle. Further removal is needed by analyzing the characteristics of the suspected burr areas caused by burrs (e.g., the directional distribution of mismatched areas under different viewing angles).
[0054] S104. For each suspected burr region, in each mismatch region of each non-standard viewpoint, match the mismatch region that belongs to the same burr as the suspected burr region, and use it as the associated mismatch region under the non-standard viewpoint.
[0055] In this embodiment, in each mismatch region of each non-standard viewpoint, a mismatch region belonging to the same burr as the suspected burr region is matched and used as the associated mismatch region under the non-standard viewpoint, specifically including: For each non-standard viewpoint, calculate the overlap ratio between each mismatched region and the suspected burr region under that non-standard viewpoint, and determine the mismatched region with the highest overlap ratio as the associated mismatched region corresponding to the same burr as the suspected burr region.
[0056] For example, the previous step extracted several suspected spurious regions from the overall distribution map of mismatched regions across multiple views. Each suspected spurious region consists of pixels whose mismatch frequency equals the number of non-standard view images, representing the location where all non-standard view images, after perspective transformation, do not match the standard view image. However, this suspected spurious region is only a spatial location area and has not yet been correlated with the specific mismatched regions under each non-standard view. Furthermore, this region may still contain false spurs caused by reflections from the standard view, which need to be removed by further analyzing the characteristics of the mismatched regions under each view.
[0057] Therefore, this step requires, for each suspected burr area, to match the mismatched areas corresponding to the same burr origin as the suspected burr area within multiple mismatched areas under each non-standard viewpoint. These mismatched areas serve as the associated mismatched areas under that non-standard viewpoint. The associated mismatched areas are the basis for subsequent analysis of burr direction, calculation of angle similarity, and differentiation between burrs and reflective interference.
[0058] For each non-standard viewpoint, several unconnected mismatch regions are obtained. Each mismatch region is a connected component in the binary image, representing the area that does not match the standard viewpoint image after perspective transformation. Among these mismatch regions, some are caused by burrs (the projection area of the burrs in the corresponding viewpoint), and others are caused by reflections or other interference.
[0059] For the current suspected glitch region, for each non-standard viewpoint, traverse each mismatch region under that non-standard viewpoint and calculate the overlap ratio between the mismatch region and the current suspected glitch region. The overlap ratio is defined as: the number of pixels in the intersection of the two regions divided by the number of pixels in the suspected glitch region (or divided by the number of pixels in the union of the two regions, which can be selected according to the specific implementation).
[0060] The overlap ratio reflects the degree of spatial overlap between the mismatched region and the suspected spurious region. Since the suspected spurious region is composed of pixels whose mismatch frequency equals the number of images in all non-standard viewpoints, it represents the common intersection (or the core of the intersection) of mismatched regions under all non-standard viewpoints. Therefore, for the same spur, each mismatched region under a non-standard viewpoint should contain the suspected spurious region or highly overlap with it. A higher overlap ratio indicates a greater likelihood that the mismatched region and the suspected spurious region correspond to the same spur.
[0061] For each non-standard viewpoint, the mismatch region with the highest overlap ratio under that viewpoint is identified as the associated mismatch region corresponding to the same burr as the suspected burr region. If multiple mismatch regions have the same and highest overlap ratio with the suspected burr region under a certain viewpoint, one of them (e.g., the one with the larger area) can be selected as the associated mismatch region.
[0062] Through the matching process described above, each non-standard viewpoint yields an associated mismatch region corresponding to the suspected burr area. These associated mismatch regions are located under different non-standard viewpoints, but all correspond to the same burr root cause.
[0063] S105. Calculate the angle between the camera orientation of each non-standard viewpoint and the main direction of the associated mismatch region under that viewpoint, and select the associated mismatch region corresponding to the non-standard viewpoint with the smallest angle as the reference mismatch region of the suspected burr region.
[0064] In this embodiment, the angle between the camera orientation and the main direction of the associated mismatch region under each non-standard viewpoint is calculated. The associated mismatch region corresponding to the non-standard viewpoint with the smallest angle is selected as the reference mismatch region of the suspected burr region. Specifically, this includes: For each non-standard viewpoint, obtain the camera orientation corresponding to that non-standard viewpoint, and extract the principal direction of the associated mismatch region under that non-standard viewpoint using principal component analysis. Calculate the angle between the camera orientation of each non-standard viewpoint and the principal direction of the associated mismatch region under that non-standard viewpoint; Among all non-standard viewpoints, the associated mismatch region corresponding to the non-standard viewpoint with the smallest included angle value is selected as the benchmark mismatch region for the suspected burr region.
[0065] For example, the characteristics of the associated mismatch regions in the suspected burr area caused by the burr are closely related to the camera position from various viewpoints. The mismatch regions obtained from the same burr at various camera positions are distributed around the burr root, and the mismatch regions obtained from adjacent camera positions are also spatially adjacent. The angle between the principal direction of each mismatch region and the corresponding camera position orientation is affected by the burr tilt direction: the closer the camera position orientation is to the burr tilt direction, the smaller the angle. If there is a camera position orientation that is basically consistent with the burr tilt direction, then the angle between the direction of the mismatch region obtained from the adjacent camera positions on both sides of that camera position and the direction of the reference mismatch region is basically consistent.
[0066] The suspected burr areas caused by reflections under standard viewing angles show consistent mismatch areas when compared after perspective transformation of images taken from various camera angles (i.e., the shape, direction, and size of the mismatch areas are similar at each viewing angle), failing to satisfy the aforementioned relationship of gradual change with adjacent camera angles. Therefore, suspected burr areas caused by burrs and reflections can be distinguished.
[0067] For the suspected spurious region, principal component analysis is performed on its associated mismatched regions under various non-standard viewpoints to extract the principal direction of each associated mismatched region. Specifically, the pixel coordinates within the associated mismatched region are used as input data, and the direction vector of the first principal component is calculated through principal component analysis. This direction is the principal direction, representing the main direction of the mismatched region's extension. Simultaneously, the maximum span of the mismatched region along the principal direction is taken as the length of the mismatched region, representing the extent of its extension along the principal direction. Starting from the end closest to the suspected spurious region, a direction vector is constructed along the principal direction.
[0068] The principal direction of the mismatch region reflects the extension direction of the burr projection at that viewpoint, and is closely related to the actual tilt direction of the burr and the camera observation angle. The length of the mismatch region reflects the size of the burr projection at that viewpoint, indirectly characterizing the height or prominence of the burr.
[0069] Calculate the angle between the camera orientation and the principal direction of the associated mismatch region at each non-standard viewpoint. The smaller the angle, the closer the principal direction of the mismatch region at that viewpoint is to the camera orientation; that is, the direction of the spur projection observed at that viewpoint is basically consistent with the observation direction, and the camera orientation corresponding to the mismatch region is closest to the tilt direction of the spur. Select the associated mismatch region corresponding to the non-standard viewpoint with the smallest angle as the reference mismatch region for the suspected spur region.
[0070] S106. Pair the associated mismatched regions corresponding to the adjacent viewpoints on both sides of the non-standard viewpoint where the reference mismatched region is located in clockwise and counterclockwise order, calculate the similarity between the angle between the two associated mismatched regions in each pair and the camera orientation of their respective non-standard viewpoints, and take the average of all similarities as the burr mismatched region similarity of the suspected burr region.
[0071] In this embodiment, the associated mismatched regions corresponding to the adjacent viewpoints on both sides of the non-standard viewpoint where the reference mismatched region is located are paired in clockwise and counterclockwise order. The similarity between the angles between the two associated mismatched regions in each pair and the camera orientation of their respective non-standard viewpoints is calculated, specifically including: Determine the non-standard viewpoint where the baseline mismatch region is located, and obtain the associated mismatch regions corresponding to the adjacent non-standard viewpoints on both sides of the non-standard viewpoint. The associated mismatch regions corresponding to the adjacent non-standard viewpoints on both sides are paired up in clockwise and counterclockwise order. The first associated mismatch region in the clockwise order is paired with the first associated mismatch region in the counterclockwise order, the second associated mismatch region in the clockwise order is paired with the second associated mismatch region in the counterclockwise order, and so on. For each pair of associated mismatch regions, calculate the first angle between the principal direction of the first associated mismatch region and the camera orientation of the non-standard view where the first associated mismatch region is located, and the second angle between the principal direction of the second associated mismatch region and the camera orientation of the non-standard view where the second associated mismatch region is located. Divide the absolute value of the difference between the first and second included angles by the sum of the first and second included angles to obtain the dissimilarity. Subtract this dissimilarity from the constant 1 to obtain the similarity of the pair of associated mismatched regions.
[0072] For example, the associated mismatch regions corresponding to adjacent non-standard viewpoints on either side of the reference mismatch region are paired in clockwise and counterclockwise directions. The pairing rule is as follows: the first associated mismatch region in the clockwise direction is paired with the first associated mismatch region in the counterclockwise direction, the second in the clockwise direction is paired with the second in the counterclockwise direction, and so on. If the number of camera positions other than the standard viewpoint is even, a single mismatch region will remain, which will be discarded.
[0073] For each pair of associated mismatched regions, calculate the similarity of the angles between the two mismatched regions in the pair and their respective camera orientations. Then, average the similarities of all pairs to obtain the spur mismatched region similarity. The calculation formula is as follows:
[0074] in, Indicates the number of pairs; This indicates the first position encountered by the machine station in a clockwise direction corresponding to the reference mismatch region. The angle between the main direction of the associated mismatch region acquired from each camera position and the orientation of the camera at that position; This indicates the first mismatch region encountered by the machine position in the counterclockwise direction. The angle between the main direction of the associated mismatch region acquired from each camera position and the orientation of the camera at that position; This represents the inherent deviation, and its value is the angle between the main direction of the reference mismatch area and the orientation of its corresponding camera position.
[0075] For suspected burr areas caused by burrs, since the burr tilt direction is fixed, the orientation of the mismatch areas on both sides of the reference mismatch area should be basically symmetrical about the burr tilt direction from adjacent viewing angles. Therefore and They should be approximately equal, resulting in The smaller the area, the lower the degree of mismatch, and the higher the similarity. However, for suspected burr areas caused by reflection, the orientation of the mismatched areas does not exhibit this symmetry across different viewpoints, resulting in generally lower similarity. Therefore, The higher the value, the greater the likelihood that the suspected burr area is caused by burrs.
[0076] S107. Identify suspected burr areas with a burr mismatch region similarity greater than a preset threshold as real burr areas, and mark the identified real burr areas on the standard view image, and output a burr defect distribution map on the top surface of the titanium electrode block.
[0077] For example, the threshold determination and the identification of the actual burr region specifically include: pre-calculating the burr mismatch region similarity of multiple groups of suspected burr regions known to be caused by burrs, statistically analyzing the distribution of these similarity values, and calculating their mean and standard deviation. The determination threshold is set as the mean minus three times the standard deviation. For a suspected burr region to be determined, if its burr mismatch region similarity... If the value exceeds the threshold, the suspected burr area is determined to be caused by a burr and confirmed as a real burr area; otherwise, it is determined to be a false area caused by reflection or other interference and is removed.
[0078] Using the mean minus three standard deviations as the threshold is based on the assumption of statistical distribution. This can ensure that about 99.7% of the real spurious regions are correctly identified under a normal distribution, while effectively eliminating outlier false regions.
[0079] Then, for the identified actual burr areas, their severity index is calculated, specifically including: For any real spur region, the insignificant spur bias of each pair of associated mismatched regions is calculated based on the similarity of each pair of associated mismatched regions. Combined with the length weight of the associated mismatched regions, the severity index of the spur region is calculated.
[0080] Based on the similarity of each pair of associated mismatched regions, the insignificant spur-induced bias of each pair of associated mismatched regions is calculated, specifically including: Obtain the similarity of each pair of associated mismatched regions corresponding to the real burr region, sort all similarities from largest to smallest, take the first half of the similarities after sorting and calculate the average to obtain the average high-order similarity. Calculate the average of all similarities, and denote it as the average similarity. For each pair of associated mismatched regions, calculate the difference between the mean high-order similarity and the similarity of the pair of associated mismatched regions, take the maximum value between the difference and zero, and determine the insignificant spurious bias of the pair of associated mismatched regions as the ratio of the maximum value to the difference between the mean high-order similarity and the average similarity.
[0081] By combining the length weights of the associated mismatched regions, the severity index of the glitch region is calculated, specifically including: Obtain the lengths of the two associated mismatched regions in the principal direction for each pair of associated mismatched regions, and calculate the sum of the two lengths; Determine the reference length, where the reference length is the maximum length of all associated mismatch regions in the principal direction within the actual burr region; The ratio of the sum of the two lengths of each pair of associated mismatched regions to twice the baseline length is determined as the length weight of that pair of associated mismatched regions. Multiply the insignificant spur bias of each pair of associated mismatch regions by its length weight to obtain the weighted bias value of that pair of associated mismatch regions; The severity index of the true spurious region is obtained by summing all the weighted deviation values of the associated mismatch regions.
[0082] For confirmed real spur regions, the similarity of each pair of associated mismatched regions is used for discrimination. When the spur region contains a single spur, the similarity of each pair of mismatched regions is high and evenly distributed. When there are insignificant spurs (i.e., smaller spurs masked by significant spurs) in the spur region, the significant spur will dominate the features of the mismatched region. Only in a few camera positions will the mismatched region be affected by the other insignificant spur, causing a deviation in the calculation of the main direction of these mismatched regions, thus resulting in a lower similarity value for that group. Therefore, this situation can be identified by the distribution characteristics of the similarity of each group.
[0083] For common The spur region of the pairing mismatch region, the first The degree to which a group is affected by insignificant burrs is denoted as the insignificant burr skewness. The calculation formula is as follows:
[0084] in, Indicates the first The similarity between mismatched regions of a pair is calculated as follows: ; Indicates all The mean of the larger half of the values in the distribution is used to represent the similarity level without being affected by insignificant spikes; Indicates all The overall average (i.e., the similarity of the burr mismatch region calculated in the previous step); It represents a very small positive real number and is used to prevent the denominator from being zero.
[0085] Indicates the first The insignificant skewing caused by insignificant skewing in the mismatched region of group 1. Group similarity Downward deviation from the mean of high similarity The greater the degree, The larger the value, the greater the degree to which the features of the mismatched regions are affected by insignificant spikes. If the similarity of a group is close to or higher than the mean of the higher similarity values, then... A value of zero or close to zero indicates that the group was not affected or was minimally affected by insignificant burrs.
[0086] Determine the reference length The baseline length is the maximum length of all associated mismatched regions in the main direction within the real burr area; the associated mismatched region corresponding to this maximum length also has the largest angle between the camera position viewpoint and the main direction of the mismatched region, and the camera orientation is closest to the direction perpendicular to the burr tilt.
[0087] When the camera is tilted perpendicular to the direction of the burr, the projection of the burr in the image best reflects its true length. Therefore, the mismatch region length at this viewpoint is used as the baseline length to normalize the mismatch region length at other viewpoints.
[0088] Obtain the insignificant spur-induced bias of each group of mismatched regions in the spur region. Then, by combining the length weights of the mismatched regions in each group, the severity index of the burr region is calculated. The calculation formula is:
[0089] in, Indicates the first Insignificant skewing caused by insignificant skewing in mismatched regions; This indicates all of the burr area. The mean of the distribution; Indicates the first The sum of the lengths of the two associated mismatched regions in the pairing along their principal directions; Indicates the reference length.
[0090] Severity Index This comprehensively reflects the complexity of the burr region. The greater the similarity within the group to which the mismatched region belongs compared to other groups (i.e., the smaller the similarity, the higher the similarity within the group compared to other groups). Larger and higher The more significant the insignificant spurs, the greater their impact on the characteristics of the mismatched region, and the higher the severity index. Simultaneously, longer mismatched regions, due to their larger area, are less susceptible to interference from insignificant spurs in their principal direction; therefore, if a longer mismatched region is still significantly affected (i.e., ...), it indicates a greater impact from insignificant spurs on the characteristics of the mismatched region, and a higher severity index. (Larger), indicating that the potential insignificant glitch effect is more severe, reflected in the product of length weights, making... The value increases further. Higher. The value suggests that the burr generation mechanism at this location is more complex, and there may be multiple burrs mixed together or burrs with abnormal shapes, which need to be dealt with first.
[0091] The above calculations yield a severity index for each actual burr area. This index can be used to guide the prioritization of subsequent burr removal processes and the adjustment of process parameters: burr areas with higher severity indices should be treated first, and appropriate removal process parameters (such as grinding intensity, processing time, etc.) should be selected based on the index value.
[0092] After obtaining the severity index, each burr region is labeled on the standard view image based on the final calculated severity. The specific labeling method is as follows: Each identified real burr area is bordered using a color that contrasts sharply with the background. For example, a rectangle or outline in a bright color such as red, green, or blue can be used to ensure it is clearly visible on a standard viewing angle image. The border width can be set to 1 to 3 pixels depending on the image resolution.
[0093] Within each burr area, the area is filled according to its severity index. Areas with higher severity indices are filled with colors having lower RGB values (i.e., darker colors), while areas with lower severity indices are filled with colors having higher RGB values (i.e., lighter colors). For example, a color mapping range can be set: burr areas with the highest severity index are filled with black, burr areas with the lowest severity index are filled with light gray, and burr areas of intermediate severity are assigned corresponding grayscale or color values using linear interpolation.
[0094] Alongside the annotated image, the original, unfilled standard-view image is displayed to analyze the specific geometric shape, location distribution, and other characteristics of the burrs, guiding the subsequent development of a burr treatment plan for the top surface of the titanium electrode block. For example, a dual-window display can be used: the left window displays the annotated defect distribution map, and the right window displays the original standard-view image for convenient comparison and analysis.
[0095] The final output is a burr defect distribution map of the top surface of the titanium electrode block. This distribution map contains the following information: the spatial location and outline of each real burr area; the severity of each burr area (represented by the depth of the fill color); and the number and distribution of burr areas.
[0096] After identifying and labeling the burrs on the top surface of the titanium electrode block, flip the unidentified surfaces of the titanium electrode block to the top and repeat the above steps until burrs on all surfaces are identified. Finally, output a burr defect distribution map of each surface of the titanium electrode block, which includes the location, outline, severity, and quantity distribution information of the burr area on each surface.
[0097] The output can be used to guide subsequent burr removal processes, such as determining the movement path of the removal tool, setting removal process parameters (such as grinding force, processing time, etc.), and evaluating product quality grades.
[0098] In summary, in this embodiment of the invention, by acquiring multi-angle images of the top surface of the titanium electrode block, and utilizing the essential difference that burrs, as three-dimensional protrusions, do not satisfy the planar homography constraint, while two-dimensional interferences such as reflections do, the invention employs perspective transformation, mismatch frequency accumulation, overlap ratio matching, principal component analysis, and angle similarity calculation to accurately distinguish between burrs and reflection interference, effectively identifying the real burr area. Furthermore, by analyzing the distribution deviation of each pairing similarity and the length weight of the mismatched area, the invention calculates the insignificant burr bias degree and severity index, achieving a quantitative assessment of the severity of burr defects. Finally, a burr defect distribution map is output through color-filled annotations. Compared to traditional three-dimensional scanning methods, this invention has lower computational load, higher detection efficiency, and lower equipment cost. Compared to traditional two-dimensional image methods, this invention has stronger resistance to reflections and texture interference, higher detection accuracy, and can provide quantitative indicators of severity, providing precise guidance for subsequent burr removal processes.
[0099] This invention also proposes a machine vision-based system for identifying burr defects in titanium electrode blocks. Please refer to [link to relevant documentation]. Figure 2 The diagram shows a structural diagram of a machine vision-based titanium electrode block burr defect identification system provided in an embodiment of the present invention. The system includes: a data acquisition module 101, a data processing module 102, and a defect detection module 103.
[0100] The data acquisition module 101 is used to acquire a standard view image and at least three non-standard view images of the top surface of the titanium electrode block, wherein each non-standard view image corresponds to a non-standard view. The data processing module 102 is used to perform perspective transformation on each non-standard view image based on the standard view image to obtain the transformed image, and to obtain the mismatch area between each transformed image and the standard view image. The binary images of each mismatch region are superimposed to obtain a mismatch frequency distribution map. The closed connected region formed by the pixels whose mismatch frequency is equal to the number of non-standard viewpoint images is extracted as the suspected spur region. For each suspected burr region, in each mismatch region of each non-standard view, match the mismatch region that belongs to the same burr as the suspected burr region, and use it as the associated mismatch region under that non-standard view. Calculate the angle between the camera orientation of each non-standard viewpoint and the main direction of the associated mismatch region under that viewpoint, and select the associated mismatch region corresponding to the non-standard viewpoint with the smallest angle as the reference mismatch region of the suspected burr region; The associated mismatched regions corresponding to the adjacent viewpoints on both sides of the non-standard viewpoint where the baseline mismatched region is located are paired in clockwise and counterclockwise order. The similarity between the angle between the two associated mismatched regions in each pair and the camera orientation of their respective non-standard viewpoints is calculated, and the average of all similarities is taken as the spur mismatched region similarity of the suspected spur region. The defect detection module 103 is used to identify suspected burr areas with a burr mismatch area similarity greater than a preset threshold as real burr areas, and to mark the identified real burr areas on a standard view image, and output a burr defect distribution map on the top surface of the titanium electrode block.
[0101] It should be noted that the system provided in the above embodiments is only an example of the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the computer device can be divided into different functional modules to complete all or part of the functions described above. In addition, the machine vision-based titanium electrode block burr defect recognition system and the machine vision-based titanium electrode block burr defect recognition method provided in the above embodiments belong to the same concept, and their specific implementation process is detailed in the method embodiments, which will not be repeated here.
[0102] It should be noted that the order of the above embodiments of the present invention is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. The processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0103] The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.
[0104] 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 within the protection scope of the present invention.
Claims
1. A machine vision-based method for identifying burr defects in titanium electrode blocks, characterized in that, include: Acquire a standard view image and at least three non-standard view images of the top surface of the titanium electrode block, wherein each non-standard view image corresponds to a non-standard view. Using the standard viewpoint image as a reference, perspective transformation is performed on each non-standard viewpoint image to obtain the transformed image, and the mismatch area between each transformed image and the standard viewpoint image is obtained. The binary images of each mismatch region are superimposed to obtain a mismatch frequency distribution map. The closed connected region formed by the pixels whose mismatch frequency is equal to the number of non-standard viewpoint images is extracted as the suspected spur region. For each suspected burr region, in each mismatch region of each non-standard view, match the mismatch region that belongs to the same burr as the suspected burr region, and use it as the associated mismatch region under that non-standard view. Calculate the angle between the camera orientation of each non-standard viewpoint and the main direction of the associated mismatch region under that viewpoint, and select the associated mismatch region corresponding to the non-standard viewpoint with the smallest angle as the reference mismatch region of the suspected burr region. The associated mismatched regions corresponding to the adjacent viewpoints on both sides of the non-standard viewpoint where the baseline mismatched region is located are paired in clockwise and counterclockwise order. The similarity between the angle between the two associated mismatched regions in each pair and the camera orientation of their respective non-standard viewpoints is calculated, and the average of all similarities is taken as the spur mismatched region similarity of the suspected spur region. Suspected burr regions with a similarity to the burr mismatch region greater than a preset threshold are identified as real burr regions. The identified real burr regions are then marked on the standard view image, and a burr defect distribution map of the top surface of the titanium electrode block is output.
2. The method for identifying burr defects in titanium electrode blocks based on machine vision according to claim 1, characterized in that, The process involves using a standard viewpoint image as a reference, performing perspective transformation on each non-standard viewpoint image to obtain the transformed image, and then identifying the mismatch region between each transformed image and the standard viewpoint image. Specifically, this includes: The four corner points of the top surface of the titanium electrode block are extracted from each non-standard viewpoint image. Based on the matching relationship between the four corner points and the corresponding corner points in the standard viewpoint image, the perspective transformation matrix from each non-standard viewpoint image to the standard viewpoint image is calculated by the direct linear transformation algorithm. The corresponding non-standard viewpoint image is projected onto the standard viewpoint image using a perspective transformation matrix to obtain the transformed image. Calculate the normalized cross-correlation coefficients within the neighborhood window of corresponding pixels in the transformed image and the standard viewpoint image; The mismatch degree is calculated based on the normalized cross-correlation coefficient, and the region with a mismatch degree greater than the threshold is identified as the mismatch region. Among them, the mismatch degree is negatively correlated with the matching degree of the two images in each neighborhood window. The threshold is the mean and standard deviation of the mismatch degree based on the pre-labeled spur regions, and the value is obtained by subtracting twice the standard deviation from the mean.
3. The method for identifying burr defects in titanium electrode blocks based on machine vision according to claim 1, characterized in that, The process involves overlaying the binary images of each mismatched region to obtain a mismatch frequency distribution map, and extracting the closed connected components formed by pixels whose mismatch frequency equals the number of non-standard viewpoint images as suspected spur regions. Specifically, this includes: Each mismatched region corresponding to each non-standard viewpoint image is converted into a binary image. In the binary image, the pixel value inside each mismatched region is 1, and the pixel value of the other regions is 0. By accumulating the binary images corresponding to all mismatched regions pixel by pixel in the same spatial coordinate system, a mismatch frequency distribution map is obtained. The value of each pixel in the mismatch frequency distribution map represents the number of times that pixel is marked in different mismatched regions. Extract all pixels in the mismatch frequency distribution map whose pixel value is equal to the number of non-standard viewpoint images. Form closed connected regions from the extracted pixels and treat each closed connected region as a suspected spur region.
4. The method for identifying burr defects in titanium electrode blocks based on machine vision according to claim 1, characterized in that, In each mismatch region of each non-standard viewpoint, the mismatch region belonging to the same burr as the suspected burr region is matched and used as the associated mismatch region under that non-standard viewpoint, specifically including: For each non-standard viewpoint, calculate the overlap ratio between each mismatched region and the suspected burr region under that non-standard viewpoint, and determine the mismatched region with the highest overlap ratio as the associated mismatched region corresponding to the same burr as the suspected burr region.
5. The method for identifying burr defects in titanium electrode blocks based on machine vision according to claim 1, characterized in that, The calculation of the angle between the camera orientation and the principal direction of the associated mismatch region under each non-standard viewpoint, and the selection of the associated mismatch region corresponding to the non-standard viewpoint with the smallest angle as the reference mismatch region for the suspected burr region, specifically includes: For each non-standard viewpoint, obtain the camera orientation corresponding to that non-standard viewpoint, and extract the principal direction of the associated mismatch region under that non-standard viewpoint using principal component analysis. Calculate the angle between the camera orientation of each non-standard viewpoint and the principal direction of the associated mismatch region under that non-standard viewpoint; Among all non-standard viewpoints, the associated mismatch region corresponding to the non-standard viewpoint with the smallest included angle value is selected as the benchmark mismatch region for the suspected burr region.
6. The method for identifying burr defects in titanium electrode blocks based on machine vision according to claim 1, characterized in that, The process involves pairing the associated mismatched regions corresponding to the adjacent viewpoints on either side of the non-standard viewpoint where the baseline mismatched region is located in clockwise and counterclockwise order, and calculating the similarity between the angles between the two associated mismatched regions in each pair and the camera orientation of their respective non-standard viewpoints. Specifically, this includes: Determine the non-standard viewpoint where the baseline mismatch region is located, and obtain the associated mismatch regions corresponding to the adjacent non-standard viewpoints on both sides of the non-standard viewpoint. The associated mismatch regions corresponding to the adjacent non-standard viewpoints on both sides are paired up in clockwise and counterclockwise order. The first associated mismatch region in the clockwise order is paired with the first associated mismatch region in the counterclockwise order, the second associated mismatch region in the clockwise order is paired with the second associated mismatch region in the counterclockwise order, and so on. For each pair of associated mismatch regions, calculate the first angle between the principal direction of the first associated mismatch region and the camera orientation of the non-standard view where the first associated mismatch region is located, and the second angle between the principal direction of the second associated mismatch region and the camera orientation of the non-standard view where the second associated mismatch region is located. Divide the absolute value of the difference between the first and second included angles by the sum of the first and second included angles to obtain the dissimilarity. Subtract this dissimilarity from the constant 1 to obtain the similarity of the pair of associated mismatched regions.
7. The method for identifying burr defects in titanium electrode blocks based on machine vision according to claim 6, characterized in that, The method further includes: For any real spur region, the insignificant spur bias of each pair of associated mismatched regions is calculated based on the similarity of each pair of associated mismatched regions. Combined with the length weight of the associated mismatched regions, the severity index of the spur region is calculated.
8. The method for identifying burr defects in titanium electrode blocks based on machine vision according to claim 7, characterized in that, For any real burr region, the insignificant burr bias of each pair of associated mismatched regions is calculated based on the similarity of each pair of associated mismatched regions. Specifically, this includes: Obtain the similarity of each pair of associated mismatched regions corresponding to the real burr region, sort all similarities from largest to smallest, take the first half of the similarities after sorting and calculate the average to obtain the average high-order similarity. Calculate the average of all similarities, and denote it as the average similarity. For each pair of associated mismatched regions, calculate the difference between the mean high-order similarity and the similarity of the pair of associated mismatched regions, take the maximum value between the difference and zero, and determine the insignificant spurious bias of the pair of associated mismatched regions as the ratio of the maximum value to the difference between the mean high-order similarity and the average similarity.
9. The method for identifying burr defects in titanium electrode blocks based on machine vision according to claim 7, characterized in that, The calculation of the severity index of the burr region by combining the length weight of the associated mismatch region specifically includes: Obtain the lengths of the two associated mismatched regions in the principal direction for each pair of associated mismatched regions, and calculate the sum of the two lengths; Determine the reference length, where the reference length is the maximum length of all associated mismatch regions in the principal direction within the actual burr region; The ratio of the sum of the two lengths of each pair of associated mismatched regions to twice the baseline length is determined as the length weight of that pair of associated mismatched regions. Multiply the insignificant spur bias of each pair of associated mismatch regions by its length weight to obtain the weighted bias value of that pair of associated mismatch regions; The severity index of the true spurious region is obtained by summing all the weighted deviation values of the associated mismatch regions.
10. A machine vision-based system for identifying burr defects in titanium electrode blocks, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the computer program is executed by the processor, it implements the steps of the machine vision-based titanium electrode block burr defect identification method as described in any one of claims 1-9.