Movatterモバイル変換


[0]ホーム

URL:


CN118096796A - Visual inspection method for appearance of radial forging titanium rod based on machine learning - Google Patents

Visual inspection method for appearance of radial forging titanium rod based on machine learning
Download PDF

Info

Publication number
CN118096796A
CN118096796ACN202410495545.8ACN202410495545ACN118096796ACN 118096796 ACN118096796 ACN 118096796ACN 202410495545 ACN202410495545 ACN 202410495545ACN 118096796 ACN118096796 ACN 118096796A
Authority
CN
China
Prior art keywords
pixel
illumination
texture
point
initial seed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202410495545.8A
Other languages
Chinese (zh)
Other versions
CN118096796B (en
Inventor
董洁
王勇锦
李宝霞
王勇根
余洁
米刚
梁琦
王虹利
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Baoji Top Titanium Industry Co ltd
Original Assignee
Baoji Top Titanium Industry Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Baoji Top Titanium Industry Co ltdfiledCriticalBaoji Top Titanium Industry Co ltd
Priority to CN202410495545.8ApriorityCriticalpatent/CN118096796B/en
Publication of CN118096796ApublicationCriticalpatent/CN118096796A/en
Application grantedgrantedCritical
Publication of CN118096796BpublicationCriticalpatent/CN118096796B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

The invention relates to the technical field of image processing, in particular to a visual detection method for the appearance of a radial forging titanium rod based on machine learning, which comprises the following steps: collecting titanium rod gray images of a plurality of titanium rods; obtaining the extension degree of the texture direction of each titanium rod gray level image according to the distribution condition of the corresponding texture extension direction of each pixel point in each titanium rod gray level image; obtaining illumination comprehensive distance measurement of any two pixel points according to the difference of the illumination intensity influence of different pixel points in the direction corresponding to the extension degree of the texture direction and the distribution distance of the corresponding positions; according to the illumination comprehensive distance measurement of any two pixel points, adaptively adjusting the side length of a search range and performing iterative clustering to obtain a plurality of titanium rod detection super-pixel blocks; and detecting each titanium rod detection super pixel block. The invention improves the accuracy of the segmentation result and the detection efficiency of the titanium rod.

Description

Visual inspection method for appearance of radial forging titanium rod based on machine learning
Technical Field
The invention relates to the technical field of image processing, in particular to a visual detection method for the appearance of a radial forging titanium rod based on machine learning.
Background
Appearance defects on the surface of the titanium rod can be detected through a machine learning technology, so that the cost for detecting the quality of the titanium rod is reduced, and the production efficiency of the titanium rod is improved; therefore, image enhancement processing is required for the image. The existing method generally utilizes a SLIC (SIMPLE LINEAR ITERATIVE Clustering) simple linear iterative clustering algorithm to segment the titanium rod image so as to detect the defect area of the titanium rod; however, the information content representation among different pixel points can be affected due to different illumination intensities received in different areas on the surface of the titanium rod; the traditional SLIC simple linear iterative clustering algorithm uses the space geometric distance between different pixel points as a distance measure to divide, and has no influence on different pixel points due to combination of illumination intensity, so that the division result is inaccurate, and the detection efficiency of the titanium rod is reduced.
Disclosure of Invention
The invention provides a visual detection method for the appearance of a radial forging titanium rod based on machine learning, which aims to solve the existing problems: the distance measurement of the traditional SLIC simple linear iterative clustering algorithm is not combined with the influence of illumination intensity on pixel points, so that the segmented result is inaccurate, and the detection efficiency of the titanium rod is reduced.
The visual detection method for the appearance of the radial forging titanium rod based on machine learning adopts the following technical scheme:
The method comprises the following steps:
Collecting a titanium rod gray image of a titanium rod;
Obtaining the extension degree of the texture direction of each titanium rod gray level image according to the gradient information distribution condition of the corresponding texture extension direction of each pixel point in each titanium rod gray level image; obtaining illumination comprehensive distance measurement of any two pixel points according to the difference of the illumination intensity influence of different pixel points in the direction corresponding to the extension degree of the texture direction and the distribution distance of the corresponding positions;
According to the illumination comprehensive distance measurement of any two pixel points, adaptively adjusting the side length of a search range and performing iterative clustering to obtain a plurality of titanium rod detection super-pixel blocks;
And detecting each titanium rod detection super pixel block.
Preferably, the method for obtaining the extension degree of the texture direction of each titanium rod gray image according to the distribution condition of the corresponding texture extension direction of each pixel point in each titanium rod gray image comprises the following specific steps:
Obtaining an initial seed point of an SLIC simple linear iterative clustering algorithm on a titanium rod gray image and a texture trend analysis window taking the initial seed point as a center; each initial seed point corresponds to a plurality of texture trend analysis windows under different angles;
Obtaining singular contribution coefficients of each texture trend analysis window of the initial seed point according to the texture change direction of each pixel point in each texture trend analysis window of the initial seed point;
Obtaining a texture direction value of each initial seed point according to the singular contribution coefficient of each texture trend analysis window;
and taking the inverse cosine value of the mean value of the texture direction values of all the initial seed points as the texture direction extension degree of the titanium bar gray level image.
Preferably, the singular contribution coefficient of each texture trend analysis window of the initial seed point is obtained according to the texture change direction of each pixel point in each texture trend analysis window of the initial seed point, which comprises the following specific steps:
A texture trend analysis window for any one of the initial seed points; constructing a gray matrix according to the arrangement mode of gray values of each pixel point of the texture trend analysis window, and carrying out SVD singular value decomposition on the gray matrix to obtain a left singular matrix and a diagonal matrix; the sequence after all singular values in the diagonal matrix are arranged in a descending order is marked as a texture direction singular value sequence; marking any singular value in the texture direction singular value sequence as a target singular value, marking the accumulated sum of all singular values before the target singular value as a first accumulated sum, marking the accumulated sum of all singular values in the texture direction singular value sequence as a second accumulated sum, marking the ratio of the first accumulated sum to the second accumulated sum as the singular contribution value of the target singular value, and obtaining the singular contribution value of all the singular values;
presetting a singular contribution value thresholdThe singular contribution value is larger than/>Marking singular values as marked singular values, marking standard deviations of all singular values before marking the singular values as singular contribution factors of texture trend analysis windows; obtaining singular contribution factors of all texture trend analysis windows of the initial seed points, carrying out linear normalization on all the singular contribution factors, and marking each singular contribution factor after normalization as a singular contribution coefficient.
Preferably, the obtaining the texture direction value of each initial seed point according to the singular contribution coefficient of each texture trend analysis window of the initial seed point comprises the following specific steps:
For any texture trend analysis window of any initial seed point, marking the ratio of the singular contribution coefficient of the texture trend analysis window to the numerical maximum element in the left singular matrix of the texture trend analysis window as the negative contribution value of the texture direction of the texture trend analysis window; and acquiring negative contribution values of all textures of the initial seed point towards the texture direction of the analysis window, and taking the minimum negative contribution value of the texture direction as the texture direction value of the initial seed point.
Preferably, the method for obtaining the illumination comprehensive distance measurement of any two pixel points according to the difference of the illumination intensity influence of different pixel points in the corresponding direction of the extension degree of the texture direction and the distribution distance of the corresponding position includes the following specific steps:
For any titanium rod gray level image, acquiring gradient amplitude and gradient degree of each pixel point in the titanium rod gray level image by using a sobel operator, and sequentially marking the type of the gray level value, the type of the gradient amplitude and the type of data of the gradient degree as a light factor dimension type;
for the first gray level image of the titanium rodIndividual pixel dot, th/>Individual pixel dot and the/>The dimension category of the illumination factors according to the/>Pixel dot and/>The pixel point is at the/>Constructing a/>, based on difference conditions of corresponding values in the dimension types of the illumination factorsPixel dot and/>The pixel point is at the/>Dimension vectors in the individual illumination factor dimension categories;
According to the firstPixel dot and/>The pixel point is at the/>The dimension vector in the dimension category of each illumination factor and the unit vector in the extension degree of the texture direction are obtained to obtain the/>Pixel dot and/>The pixel point is at the/>Illumination dimension weights in individual illumination factor dimension categories;
Any two pixels are arranged at the firstAbsolute values of differences of corresponding data in the dimension types of the illumination factors are recorded as the first/>, the second pixel points are recorded as the absolute values of differences of the corresponding data in the dimension types of the illumination factorsThe illumination factor data difference values in the individual illumination factor dimension types; according to the overall variation amplitude of the difference value of the illumination factor data of all arbitrary two pixel points in all illumination factor dimension types, and the/>Pixel dot and/>The illumination dimension weight of each pixel point in each illumination factor dimension category is obtained to obtain the/>The pixel point and the firstThe illumination comprehensive distance measurement of each pixel point comprises the following specific methods:
In the method, in the process of the invention,Represents the/>Pixel dot and/>Light illumination comprehensive distance measurement of each pixel point; /(I)Representing the number of all illumination factor dimension categories; /(I)Represents the/>Pixel dot and/>The pixel point is at the/>Illumination dimension weights in individual illumination factor dimension categories; /(I)Indicating that any two pixel points are at the first/>Standard deviation of the difference values of all the illumination factor data in the individual illumination factor dimension types; /(I)An exponential function based on a natural constant is represented.
Preferably, the method according to the first aspectPixel dot and/>The pixel point is at the/>Constructing a/>, based on difference conditions of corresponding values in the dimension types of the illumination factorsPixel dot and/>The pixel point is at the/>The specific method for dimension vectors in the dimension types of the illumination factors comprises the following steps:
Will be the firstPixel to the/>The direction of each pixel point is taken as the direction of the vector, and the/>Pixel dot and/>The pixel point is at the/>The absolute value of the difference value between the corresponding values in the dimension types of the illumination factors is used as the size of the vector, the vector is constructed according to the direction of the vector and the size of the vector, and is used as the/>Pixel dot and/>The pixel point is at the/>A dimension vector in a dimension category of the individual illumination factors.
Preferably, the method according to the first aspectPixel dot and/>The pixel point is at the/>The dimension vector in the dimension category of each illumination factor and the unit vector in the extension degree of the texture direction are obtained to obtain the/>Pixel dot and/>The pixel point is at the/>The illumination dimension weight in each illumination factor dimension category comprises the following specific methods:
In the method, in the process of the invention,Represents the/>Pixel dot and/>The pixel point is at the/>Illumination dimension weights in individual illumination factor dimension categories; /(I)Represents the/>Pixel dot and/>The pixel point is at the/>Dimension vectors in the individual illumination factor dimension categories; /(I)A unit vector representing the degree of extension of the texture direction; /(I)Represents the/>Pixel dot and/>Euclidean distance of individual pixels; /(I)Representing the binary norm of the vector.
Preferably, the method for obtaining the titanium rod detection super-pixel block by adaptively adjusting the side length of the search range and performing iterative clustering according to the illumination comprehensive distance measurement of any two pixel points comprises the following specific steps:
Obtaining a range distance weight coefficient of each pixel point in an initial reference area of the initial seed point according to the distance difference between the different pixel points in the initial reference area of the initial seed point and the pixel points of the initial seed point contrast distribution;
obtaining the self-adaptive searching range side length of the initial seed point according to the range distance weight coefficients of all pixel points in the initial reference area of the initial seed point;
and clustering iteration is carried out through an SLIC simple linear iterative clustering algorithm according to the self-adaptive searching range side length of the initial seed point, so that the titanium rod detection super-pixel block of the initial seed point is obtained.
Preferably, the obtaining the range distance weight coefficient of each pixel point in the initial reference area of the initial seed point according to the distance difference between the pixels points of different pixels points in the initial reference area of the initial seed point with respect to the initial seed point contrast distribution includes the specific method that:
Presetting a neighborhood window side lengthFor any initial seed point in any titanium rod gray level image, taking the initial seed point as the center, and the window size is/>The window area of (2) is marked as an initial reference area of an initial seed point;
Marking any pixel point in an initial reference area of the initial seed point as a target pixel point, and marking the target pixel point as a straight line in a direction corresponding to the extension degree of the texture direction of the titanium bar gray image and a target straight line; making a straight line perpendicular to the target straight line by passing through the initial seed point, and marking the straight line as a perpendicular comparison straight line; marking the pixel points of which the target pixel points are axisymmetric relative to the vertical comparison straight line as neighborhood comparison pixel points of the target pixel points; taking Euclidean distance between the neighborhood reference pixel point and the target pixel point as a range reference distance of the target pixel point; obtaining range reference distances of all pixel points in an initial reference area of an initial seed point, carrying out linear normalization on all range reference distances, and recording each normalized range reference distance as a range distance weight coefficient.
Preferably, the obtaining the self-adaptive searching range side length of the initial seed point according to the range distance weight coefficient of all pixel points in the initial reference area of the initial seed point comprises the following specific steps:
In the method, in the process of the invention,Representing the adaptive search range side length of the initial seed point; /(I)Representing the number of all pixel points in an initial reference area of an initial seed point; /(I)First/>, within an initial reference region representing an initial seed pointA range distance weight coefficient of each pixel point; /(I)Indicating the preset super-parameter multiple.
The technical scheme of the invention has the beneficial effects that: according to the invention, the distribution condition of each pixel point in the corresponding texture extending direction and the difference of the illumination intensity influence of different pixel points in the corresponding direction are analyzed to obtain the illumination comprehensive distance measurement of any two pixel points, so that the search frame range is self-adaptively adjusted and iterative clustering is performed to obtain the titanium rod detection super-pixel block of each initial seed point; firstly, obtaining the extension degree of the texture direction of each titanium rod gray image according to the distribution condition of the corresponding texture extension direction of each pixel point in each titanium rod gray image, wherein the extension degree of the texture direction is used for describing the whole extension direction of the texture of the titanium rod surface in the titanium rod gray image, so that the degree of influence of illumination intensity among different pixel points is more obvious; obtaining illumination comprehensive distance measurement of any two pixels according to the difference of illumination intensity influence of different pixels in the corresponding direction of the extension degree of the texture direction and the distribution distance of corresponding positions, wherein the illumination comprehensive distance measurement is used for describing the distance measurement between different pixels under the influence of the combined illumination intensity, and the accuracy of effective information expression between the different pixels is improved; finally, according to the illumination comprehensive distance measurement of any two pixel points, adaptively adjusting the search range side length and performing iterative clustering to obtain a titanium rod detection super pixel block of each initial seed point, wherein the adaptive adjustment search range side length is used for describing and adjusting the search range side length of a traditional SLIC simple linear iterative clustering algorithm when the seed points are subjected to iterative clustering, the pixel points which actually represent similar information on the surface of the titanium rod are better divided into the same super pixel block, and the possibility that the pixel points containing effective information are divided by errors is reduced; the invention improves the accuracy of the segmentation result and the detection efficiency of the titanium rod.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of steps of a visual inspection method for the appearance of a radial forged titanium rod based on machine learning;
FIG. 2 is a block partitioning diagram of a super pixel processed by a conventional SLIC algorithm according to the present invention;
FIG. 3 is a schematic diagram of a super pixel block segmentation mask processed by the conventional SLIC algorithm of the present invention;
FIG. 4 is a block segmentation schematic diagram of a super pixel of the improved SLIC algorithm post-processing of the present invention;
FIG. 5 is a schematic diagram of a super pixel block segmentation mask for improved SLIC algorithm post-processing in accordance with the present invention.
Detailed Description
In order to further describe the technical means and effects adopted by the invention to achieve the preset aim, the following detailed description is given below of the visual inspection method for the appearance of the radial forging titanium rod based on machine learning according to the invention, which is provided by combining the accompanying drawings and the preferred embodiment. In the following description, different "one embodiment" or "another embodiment" means that the embodiments are not necessarily the same. Furthermore, the particular features, structures, or characteristics of one or more embodiments may be combined in any suitable manner.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
The following specifically describes a specific scheme of the visual inspection method for the appearance of the radial forging titanium rod based on machine learning.
Referring to fig. 1, a flowchart of the steps of a visual inspection method for appearance of a machine-learning-based radial forged titanium rod according to an embodiment of the present invention is shown, the method includes the steps of:
step S001: and collecting a titanium rod gray image of the titanium rod.
It should be noted that, in the existing method, a SLIC (SIMPLE LINEAR ITERATIVE Clustering) simple linear iterative clustering algorithm is generally used to segment the titanium rod image, so as to detect the defect area of the titanium rod; however, the information content representation among different pixel points can be affected due to different illumination intensities received in different areas on the surface of the titanium rod; the traditional SLIC simple linear iterative clustering algorithm uses the space geometric distance between different pixel points as a distance measure to divide, and has no influence on different pixel points due to combination of illumination intensity, so that the division result is inaccurate, and the detection efficiency of the titanium rod is reduced.
Specifically, firstly, a gray level image of a titanium rod needs to be acquired, and the specific process is as follows: shooting a plurality of titanium rod surface images by using an industrial camera; and carrying out graying treatment on the surface image of each titanium rod to obtain a plurality of titanium rod gray images. The graying process is a known technique, and the description of this embodiment is omitted.
So far, all titanium rod gray images are obtained through the method.
Step S002: obtaining the extension degree of the texture direction of each titanium rod gray level image according to the gradient information distribution condition of the corresponding texture extension direction of each pixel point in each titanium rod gray level image; and obtaining the illumination comprehensive distance measurement of any two pixel points according to the difference of the illumination intensity influence of different pixel points in the direction corresponding to the extension degree of the texture direction and the distribution distance of the corresponding positions.
It should be noted that, in the actual monitoring process, the surface of the titanium rod is not completely smooth and flat, so that under the influence of illumination, certain differences occur in illumination intensity presented by different titanium rod surface areas, so that different differences can also occur in average gray scale sizes corresponding to different titanium rod gray scale images; when the traditional SLIC simple linear iterative clustering algorithm is used for segmentation, the distance measurement in the algorithm only considers the space position distance between two pixel points, and does not consider the difference of information represented by illumination intensity between different pixel points; the distance measure can be adaptively adjusted by analyzing the difference of the illumination intensities between different pixel points.
It should be further noted that the actual edge texture of the titanium rod surface is in a more pronounced extended form along a certain direction, and in a relatively blurred extended form in other directions; the different texture distribution on the surface of the titanium rod can cause different illumination intensities reflected by corresponding areas, so that the texture direction extension degree of each titanium rod gray level image can be obtained by analyzing the distribution condition of corresponding texture extension directions on pixel points, and then the illumination comprehensive distance measurement of any two pixel points can be obtained according to the difference of the illumination intensities of different pixel points in the corresponding directions of the texture direction extension degree and the distribution distance of corresponding positions, so as to realize the self-adaptive adjustment of the distance measurement.
Preferably, in one embodiment of the present invention, the method for obtaining the extension degree of the texture direction of each titanium bar gray level image according to the distribution condition of the corresponding texture extension direction on the pixel point includes the following specific steps:
Presetting a seed point numberWherein the present embodiment is described as/>To describe the example, the present embodiment is not particularly limited, wherein/>Depending on the particular implementation; taking any titanium rod gray level image as an example, randomly selecting/>, and carrying out the methodEach pixel point is used as an initial seed point; presetting a window size/>One degree of rotation/>Wherein the present embodiment is described as/>To describe the example, the present embodiment is not particularly limited, wherein/>Depending on the particular implementation; taking any initial seed point as an example, taking the initial seed point as a center, and taking the window size as/>The window areas of (2) are rotated in a clockwise direction in turn/>And (3) rotating for one circle, acquiring a window area of the initial seed point under each rotation, and marking the window area of the initial seed point under each rotation as a texture trend analysis window of the initial seed point. Each initial seed point corresponds to a plurality of texture trend analysis windows, and each texture trend analysis window comprises a plurality of pixel points; in addition, the process of obtaining the initial seed point is a well-known content of the SLIC simple linear iterative clustering algorithm, and this embodiment will not be described in detail.
Specifically, in the process of obtaining the texture trend analysis window of the initial seed point, if the number of pixels actually existing around the initial seed point does not satisfy the preset valueAnd obtaining a texture trend analysis window of the initial seed point based on the number of pixel points actually existing around the initial seed point.
Further, taking any texture trend analysis window of the initial seed point as an example, constructing a gray matrix according to the arrangement mode of gray values of each pixel point of the texture trend analysis window, and performing SVD singular value decomposition on the gray matrix to obtain a left singular matrix and a diagonal matrix; the sequence after all singular values in the diagonal matrix are arranged in a descending order is marked as a texture direction singular value sequence; taking any singular value in the texture direction singular value sequence as an example, marking the accumulation sum of all singular values before the singular value as a first accumulation sum, marking the accumulation sum of all singular values in the texture direction singular value sequence as a second accumulation sum, marking the ratio of the first accumulation sum to the second accumulation sum as the singular contribution value of the singular value, and obtaining the singular contribution value of all the singular values. Presetting a singular contribution value thresholdWherein the present embodiment is described as/>To describe the example, the present embodiment is not particularly limited, wherein/>Depending on the particular implementation; the singular contribution value is greater than/>Marking singular values as marked singular values, marking standard deviations of all singular values before marking the singular values as singular contribution factors of the texture trend analysis window; obtaining singular contribution factors of all texture trend analysis windows of the initial seed points, carrying out linear normalization on all the singular contribution factors, and marking each singular contribution factor after normalization as a singular contribution coefficient. Each texture trend analysis window corresponds to one gray matrix, each gray matrix corresponds to one texture direction singular value sequence, and the arrangement mode of gray values of pixel points in the corresponding gray matrix is consistent with that of each texture trend analysis window; the diagonal matrix comprises a plurality of singular values; in addition, the process of obtaining the left singular matrix, the diagonal matrix and the singular values is a well-known content of SVD (Singular Value Decomposition) singular value decomposition algorithm, and this embodiment will not be described in detail.
Further, taking any texture trend analysis window of the initial seed point as an example, and marking the ratio of the singular contribution coefficient of the texture trend analysis window to the numerical maximum element in the left singular matrix of the texture trend analysis window as a negative contribution value of the texture direction of the texture trend analysis window; acquiring negative contribution values of all textures of the initial seed point towards the texture direction of the analysis window, and taking the minimum negative contribution value of the texture direction as the texture direction value of the initial seed point; and taking the inverse cosine value of the mean value of the texture direction values of all the initial seed points as the texture direction extension degree of the titanium bar gray level image.
Preferably, in an embodiment of the present invention, according to differences of influence of illumination intensities of different pixel points in directions corresponding to extension degrees of a texture direction and distribution distances of corresponding positions, an illumination comprehensive distance metric of any two pixel points is obtained, including the specific method that:
Acquiring gradient amplitude and gradient degree of each pixel point in the titanium bar gray image by using a sobel operator, and sequentially marking the type of the gray value, the type of the gradient amplitude and the type of data of the gradient degree as a light factor dimension type; the first gray level image of the titanium rodIndividual pixel dot, th/>Individual pixel dot and the/>For example, the dimension category of each illumination factor will be the/>Pixel to the/>The direction of each pixel point is taken as the direction of the vector, and the/>Pixel dot and/>The pixel point is at the/>The absolute value of the difference value between the corresponding values in the dimension types of the illumination factors is used as the size of the vector, the vector is constructed according to the direction of the vector and the size of the vector, and is used as the/>Pixel dot and/>The pixel point is at the/>A dimension vector in a dimension category of the individual illumination factors. Wherein each pixel point corresponds to a numerical value in each dimension type; in addition, the process of obtaining the gradient amplitude and the gradient degree is a well-known content of the sobel operator algorithm, and the embodiment is not repeated.
Further, according to the firstPixel dot and/>The pixel point is at the/>The dimension vector in the dimension category of each illumination factor and the unit vector in the extension degree of the texture direction are obtained to obtain the/>Pixel dot and/>The pixel point is at the/>Illumination dimension weights in individual illumination factor dimension categories. As an example, the/>, can be calculated by the following formulaThe pixel point and the firstThe pixel point is at the/>Illumination dimension weights in the individual illumination factor dimension categories:
In the method, in the process of the invention,Represents the/>Pixel dot and/>The pixel point is at the/>Illumination dimension weights in individual illumination factor dimension categories; /(I)Represents the/>Pixel dot and/>The pixel point is at the/>Dimension vectors in the individual illumination factor dimension categories; /(I)A unit vector representing the degree of extension of the texture direction; /(I)Represents the/>Pixel dot and/>Euclidean distance of individual pixels; /(I)Representing the binary norm of the vector. Acquisition of the/>Pixel dot and/>Illumination dimension weights of the individual pixels in each illumination factor dimension category. The obtaining of the euclidean distance is a known technique, and this embodiment is not described in detail.
The method is characterized in that the influence of each illumination factor dimension type on the distance measurement, namely the illumination dimension weight, is quantified through the numerical variation difference and the distribution distance of any two pixel points under the same illumination factor dimension type; wherein if the first isPixel dot and/>The pixel point is at the/>The larger the illumination dimension weight in each illumination factor dimension category, the description of the/>Pixel dot and/>The pixel point is at the/>The closer the relation between the numerical value in each illumination factor dimension type and the illumination intensity of the surface of the titanium rod is, the reflecting the/>Pixel dot and/>The pixel point is at the/>The more the dimension type of each illumination factor can represent the illumination intensity of the surface of the titanium rod.
Further, in the acquisition of the firstPixel dot and/>The pixel point is at the/>When the dimension vector in the dimension category of the illumination factors is the/>Pixel to the/>Direction of individual pixel points, and/>Pixel to the/>Of the two directions of the individual pixel points, the first/>Pixel dot and/>The pixel point is at the/>The illumination dimension weights in the illumination factor dimension types are consistent with the corresponding values acquired through each direction, so that one direction can be selected randomly from the two directions.
Further, any two pixels are arranged at the first pixel pointAbsolute values of differences of corresponding data in the dimension types of the illumination factors are recorded as the first/>, the second pixel points are recorded as the absolute values of differences of the corresponding data in the dimension types of the illumination factorsThe illumination factor data difference values in the individual illumination factor dimension types; according to the overall variation amplitude of the difference value of the illumination factor data of all arbitrary two pixel points in all illumination factor dimension types, and the/>Pixel dot and/>The illumination dimension weight of each pixel point in each illumination factor dimension category is obtained to obtain the/>Pixel dot and/>Illumination integration distance metric for individual pixels. As an example, the/>, can be calculated by the following formulaPixel dot and/>Illumination integration distance metric for individual pixels:
In the method, in the process of the invention,Represents the/>Pixel dot and/>Light illumination comprehensive distance measurement of each pixel point; /(I)Representing the number of all illumination factor dimension categories; /(I)Represents the/>Pixel dot and/>The pixel point is at the/>Illumination dimension weights in individual illumination factor dimension categories; /(I)Indicating that any two pixel points are at the first/>Standard deviation of the difference values of all the illumination factor data in the individual illumination factor dimension types; /(I)Representing an exponential function based on natural constants, the embodiments employModel to present inverse proportional relationship and normalization process,/>For model input, the implementer may choose the inverse proportion function and the normalization function according to the actual situation. And acquiring the illumination comprehensive distance measurement of any two pixel points.
It should be noted that, ifPixel dot and/>The larger the illumination comprehensive distance measurement of each pixel point is, the description of the/>Pixel dot and/>The greater the influence of illumination intensity on each pixel point, the more reflective the/>Pixel dot and/>The more non-pixels belong to the same super-pixel block.
So far, the illumination comprehensive distance measurement of any two pixel points is obtained through the method.
Step S003: and according to the illumination comprehensive distance measurement of any two pixel points, adaptively adjusting the side length of the search range and performing iterative clustering to obtain a plurality of titanium rod detection super-pixel blocks.
It should be noted that, after the distance measurement is adaptively adjusted in combination with the influence of the illumination intensity, the adaptive distance measurement corresponding to the seed points and the pixel points distributed around the seed points has different distance values due to the influence of the illumination intensity and the spatial position; there may be a case where the adaptive distance measure between the seed point and the pixel point farther from the seed point is smaller and the adaptive distance measure between the pixel point nearer to the seed point is larger; when the traditional SLIC detection linear iterative clustering algorithm acquires the super-pixel blocks, a search frame formed by preset fixed side lengths is generally used for carrying out iterative clustering analysis on a plurality of pixel points in the fixed search frame around the seed points, and finally, the pixel points with close corresponding distance measures are divided into the same super-pixel blocks; therefore, in order to make the acquired segmentation result more accurate, the search box range needs to be adaptively adjusted based on the illumination-integrated distance metric after the distance metric is adaptively adjusted.
Preferably, in one embodiment of the present invention, according to the illumination comprehensive distance metric of any two pixel points, the search frame range is adaptively adjusted and iterative clustering is performed, so as to obtain a titanium rod detection super-pixel block of each initial seed point, including the specific method that:
Presetting a neighborhood window side lengthWherein the present embodiment is described as/>To describe the example, the present embodiment is not particularly limited, wherein/>Depending on the particular implementation; taking any initial seed point in the titanium rod gray level image as an example, taking the initial seed point as the center, and taking the window size as/>The window area of the initial seed point is marked as an initial reference area of the initial seed point; marking any pixel point in an initial reference area of the initial seed point as a target pixel point, and marking the target pixel point as a straight line in a direction corresponding to the extension degree of the texture direction of the titanium bar gray image and a target straight line; making a straight line perpendicular to the target straight line through the initial seed point, and marking the straight line as a perpendicular comparison straight line; the pixel point of which the target pixel point is axisymmetric relative to the vertical comparison straight line is marked as a neighborhood comparison pixel point of the target pixel point; taking Euclidean distance between the neighborhood reference pixel point and the target pixel point as a range reference distance of the target pixel point; obtaining range reference distances of all pixel points in an initial reference area of the initial seed point, carrying out linear normalization on all range reference distances, and recording each normalized range reference distance as a range distance weight coefficient.
Further, according to the range distance weight coefficient of all pixel points in the initial reference area of the initial seed point, the self-adaptive searching range side length of the initial seed point is obtained. As an example, the adaptive search range side of the initial seed point may be calculated by the following formula:
In the method, in the process of the invention,Representing the adaptive search range side length of the initial seed point; /(I)Representing the number of all pixel points in the initial reference area of the initial seed point; /(I)First/>, within an initial reference region representing the initial seed pointA range distance weight coefficient of each pixel point; /(I)Representing the preset edge length of a neighborhood window; /(I)Representing a preset super-parameter multiple, preset in this embodimentFor characterising/>Upper limit of window side length of/>, whereinDepending on the particular implementation.
It should be noted that, if the adaptive search range side length of the initial seed point is larger, the distribution of pixels around the initial seed point, where similar image information may exist, is more discrete, which reflects the more pixels that need to be referred to when the initial seed point is subjected to iterative clustering in the following.
Further, the initial seed point is taken as the center, and the window size isAs the adaptive search range of the initial seed point; taking the initial seed point as a seed point of the first iterative clustering, and clustering all pixel points in the self-adaptive searching range of the initial seed point to obtain a seed point of the second iterative clustering; the self-adaptive search range side length of the seed points of the first iterative clustering is recorded as a first range side length/>Taking the seed points of the second iterative clustering as the center, and the window size is/>The window area of the initial seed point is recorded as the initial search range of the seed point of the second iterative clustering, the initial reference area of the initial seed point is replaced by the initial search range of the seed point of the second iterative clustering by referring to the method for acquiring the self-adaptive search range side length of the seed point of the second iterative clustering, and the self-adaptive search range side length/>Taking the seed points of the second iterative clustering as the center, and the window size is/>The window area of the second iterative clustering is marked as the self-adaptive searching range of the seed points; clustering all pixel points in the self-adaptive search range of the seed points of the second iterative clustering to obtain seed points of the third iterative clustering; the seed point of the third iterative clustering is taken as the center, and the window size is/>The window area of the initial seed point is recorded as the initial search range of the seed point of the third iterative clustering, the initial reference area of the initial seed point is replaced by the initial search range of the seed point of the third iterative clustering by referring to the method for acquiring the self-adaptive search range side length of the seed point of the third iterative clustering, and the self-adaptive search range side length/>Taking the seed point of the third iterative clustering as the center, and the window size is/>The window area of the (2) is marked as the self-adaptive searching range of the seed points of the third iterative clustering; clustering all pixel points in the self-adaptive search range of the seed points of the third iterative clustering to obtain seed points of the fourth iterative clustering; and by analogy, stopping iterative clustering until the seed point obtained by the latest iterative clustering is no longer changed, and marking the super-pixel block corresponding to the seed point of the last iterative clustering as a titanium rod detection super-pixel block of the initial seed point; and acquiring titanium rod detection super-pixel blocks of all initial seed points in the titanium rod gray level image. The seed points of each iterative cluster correspond to one super-pixel block, and each super-pixel block comprises a plurality of pixel points; in addition, the process of obtaining the seed points and iterative clustering is a well-known content of the SLIC simple linear iterative clustering algorithm, and this embodiment will not be described in detail.
So far, the titanium rod detection super-pixel blocks of all initial seed points in all titanium rod gray images are obtained through the method.
Step S004: and detecting each titanium rod detection super pixel block.
Preferably, in one embodiment of the present invention, taking any one titanium rod gray level image as an example, a titanium rod detection super pixel block of all initial seed points in the titanium rod gray level image is input into a trained neural network to obtain a titanium rod appearance defect region in the titanium rod gray level image; the neural network used in this embodiment is YOLOv, and the method for acquiring the data set for training the neural network is as follows:
Collecting a large number of titanium rod detection super-pixel blocks of all initial seed points in the titanium rod gray level images, artificially marking a titanium rod appearance defect area on each titanium rod detection super-pixel block in each titanium rod gray level image by using a bounding box, and marking the marking result as a label of each titanium rod gray level image; collecting a large number of titanium rod detection super-pixel blocks of all initial seed points in the titanium rod gray level image and corresponding labels thereof to form a data set; training the neural network by using the data set, wherein a loss function used in the training process is a mean square error loss function; the specific training process is a well-known content of the neural network, and the specific training process is not described in detail in this embodiment. Referring to FIG. 2, a block partitioning diagram of a super pixel processed by a conventional SLIC algorithm is shown; referring to FIG. 3, a schematic diagram of a super pixel block segmentation mask processed by a conventional SLIC algorithm is shown; referring to FIG. 4, a block segmentation schematic of a super pixel that improves post-processing of the SLIC algorithm is shown; referring to fig. 5, a block segmentation mask schematic diagram of a super pixel that improves post-processing of the SLIC algorithm is shown.
This embodiment is completed.
The above description is only of the preferred embodiments of the present invention and is not intended to limit the invention, but any modifications, equivalent substitutions, improvements, etc. within the principles of the present invention should be included in the scope of the present invention.

Claims (9)

Any two pixels are arranged at the firstAbsolute values of differences of corresponding data in the dimension types of the illumination factors are recorded as the first/>, the second pixel points are recorded as the absolute values of differences of the corresponding data in the dimension types of the illumination factorsThe illumination factor data difference values in the individual illumination factor dimension types; according to the overall variation amplitude of the difference value of the illumination factor data of all arbitrary two pixel points in all illumination factor dimension types, and the/>Pixel dot and/>The illumination dimension weight of each pixel point in each illumination factor dimension category is obtained to obtain the/>Pixel dot and/>The illumination comprehensive distance measurement of each pixel point comprises the following specific methods:
A texture trend analysis window for any one of the initial seed points; constructing a gray matrix according to the arrangement mode of gray values of each pixel point of the texture trend analysis window, and carrying out SVD singular value decomposition on the gray matrix to obtain a left singular matrix and a diagonal matrix; the sequence after all singular values in the diagonal matrix are arranged in a descending order is marked as a texture direction singular value sequence; marking any singular value in the texture direction singular value sequence as a target singular value, marking the accumulated sum of all singular values before the target singular value as a first accumulated sum, marking the accumulated sum of all singular values in the texture direction singular value sequence as a second accumulated sum, marking the ratio of the first accumulated sum to the second accumulated sum as the singular contribution value of the target singular value, and obtaining the singular contribution value of all the singular values;
Marking any pixel point in an initial reference area of the initial seed point as a target pixel point, and marking the target pixel point as a straight line in a direction corresponding to the extension degree of the texture direction of the titanium bar gray image and a target straight line; making a straight line perpendicular to the target straight line by passing through the initial seed point, and marking the straight line as a perpendicular comparison straight line; marking the pixel points of which the target pixel points are axisymmetric relative to the vertical comparison straight line as neighborhood comparison pixel points of the target pixel points; taking Euclidean distance between the neighborhood reference pixel point and the target pixel point as a range reference distance of the target pixel point; obtaining range reference distances of all pixel points in an initial reference area of an initial seed point, carrying out linear normalization on all range reference distances, and recording each normalized range reference distance as a range distance weight coefficient.
CN202410495545.8A2024-04-242024-04-24Visual inspection method for appearance of radial forging titanium rod based on machine learningActiveCN118096796B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202410495545.8ACN118096796B (en)2024-04-242024-04-24Visual inspection method for appearance of radial forging titanium rod based on machine learning

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202410495545.8ACN118096796B (en)2024-04-242024-04-24Visual inspection method for appearance of radial forging titanium rod based on machine learning

Publications (2)

Publication NumberPublication Date
CN118096796Atrue CN118096796A (en)2024-05-28
CN118096796B CN118096796B (en)2024-07-30

Family

ID=91150329

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202410495545.8AActiveCN118096796B (en)2024-04-242024-04-24Visual inspection method for appearance of radial forging titanium rod based on machine learning

Country Status (1)

CountryLink
CN (1)CN118096796B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN118247338A (en)*2024-05-292024-06-25山东威诺重工数控机床有限公司Accurate positioning method for numerical control machine tool machining
CN118628493A (en)*2024-08-132024-09-10宝鸡拓普达钛业有限公司 Titanium rod production quality inspection method based on image features

Citations (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20120308099A1 (en)*2011-05-312012-12-06General Electric CompanyMethod and system for reconstruction of tomographic images
WO2019062092A1 (en)*2017-09-302019-04-04深圳市颐通科技有限公司Superpixel- and multivariate color space-based body outline extraction method
CN111612769A (en)*2020-05-222020-09-01湘潭市锦程半导体科技有限公司Method for detecting surface concave-convex defect of triode packaging metal cap
EP3961477A1 (en)*2020-08-242022-03-02Saint-Gobain Glass FranceMethod for detecting and reading a matrix code marked on a glass substrate
WO2022074643A1 (en)*2020-10-082022-04-14Edgy Bees Ltd.Improving geo-registration using machine-learning based object identification

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20120308099A1 (en)*2011-05-312012-12-06General Electric CompanyMethod and system for reconstruction of tomographic images
WO2019062092A1 (en)*2017-09-302019-04-04深圳市颐通科技有限公司Superpixel- and multivariate color space-based body outline extraction method
CN111612769A (en)*2020-05-222020-09-01湘潭市锦程半导体科技有限公司Method for detecting surface concave-convex defect of triode packaging metal cap
EP3961477A1 (en)*2020-08-242022-03-02Saint-Gobain Glass FranceMethod for detecting and reading a matrix code marked on a glass substrate
WO2022074643A1 (en)*2020-10-082022-04-14Edgy Bees Ltd.Improving geo-registration using machine-learning based object identification

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
薛萍: "基于超像素特征表示的图像前景背景分割算法", 西安科技大学学报, vol. 37, no. 5, 30 September 2017 (2017-09-30), pages 731 - 735*

Cited By (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN118247338A (en)*2024-05-292024-06-25山东威诺重工数控机床有限公司Accurate positioning method for numerical control machine tool machining
CN118628493A (en)*2024-08-132024-09-10宝鸡拓普达钛业有限公司 Titanium rod production quality inspection method based on image features

Also Published As

Publication numberPublication date
CN118096796B (en)2024-07-30

Similar Documents

PublicationPublication DateTitle
CN118096796B (en)Visual inspection method for appearance of radial forging titanium rod based on machine learning
CN115829883B (en)Surface image denoising method for special-shaped metal structural member
CN109118473B (en)Angular point detection method based on neural network, storage medium and image processing system
CN115690105B (en)Milling cutter scratch detection method based on computer vision
CN116664565A (en)Hidden crack detection method and system for photovoltaic solar cell
CN118115498B (en)Method and system for rapidly detecting glossiness of titanium rod
CN116363127B (en)Image processing-based quality detection method for fully-degradable plastic product
CN116246174B (en)Sweet potato variety identification method based on image processing
CN117952979B (en)Construction engineering quality detection supervision method and system
CN116912820B (en)Visual inspection method for infant food safety
CN117808796B (en)Gear surface damage detection method based on computer vision
CN117541582B (en)IGBT insulation quality detection method for high-frequency converter
CN117314940B (en)Laser cutting part contour rapid segmentation method based on artificial intelligence
CN118967690A (en) A defect detection method based on deep contrastive learning
CN119850605A (en)Visual detection method and system for welding quality of heat exchanger
CN119417817B (en)Paint defect detection method and system based on machine vision
CN118096579A (en)3D printing lattice structure defect detection method
CN117094916A (en)Visual inspection method for municipal bridge support
CN119785354A (en) An industrial machine vision recognition and analysis system
CN118196080B (en)Intelligent defect identification method and system for titanium alloy product
CN118365635B (en)Visual inspection method and system for surface defects of packaging film
CN117314901B (en) A scale-adaptive neural network system for chip detection
CN117474916A (en)Image detection method, electronic equipment and storage medium
CN119251573B (en)Quality test analysis method for rotameter production process
CN116894841B (en)Visual detection method for quality of alloy shell of gearbox

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp