CN110223296B - Deformed steel bar surface defect detection method and system based on machine vision - Google Patents

Deformed steel bar surface defect detection method and system based on machine vision Download PDF

Info

Publication number
CN110223296B
CN110223296B CN201910610402.6A CN201910610402A CN110223296B CN 110223296 B CN110223296 B CN 110223296B CN 201910610402 A CN201910610402 A CN 201910610402A CN 110223296 B CN110223296 B CN 110223296B
Authority
CN
China
Prior art keywords
image
area
deformed steel
steel bar
detection
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
CN201910610402.6A
Other languages
Chinese (zh)
Other versions
CN110223296A (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 Zhengchen Polytron Technologies Co ltd
Original Assignee
Shandong Jianzhu University
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 Jianzhu University filed Critical Shandong Jianzhu University
Priority to CN201910610402.6A priority Critical patent/CN110223296B/en
Publication of CN110223296A publication Critical patent/CN110223296A/en
Application granted granted Critical
Publication of CN110223296B publication Critical patent/CN110223296B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/8851Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges
    • 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
    • G06T7/0008Industrial image inspection checking presence/absence
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/8851Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges
    • G01N2021/8887Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges based on image processing techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20048Transform domain processing
    • G06T2207/20061Hough transform
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20112Image segmentation details
    • G06T2207/20132Image cropping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • G06T2207/30164Workpiece; Machine component

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Chemical & Material Sciences (AREA)
  • Analytical Chemistry (AREA)
  • Biochemistry (AREA)
  • General Health & Medical Sciences (AREA)
  • Immunology (AREA)
  • Pathology (AREA)
  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses a deformed steel bar surface defect identification and detection method and a system, wherein the method comprises the following steps: acquiring an original image of the deformed steel bar and preprocessing the original image; carrying out image segmentation and cutting on the preprocessed original image to obtain a deformed steel bar region image; carrying out Hough transform line detection on the threaded steel area image, and distinguishing the front side and the side according to a line detection result; performing defect detection on the front image or the side image; the identified defects are marked in the original image and visualized. The invention can quickly and accurately judge the defects in the front image, effectively reduce the omission factor and the overdetection factor and improve the detection precision.

Description

Deformed steel bar surface defect detection method and system based on machine vision
Technical Field
The invention belongs to the technical field of machine vision, and particularly relates to a deformed steel bar defect detection method and system based on machine vision.
Background
The statements in this section merely provide background information related to the present disclosure and may not necessarily constitute prior art.
In the production process of the deformed steel bar, the deformed steel bar products rolled by each blank are subjected to product sample rod off-line laboratory detection according to national standard requirements or enterprise internal control standards, and the detection contents comprise: the size, appearance, surface, negative variation, etc. of the sample bar are generally detected every 15 to 20 minutes or so, and once the above-mentioned problem exceeding the range is detected, it is necessary to alarm in time and quickly adjust the pressure of the rolling mill or replace the rolling equipment. Due to factors such as production process, raw materials and pressing equipment, the surface of the deformed steel bar often has defects such as scratches, cracks, pits, pitted surfaces, folding and scabbing, if the defects cannot be found and treated in time, a large amount of waste products can be caused to subsequent production, and huge loss is brought to enterprises. Due to the factors of bad working environment, low labor intensity, dangerous operation, low detection efficiency, poor timeliness far away from a production point and the like of a sampling point, each deformed steel bar production enterprise urgently needs an automatic rapid intelligent analysis system to solve the problem.
The manual detection mainly relies on human eyes to detect and identify defects, but the time is too long, the eyes can generate visual fatigue, the motion blur feeling is generated, and people can not distinguish fine surface defects, so that a large amount of false detection and missing detection can be caused. In 1989, an eddy current testing apparatus developed by Lolin continuous rolling France used eddy current probes disposed on the narrow side and upper and lower surfaces of a hot-cast slab to test surface crack defects of the hot-cast slab. However, the device detects a small number of defect types, and the extracted defect characteristic parameters are extremely limited, so that the comprehensive evaluation of the surface quality condition of the product cannot be completed, and the device is only suitable for occasions with low requirements. In 2010, the crack defect of the buried oil pipeline is detected by utilizing a magnetic flux leakage detection method in combination with a continuous wavelet transform energy method, such as Song Zhi, Li Shu, Zhang and the like. However, the magnetic flux leakage detection device is complicated in structure, difficult to maintain, and easily affected by environmental factors, and cannot detect the roughness of the surface of the strip steel or correctly classify the surface defects, and thus is not widely used in industrial production. The infrared detection device was first developed by Elkem corporation in 1990, norway, and when there was a defect, the stroke of the induced current generated by the high-frequency induction coil on the conveying roller path increased, causing the temperature of the billet surface to rise, thereby realizing the detection function. However, the infrared detection method has high requirements on the environment, and accurate classification of defect types cannot be realized.
In the process of researching machine vision detection algorithms, many scholars propose own defect detection algorithms. A real-time defect detection algorithm was proposed by Jong Pil Yun et al, purkinje iron corporation, 2006. The detection algorithm mainly provides defect detection by using a morphological operation method. There are some imperfections in the use of morphological algorithms. In 2007, Choi et al propose an idea of combining three steps of edge filtering, laplacian filtering and dual-threshold binarization when processing a wire surface defect detection algorithm. The method can meet the requirement of real-time detection, but has high requirement on the precision of the image, and provides higher requirement on the image acquisition and transmission process. In 2010, Choi et al preliminarily detected whether the image has surface defects by selecting a threshold between line images or between line images on the basis of the original image and comparing a second-order differential value between the images with a set threshold. The algorithm is simple in calculation and high in speed, but has high requirements on the quality of the image, and a more comprehensive method is adopted for further detection. In 2015, Wangqi et al used median filtering and an image enhancement method based on discrete cosine transform to preprocess an image, extract crest fracture marks and root scratch defects on the surface of a thread, calculate the length and width of the minimum circumscribed rectangle of a suspected defect area, and compare the length and width with a standard to judge whether the defect area is a defect. However, the method has general universality and weak anti-interference capability, and does not meet the requirements of industrial development. In 2015, a sub-pixel boundary positioning method based on projection gravity center is designed by sunshine et al through joint processing of front and side images of deformed steel bars, and a deformed steel bar dimension calculation algorithm based on edges is designed, so that a reference basis is provided for detection of deformed steel bar overall dimension defects, but detection research of specific deformed steel bar surface defects is not involved. Because the deformed steel bar has various surface defects, complex textures, variable forms and higher requirement on the algorithm of defect detection, the algorithm and data which can be referred at present are relatively less.
The methods have various characteristics, but the common defects are that the system structure is complex and is not beneficial to maintenance, so that the methods are not widely applied to industrial detection. The deformed steel bar surface defect detection method based on machine vision utilizes the reliability and the detection accuracy of the machine vision technology and improves the production efficiency and the product quality, can realize reliable, accurate and rapid nondestructive intelligent detection of deformed steel bar surface defects, and has important significance for reducing the labor intensity of workers and improving the production efficiency and the product quality.
Disclosure of Invention
In order to overcome the defects of the prior art, the invention provides a deformed steel bar defect detection method and a system based on machine vision, which utilize affine transformation to perform inclination correction on a deformed steel bar area, distinguish and judge the front and side images of the deformed steel bar based on Hough transformation straight line detection, and finally respectively execute defect detection aiming at the front and side images, can quickly and accurately judge the defects of scratches, cracks, pits, pitted surfaces, folding, scab and the like, effectively reduce the omission factor and the over-detection factor, and improve the detection precision.
In order to achieve the above object, one or more embodiments of the present invention provide the following technical solutions:
a deformed steel bar surface defect identification and detection method comprises the following steps:
acquiring an original image of the deformed steel bar and preprocessing the original image;
carrying out image segmentation and cutting on the preprocessed original image to obtain a deformed steel bar region image;
carrying out Hough transform line detection on the threaded steel area image, and distinguishing the front side and the side according to a line detection result;
performing defect detection on the front image or the side image;
the identified defects are marked in the original image and visualized.
One or more embodiments provide a deformed steel bar surface defect identification and detection system, which comprises:
the data acquisition module is used for acquiring an original image of the deformed steel bar and preprocessing the original image;
the interesting region acquisition module is used for carrying out image segmentation and cutting on the preprocessed original image to obtain a deformed steel bar region image;
the positive side surface dividing module is used for carrying out Hough transformation linear detection on the threaded steel area image and dividing the positive side surface according to a linear detection result;
a defect detection module for performing defect detection on the front image or the side image;
and the defect marking module is used for marking the identified defect position and defect type in the original image and visualizing the defect position and the defect type.
One or more embodiments provide an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method for identifying and detecting the surface defects of the deformed steel bar when executing the program.
One or more embodiments provide a computer-readable storage medium on which a computer program is stored, wherein the program is executed by a processor to implement the method for identifying and detecting the surface defects of the deformed steel bar.
The above one or more technical solutions have the following beneficial effects:
according to the method, the inclination of the deformed steel area is corrected by using affine transformation, the area where the deformed steel is located, images of the front side and the side of the deformed steel are distinguished and judged by Hough transformation linear detection, and the method replaces the mode that the front side and the side of the images are distinguished by the shooting times of the camera and the times of moving back and forth in the industry, for example, the front side image of the deformed steel is shot in the forward direction in the first time of the camera, and after the deformed steel is rotated by 180 degrees, the side image of the deformed steel is shot in the reverse direction in the second time, and the steps are repeated until the deformed steel is rotated by 360 degrees, so that.
The invention respectively carries out targeted defect detection on the obtained front and side images, can quickly and accurately position and classify the defects on the surface of the deformed steel bar, effectively reduces the omission factor and the over-detection factor, and improves the detection precision.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, are included to provide a further understanding of the invention, and are incorporated in and constitute a part of this specification, illustrate exemplary embodiments of the invention and together with the description serve to explain the invention and not to limit the invention.
FIG. 1 is a general flow diagram of a method for identifying and detecting surface defects of deformed steel bars according to one or more embodiments of the invention;
FIG. 2 is a flow chart illustrating the detection of surface defects in an image of the front surface of a deformed steel bar according to one or more embodiments of the present disclosure;
FIG. 3 is a flow chart illustrating the detection of surface defects in an image of a flank of a deformed steel bar according to one or more embodiments of the present invention.
Detailed Description
It is to be understood that the following detailed description is exemplary and is intended to provide further explanation of the invention as claimed. 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.
It is noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of exemplary embodiments according to the invention. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, and it should be understood that when the terms "comprises" and/or "comprising" are used in this specification, they specify the presence of stated features, steps, operations, devices, components, and/or combinations thereof, unless the context clearly indicates otherwise.
The embodiments and features of the embodiments of the present invention may be combined with each other without conflict.
Example one
The embodiment discloses a deformed steel bar surface defect identification and detection method, which comprises the following steps:
step 1, acquiring an original image of the deformed steel bar by a high-speed industrial camera.
And 2, graying the image, and performing enhancement and mean value filtering processing on the image. Specifically, the contrast of the image is enhanced by using a low-pass mask having a contrast of 8 and a width and height of 15 × 15, high-frequency regions (edges and corners) of the image are emphasized, the resulting image is made to look clearer, and the image is subjected to smoothing filtering processing using 5 × 5 mean filtering.
And 3, segmenting the whole area of the deformed steel bar by an automatic threshold segmentation method and characteristic selection. Specifically, threshold segmentation is performed on the image subjected to the smoothing filtering processing according to a preset threshold, and the preset threshold is automatically set by an automatic threshold segmentation operator according to the image subjected to the smoothing filtering processing. And (4) solving a connected domain, and selecting the integral area of the deformed steel bar with the central row coordinate of 84-260 and the convexity of 0.3-1.
And 4, correcting the original image and the region processed in the step 3 and extracting the ROI image, wherein the method specifically comprises the following steps:
4-1: calculating the direction of the area processed in the step (3) and the row-column coordinates of the central point;
and transforming the shape of the region by using shape _ trans operator to obtain the minimum circumscribed rectangle of the region in any direction, and solving the characteristics of the direction Phi (expressed by radian) of the minimum circumscribed rectangle, Row-Column coordinates Row of the central point, Column and the like.
4-2: performing inclination correction on the original image and the area processed in the step 3 by using affine transformation;
a rigid affine transformation matrix is calculated from the centre points (Row, Column) and the directions Phi of the minimum bounding rectangle, and the image is then rotated and translated. And the Row and Column coordinates of the origin and the Row and Column coordinates of the transformed points are Row and Column coordinates Row and Column coordinates of the minimum circumscribed rectangle center point. If the radian Phi is-1.57 (angle-90 degrees), the radian of the transformed point is-3.14 (angle-180 degrees); if-1.57 < radian Phi <1.57, the radian of the transformed point is 0 (angle 0); if the radian Phi >1.57, the radian of the transformed point is 3.14 (angle 180).
The rotation correction operation is performed on the original image first, and then the same rotation correction operation is performed on the minimum bounding rectangle in the above 4-1.
4-3: cutting the corrected original image by taking the corrected area as a template to obtain an ROI image with deformed steel bars, and reducing the interference of subsequent processing time and background;
and cutting out an area similar to the minimum circumscribed rectangle from the original image through a reduce _ domin operator to be used as an image after correction preprocessing.
4-4: and 4, storing the ROI image processed in the step 4-3 as a preprocessed image.
And 5, judging the front side surface of the image processed in the step 4, specifically:
5-1: for the image processed in the step 4, edge detection is carried out by using a canny operator based on non-maximum suppression, so that the edge detection accuracy is improved, and false edges are suppressed;
and (4) smoothing the image corrected in the step (4) by using a 3 multiplied by 3 discrete Gaussian function gauss _ filter operator. The edge of the image is obtained by using a non-maximum suppression canny filter having a filter parameter of 1.3 and a threshold value of 15 to 30, and an edge amplitude (gradient size) image ImaAmp and an edge direction image ImaDir are obtained.
5-2: and then detecting straight lines in the edge image by using a Hough _ lines _ dir operator of local gradient direction, and returning the angle and direction of the straight lines in a normal form. Collinear points in the image space correspond to lines intersected in the parameter space, and all straight lines intersected at the same point in the parameter space have collinear points in the image space and correspond to the collinear points;
and detecting lines in the edge image ImaDir by using a Hough transform Hough _ lines _ dir operator in a local gradient direction, wherein the threshold value of the number of collinear points formed in the Hough image is 67. The input lines described in the Hesse regular shape are stored as regions using the gen _ region _ hline operator.
5-3: and distinguishing the front images and the side images according to different position ranges of the collinear straight lines detected in the front images of the deformed steel bars and the collinear straight lines detectable in the side images. For example, the straight lines detected in the front image are located slightly to both sides of the upper and lower edges of the image, and the straight lines detected in the side image are located slightly to the center portion of the image. Specifically, the line-row coordinates of the center point of the straight line are obtained by the area _ center operator, if the line-row coordinates of the straight line are between 0-30 or 160-190, the original image is a front image with the transverse ribs facing forward, and if the line-row coordinates of the straight line are between 50-145, the original image is a side image with the side ribs facing forward.
And 6, carrying out regional blocking defect detection on the front image distinguished in the step 5, specifically:
6-1: for a front image, firstly, performing sub-pixel edge detection, selecting edges based on the length of the outline, connecting the approximately collinear outlines, finding out the areas where the upper edge and the lower edge are located, respectively generating the minimum circumscribed rectangles of the areas, and independently cutting the upper edge and the lower edge from an original image by taking the minimum circumscribed rectangles as a template;
the Canny filter in the edges _ sub _ pix operator is used for extracting the precise upper and lower edges at the sub-pixel level, the union _ collilinear _ constraints _ xld operator is used for connecting the approximate collinear contour with the maximum gap length of 30 between the two contour lines, and the select _ shape _ xld operator is used for selecting the edge contour with the total contour length of 123-1000. And respectively generating minimum circumscribed rectangles at the upper edge and the lower edge, cutting out the areas which are the same as the minimum circumscribed rectangles from the original image, and obtaining area images ImageA and ImageB only containing the upper edge and the lower edge.
6-2: respectively carrying out global threshold processing on the extracted upper and lower longitudinal rib images, and carrying out morphological opening operation on the extracted upper and lower longitudinal rib images by using a rectangular structural element;
extracting interested areas in the images Imaga and ImageB by using a threshold operator, and performing opening operation by using a rectangular structural element of 3x 3.
6-3: selecting features based on the convexity features of the regions, and finding out the regions where the defects are located;
and extracting a connected domain, and selecting a region with the convexity of 0.51369-0.60447 and the area of 0-357 by using a select _ shape operator, wherein if the region exists, the upper edge image and the lower edge image have defects, and if the region does not exist, the upper edge image and the lower edge image do not have defects.
6-4: extracting transverse rib areas except upper and lower edge areas from an original image by using a differences operator; and (5) clipping the image by using a crop _ domain operator to obtain ImageC.
6-5: for the middle transverse rib part, firstly, the position of each transverse rib is found by utilizing a template matching method to obtain the characteristics of the central point coordinate, the angle, the radius and the like of each transverse rib;
firstly, a single non-defective cross-rib image is found as a template, a create _ shape _ model operator is used for creating a shape model, a get _ shape _ model _ constraints operator returns the outline representation of the shape model, and a find _ shape _ model operator finds the optimal matching of the shape model in the image ImageC to obtain the relevant position parameters of the shape model.
6-6: and generating an elliptical area which takes the central point (row and column) and the direction as the standard and has a major axis Radius1 and a minor axis Radius2 which are slightly larger than the Radius of the transverse rib at each matched transverse rib, wherein the adjacent areas can be partially overlapped. Cutting the transverse rib area in the original image by taking the transverse rib area as a template, extracting all transverse rib parts, and respectively detecting and positioning defects;
and for the matched single deformed steel bar area, generating an elliptical area with the radius of the major axis and the minor axis slightly larger than that of the original template based on the central point and the direction value of the single deformed steel bar area, cutting the elliptical area from the transverse rib image ImageC, and performing next processing.
6-7: for each extracted transverse rib area, firstly, edge detection is carried out by using a canny operator, threshold segmentation is carried out on an edge amplitude (gradient magnitude) image, and a connected component is extracted;
for the images extracted in the above 6-6, the edge of a single transverse rib image was obtained using a non-maximum suppression canny filter having a filter parameter of 1.5 and a threshold of 10-30, and an edge amplitude (gradient size) image ImaAmp1 was obtained, and the connected domain was extracted by performing threshold segmentation on the edge amplitude image.
6-8: and selecting the characteristics according to the area and the circularity, and finding out the region where the defect is located.
And selecting the characteristics of the connected domain, selecting a region with the area of 12-30 and the circularity of 0.1-0.5, and if the region exists, determining that the defect exists in the transverse rib image, otherwise, determining that the defect does not exist.
And 7: and (5) carrying out defect detection on the side images distinguished in the step (5). Because the texture of the background may not be identical to the texture of the current image, the embodiment performs processing by transforming the image into a frequency domain, extracts the defect components, then inversely transforms the defect components into a spatial domain, and obtains the specific positions of the defects by operations such as threshold segmentation. The method specifically comprises the following steps:
7-1: graying a side image;
7-2: the frequency range of the defect in the surface to be detected is obviously different from the background and the noise, the frequency components obtained after band-stop filtering obviously inhibit the texture in the background, and the defect components are highlighted. Fourier transform is carried out on the image, the image is converted into a frequency domain space, and interference of periodic signals is removed; generating two Gaussian low-pass filters in an FFT mode in a frequency domain, and constructing a band elimination filter to extract a defect component after subtracting; convolving the side images by using a band elimination filter; performing Fourier inversion on the image to a spatial domain;
in the surface to be detected, the low frequency is mostly the smooth part of the background in the image, and the high frequency is mostly the part with severe change such as edge or noise, and the frequency component obtained after band elimination filtering has the inhibiting effect on the texture in the background, and the defect component is highlighted. Fourier transform is carried out on the image, the image is converted into a frequency domain space, and interference of periodic signals is removed; generating a gaussian filter 1 with 'FFT' mode, Sigma1 ═ 10 and Sigm2 ═ 10 and a gaussian filter 2 with 'FFT' mode, Sigma1 ═ 3 and Sigma2 ═ 3 in a frequency domain, and then subtracting the filter 2 from the filter 1 to obtain a band-stop filter; the band elimination filter is used for carrying out convolution on the side face image, Fourier inversion is carried out on the image to a space domain, and the contrast of defects and other areas is enhanced;
7-3: and calculating the gray value range of the image in the spatial domain, namely traversing the input image by taking a rectangle of 10 multiplied by 10 as a template, solving the difference (max-min) between the maximum gray value and the minimum gray value of the image in each rectangular mask, wherein each difference forms an image point, all the image points form an image, and the result is returned in the form of the image so as to enhance the contrast between the textures and facilitate the threshold segmentation. If the parameter mask height or mask width is even, then change them to the next smaller singular value; at the boundaries of the image, the gray values are mirrored.
7-4: determining 7-3 the minimum gray value Min and the maximum gray value Max of the image generated by the result;
7-5: determining a threshold value by comparing the selected threshold value T with the maximum gray value Max, and segmenting the image of 7-3; selecting 7-3 regions of the generated image having gray scale values between (Max ([ T, Max 0.3]), 255);
7-6: and (5) processing a connected region, and extracting a defect region based on the area and circularity characteristics.
And 8, for the defect region found in each step, firstly obtaining the area of the region and the row-column coordinates of the central point, then generating an XLD sub-pixel outline from the region, approximating the XLD outline by a circle, and marking the information such as the area, the position and the like of the region where the defect is located in the original drawing.
The defect detection method is based on the Halcon vision algorithm, the defect detection is realized by compiling the vision algorithm processing image through Halcon, counting the defect information, realizing automatic operation of a machine, improving the detection efficiency, reducing the labor waste and realizing continuous detection work.
Example two
The purpose of this embodiment is to provide a deformed steel bar surface defect discernment detecting system.
In order to achieve the above object, the present embodiment provides a deformed steel bar surface defect identification and detection system, including:
the data acquisition module is used for acquiring an original image of the deformed steel bar and preprocessing the original image;
the interesting region acquisition module is used for carrying out image segmentation and cutting on the preprocessed original image to obtain a deformed steel bar region image;
the positive side surface dividing module is used for carrying out Hough transformation linear detection on the threaded steel area image and dividing the positive side surface according to a linear detection result;
a defect detection module for performing defect detection on the front image or the side image;
and the defect marking module marks the identified defects in the original image and visualizes the defects.
EXAMPLE III
The embodiment aims at providing an electronic device.
An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the program, comprising:
acquiring an original image of the deformed steel bar and preprocessing the original image;
carrying out image segmentation and cutting on the preprocessed original image to obtain a deformed steel bar region image;
carrying out Hough transform line detection on the threaded steel area image, and distinguishing the front side and the side according to a line detection result;
performing defect detection on the front image or the side image;
the identified defects are marked in the original image and visualized.
Example four
An object of the present embodiment is to provide a computer-readable storage medium.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
acquiring an original image of the deformed steel bar and preprocessing the original image;
carrying out image segmentation and cutting on the preprocessed original image to obtain a deformed steel bar region image;
carrying out Hough transform line detection on the threaded steel area image, and distinguishing the front side and the side according to a line detection result;
performing defect detection on the front image or the side image;
the identified defects are marked in the original image and visualized.
The steps involved in the above second, third and fourth embodiments correspond to the first embodiment of the method, and the detailed description thereof can be found in the relevant description of the first embodiment. The term "computer-readable storage medium" should be taken to include a single medium or multiple media containing one or more sets of instructions; it should also be understood to include any medium that is capable of storing, encoding or carrying a set of instructions for execution by a processor and that cause the processor to perform any of the methods of the present invention.
One or more of the above embodiments have the following technical effects:
the method utilizes affine transformation to perform inclination correction on the deformed steel bar area and simultaneously positions the area where the deformed steel bar is located. The threaded steel front image is judged in a regional mode through Hough transformation linear detection, the mode that the front and the side of the image are industrially distinguished through the shooting times of a camera and the number of times of moving back and forth is replaced, for example, the threaded steel front image is shot in the forward direction in the first time of the camera, and after the threaded steel front image is shot in the reverse direction in the second time after the threaded steel side image is rotated for 180 degrees, the operation is repeated until the threaded steel front image is rotated for 360 degrees, the judgment method is simplified, and the working efficiency is improved.
The invention judges the obtained upper edge defect detection image, the lower edge defect detection image and the middle defect detection image, can quickly and accurately judge the defects in the front image, effectively reduces the omission factor and the overdetection factor and improves the detection precision.
The invention provides a detection method for deformed steel bar surface defects, which has a very simple structure, expands the application range of deformed steel bar identification, improves the surface quality of a deformed steel bar finished product, promotes the development and application of deformed steel bar defect detection in industrial production, and meets the requirements of users in practice.
According to the method, the positions of the single transverse ribs are found by carrying out template matching on the whole transverse rib part, and then the defects are sequentially detected and judged, so that the problem that the deformed steel bar is difficult to segment due to the fact that the whole gray value is close to the original gray value is solved; the block detection is carried out on the transverse rib part, so that the precision and the speed of defect detection are improved.
The method uses two low-pass filters, a band-elimination filter is constructed after subtraction to extract defect components, the frequency components obtained after band-elimination filtering obviously inhibit the texture in the background, and the difference between the defects in the surface to be detected and the background and noise is enhanced; and reconstructing after Fourier inversion to obtain a defect image, and obtaining the specific position of the defect through threshold operation.
Those skilled in the art will appreciate that the modules or steps of the present invention described above can be implemented using general purpose computer means, or alternatively, they can be implemented using program code that is executable by computing means, such that they are stored in memory means for execution by the computing means, or they are separately fabricated into individual integrated circuit modules, or multiple modules or steps of them are fabricated into a single integrated circuit module. The present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Although the embodiments of the present invention have been described with reference to the accompanying drawings, it is not intended to limit the scope of the present invention, and it should be understood by those skilled in the art that various modifications and variations can be made without inventive efforts by those skilled in the art based on the technical solution of the present invention.

Claims (9)

1. A deformed steel bar surface defect identification and detection method is characterized by comprising the following steps:
acquiring an original image of the deformed steel bar and preprocessing the original image;
carrying out image segmentation and cutting on the preprocessed original image to obtain a deformed steel bar region image;
carrying out Hough transform line detection on the threaded steel area image, and distinguishing the front side and the side according to a line detection result;
performing defect detection on the front image or the side image, the performing defect detection on the front image comprising:
performing sub-pixel edge detection on the front image to obtain an area where the upper edge and the lower edge are located and a middle area;
respectively generating minimum external rectangles of the areas where the upper and lower edges are located, and cutting the original image based on the minimum external rectangles to obtain images of the upper and lower longitudinal rib areas;
respectively performing global threshold processing on the images of the upper and lower longitudinal rib areas, performing morphological opening operation by adopting rectangular structural elements, and determining the area where the defect is located according to the convexity characteristic of the area;
for the image of the middle transverse rib area, searching the position of each transverse rib by using a template matching method, and acquiring the coordinate, the angle and the radius of the central point of each transverse rib; generating an elliptical area which is consistent with the center point and the direction of the transverse rib and has the major axis and the minor axis larger than the radius of the transverse rib at each matched transverse rib, partially overlapping the adjacent elliptical areas, and cutting an original image based on the elliptical areas to obtain a transverse rib area image corresponding to each transverse rib;
for each transverse rib area image, firstly, edge detection is carried out by using a canny operator, the edge amplitude image is subjected to threshold segmentation, connected components are extracted, and the area where the defect is located is determined according to the area and the circularity;
the identified defects are marked in the original image and visualized.
2. The method for identifying and detecting the surface defects of the deformed steel bars according to claim 1, wherein the pretreatment comprises the following steps: enhancing image contrast with a low-pass mask; and carrying out smooth filtering processing on the image by adopting average filtering.
3. The method for identifying and detecting the surface defects of the deformed steel bars according to claim 1, wherein the step of carrying out image segmentation and cutting on the preprocessed original image comprises the following steps:
obtaining the area of the whole deformed steel bar based on automatic threshold segmentation and connected domain selection;
calculating the direction of the minimum external rectangle of the region and the row-column coordinates of the central point;
calculating a rigid affine transformation matrix according to the direction and the central point position of the minimum circumscribed rectangle;
performing rotation correction on the original image and the minimum circumscribed rectangle based on the affine transformation matrix;
and based on the corrected minimum circumscribed rectangle, cutting the corrected original image to obtain the deformed steel bar region image.
4. The method for identifying and detecting the surface defects of the deformed steel bar according to claim 1, wherein the judging of the front side surface comprises the following steps:
performing edge detection on the image of the deformed steel bar area;
detecting a straight line in the edge image based on a Hough transform operator;
and distinguishing the front image and the side image according to different detectable collinear straight line position ranges in the front image and the side image of the deformed steel bar.
5. The method for identifying and detecting the surface defects of the deformed steel bar according to claim 1, wherein the step of performing defect detection on the side image comprises the following steps:
fourier transform is carried out on the side images, and the side images are converted into a frequency domain space;
constructing a band elimination filter, performing convolution on the side image, performing Fourier inverse transformation after the convolution, and converting the side image into a spatial domain;
performing contrast enhancement on the spatial domain image based on the mask, and then performing threshold segmentation;
and extracting a defect region based on the area and circularity characteristics of the connected region.
6. The method for identifying and detecting the surface defects of the deformed steel bar according to claim 1, wherein the step of marking the identified defects in the original image comprises the following steps:
for each defect area, obtaining the area of the area and the row-column coordinates of the central point;
generating a sub-pixel contour from the region and approximating the sub-pixel contour with a circle;
the area and location of the area in which the defect is located is marked in the original image.
7. A deformed steel bar surface defect identification and detection system is characterized by comprising:
the data acquisition module is used for acquiring an original image of the deformed steel bar and preprocessing the original image;
the interesting region acquisition module is used for carrying out image segmentation and cutting on the preprocessed original image to obtain a deformed steel bar region image;
the positive side surface dividing module is used for carrying out Hough transformation linear detection on the threaded steel area image and dividing the positive side surface according to a linear detection result;
a defect detection module that performs defect detection on the front image or the side image, the performing defect detection on the front image including:
performing sub-pixel edge detection on the front image to obtain an area where the upper edge and the lower edge are located and a middle area;
respectively generating minimum external rectangles of the areas where the upper and lower edges are located, and cutting the original image based on the minimum external rectangles to obtain images of the upper and lower longitudinal rib areas;
respectively performing global threshold processing on the images of the upper and lower longitudinal rib areas, performing morphological opening operation by adopting rectangular structural elements, and determining the area where the defect is located according to the convexity characteristic of the area;
for the image of the middle transverse rib area, searching the position of each transverse rib by using a template matching method, and acquiring the coordinate, the angle and the radius of the central point of each transverse rib; generating an elliptical area which is consistent with the center point and the direction of the transverse rib and has the major axis and the minor axis larger than the radius of the transverse rib at each matched transverse rib, partially overlapping the adjacent elliptical areas, and cutting an original image based on the elliptical areas to obtain a transverse rib area image corresponding to each transverse rib;
for each transverse rib area image, firstly, edge detection is carried out by using a canny operator, the edge amplitude image is subjected to threshold segmentation, connected components are extracted, and the area where the defect is located is determined according to the area and the circularity;
and the defect marking module marks the identified defects in the original image and visualizes the defects.
8. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor executes the program to implement a method for identifying and detecting defects on a surface of deformed steel bar according to any one of claims 1 to 6.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a method for identifying and detecting surface defects of a deformed steel bar according to any one of claims 1 to 6.
CN201910610402.6A 2019-07-08 2019-07-08 Deformed steel bar surface defect detection method and system based on machine vision Active CN110223296B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910610402.6A CN110223296B (en) 2019-07-08 2019-07-08 Deformed steel bar surface defect detection method and system based on machine vision

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910610402.6A CN110223296B (en) 2019-07-08 2019-07-08 Deformed steel bar surface defect detection method and system based on machine vision

Publications (2)

Publication Number Publication Date
CN110223296A CN110223296A (en) 2019-09-10
CN110223296B true CN110223296B (en) 2021-06-11

Family

ID=67812250

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910610402.6A Active CN110223296B (en) 2019-07-08 2019-07-08 Deformed steel bar surface defect detection method and system based on machine vision

Country Status (1)

Country Link
CN (1) CN110223296B (en)

Families Citing this family (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110717902B (en) * 2019-09-29 2023-06-09 中山市瑞福达触控显示技术有限公司 Processing method for display image edge
CN111047556B (en) * 2019-11-13 2024-04-05 广智微芯(扬州)有限公司 Strip steel surface defect detection method and device
CN112884694B (en) * 2019-11-13 2023-12-22 合肥欣奕华智能机器股份有限公司 Defect detection method, device, equipment and medium for flat display panel
CN110991667A (en) * 2019-11-28 2020-04-10 中国铁道科学研究院集团有限公司 Railway track facility abnormity identification method and system
CN112991251B (en) * 2019-11-29 2023-01-17 合肥欣奕华智能机器股份有限公司 Method, device and equipment for detecting surface defects
CN111028215A (en) * 2019-12-06 2020-04-17 上海大学 Method for detecting end surface defects of steel coil based on machine vision
CN111598831A (en) * 2020-03-26 2020-08-28 浙江科技学院 Detection method and system for cylindrical roller bearing
CN111855672A (en) * 2020-07-29 2020-10-30 佛山市南海区广工大数控装备协同创新研究院 Method for detecting COF flexible board defects
CN112164052B (en) * 2020-09-30 2021-10-15 西南交通大学 Railway sleeper defect detection method based on terahertz imaging
CN112629407B (en) * 2020-11-24 2024-03-22 西安理工大学 Deformed steel bar dimension measuring method based on image analysis
CN112378338B (en) * 2020-11-25 2022-10-14 上海里莱技术服务中心 External thread detection method based on Hough transformation
CN112881404A (en) * 2021-01-12 2021-06-01 王玮佳 Deformed steel bar appearance defect detection device
CN112834457B (en) * 2021-01-23 2022-06-03 中北大学 Metal microcrack three-dimensional characterization system and method based on reflective laser thermal imaging
CN113240579A (en) * 2021-04-02 2021-08-10 维库(厦门)信息技术有限公司 Intelligent industrial product defect detection method and device and computer storage medium thereof
CN113327257B (en) * 2021-06-02 2022-07-26 蚌埠凯盛工程技术有限公司 Method and device for judging automobile glass in different areas
CN113505811A (en) * 2021-06-10 2021-10-15 常州理工科技股份有限公司 Machine vision imaging method for hub production
TWI792351B (en) * 2021-06-15 2023-02-11 鴻海精密工業股份有限公司 Method for detecting defects, electronic device and storage medium
CN113744194B (en) * 2021-08-04 2024-03-19 武汉钢铁有限公司 Steel plate defect detection method and computer readable storage medium
CN114354491A (en) * 2021-12-30 2022-04-15 苏州精创光学仪器有限公司 DCB ceramic substrate defect detection method based on machine vision
CN115375693B (en) * 2022-10-27 2023-02-10 浙江托普云农科技股份有限公司 Method, system and device for detecting defects of probe of agricultural information acquisition sensor
CN116452589B (en) * 2023-06-16 2023-10-20 山东伟国板业科技有限公司 Intelligent detection method for surface defects of artificial board based on image processing

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010164318A (en) * 2009-01-13 2010-07-29 Nippon Steel Corp Method and device for inspecting flaw
CN104121853A (en) * 2014-07-15 2014-10-29 深圳市大族激光科技股份有限公司 Casing detection device and objective table thereof
CN106053479A (en) * 2016-07-21 2016-10-26 湘潭大学 System for visually detecting workpiece appearance defects based on image processing
CN107478657A (en) * 2017-06-20 2017-12-15 广东工业大学 Stainless steel surfaces defect inspection method based on machine vision
CN107507206A (en) * 2017-06-09 2017-12-22 合肥工业大学 A kind of depth map extracting method based on conspicuousness detection
CN109001212A (en) * 2018-07-17 2018-12-14 五邑大学 A kind of stainless steel soup ladle defect inspection method based on machine vision
CN109827515A (en) * 2018-12-28 2019-05-31 甘肃第一建设集团有限责任公司 A kind of the screw steel wire area of bed detection system and method for separate type

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8615125B2 (en) * 2010-10-08 2013-12-24 Omron Corporation Apparatus and method for inspecting surface state
US20160293502A1 (en) * 2015-03-31 2016-10-06 Lam Research Corporation Method and apparatus for detecting defects on wafers
CN105631414B (en) * 2015-12-23 2019-04-05 上海理工大学 A kind of vehicle-mounted multi-obstacle avoidance sorter and method based on Bayes classifier
CN106204614B (en) * 2016-07-21 2019-01-08 湘潭大学 A kind of workpiece appearance defects detection method based on machine vision
CN106011672A (en) * 2016-07-29 2016-10-12 常州东大中天钢铁研究院有限公司 Philippine-standard straight screw-thread steel and low-cost production technology thereof
CN107610104A (en) * 2017-08-31 2018-01-19 南通兴华达高实业有限公司 Crack detecting method at a kind of elevator compensation chain R based on machine vision
CN108548820B (en) * 2018-03-28 2023-08-15 浙江理工大学 Cosmetic paper label defect detection method
CN108560345B (en) * 2018-05-04 2020-08-07 绍兴市尊铖自动化设备有限公司 Road construction pretreatment device and construction method thereof
CN109118471A (en) * 2018-06-26 2019-01-01 广东工业大学 A kind of polishing workpiece, defect detection method suitable under complex environment

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010164318A (en) * 2009-01-13 2010-07-29 Nippon Steel Corp Method and device for inspecting flaw
CN104121853A (en) * 2014-07-15 2014-10-29 深圳市大族激光科技股份有限公司 Casing detection device and objective table thereof
CN106053479A (en) * 2016-07-21 2016-10-26 湘潭大学 System for visually detecting workpiece appearance defects based on image processing
CN107507206A (en) * 2017-06-09 2017-12-22 合肥工业大学 A kind of depth map extracting method based on conspicuousness detection
CN107478657A (en) * 2017-06-20 2017-12-15 广东工业大学 Stainless steel surfaces defect inspection method based on machine vision
CN109001212A (en) * 2018-07-17 2018-12-14 五邑大学 A kind of stainless steel soup ladle defect inspection method based on machine vision
CN109827515A (en) * 2018-12-28 2019-05-31 甘肃第一建设集团有限责任公司 A kind of the screw steel wire area of bed detection system and method for separate type

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Review of vision-based steel surface inspection systems;Nirbhar Neogi等;《EURASIP Journal on Image and Video Processing》;20141231;第1-19页 *
螺纹钢表面缺陷检测算法研究;来煜;《中国优秀硕士学位论文全文数据库 信息科技辑》;20150715(第7期);第I138-1306页正文第11-12、22-23页 *

Also Published As

Publication number Publication date
CN110223296A (en) 2019-09-10

Similar Documents

Publication Publication Date Title
CN110223296B (en) Deformed steel bar surface defect detection method and system based on machine vision
CN105913415B (en) A kind of image sub-pixel edge extracting method with extensive adaptability
Li et al. A local annular contrast based real-time inspection algorithm for steel bar surface defects
CN112053376B (en) Workpiece weld joint identification method based on depth information
CN105930858A (en) Fast high-precision geometric template matching method enabling rotation and scaling functions
CN109584215A (en) A kind of online vision detection system of circuit board
CN110751604A (en) Machine vision-based steel pipe weld defect online detection method
CN109118471A (en) A kind of polishing workpiece, defect detection method suitable under complex environment
CN115096206B (en) High-precision part size measurement method based on machine vision
CN113077437B (en) Workpiece quality detection method and system
CN110717909A (en) Metal surface scratch detection method and device
CN107993219A (en) A kind of deck of boat detection method of surface flaw based on machine vision
Alazzawi Edge detection-application of (first and second) order derivative in image processing: communication
CN108986160A (en) A kind of image laser center line extraction method containing specular light interference
Reddy et al. Canny scale edge detection
CN110390649B (en) Method for reducing noise of oil and gas pipeline weld image
CN112884694A (en) Defect detection method, device, equipment and medium for flat display panel
Lee et al. A study on modified Hough algorithm for image processing in weld seam tracking system
CN115131250A (en) Intelligent machine tool component identification method for machine tool assembly
Zheng et al. Measurement of laser welding pool geometry using a closed convex active contour model
CN114354631A (en) Valve blank surface defect detection method based on vision
Niu et al. Application of CEM algorithm in the field of tunnel crack identification
Choi et al. Faulty scarfing slab detection using machine vision
CN111161296A (en) Multi-scale edge detection method based on discrete wavelet transform
Chen et al. Research and application of machine vision technology in workpiece detection and recognition

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
TR01 Transfer of patent right

Effective date of registration: 20230818

Address after: Block A, Building 2, Intelligent Transportation Industrial Park, No. 11777, Tourist Road, Jinan Area, China (Shandong) Pilot Free Trade Zone, Jinan City, Shandong Province, 250000

Patentee after: SHANDONG ZHENGCHEN POLYTRON TECHNOLOGIES Co.,Ltd.

Address before: 250101 1000, Feng Ming Road, Lingang Development Zone, Licheng District, Ji'nan, Shandong

Patentee before: SHANDONG JIANZHU University

TR01 Transfer of patent right