CN116309570B - Titanium alloy bar quality detection method and system - Google Patents

Titanium alloy bar quality detection method and system Download PDF

Info

Publication number
CN116309570B
CN116309570B CN202310559029.2A CN202310559029A CN116309570B CN 116309570 B CN116309570 B CN 116309570B CN 202310559029 A CN202310559029 A CN 202310559029A CN 116309570 B CN116309570 B CN 116309570B
Authority
CN
China
Prior art keywords
titanium alloy
standard deviation
image
edge
alloy bar
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.)
Active
Application number
CN202310559029.2A
Other languages
Chinese (zh)
Other versions
CN116309570A (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.)
Shandong Liangma New Material Technology Co ltd
Original Assignee
Shandong Liangma New Material Technology 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 Shandong Liangma New Material Technology Co ltd filed Critical Shandong Liangma New Material Technology Co ltd
Priority to CN202310559029.2A priority Critical patent/CN116309570B/en
Publication of CN116309570A publication Critical patent/CN116309570A/en
Application granted granted Critical
Publication of CN116309570B publication Critical patent/CN116309570B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/20Image enhancement or restoration using local operators
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Quality & Reliability (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

The invention relates to the technical field of data processing, in particular to a titanium alloy bar quality detection method and a system, wherein the method acquires a gray image of a titanium alloy bar to be detected; extracting quasi edge points and edge points for each window area on the gray level image; acquiring the noise degree of the center point of the corresponding window area according to the difference between the gray value and the background value of the center point of the window area, the information entropy of the window area and the quantity proportion of the edge points to the quasi-edge points; further obtaining a basic standard deviation when each pixel point carries out Gaussian filtering; obtaining the self-adaptive standard deviation of the defective pixel point by using the correction coefficient; the basic standard deviation of other pixel points is the corresponding self-adaptive standard deviation; and (3) completing corresponding Gaussian filtering by using the self-adaptive standard deviation of the pixel points to obtain a denoising image, and detecting the quality according to the denoising image. The invention can eliminate image noise and simultaneously retain detail information, and accurate quality detection results are obtained by utilizing the denoised image after data processing.

Description

Titanium alloy bar quality detection method and system
Technical Field
The invention relates to the technical field of data processing, in particular to a titanium alloy bar quality detection method and system.
Background
Titanium alloys are widely used in many fields by virtue of their excellent properties and relatively low cost. At present, the global titanium alloy yield is steadily increasing, titanium alloy materials are indispensable, and shadows of titanium alloy exist in important fields such as automobiles, aerospace, ships and the like, so that the production quality detection of the titanium alloy is particularly important.
In the production process of the titanium alloy bar, a black pitting defect exists on the surface, the corrosion resistance of the titanium alloy bar can be greatly affected when the titanium alloy bar is more defective, and the defects are irregular in shape, small in area and unobvious in appearance, when the defect detection is carried out by utilizing an image, the noise is similar to noise existing in the image, so that the interference caused by the noise on the image identification is greatly improved, the quality detection difficulty of the surface of the titanium alloy bar is greatly improved, and the detection result is error.
At present, gaussian filtering can be used for carrying out noise reduction treatment on an image, but because of the singleness of Gaussian filtering, the defect of black pits can be blurred when noise is removed, even the black pits are directly removed, and the accuracy of a detection result is greatly influenced.
Disclosure of Invention
In order to solve the problem of inaccurate quality detection results caused by inaccurate Gaussian filter denoising when the quality detection is carried out on the titanium alloy bar with tiny defects such as black pits and the like by utilizing image recognition, the invention provides a titanium alloy bar quality detection method and system, and the adopted technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a method for detecting quality of a titanium alloy bar, including the steps of:
collecting a global image of the surface of a bar body of a titanium alloy bar to be detected, and obtaining a gray image of the global image, wherein a gray value with the largest occurrence frequency in the gray image is used as a background value; sliding on the gray level image pixel by a sliding window with a preset size, and generating a window area by sliding each time;
for each window area, generating an edge range based on the maximum gradient value, extracting pixel points with gradient values in the edge range from the window area, marking the pixel points as quasi-edge points, marking the longest line formed by connecting the mutually communicated quasi-edge points as edge lines, and marking each quasi-edge point connected into the edge lines as an edge point;
acquiring the noise degree of the center point of the corresponding window area according to the difference between the gray value and the background value of the center point of the window area, the information entropy of the window area and the quantity proportion of the edge points to the quasi-edge points; acquiring a basic standard deviation of each pixel point when Gaussian filtering is performed according to the noise degree;
screening defective pixel points according to noise degree, acquiring correction coefficients based on the distance between each defective pixel point and the edge line of the corresponding window area and the gray value of the defective pixel point, and correcting the basic standard deviation of the defective pixel points by using the correction coefficients to obtain the self-adaptive standard deviation of the defective pixel points; the basic standard deviation of other pixel points is the corresponding self-adaptive standard deviation;
and finishing corresponding Gaussian filtering by using the self-adaptive standard deviation of the pixel points to obtain a denoising image, and detecting the quality of the titanium alloy bar to be detected according to the denoising image.
Further, the method for obtaining the noise level comprises the following steps:
calculating the absolute value of the difference between the gray value of the central point of the window area and the background value, carrying out weighted summation on the absolute value of the difference and the corresponding information entropy, taking the normalized weighted summation result as a molecule, and taking the corresponding quantity proportion as a denominator, wherein the obtained ratio is the noise degree.
Further, the method for obtaining the basic standard deviation comprises the following steps:
and for each pixel point, acquiring the basic standard deviation of the pixel point when Gaussian filtering is carried out by utilizing the difference between the corresponding noise degree and the minimum value of the noise degree and the range of all the noise degrees.
Further, the method for obtaining the correction coefficient comprises the following steps:
and calculating the absolute value of the difference between the gray value of the defective pixel point and the minimum gray value in the corresponding window edge point, and carrying out normalized mapping on the sum of the distance and the absolute value of the difference to obtain the correction coefficient.
Further, the method for obtaining the adaptive standard deviation of the defective pixel point comprises the following steps: taking the product of the basic standard deviation of the defective pixel point and the corresponding correction coefficient as the adaptive standard deviation of the defective pixel point.
Further, the quality detection of the titanium alloy bar to be detected according to the denoising image includes:
and carrying out defect identification on the denoising image, obtaining an identified defect area, calculating the duty ratio of the defect area in the global image as defect degree, and completing the quality detection according to the defect degree.
Further, the global image acquisition method comprises the following steps:
the method comprises the steps of collecting initial images of at least two rod body surfaces by rotating a rod body of a titanium alloy rod to be detected, performing perspective distortion correction on the initial images to obtain corrected images, and splicing the corrected images according to the collection sequence to obtain the global image.
Further, the method for obtaining the edge range comprises the following steps:
and presetting a gradient threshold, taking the difference of subtracting the gradient threshold from the maximum gradient value as the upper bound of the closed interval, and taking the maximum gradient value as the lower bound of the closed interval to form the edge range.
Further, the screening method of the defective pixel points comprises the following steps: and when the noise degree is not greater than a preset noise threshold value, the corresponding pixel point is a defective pixel point.
In a second aspect, another embodiment of the present invention provides a system for detecting quality of a titanium alloy rod, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method for detecting quality of a titanium alloy rod when executing the computer program.
The embodiment of the invention has at least the following beneficial effects:
each pixel point corresponds to a window area through a sliding window sliding pixel by pixel on a gray level image of the titanium alloy bar, and the window area is subjected to subsequent analysis, so that the effect of pixel by pixel analysis can be achieved; screening quasi-edge points of each window region through gradient values, screening quasi-edge points which are possibly edge points by utilizing the characteristic that the peripheral change of the edge points is large, further screening out quasi-edge points which are mutually communicated into the longest straight line and are possibly noise, and screening out quasi-edge points which cannot form edge lines through connecting lines to obtain accurate edge points; obtaining the noise degree of the center point of the corresponding window area according to the difference between the gray value of the center point of the window area and the background value, the information entropy of the window area and the number proportion of the edge points occupying the standard edge points, reflecting the possibility that the center point is not the background through the difference between the gray value of the center point of the window area and the background value, reflecting the chaotic degree of the window area through the information entropy of the window area, reflecting the number proportion of the real edge points in all the pixel points which are possible to be the edge points through the number proportion of the edge points occupying the standard edge points, reflecting the noise degree of the center point in the window area by combining the difference between the gray value of the center point of the window area and the background value, the information entropy of the window area and the number proportion of the edge points occupying the standard edge points, wherein the larger the noise degree is, the more possible to be the noise pixel points; obtaining a basic standard deviation of corresponding pixel points when Gaussian filtering is carried out according to the noise degree, so as to preliminarily obtain the standard deviation of each pixel point, screening out defective pixel points by utilizing the noise degree, correcting the basic standard deviation by utilizing the distance between each defective pixel point and the edge line of the corresponding window area and the gray value of the defective pixel point for the defective pixel points to obtain an adaptive standard deviation, wherein the rest pixel points take the basic standard deviation as the corresponding adaptive standard deviation without correction; the corresponding Gaussian filtering is completed by using the self-adaptive standard deviation of the pixel points, a denoised image is obtained, the corresponding Gaussian filtering is carried out by calculating the self-adaptive standard deviation corresponding to each pixel point, the noise can be accurately removed according to the characteristics of each pixel point, the denoised image after accurate denoising is obtained, the small defects are completely reserved while the noise is removed, and therefore the detection result obtained in the subsequent image recognition is more accurate; and detecting the quality of the titanium alloy bar to be detected according to the denoising image, detecting the quality of the titanium alloy bar to be detected by using the denoising image obtained after data processing, obtaining an accurate detection result through image recognition, and improving the accuracy of quality detection.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions and advantages of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are only some embodiments of the invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of steps of a method for detecting quality of a titanium alloy bar according to an embodiment of the present invention;
FIG. 2 is a schematic view of initial image acquisition according to one embodiment of the present invention;
FIG. 3 is a gray scale image provided by one embodiment of the present invention;
FIG. 4 is the image of FIG. 3 after normal Gaussian filtering;
FIG. 5 is a schematic diagram of an edge line according to an embodiment of the present invention;
fig. 6 is the denoised image of fig. 3.
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 a titanium alloy bar quality detection method and system according to the invention, and the detailed implementation, structure, characteristics and effects thereof are as follows. 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 invention provides a titanium alloy bar quality detection method and a system thereof, which are specifically described below with reference to the accompanying drawings.
Referring to fig. 1, a flowchart illustrating a method for detecting quality of a titanium alloy bar according to an embodiment of the invention is shown, the method includes the following steps:
firstly, collecting a global image of the surface of a bar body of a titanium alloy bar to be detected, and acquiring a gray image of the global image, wherein a gray value with the largest occurrence frequency in the gray image is used as a background value; sliding on the gray level image pixel by pixel with a sliding window of a preset size, each sliding generating a window area.
The titanium alloy bar to be detected is horizontally placed at a fixed position, the bar body is rotated at a constant speed, the image acquisition device is fixed right above the titanium alloy bar to be detected, and an initial image of the bar body of the titanium alloy bar to be detected is acquired in a overlooking mode.
The method comprises the steps of collecting initial images of at least two rod body surfaces by rotating a rod body of a titanium alloy rod to be detected, correcting perspective distortion of the initial images to obtain corrected images, and splicing the corrected images according to the collection sequence to obtain a global image.
In the embodiment of the invention, the camera is used for collecting initial images, the position relation between the camera and the titanium alloy bar to be detected and the rotation direction of the titanium alloy bar to be detected are shown in fig. 2, the initial images of the surfaces of 4 bar bodies are collected and perspective distortion correction is carried out to obtain 4 corrected images, the 4 corrected images are spliced according to the collection sequence to obtain a global image, and the images are spliced to form the prior art, so that the specific process is not repeated.
There are many methods for obtaining a gray image by graying a global image, and in the embodiment of the present invention, a weighted average method is used to gray the global image to obtain the gray image, as shown in fig. 3.
When the defect detection is carried out on the tiny defects such as black pits and the like on the surface of the titanium alloy bar, partial noise points existing in the process of obtaining an image are similar to the tiny defects, the Gaussian filter is single in selection, partial tiny defects can be mistakenly removed together, and the reserved defect edges can be blurred, so that the defect presentation degree in the image is reduced, the difficulty in the subsequent defect detection is improved, the accuracy of a detection result is reduced, for example, the image after denoising through the common Gaussian filter is shown in fig. 4, the reserved edges in the black frame are smoothed to enable the whole to be blurred, the black pits in the white frame are mistakenly identified as the noise points to be removed, and the denoising effect is poor.
Acquiring a gray distribution histogram of the gray image, wherein the gray value with the largest occurrence frequency in the gray image is taken as a background value, namely the gray value corresponding to the largest frequency in the gray distribution histogram is taken as the background value, and the gray distribution histogram is recorded as
And sliding the sliding window with a preset size on the gray level image pixel by pixel, namely sequentially taking each pixel point as a sliding window center point to realize pixel-by-pixel traversal of the sliding window, and generating a window area by sliding each time.
In the conventional Gaussian filtering, the sizes of convolution kernels are generally 3×3, 5×5 and 7×7, under the same condition, the sizes of the convolution kernels corresponding to the Gaussian filtering are different, the smoothing effects of the corresponding images are different, the larger the convolution kernel is, the better the smoothing effect of the image is, but the more blurred the image is, and the detail loss is serious; on the contrary, the weaker the smoothing effect is, the less the image detail is lost, so in order to keep the original image detail as much as possible, and the smoothing effect is better, a convolution kernel with the middle size, namely a convolution kernel with the size of 5 multiplied by 5, in the conventional convolution kernels is selected, the capability of adapting to the image is relatively good, the smoothing effect of the image is better, the more obvious the noise removing degree is, and meanwhile, the lost original image detail information is less.
Because the convolution kernel size corresponding to the gaussian filtering is 5×5, in order to improve the accuracy of the gray distribution feature analysis, the sliding window size needs to include the whole convolution kernel, and in the embodiment of the invention, the preset size is 7×7, that is, a sliding window with the size of 7×7 is built to slide pixel by pixel on the gray image, and a window area with the size of 7×7 is generated once sliding.
And secondly, generating an edge range based on the maximum gradient value for each window area, extracting pixel points with gradient values in the edge range in the window area, marking the pixel points as quasi-edge points, marking the longest line formed by connecting the mutually communicated quasi-edge points as edge lines, and marking each quasi-edge point connected into the edge lines as the edge point.
For each window area, extracting the pixel point with the maximum gradient value in the window area and obtaining the maximum gradient valuePresetting a gradient thresholdThe difference of the maximum gradient value minus the gradient threshold valueAs the upper boundary of the closed interval, the maximum gradient valueAs the lower bound of the closed interval, make up the edge range
Gradient thresholdAccording to experience and actual condition setting, in the embodiment of the invention, the gradient threshold valueThe value is 3, and in other embodiments, the adjustment can be performed according to actual situations.
The larger the gradient value is, the larger the surrounding change of the corresponding pixel point is, and the more likely the corresponding pixel point is an edge point, so that the maximum gradient value is extracted to construct an edge range, and the pixel point with the maximum gradient value is extracted by a plurality of methods.
Extracting pixel points with gradient values of the pixel points in the window area within the edge range, marking the extracted pixel points as quasi-edge points, and counting the total number of the quasi-edge pointsThe longest line formed by connecting the mutually communicated quasi-edge points is marked as an edge line, each quasi-edge point connected into the edge line is marked as an edge point, and the total number of the edge points is. As shown in FIG. 5, the solid circle is the center point of the window area, and the hollow circleAnd 1 is an extracted quasi-edge point, and the connected broken line is an edge line in the window area.
Thirdly, obtaining the noise degree of the center point of the corresponding window area according to the difference between the gray value and the background value of the center point of the window area, the information entropy of the window area and the quantity proportion of the edge points to the quasi-edge points; and obtaining the basic standard deviation of each pixel point when Gaussian filtering is carried out according to the noise degree.
In the gray image, gray distribution characteristics around different types of pixel points are different, gray distribution regularity of the pixel points corresponding to the noise points is low, gray value change range is large, distribution is disordered, gray value change range around the defective pixel points is small, and the existing regularity is strong, so that the pixel points are identified to a certain extent by analyzing the gray distribution characteristics around the pixel points, and corresponding standard deviation is obtained in a self-adaptive mode.
Calculating the difference absolute value of the gray value and the background value of the central point of the window area, carrying out weighted summation on the difference absolute value and the corresponding information entropy, taking the normalized weighted summation result as a molecule, and taking the corresponding quantity proportion as a denominator, wherein the obtained ratio is the noise degree.
The calculation formula of the noise degree is as follows:
wherein,,indicating the degree of noise and,representing a normalization function;represents the gray value of the center point of the window area,the background value is indicated and the value of the background,representing absolute value symbols;representing the probability that a pixel with a pixel value i appears in the gray image,representing a base number of 2Is used for the number of pairs of (a),information entropy in the window area is represented;representing the absolute value of the difference between the gray value of the center point of the window area and the background valueIs used for the weight of the (c),representing information entropyIs used for the weight of the (c),a weighted summation result representing the absolute value of the difference and the corresponding information entropy;representing the total number of edge points;representing the total number of quasi-edge points,representing the quantitative ratio.
Weighting ofAndaccording to the actual situation, the partial weight with larger influence is larger, andas an example, in an embodiment of the present invention,
the larger the difference between the gray value and the background value of the central point of the window area, namelyThe larger the probability that the corresponding pixel point is a defective pixel point or a noise point is, the higher the probability that smoothing is needed is; the information entropy reflects the disorder degree of the information, and the larger the information entropy in the window area is, namelyThe larger the gray value variation range around the center point is, the more disordered and irregular the distribution is, and the larger the probability that the center point is a noise point is; ratio of number in window areaThe smaller the gradient is, the fewer the real edge points are in the quasi-edge points with larger gradients, and the larger the probability that the corresponding center point is a noise point is; corresponding noise levelThe larger the center point, the more likely it is to be a noise point.
When denominator isAt 0, the noise levelAbsence, i.e. absence of edge points in the window area, indicates that the window center point is locatedInside the normal area or the defective area, smoothing processing is not required.
When the noise level isWhen the noise level is present, the basic standard deviation of the pixel point when Gaussian filtering is carried out is obtained by utilizing the difference between the corresponding noise level and the minimum value of the noise level and the range of all the noise levels for each pixel point.
Selecting the maximum value of noise degree in the noise degree corresponding to all pixel points in the gray imageAnd noise level minimumCalculating the difference between the maximum and minimum noise levelsNamely, the minimum difference of all noise degrees is obtained, and then the basic standard deviation of the pixel point in Gaussian filtering is obtained by utilizing the difference of the noise degree and the minimum value of the noise degree and the minimum difference of all noise degrees:
wherein,,the base standard deviation is indicated as such,indicating the noise level of the current pixel point,represents the maximum value of noise levels among the noise levels corresponding to all the pixel points in the gray image,noise range corresponding to all pixel points in gray level imageThe minimum value of the noise level in the degree,indicating a very poor level of all noise.
For each pixel point, the greater the noise level is, the greater the level of smoothing is required, and accordingly, the greater the standard deviation corresponding to the gaussian filtering is, and the standard deviation corresponding to the gaussian filtering has a value range, and the determination of the value range depends on the specific solution problem, according to the actual situation, so the embodiment uses the normalized value of the noise levelMultiplying by 5 limits the range of standard deviation toWithin the range.
Then screening the defective pixel points according to the noise degree, acquiring correction coefficients based on the distance between each defective pixel point and the edge line of the corresponding window area and the gray value of the defective pixel point, and correcting the basic standard deviation of the defective pixel points by using the correction coefficients to obtain the self-adaptive standard deviation of the defective pixel points; the basic standard deviation of other pixel points is the corresponding self-adaptive standard deviation.
When the noise degree is not greater than the preset noise threshold, the corresponding pixel is a defective pixel, and in order to avoid blurring the defective edge and reduce the defective image rendering degree, the basic standard deviation of the defective pixel needs to be corrected. As an example, the noise threshold preset in the embodiment of the present invention is 2.
And calculating the absolute value of the difference between the gray value of the defective pixel point and the minimum gray value in the corresponding window edge point, and carrying out normalized mapping on the sum of the distance and the absolute value of the difference to obtain a correction coefficient.
The specific calculation formula is as follows:
wherein Z represents a correction coefficient,an exponential function based on a natural constant e is represented,the gray value representing the defective pixel point,representing the minimum gray value in the edge point of the corresponding window of the defective pixel point,the sign of the absolute value is represented,representing the distance between the defective pixel point and the edge line of the corresponding window area.
By usingSum of distance and absolute value of differenceThe normalization mapping is carried out to obtain a correction coefficient, the denominator +1 is used for avoiding that the denominator is 0, and the closer the gray value of the defective pixel point is to the gray value at the edge, namely the absolute value of the difference value between the gray value of the defective pixel point and the minimum gray value in the edge point of the corresponding windowThe smaller the defect pixel point is, the more likely the defect pixel point is the pixel point near the edge, and the smaller the degree of smoothing is required; distance between defective pixel point and edge line of corresponding window regionThe smaller the defect pixel point is, the closer the defect pixel point is to the defect edge, the more likely the defect pixel point is to be the pixel point near the edge, and the smaller the degree of smoothing is required; i.e.The larger the corresponding defective pixel point is, the smaller the degree of smoothing is required, and the smaller the correction coefficient is.
Taking the product of the basic standard deviation of the defective pixel and the corresponding correction coefficient as the adaptive standard deviation of the defective pixel:representing the adaptive standard deviation.
And correcting the basic standard deviation by using the correction coefficient to obtain the self-adaptive standard deviation which is more suitable for the defective pixel point, wherein other pixel points are not defective pixel points, and the correction is not needed, and the basic standard deviation is the corresponding self-adaptive standard deviation.
And finally, performing corresponding Gaussian filtering by using the self-adaptive standard deviation of the pixel points to obtain a denoising image, and performing quality detection on the titanium alloy bar to be detected according to the denoising image.
The adaptive standard deviation of the pixel points is utilized to complete the corresponding Gaussian filtering, the optimized Gaussian filtering is used for noise reduction treatment on the gray image, different standard deviations are used for different pixel points, the noise smoothness is higher, the noise reduction effect is better, the smoothness of the defective pixel points is smaller, the detail information is effectively reserved, the noise-removed image is obtained, the defect and important detail information can be well reserved while noise is eliminated, the gray image is less influenced by the noise, the performance effect in the image is clearer, the noise-removed image of FIG. 3 is shown in FIG. 6, the reserved edge in the black frame is clear, the black pit defect in the white frame is reserved, and the noise-removing effect is better compared with that of FIG. 4.
And carrying out defect identification on the denoising image, obtaining the defect area obtained by identification, calculating the duty ratio of the defect area in the global image as the defect degree, and completing quality detection according to the defect degree.
After the denoising image is obtained, defect identification is performed on the denoising image, a defect area is identified, various defect identification methods can be realized, for example, a semantic segmentation method or a threshold segmentation method can be realized, a specific process is not repeated in the embodiment, the area of the defect area obtained by the identification is obtained and recorded as a defect area, the ratio of the defect area in the global image is calculated as the defect degree, the larger the defect degree is, the worse the surface quality of the titanium alloy bar to be detected is, and quality detection is completed according to the defect degree.
In summary, the embodiment of the invention acquires the global image of the surface of the bar body of the titanium alloy bar to be detected, acquires the gray level image of the global image, and takes the gray level value with the largest occurrence frequency in the gray level image as the background value; sliding pixels on the gray level image by a sliding window with a preset size, and generating a window area by sliding each time; for each window area, generating an edge range based on the maximum gradient value, extracting pixel points with gradient values in the edge range from the window area, marking the pixel points as quasi-edge points, marking the longest line formed by connecting the mutually communicated quasi-edge points as edge lines, and marking each quasi-edge point connected into the edge lines as an edge point; acquiring the noise degree of the center point of the corresponding window area according to the difference between the gray value and the background value of the center point of the window area, the information entropy of the window area and the quantity proportion of the edge points to the quasi-edge points; acquiring a basic standard deviation of each pixel point when Gaussian filtering is performed according to the noise degree; when the noise degree is not greater than a preset noise threshold value, the corresponding pixel point is a defective pixel point; acquiring correction coefficients based on the distance between each defective pixel point and the edge line of the corresponding window area and the gray value of the defective pixel point, and correcting the basic standard deviation of the defective pixel point by using the correction coefficients to obtain the self-adaptive standard deviation of the defective pixel point; the basic standard deviation of other pixel points is the corresponding self-adaptive standard deviation; and (3) completing corresponding Gaussian filtering by using the self-adaptive standard deviation of the pixel points to obtain a denoising image, and detecting the quality of the titanium alloy bar to be detected according to the denoising image. The invention can eliminate noise, well reserve defects and important detail information, so that the gray level image is less influenced by the noise, and the expression effect in the image is clearer, thereby obtaining accurate detection results and improving the accuracy of the detection results.
The embodiment of the invention also provides a titanium alloy bar quality detection system which comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor, wherein the processor realizes the steps when executing the computer program. Because a detailed description is given above for a quality detection method of the titanium alloy bar, the detailed description is omitted.
It should be noted that: the sequence of the embodiments of the present invention is only for description, and does not represent the advantages and disadvantages of the embodiments. And the foregoing description has been directed to specific embodiments of this specification. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
In this specification, each embodiment is described in a progressive manner, and the same or similar parts of each embodiment are referred to each other, and each embodiment mainly describes differences from other embodiments.
The above embodiments are only for illustrating the technical solution of the present application, and are not limiting; the technical solutions described in the foregoing embodiments are modified or some of the technical features are replaced equivalently, so that the essence of the corresponding technical solutions does not deviate from the scope of the technical solutions of the embodiments of the present application, and all the technical solutions are included in the protection scope of the present application.

Claims (10)

1. The quality detection method of the titanium alloy bar is characterized by comprising the following steps of:
collecting a global image of the surface of a bar body of a titanium alloy bar to be detected, and obtaining a gray image of the global image, wherein a gray value with the largest occurrence frequency in the gray image is used as a background value; sliding on the gray level image pixel by a sliding window with a preset size, and generating a window area by sliding each time;
for each window area, generating an edge range based on the maximum gradient value, extracting pixel points with gradient values in the edge range from the window area, marking the pixel points as quasi-edge points, marking the longest line formed by connecting the mutually communicated quasi-edge points as edge lines, and marking each quasi-edge point connected into the edge lines as an edge point;
acquiring the noise degree of the center point of the corresponding window area according to the difference between the gray value and the background value of the center point of the window area, the information entropy of the window area and the quantity proportion of the edge points to the quasi-edge points; acquiring a basic standard deviation of each pixel point when Gaussian filtering is performed according to the noise degree;
screening defective pixel points according to noise degree, acquiring correction coefficients based on the distance between each defective pixel point and the edge line of the corresponding window area and the gray value of the defective pixel point, and correcting the basic standard deviation of the defective pixel points by using the correction coefficients to obtain the self-adaptive standard deviation of the defective pixel points; the basic standard deviation of other pixel points is the corresponding self-adaptive standard deviation;
and finishing corresponding Gaussian filtering by using the self-adaptive standard deviation of the pixel points to obtain a denoising image, and detecting the quality of the titanium alloy bar to be detected according to the denoising image.
2. The method for detecting the quality of the titanium alloy bar according to claim 1, wherein the method for obtaining the noise degree is as follows:
calculating the absolute value of the difference between the gray value of the central point of the window area and the background value, carrying out weighted summation on the absolute value of the difference and the corresponding information entropy, taking the normalized weighted summation result as a molecule, and taking the corresponding quantity proportion as a denominator, wherein the obtained ratio is the noise degree.
3. The method for detecting the quality of the titanium alloy bar according to claim 1, wherein the method for obtaining the basic standard deviation is as follows:
and for each pixel point, acquiring the basic standard deviation of the pixel point when Gaussian filtering is carried out by utilizing the difference between the corresponding noise degree and the minimum value of the noise degree and the range of all the noise degrees.
4. The method for detecting the quality of the titanium alloy bar according to claim 1, wherein the method for obtaining the correction coefficient is as follows:
and calculating the absolute value of the difference between the gray value of the defective pixel point and the minimum gray value in the corresponding window edge point, and carrying out normalized mapping on the sum of the distance and the absolute value of the difference to obtain the correction coefficient.
5. The method for detecting the quality of the titanium alloy bar according to claim 1, wherein the method for obtaining the adaptive standard deviation of the defective pixel point is as follows: taking the product of the basic standard deviation of the defective pixel point and the corresponding correction coefficient as the adaptive standard deviation of the defective pixel point.
6. The method for detecting the quality of the titanium alloy bar according to claim 1, wherein the detecting the quality of the titanium alloy bar to be detected according to the denoising image comprises the following steps:
and carrying out defect identification on the denoising image, obtaining an identified defect area, calculating the duty ratio of the defect area in the global image as defect degree, and completing the quality detection according to the defect degree.
7. The method for detecting the quality of the titanium alloy bar according to claim 1, wherein the method for acquiring the global image is as follows:
the method comprises the steps of collecting initial images of at least two rod body surfaces by rotating a rod body of a titanium alloy rod to be detected, performing perspective distortion correction on the initial images to obtain corrected images, and splicing the corrected images according to the collection sequence to obtain the global image.
8. The method for detecting the quality of the titanium alloy bar according to claim 1, wherein the method for obtaining the edge range is as follows:
and presetting a gradient threshold, taking the difference of subtracting the gradient threshold from the maximum gradient value as the upper bound of the closed interval, and taking the maximum gradient value as the lower bound of the closed interval to form the edge range.
9. The method for detecting the quality of the titanium alloy bar according to claim 1, wherein the screening method of the defective pixel points is as follows: and when the noise degree is not greater than a preset noise threshold value, the corresponding pixel point is a defective pixel point.
10. A titanium alloy bar quality detection system comprising a memory, a processor and a computer program stored in the memory and operable on the processor, wherein the processor, when executing the computer program, performs the steps of a titanium alloy bar quality detection method according to any one of claims 1-8.
CN202310559029.2A 2023-05-18 2023-05-18 Titanium alloy bar quality detection method and system Active CN116309570B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310559029.2A CN116309570B (en) 2023-05-18 2023-05-18 Titanium alloy bar quality detection method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310559029.2A CN116309570B (en) 2023-05-18 2023-05-18 Titanium alloy bar quality detection method and system

Publications (2)

Publication Number Publication Date
CN116309570A CN116309570A (en) 2023-06-23
CN116309570B true CN116309570B (en) 2023-08-04

Family

ID=86799924

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310559029.2A Active CN116309570B (en) 2023-05-18 2023-05-18 Titanium alloy bar quality detection method and system

Country Status (1)

Country Link
CN (1) CN116309570B (en)

Families Citing this family (29)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116503404B (en) * 2023-06-27 2023-09-01 梁山县创新工艺品股份有限公司 Plastic toy quality detection method and device, electronic equipment and storage medium
CN116523913B (en) * 2023-07-03 2023-11-03 惠州市金思维科技有限公司 Intelligent detection method for quality of screw rod
CN116563279B (en) * 2023-07-07 2023-09-19 山东德源电力科技股份有限公司 Measuring switch detection method based on computer vision
CN116580024B (en) * 2023-07-12 2023-09-15 山东荣信集团有限公司 Coke quality detection method based on image processing
CN116612112B (en) * 2023-07-17 2023-09-22 鑫脉(山东)工贸有限公司 Visual inspection method for surface defects of bucket
CN116596924B (en) * 2023-07-17 2023-10-20 山东唐乐生物科技股份有限公司 Stevioside quality detection method and system based on machine vision
CN116611748B (en) * 2023-07-20 2023-10-20 吴江市高瑞庭园金属制品有限公司 Titanium alloy furniture production quality monitoring system
CN116630314B (en) * 2023-07-24 2024-01-30 日照元鼎包装有限公司 Image processing-based preservation carton film coating detection method
CN116681695B (en) * 2023-07-27 2023-12-01 山东阁林板建材科技有限公司 Quality detection method for anti-deformation template end face
CN116758071B (en) * 2023-08-17 2023-11-03 青岛冠宝林活性炭有限公司 Intelligent detection method for carbon electrode dirt under visual assistance
CN116977337B (en) * 2023-09-22 2024-01-16 张家港晨旭门窗科技有限公司 Waterproof aluminum alloy door and window detection method based on machine vision
CN117218097B (en) * 2023-09-23 2024-04-12 宁波江北骏欣密封件有限公司 Method and device for detecting surface defects of shaft sleeve type silk screen gasket part
CN116993643B (en) * 2023-09-27 2023-12-12 山东建筑大学 Unmanned aerial vehicle photogrammetry image correction method based on artificial intelligence
CN116993731B (en) * 2023-09-27 2023-12-19 山东济矿鲁能煤电股份有限公司阳城煤矿 Shield tunneling machine tool bit defect detection method based on image
CN117095003B (en) * 2023-10-20 2024-01-26 山东亿盟源新材料科技有限公司 Method and device for detecting cleanliness of carbon steel raw materials of bimetal composite plate
CN117274251B (en) * 2023-11-20 2024-02-06 山东鲁抗医药集团赛特有限责任公司 Tablet quality detection method in medicine production process based on image data
CN117437279B (en) * 2023-12-12 2024-03-22 山东艺达环保科技有限公司 Packing box surface flatness detection method and system
CN117455800B (en) * 2023-12-22 2024-03-15 肥城新查庄地质勘查有限公司 Coal mine drilling positioning method based on computer vision
CN117522863B (en) * 2023-12-29 2024-03-29 临沂天耀箱包有限公司 Integrated box body quality detection method based on image features
CN117541582B (en) * 2024-01-09 2024-04-19 山东海纳智能装备科技股份有限公司 IGBT insulation quality detection method for high-frequency converter
CN117893527B (en) * 2024-03-07 2024-05-28 江苏亿都智能特种装备有限公司 New energy storage box surface defect detection method
CN117876366A (en) * 2024-03-11 2024-04-12 宝鸡子扬双金属材料有限公司 Titanium tube quality detection method and system based on image processing
CN118115744B (en) * 2024-04-23 2024-07-02 江苏卡欧万泓电子有限公司 Electric energy meter shell detection method based on image recognition
CN118154584A (en) * 2024-05-06 2024-06-07 陕西银汉空天科技有限公司 Part surface defect detection system
CN118196080B (en) * 2024-05-13 2024-08-13 宝鸡拓普达钛业有限公司 Intelligent defect identification method and system for titanium alloy product
CN118229676B (en) * 2024-05-22 2024-08-20 宝鸡拓普达钛业有限公司 Visual detection method for titanium alloy bar based on image segmentation
CN118297839B (en) * 2024-06-04 2024-08-30 山东华尚电气有限公司 Transformer winding state detection method based on vision
CN118365867B (en) * 2024-06-20 2024-09-06 宝鸡钛莱康高新金属材料有限公司 Titanium alloy bar identification method and system based on image analysis
CN118397003B (en) * 2024-06-27 2024-10-15 宝鸡市鹏盛鑫有色金属有限责任公司 Defect positioning method and system for nonferrous metal part

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021000524A1 (en) * 2019-07-03 2021-01-07 研祥智能科技股份有限公司 Hole protection cap detection method and apparatus, computer device and storage medium
CN112630222A (en) * 2020-11-24 2021-04-09 河海大学常州校区 Mobile phone cover plate glass defect detection method based on machine vision
CN113935953A (en) * 2021-09-18 2022-01-14 南通豪派金属制品有限公司 Steel coil defect detection method based on image processing
CN114742727A (en) * 2022-03-31 2022-07-12 南通电博士自动化设备有限公司 Noise processing method and system based on image smoothing
CN217006957U (en) * 2022-03-30 2022-07-19 西北农林科技大学 Image acquisition system for titanium alloy surface defects
CN115170576A (en) * 2022-09-09 2022-10-11 山东中发新材料科技有限公司 Aluminum pipe surface defect detection method based on machine vision
CN115170669A (en) * 2022-09-05 2022-10-11 合肥安迅精密技术有限公司 Identification and positioning method and system based on edge feature point set registration and storage medium
CN115345837A (en) * 2022-07-29 2022-11-15 中国航发北京航空材料研究院 Nondestructive evaluation method for internal pores of additive manufacturing titanium alloy test bar

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021000524A1 (en) * 2019-07-03 2021-01-07 研祥智能科技股份有限公司 Hole protection cap detection method and apparatus, computer device and storage medium
CN112630222A (en) * 2020-11-24 2021-04-09 河海大学常州校区 Mobile phone cover plate glass defect detection method based on machine vision
CN113935953A (en) * 2021-09-18 2022-01-14 南通豪派金属制品有限公司 Steel coil defect detection method based on image processing
CN217006957U (en) * 2022-03-30 2022-07-19 西北农林科技大学 Image acquisition system for titanium alloy surface defects
CN114742727A (en) * 2022-03-31 2022-07-12 南通电博士自动化设备有限公司 Noise processing method and system based on image smoothing
CN115345837A (en) * 2022-07-29 2022-11-15 中国航发北京航空材料研究院 Nondestructive evaluation method for internal pores of additive manufacturing titanium alloy test bar
CN115170669A (en) * 2022-09-05 2022-10-11 合肥安迅精密技术有限公司 Identification and positioning method and system based on edge feature point set registration and storage medium
CN115170576A (en) * 2022-09-09 2022-10-11 山东中发新材料科技有限公司 Aluminum pipe surface defect detection method based on machine vision

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于机器视觉的加工刀具磨损量在线测量;周俊杰,余建波;《上海交通大学学报》;第55卷(第6期);第741-749页 *

Also Published As

Publication number Publication date
CN116309570A (en) 2023-06-23

Similar Documents

Publication Publication Date Title
CN116309570B (en) Titanium alloy bar quality detection method and system
CN105654436B (en) A kind of backlight image enhancing denoising method based on prospect background separation
CN105976330B (en) A kind of embedded greasy weather real time video image stabilization
CN110706174B (en) Image enhancement method, terminal equipment and storage medium
CN115984148B (en) Denoising enhancement method for high-throughput gene sequencing data
CN114240797B (en) OCT image denoising method, device, equipment and medium
CN106934806A (en) It is a kind of based on text structure without with reference to figure fuzzy region dividing method out of focus
CN111368661A (en) Finger vein image enhancement method based on image processing
CN117994154B (en) Intelligent image denoising method based on sensor
Estrada et al. Stochastic Image Denoising.
CN112053302A (en) Denoising method and device for hyperspectral image and storage medium
CN114255468A (en) Handwriting recognition method and related equipment thereof
CN112288726A (en) Method for detecting foreign matters on belt surface of underground belt conveyor
CN116091312A (en) Low-contrast image joint enhancement and super-resolution reconstruction method
CN113673396B (en) Spore germination rate calculation method, device and storage medium
CN109658357A (en) A kind of denoising method towards remote sensing satellite image
CN116012265B (en) Infrared video denoising method and device based on time-space domain adaptive filtering
CN104063864B (en) Image fuzziness assessment method based on quaternary phase congruency model
CN114529518B (en) Image pyramid and NLM-based frozen electron microscope image enhancement method
CN116012767A (en) Visual detection method for cracks of clutch housing of electrically-controlled silicone oil fan
CN111415365A (en) Image detection method and device
Zia et al. Rician noise removal from MR images using novel adapted selective non-local means filter
CN114994098A (en) Foreign matter detection method and device
Chen A Novel Image Blurring Detection Scheme using Spatial Autocorrelation
Si et al. TFR: Texture Defect Detection with Fourier Transform using Normal Reconstructed Template of Simple Autoencoder

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant