CN114820629A - Welding identification method for automobile parts - Google Patents

Welding identification method for automobile parts Download PDF

Info

Publication number
CN114820629A
CN114820629A CN202210764041.2A CN202210764041A CN114820629A CN 114820629 A CN114820629 A CN 114820629A CN 202210764041 A CN202210764041 A CN 202210764041A CN 114820629 A CN114820629 A CN 114820629A
Authority
CN
China
Prior art keywords
neighborhood
color
side neighborhood
line
welding
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210764041.2A
Other languages
Chinese (zh)
Other versions
CN114820629B (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 Yijixi Precision Manufacturing Co ltd
Original Assignee
Shandong Yijixi Precision Manufacturing 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 Yijixi Precision Manufacturing Co ltd filed Critical Shandong Yijixi Precision Manufacturing Co ltd
Priority to CN202210764041.2A priority Critical patent/CN114820629B/en
Publication of CN114820629A publication Critical patent/CN114820629A/en
Application granted granted Critical
Publication of CN114820629B publication Critical patent/CN114820629B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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
    • G06T5/30Erosion or dilatation, e.g. thinning
    • 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
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/54Extraction of image or video features relating to texture
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/56Extraction of image or video features relating to colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/761Proximity, similarity or dissimilarity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • 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/20024Filtering details
    • G06T2207/20032Median filtering
    • 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/20036Morphological image processing
    • 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/30152Solder
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V2201/00Indexing scheme relating to image or video recognition or understanding
    • G06V2201/06Recognition of objects for industrial automation
    • 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)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Multimedia (AREA)
  • Artificial Intelligence (AREA)
  • Health & Medical Sciences (AREA)
  • Quality & Reliability (AREA)
  • Computing Systems (AREA)
  • Databases & Information Systems (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Image Analysis (AREA)

Abstract

The invention relates to a welding identification method of automobile parts, belonging to the technical field of identifying welding seams by using a computer vision technology, comprising the following steps: acquiring a first side neighborhood and a second side neighborhood of each independent contour line in an automobile part image; when the color richness of any side neighborhood in any one independent contour line is greater than a color richness threshold value, taking the independent contour line as an alternative weld line; selecting a weld joint line to be determined from the alternative weld joint lines by utilizing the color contrast and the texture contrast of the neighborhoods on the two sides of each alternative weld joint line; carrying out wrapping detection on any two weld lines to be determined to identify a final weld line, and taking an area enclosed in the final weld line as a welding area; the invention provides a method for identifying a welding area of an automobile part based on the characteristics of the welding area and the morphological and structural characteristics of the area around the welding area, which greatly reduces the false detection rate of the welding area.

Description

Welding identification method for automobile parts
Technical Field
The invention belongs to the technical field of weld joint identification by using a computer vision technology, and particularly relates to a welding identification method for automobile parts.
Background
The automobile parts are various parts forming the whole automobile, the variety of the automobile parts is various, and the mass of the automobile parts plays a great role in the mass of the whole automobile and is one of key elements of the whole automobile mass. In order to ensure the quality of the automobile parts, higher requirements are also put forward on the welding of the automobile parts, the quality of the welding quality directly influences the quality of the automobile parts, and a welding seam area needs to be extracted quickly when the welding quality is detected.
At present, with the rapid development of an artificial intelligence technology, how to utilize a computer vision technology to rapidly identify a welding seam area is a technical problem to be solved firstly. However, since the general structure of the automobile parts is complex, there are edge lines which are difficult to distinguish, and meanwhile, the metal on the surface of the automobile parts can have a light reflection region which is difficult to distinguish from a bright welding region, and the surface of the automobile parts can also have a hole structure which is similar to the shape structure of the welding region, which brings difficulty to the extraction of the welding region.
Disclosure of Invention
The invention provides a method for identifying a welding area of an automobile part based on the characteristics of the welding area and the morphological and structural characteristics of the area around the welding area, which greatly reduces the false detection rate of the welding area.
The invention discloses a welding identification method of automobile parts, which adopts the following technical scheme: the method comprises the following steps:
obtaining an automobile part image, and extracting a plurality of independent contour lines in the automobile part image;
neighborhood detection is carried out on two sides of each independent contour line to obtain neighborhood on two sides of each independent contour line, wherein the neighborhood on two sides comprises a first side neighborhood and a second side neighborhood;
converting the automobile part image into a color LAB image, calculating the color richness of a first side neighborhood and a second side neighborhood of each independent contour line in the color LAB image, and determining a color richness threshold value according to all the obtained color richness;
when the color richness of the first side neighborhood or the color richness of the second side neighborhood of any one independent contour line is larger than a color richness threshold value, the independent contour line is used as an alternative welding line to obtain all alternative welding lines;
calculating the color contrast of the first side neighborhood and the second side neighborhood of each alternative welding line by using the color richness of the first side neighborhood and the color richness of the second side neighborhood of each alternative welding line;
acquiring gray level images of a first side neighborhood and a second side neighborhood, constructing a gray level co-occurrence matrix, extracting texture characteristics of the first side neighborhood and the second side neighborhood of each alternative welding line in the gray level images by using the gray level co-occurrence matrix, and calculating the texture contrast of the first side neighborhood and the second side neighborhood of each alternative welding line;
calculating the total contrast of a first side neighborhood and a second side neighborhood of each alternative weld line by using the color contrast and the texture contrast corresponding to each alternative weld line, and taking the alternative weld line as the weld line to be determined when the total contrast is greater than a preset total contrast threshold;
and (4) detecting the encapsulation of any two weld lines to be determined to identify a final weld line, and taking the area enclosed in the final weld line as a welding area.
Further, the calculating the color richness of the first side neighborhood and the second side neighborhood of each independent contour line in the color LAB image includes:
acquiring channel values of each pixel point in a first side neighborhood of each independent contour line in three channels of L, A and B in the color LAB image;
obtaining a color vector of each pixel point in the first side neighborhood according to the channel value of each pixel point in the L, A and B channels in the first side neighborhood, dividing the pixel points corresponding to the same color vector into same category colors, and counting the number of the pixel points in the same category color and the category number of the color in the first side neighborhood;
calculating the channel value mean values of all pixel points in the first side neighborhood in three channels of L, A and B by using the color vector of each pixel point in the first side neighborhood, and forming a reference color vector by the calculated channel value mean values in the three channels;
calculating the distance between the color vector corresponding to each category color in the first side neighborhood and the reference color vector;
extracting gradients of each pixel point in the first side neighborhood on three channels of L, A and B, and calculating the color gradient of each pixel point according to the gradients of each pixel point on the three channels of L, A and B;
calculating the average color gradient of all pixel points in the first side neighborhood according to the color gradient of each pixel point in the first side neighborhood;
calculating the color richness of the first side neighborhood of each independent contour line by utilizing the category number of the colors in the first side neighborhood, the number of pixel points in the same category color, the distance between the color vector corresponding to each category color and the reference color vector and the average color gradient of all the pixel points;
and according to the calculation method of the color richness of the first side neighborhood of each independent contour line, calculating the color richness of the first side neighborhood and the second side neighborhood of each independent contour line in the color LAB image.
Further, the formula for calculating the color richness of the first side neighborhood of each individual contour line is shown as follows:
Figure 25154DEST_PATH_IMAGE001
wherein the content of the first and second substances,
Figure 879978DEST_PATH_IMAGE002
representing the number of categories of colors within the first lateral neighborhood;
Figure 925294DEST_PATH_IMAGE003
representing the number of pixel points in the same category color in the first side neighborhood;
Figure 976296DEST_PATH_IMAGE004
representing the total number of pixel points in the first side neighborhood;
Figure 993930DEST_PATH_IMAGE005
indicating the second in the first side neighborhood
Figure 81972DEST_PATH_IMAGE006
The distance between the color vector corresponding to the color of the individual category and the reference color vector;
Figure 4798DEST_PATH_IMAGE007
representing the average color gradient of all pixel points in the first side neighborhood;
Figure 734856DEST_PATH_IMAGE008
and representing the color richness of the neighborhood of the first side of any one independent contour line.
Further, the calculation formula of the color contrast of the first side adjacent region and the second side adjacent region of each candidate weld line is shown as the following formula:
Figure 606997DEST_PATH_IMAGE009
wherein the content of the first and second substances,
Figure 256153DEST_PATH_IMAGE010
representing the color richness of the first side neighborhood of any one alternative welding line;
Figure 276062DEST_PATH_IMAGE011
representing the color richness of the second side neighborhood of any one alternative welding line;
Figure 685178DEST_PATH_IMAGE012
to represent
Figure 739721DEST_PATH_IMAGE010
And
Figure 356516DEST_PATH_IMAGE011
minimum value of (1);
Figure 4666DEST_PATH_IMAGE013
to represent
Figure 810948DEST_PATH_IMAGE010
And
Figure 844632DEST_PATH_IMAGE011
maximum value of (1);
Figure 648640DEST_PATH_IMAGE014
representing the color contrast of the first and second side neighborhoods of any one of the candidate weld lines.
Further, the calculating the texture contrast of the first side neighborhood and the second side neighborhood of each candidate welding line by using the texture features of the first side neighborhood and the second side neighborhood of each candidate welding line in the gray scale image extracted by the gray scale co-occurrence matrix includes:
obtaining a first gray level co-occurrence matrix by utilizing the gray level value of the first side neighborhood of each alternative weld line in the gray level image;
obtaining a second gray level co-occurrence matrix by utilizing the gray level value of the second side neighborhood of each alternative weld line in the gray level image;
calculating the energy, entropy, contrast and inverse difference moment of the first gray level co-occurrence matrix and the second gray level co-occurrence matrix by using each numerical value in the first gray level co-occurrence matrix and the second gray level co-occurrence matrix as a texture feature;
calculating the texture structure similarity of the first side neighborhood and the second side neighborhood of each alternative welding line by using the texture characteristics of the first side neighborhood and the second side neighborhood of each alternative welding line in the gray level image;
and calculating the texture contrast of the first side neighborhood and the second side neighborhood of each alternative welding line according to the texture structure similarity of the first side neighborhood and the second side neighborhood of each alternative welding line.
Further, the calculation formula of the texture similarity of the first side neighborhood and the second side neighborhood of each candidate weld line is shown as the following formula:
Figure 643141DEST_PATH_IMAGE015
wherein the content of the first and second substances,
Figure 643327DEST_PATH_IMAGE016
texture feature representing the neighborhood of the first side of any one of the candidate weld lines
Figure 406884DEST_PATH_IMAGE006
A numerical value;
Figure 585055DEST_PATH_IMAGE017
second representing texture features adjacent to a second side of any one of the candidate weld lines
Figure 801273DEST_PATH_IMAGE006
A numerical value;
Figure 339571DEST_PATH_IMAGE018
representing the texture structure similarity of a first side neighborhood and a second side neighborhood of any one alternative welding line;
the calculation formula of the texture contrast of the first side neighborhood and the second side neighborhood of each candidate welding line is shown as the following formula:
Figure 223213DEST_PATH_IMAGE019
wherein the content of the first and second substances,
Figure 369023DEST_PATH_IMAGE018
indicating any alternative weldsTexture similarity of a first side neighborhood and a second side neighborhood of the suture;
Figure 197171DEST_PATH_IMAGE020
representing the texture contrast of the first and second side neighborhoods of any one of the candidate weld lines.
Further, the calculation formula of the total contrast of the first side neighboring region and the second side neighboring region of each candidate weld line is as follows:
Figure 414526DEST_PATH_IMAGE021
wherein the content of the first and second substances,
Figure 28041DEST_PATH_IMAGE014
representing the color contrast of the first side neighborhood and the second side neighborhood of any one alternative weld line;
Figure 672649DEST_PATH_IMAGE020
representing the texture contrast of the first side neighborhood and the second side neighborhood of any one alternative weld line;
Figure 565256DEST_PATH_IMAGE022
representing the total contrast of the first and second side neighborhoods of any one of the candidate weld lines.
Further, the wrapping detection of any two weld lines to be determined identifies a final weld line, and the area enclosed in the final weld line is used as a welding area, including:
respectively solving the convex contour line of each weld line to be determined by using a convex hull algorithm;
obtaining an intersection of the areas surrounded by the convex contour lines of any two to-be-determined weld lines;
extracting two regions with intersection, and recording the region with more pixels in the two regions with intersection as the region
Figure 242094DEST_PATH_IMAGE023
Will have a crossOf the two regions of the set, the region containing a small number of pixels is referred to as a region
Figure 100329DEST_PATH_IMAGE024
Area finding
Figure 260046DEST_PATH_IMAGE023
And area
Figure 203731DEST_PATH_IMAGE024
Of intersection of
Figure 887522DEST_PATH_IMAGE025
To find a region
Figure 272367DEST_PATH_IMAGE023
And area
Figure 258777DEST_PATH_IMAGE024
Union of
Figure 548813DEST_PATH_IMAGE026
If there is an intersection
Figure 380503DEST_PATH_IMAGE025
Number and area of middle pixel points
Figure 88696DEST_PATH_IMAGE024
The number ratio of the middle pixel points is more than or equal to
Figure 246008DEST_PATH_IMAGE027
If region
Figure 820078DEST_PATH_IMAGE023
Number and union of middle pixel points
Figure 330825DEST_PATH_IMAGE026
Is greater than or equal to
Figure 18158DEST_PATH_IMAGE028
Then region of
Figure 267743DEST_PATH_IMAGE023
Parcel area
Figure 283103DEST_PATH_IMAGE024
Region to region
Figure 456595DEST_PATH_IMAGE024
And taking the corresponding weld line to be determined as a final weld line, and taking the area enclosed in the final weld line as a welding area.
The invention has the beneficial effects that:
at present, because the general structure of the automobile parts is complex, edge lines which are difficult to distinguish exist, a light reflection area and a bright welding area are difficult to distinguish in metal on the surface of the automobile parts, and hole structures similar to the shape structure of the welding area also appear, which bring difficulty to the extraction of the welding area. The invention provides a welding identification method of automobile parts, which utilizes a computer vision technology to identify a welding seam area in an image of the automobile parts. The method can accurately identify the welding area of the automobile parts based on the characteristics of the welding area and the morphological and structural characteristics of the area around the welding area, and greatly reduces the false detection rate of the welding area.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a flow chart illustrating the general steps of an embodiment of a method for identifying a weld of an automobile component according to the present invention;
FIG. 2 is a schematic view of a weld line a to be determined and a weld line b to be determined in an embodiment of the present invention;
fig. 3 is a schematic view of a weld line c to be determined and a weld line d to be determined in an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
An embodiment of a welding identification method for automobile parts according to the present invention is shown in fig. 1, and the method includes:
and S1, acquiring the automobile part image, and extracting a plurality of independent contour lines in the automobile part image.
Wherein, draw many independent contour lines in the automobile parts image, include: detecting edge information in the automobile part image to obtain a plurality of edge lines; filling up broken edge lines by adopting morphological closed operation, and then obtaining a plurality of independent contour lines by adopting a DBSCAN algorithm on the edge lines.
The method comprises the steps of firstly obtaining an automobile part image, then preprocessing the automobile part image, filtering noise in the automobile part image by adopting a median filter, and enhancing the gray scale contrast of the automobile part image by adopting histogram equalization.
If the parts of the automobile shock absorber are taken as an example, the image of the automobile shock absorber is obtained. The automobile shock absorber is a key part of an automobile, can reduce shaking and vibration of an automobile body when the automobile turns sharply or brakes sharply to enable vibration between the frame and the automobile body to be attenuated rapidly, and enables ride comfort and comfort of automobile running to be improved greatly. The welding quality of the automobile shock absorber directly influences the running stability of the automobile and the service life of other parts, so the welding detection and quality judgment of the shock absorber are particularly important.
After the automobile part image is obtained, firstly, the canny operator is utilized to detect the edge information in the automobile part image to obtain a plurality of edge lines
Figure 123069DEST_PATH_IMAGE029
. Then adopting morphological closed operation to the edge line of the fracture
Figure 622183DEST_PATH_IMAGE029
Filling, and then aligning the edge line
Figure 921578DEST_PATH_IMAGE029
Setting the neighborhood radius by adopting DBSCAN algorithm
Figure 288974DEST_PATH_IMAGE030
And a number threshold
Figure 419741DEST_PATH_IMAGE031
Divide it into
Figure 965123DEST_PATH_IMAGE032
Individual contour lines of strips
Figure 79710DEST_PATH_IMAGE033
The welding area of the automobile parts is in the connecting area between different automobile shock absorber structures, and in the heat affected zone outside the welding area, due to high temperature factors in the welding process, the surface of the heat affected zone can be oxidized and discolored, namely colorful patterns, and the welding area is a smooth silver surface. Therefore, the outer contour line of the welding region has unique color and texture characteristics in comparison with other contour lines at both sides of the outer contour line of the welding region. Based on this, to
Figure 70972DEST_PATH_IMAGE032
Individual contour lines of strips
Figure 197191DEST_PATH_IMAGE033
The features of the left and right neighborhoods of the image are analyzed.
And S2, performing neighborhood detection on two sides of each independent contour line to obtain two-side neighborhoods of each independent contour line, wherein the two-side neighborhoods comprise a first-side neighborhood and a second-side neighborhood.
To pair
Figure 772529DEST_PATH_IMAGE032
Individual contour lines of strips
Figure 499045DEST_PATH_IMAGE033
The neighborhood detection is performed on both sides of the cell. And taking each independent contour line as a reference line, adopting a region growing method at two sides of the reference line, respectively selecting pixels which do not belong to the independent contour line in eight adjacent regions of the pixels on the independent contour line from the initial growing points, and dividing the pixels into the initial growing points of two adjacent regions by taking the independent contour line as a boundary. Setting growth conditions that the growth times are not more than 50 and no gray growth condition is set (adding all pixels in the growth times into the region) to form the neighborhood of the first side of the contour line
Figure 83610DEST_PATH_IMAGE034
And a second side neighborhood
Figure 126653DEST_PATH_IMAGE035
S3, converting the automobile part image into a color LAB image, calculating the color richness of the first side neighborhood and the second side neighborhood of each independent contour line in the color LAB image, and determining a color richness threshold value according to all the obtained color richness.
In the present invention, it is considered that a seven-color pattern appears on the surface of the heat affected zone in terms of oxidative discoloration, and it is difficult to describe the seven-color pattern with a certain color, thereby introducing richness of colors
Figure 263105DEST_PATH_IMAGE008
Is characteristic of, richness of color
Figure 352284DEST_PATH_IMAGE008
Is used for representing the color diversity in the region, i.e. the more colors the region contains, the more dispersed the color distribution, the more intense the color changes locally, and the richness of the color
Figure 84747DEST_PATH_IMAGE008
The larger.
Wherein, calculating the color richness of the first side neighborhood and the second side neighborhood of each independent contour line in the color LAB image comprises:
s31, obtaining the channel value of each pixel point in the first side neighborhood of each independent contour line in three channels of L, A and B in the color LAB image.
S32, obtaining a color vector of each pixel point in the first side neighborhood according to the channel value of each pixel point in the L, A and B channels in the first side neighborhood, dividing the pixel points corresponding to the same color vector into the same category color, and counting the number of the pixel points in the same category color and the category number of the color in the first side neighborhood.
In a color LAB image, different colors differ in the composition of the channel values in the three channels L, a and B (one luminance, two color channels). Based on this in the first side neighborhood
Figure 310192DEST_PATH_IMAGE034
And a second side neighborhood
Figure 883125DEST_PATH_IMAGE035
Performing color richness detection on the first side neighborhood
Figure 194021DEST_PATH_IMAGE034
Each pixel point is obtained in the color channels of L, A and B
Figure 792492DEST_PATH_IMAGE036
Channel value
Figure 262657DEST_PATH_IMAGE037
,
Figure 350698DEST_PATH_IMAGE038
Channel value
Figure 24256DEST_PATH_IMAGE039
And
Figure 754315DEST_PATH_IMAGE040
channel value
Figure 875724DEST_PATH_IMAGE041
Forming a color vector
Figure 10033DEST_PATH_IMAGE042
Wherein
Figure 295521DEST_PATH_IMAGE043
Representing pixel points
Figure 485062DEST_PATH_IMAGE044
The color vector of (2). And after the color vector of each pixel point in the first side neighborhood is obtained, dividing the pixel points corresponding to the same color vector into the same category color, and counting the number of the pixel points in the same category color and the category number of the color in the first side neighborhood.
S33, calculating the channel value mean values of all pixel points in the first side neighborhood in three channels L, A and B by using the color vector of each pixel point in the first side neighborhood, and forming a reference color vector by the calculated channel value mean values in the three channels.
In the invention, the color vector of each pixel point in the first side neighborhood is utilized
Figure 414972DEST_PATH_IMAGE042
Calculating the channel value mean value of all pixel points in the first side neighborhood in three channels of L, A and B
Figure 375975DEST_PATH_IMAGE045
Forming a reference color vector from the calculated average values of the channel values in the three channels
Figure 273393DEST_PATH_IMAGE046
And S34, calculating the distance between the color vector corresponding to each category color in the first side neighborhood and the reference color vector.
Wherein, the color vector corresponding to each category color is calculated
Figure 79675DEST_PATH_IMAGE042
To reference color vector
Figure 129670DEST_PATH_IMAGE046
The distance is calculated as follows:
Figure 995995DEST_PATH_IMAGE047
wherein the content of the first and second substances,
Figure 115130DEST_PATH_IMAGE048
representing a color vector
Figure 725103DEST_PATH_IMAGE049
Figure 629605DEST_PATH_IMAGE050
Representing a reference color vector
Figure 932410DEST_PATH_IMAGE046
Figure 538841DEST_PATH_IMAGE051
Representing a color vector to a reference color vector
Figure 624609DEST_PATH_IMAGE046
The distance of (c).
S35, extracting gradients of each pixel point in the first side neighborhood on three channels L, A and B, and calculating the color gradient of each pixel point according to the gradients of each pixel point on the three channels L, A and B.
By using
Figure 508251DEST_PATH_IMAGE052
The operator extracts the gradient of the pixel on three channels
Figure 106591DEST_PATH_IMAGE053
Figure 810105DEST_PATH_IMAGE054
And
Figure 637247DEST_PATH_IMAGE055
calculating the color gradient of each pixel point according to the gradients of each pixel point on three channels of L, A and B, wherein the color gradient of each pixel point is expressed as the following formula:
Figure 640975DEST_PATH_IMAGE056
wherein the content of the first and second substances,
Figure 410217DEST_PATH_IMAGE057
expressing the gradient of the pixel point on an L channel;
Figure 866606DEST_PATH_IMAGE054
representing the gradient of the pixel point on the channel A;
Figure 497438DEST_PATH_IMAGE055
representing the gradient of the pixel over the B channel.
S36, calculating the average color gradient of all the pixel points in the first side neighborhood according to the color gradient of each pixel point in the first side neighborhood.
S37, calculating the color richness of the first side neighborhood of each independent contour line by utilizing the category number of the colors in the first side neighborhood, the number of pixel points in the same category color, the distance between the color vector corresponding to each category color and the reference color vector and the average color gradient of all the pixel points;
and S38, calculating the color richness of the first side neighborhood and the second side neighborhood of each independent contour line in the color LAB image according to the calculation method of the color richness of the first side neighborhood of each independent contour line.
The formula for calculating the color richness of the first side neighborhood of each individual contour line is shown as follows:
Figure 90094DEST_PATH_IMAGE058
wherein the content of the first and second substances,
Figure 826975DEST_PATH_IMAGE002
representing the number of categories of colors within the first lateral neighborhood;
Figure 646026DEST_PATH_IMAGE003
representing the number of pixel points in the same category color in the first side neighborhood;
Figure 939604DEST_PATH_IMAGE004
representing the total number of pixel points in the first side neighborhood;
Figure 776979DEST_PATH_IMAGE005
indicating the second in the first side neighborhood
Figure 497810DEST_PATH_IMAGE006
The distance between the color vector corresponding to the color of the individual category and the reference color vector;
Figure 804158DEST_PATH_IMAGE007
representing the average color gradient of all pixel points in the first side neighborhood;
Figure 822798DEST_PATH_IMAGE008
and representing the color richness of the neighborhood of the first side of any one independent contour line. When the number of the categories of the colors contained in the first side neighborhood is larger, the distance between the color vector corresponding to each category color in the first side neighborhood and the reference color vector is larger, the average color gradient of all the pixel points in the side neighborhood is larger, and the color richness of the first side neighborhood is larger.
For independent contour line
Figure 655625DEST_PATH_IMAGE033
Each contour line in (a) obtains its first side neighborhood
Figure 422724DEST_PATH_IMAGE034
And a second side neighborhood
Figure 75422DEST_PATH_IMAGE035
Since each individual contour line corresponds to two color richness levels, the color richness of (1)
Figure 897753DEST_PATH_IMAGE032
Individual contour line corresponds to
Figure 929295DEST_PATH_IMAGE059
And (4) the richness of colors. To pair
Figure 257508DEST_PATH_IMAGE059
The individual color richness is segmented based on the color richness by Otsu's Otsu method to obtain an optimal color richness threshold
Figure 522136DEST_PATH_IMAGE060
And taking the area corresponding to the color richness larger than the color richness threshold value as a heat affected zone.
S4, when the color richness of the first side neighborhood or the color richness of the second side neighborhood of any one independent contour line is larger than the color richness threshold value, the independent contour line is used as an alternative welding line, and all the alternative welding lines are obtained.
When the color richness of the first side neighborhood or the second side neighborhood in any one independent contour line
Figure 226787DEST_PATH_IMAGE008
Greater than the color richness threshold
Figure 440730DEST_PATH_IMAGE060
And taking the independent contour line as an alternative welding line.
S5, calculating the color contrast of the first side neighborhood and the second side neighborhood of each alternative welding line by using the color richness of the first side neighborhood and the color richness of the second side neighborhood of each alternative welding line.
And carrying out color contrast detection on the alternative weld lines. Since it is known that one side of the weld line is a colorful heat affected zone and the other side is a silver welding zone with uniform color, i.e. on both sides of the weld line, the color shows a significant difference, and in addition, compared with the structure that the outer edge of the heat affected zone is the surface area of the automobile shock absorber wrapping the heat affected zone, the structure of the weld line is the heat affected zone wrapping the welding zone, i.e. the outer edge of the heat affected zone wrapping the weld edge.
The color contrast is used for representing the difference of the color richness of the first side adjacent region and the second side adjacent region of each alternative welding seam line, namely the first side adjacent region of each alternative welding seam line
Figure 64479DEST_PATH_IMAGE034
Corresponding color richness
Figure 691769DEST_PATH_IMAGE010
And a second side neighborhood
Figure 544318DEST_PATH_IMAGE035
Corresponding to the difference in richness of colors.
The formula for calculating the color contrast of the first side neighborhood and the second side neighborhood of each candidate weld line is shown as follows:
Figure 940665DEST_PATH_IMAGE061
wherein the content of the first and second substances,
Figure 735314DEST_PATH_IMAGE010
representing the color richness of the first side neighborhood of any one alternative welding line;
Figure 849901DEST_PATH_IMAGE011
representing the color richness of the second side neighborhood of any one alternative welding line;
Figure 506141DEST_PATH_IMAGE012
to represent
Figure 22573DEST_PATH_IMAGE010
And
Figure 988124DEST_PATH_IMAGE011
minimum value of (1);
Figure 262111DEST_PATH_IMAGE013
to represent
Figure 846676DEST_PATH_IMAGE010
And
Figure 342248DEST_PATH_IMAGE011
maximum value of (1);
Figure 354066DEST_PATH_IMAGE014
representing the color contrast of the first and second side neighborhoods of any one of the candidate weld lines.
Figure 53032DEST_PATH_IMAGE014
The closer to each other
Figure 441288DEST_PATH_IMAGE062
Neighborhood of left and right sides of each alternative weld line
Figure 791367DEST_PATH_IMAGE034
And
Figure 974086DEST_PATH_IMAGE035
corresponding color richness
Figure 425927DEST_PATH_IMAGE010
And
Figure 352295DEST_PATH_IMAGE011
the greater the difference.
Figure 291301DEST_PATH_IMAGE014
The closer to each other
Figure 910501DEST_PATH_IMAGE063
Neighborhood of left and right sides of each alternative weld line
Figure 380797DEST_PATH_IMAGE034
And
Figure 235489DEST_PATH_IMAGE035
corresponding color richness
Figure 169947DEST_PATH_IMAGE010
And
Figure 835415DEST_PATH_IMAGE011
the smaller the difference.
S6, obtaining gray level images of the first side neighborhood and the second side neighborhood, constructing a gray level co-occurrence matrix, and calculating texture contrast of the first side neighborhood and the second side neighborhood of each candidate welding line by using texture features of the first side neighborhood and the second side neighborhood of each candidate welding line in the gray level images, which are extracted by the gray level co-occurrence matrix.
The texture contrast of the first side neighborhood and the second side neighborhood of each candidate welding line is calculated by using the texture features of the first side neighborhood and the second side neighborhood of each candidate welding line in the gray scale image, which are extracted by the gray scale co-occurrence matrix, and the method comprises the following steps: obtaining a first gray level co-occurrence matrix by utilizing the gray level value of the first side neighborhood of each alternative weld line in the gray level image; obtaining a second gray level co-occurrence matrix by utilizing the gray level value of the second side neighborhood of each alternative weld line in the gray level image; calculating the energy, entropy, contrast and inverse difference moment of the first gray level co-occurrence matrix and the second gray level co-occurrence matrix by using each numerical value in the first gray level co-occurrence matrix and the second gray level co-occurrence matrix as a texture feature; calculating the texture structure similarity of the first side neighborhood and the second side neighborhood of each alternative welding line by using the texture characteristics of the first side neighborhood and the second side neighborhood of each alternative welding line in the gray level image; lines from the first side neighbourhood and the second side neighbourhood of each candidate weld lineAnd (4) calculating the texture contrast of a first side neighborhood and a second side neighborhood of each alternative weld line according to the structural similarity. The texture is characterized in that
Figure 120903DEST_PATH_IMAGE064
Wherein, in the step (A),
Figure 248128DEST_PATH_IMAGE065
energy representing a gray level co-occurrence matrix;
Figure 302671DEST_PATH_IMAGE066
entropy values representing a gray level co-occurrence matrix;
Figure 139040DEST_PATH_IMAGE067
representing a contrast of the gray level co-occurrence matrix;
Figure 646245DEST_PATH_IMAGE068
the inverse difference moment of the gray level co-occurrence matrix is represented.
And carrying out texture contrast detection on the alternative weld lines. Since it is known that the weld line is a seven-colored heat affected zone on one side and a uniformly colored silver weld zone on the other side, i.e. the texture appears significantly different on both sides of the weld line.
For each candidate weld line, first side neighborhood
Figure 842740DEST_PATH_IMAGE034
And a second side neighborhood
Figure 17369DEST_PATH_IMAGE035
Intra-texture contrast
Figure 555798DEST_PATH_IMAGE020
And (6) detecting. The first side neighborhood of each alternative welding line
Figure 19141DEST_PATH_IMAGE034
And a second side neighborhood
Figure 550485DEST_PATH_IMAGE035
From colour LAThe B image is converted into a gray image, and the first side neighborhood and the second side neighborhood of each alternative welding line in the gray image are expressed as
Figure 454987DEST_PATH_IMAGE069
And
Figure 492213DEST_PATH_IMAGE070
. Respectively aligning the first side neighborhood gray level images
Figure 364223DEST_PATH_IMAGE069
And a second side neighborhood grayscale image
Figure 777887DEST_PATH_IMAGE070
Extracting texture information by using gray level co-occurrence matrix, and storing energy of the gray level co-occurrence matrix
Figure 271316DEST_PATH_IMAGE065
Entropy value of
Figure 666394DEST_PATH_IMAGE066
Contrast ratio of
Figure 635487DEST_PATH_IMAGE067
Sum and inverse difference moment
Figure 462629DEST_PATH_IMAGE068
Texture feature matrix with features as regions
Figure 466357DEST_PATH_IMAGE064
Obtaining texture characteristics of the first side neighborhood of each alternative welding line in the gray level image
Figure 970020DEST_PATH_IMAGE071
And texture features of the second side neighborhood
Figure 426409DEST_PATH_IMAGE072
Texture features of the first side neighborhood using each candidate weld line
Figure 791662DEST_PATH_IMAGE071
And texture features of the second side neighborhood
Figure 649897DEST_PATH_IMAGE072
And calculating the texture structure similarity of the first side neighborhood and the second side neighborhood of each alternative welding line. The calculation formula of the texture similarity of the first side neighborhood and the second side neighborhood of each candidate weld line is shown as the following formula:
Figure 386778DEST_PATH_IMAGE073
wherein the content of the first and second substances,
Figure 940250DEST_PATH_IMAGE016
texture feature representing the neighborhood of the first side of any one of the candidate weld lines
Figure 233828DEST_PATH_IMAGE006
A numerical value;
Figure 71203DEST_PATH_IMAGE017
second representing texture features adjacent to a second side of any one of the candidate weld lines
Figure 57613DEST_PATH_IMAGE006
A numerical value;
Figure 363961DEST_PATH_IMAGE018
and representing the texture similarity of the first side neighborhood and the second side neighborhood of any one alternative welding line.
And calculating the texture contrast of the first side neighborhood and the second side neighborhood of each alternative welding line according to the texture structure similarity of the first side neighborhood and the second side neighborhood of each alternative welding line. The texture contrast of the first side neighborhood and the second side neighborhood of each candidate weld line is calculated as follows:
Figure 140460DEST_PATH_IMAGE074
wherein the content of the first and second substances,
Figure 910969DEST_PATH_IMAGE018
representing the texture structure similarity of a first side neighborhood and a second side neighborhood of any one alternative welding line;
Figure 927336DEST_PATH_IMAGE020
representing the texture contrast of the first and second side neighborhoods of any one of the candidate weld lines.
S7, calculating the total contrast of the first side neighborhood and the second side neighborhood of each candidate welding line by using the color contrast and the texture contrast corresponding to each candidate welding line, and taking the candidate welding line as the welding line to be determined when the total contrast is greater than a preset total contrast threshold.
In the invention, the total contrast of the first side neighborhood and the second side neighborhood of each alternative welding line is calculated based on the color contrast of the first side neighborhood and the second side neighborhood of each alternative welding line and the texture contrast of the first side neighborhood and the second side neighborhood of each alternative welding line. The calculation formula of the total contrast of the first side neighborhood and the second side neighborhood of each candidate weld line is shown as follows:
Figure 517717DEST_PATH_IMAGE075
wherein the content of the first and second substances,
Figure 153098DEST_PATH_IMAGE014
representing the color contrast of the first side neighborhood and the second side neighborhood of any one alternative weld line;
Figure 699486DEST_PATH_IMAGE020
representing the texture contrast of the first side neighborhood and the second side neighborhood of any one alternative weld line;
Figure 27699DEST_PATH_IMAGE022
representing the total contrast of the first and second lateral neighbourhoods of any one candidate weld line. Setting a total contrast threshold in the present invention
Figure 43059DEST_PATH_IMAGE076
Will be greater than the overall contrast threshold
Figure 747710DEST_PATH_IMAGE077
The alternative welding line is extracted to be used as the welding line to be determined, and then the wrapping performance of the welding line to be determined is detected.
And S8, detecting the wrapping performance of any two weld lines to be determined to identify a final weld line, and taking the area enclosed in the final weld line as a welding area.
Wherein, include: respectively solving the convex contour line of each weld line to be determined by using a convex hull algorithm; obtaining an intersection of the areas surrounded by the convex contour lines of any two to-be-determined weld lines; extracting two regions with intersection, and recording the region with more pixels in the two regions with intersection as the region
Figure 414184DEST_PATH_IMAGE023
In the two regions having intersection, a region having a small number of pixels is defined as a region
Figure 913298DEST_PATH_IMAGE024
(ii) a Area finding
Figure 415955DEST_PATH_IMAGE023
And area
Figure 393138DEST_PATH_IMAGE024
Of intersection of
Figure 976435DEST_PATH_IMAGE025
To find a region
Figure 521817DEST_PATH_IMAGE023
And area
Figure 636404DEST_PATH_IMAGE024
Union of
Figure 541912DEST_PATH_IMAGE026
If there is an intersection
Figure 792764DEST_PATH_IMAGE025
Number and area of middle pixel points
Figure 509048DEST_PATH_IMAGE024
The number ratio of the middle pixel points is more than or equal to
Figure 32302DEST_PATH_IMAGE027
If region
Figure 351288DEST_PATH_IMAGE023
Number and union of middle pixel points
Figure 597592DEST_PATH_IMAGE026
Is greater than or equal to
Figure 609411DEST_PATH_IMAGE028
Then region of
Figure 354382DEST_PATH_IMAGE023
Parcel area
Figure 618004DEST_PATH_IMAGE024
(ii) a Region to region
Figure 843449DEST_PATH_IMAGE024
And taking the corresponding edge line as a final welding line, and taking the area enclosed in the final welding line as a welding area, so far, completing the identification of the welding area of the automobile parts.
According to the total contrast of the first side neighborhood and the second side neighborhood of each alternative welding line, all welding lines to be determined are selected. In the case of a regular weld region, the outer contour of the heat affected zone outside the weld region would enclose the outer contour of the weld region. Since the total contrast on both sides of the outer contour line of the heat affected zone outside the welding area is large, and the total contrast on both sides of the outer contour line of the welding area is also large, both the outer contour line of the heat affected zone outside the welding area and the outer contour line of the welding area are selected as the weld line to be determined only by calculation of the contrast.
In the case of irregular welding regions, the outer contour of the heat affected zone outside the welding region may be misaligned with the outer contour of the welding region, but a large intersection may still exist. Since the total contrast on both sides of the outer contour line of the heat affected zone outside the welding area is large, and the total contrast on both sides of the outer contour line of the welding area is also large, both the outer contour line of the heat affected zone outside the welding area and the outer contour line of the welding area are selected as the weld line to be determined only by calculation of the contrast.
However, how to detect the outer contour of the heat affected zone outside the welding area and the outer contour of the welding area needs to perform encapsulation detection on any two weld lines to be determined to identify the final weld line.
As shown in fig. 2, in the case of a regular welding area, a first side adjacent region of the weld line a to be determined is an image of the surface of the automobile part, and a second side adjacent region of the weld line a to be determined is a heat affected zone. The first side adjacent area of the weld line b to be determined is a heat affected zone, and the second side adjacent area of the weld line b to be determined is a smooth silver surface. When the welding line a to be determined and the welding line b to be determined are subjected to encapsulation detection, the area surrounded by the welding line a to be determined is marked as an area due to the fact that the welding line a to be determined contains a large number of pixels
Figure 229431DEST_PATH_IMAGE023
The area surrounded by the welding line b to be determined is recorded as an area due to the small number of pixels contained in the welding line b to be determined
Figure 727277DEST_PATH_IMAGE024
. Area finding
Figure 529011DEST_PATH_IMAGE023
And area
Figure 608962DEST_PATH_IMAGE024
Of intersection of
Figure 352796DEST_PATH_IMAGE025
To find a region
Figure 885409DEST_PATH_IMAGE023
And area
Figure 225255DEST_PATH_IMAGE024
Union of
Figure 425292DEST_PATH_IMAGE026
If there is an intersection
Figure 340027DEST_PATH_IMAGE025
Number and area of middle pixel points
Figure 359936DEST_PATH_IMAGE024
The number ratio of the middle pixel points is more than or equal to
Figure 565789DEST_PATH_IMAGE027
If region
Figure 744966DEST_PATH_IMAGE023
Number and union of middle pixel points
Figure 440390DEST_PATH_IMAGE026
Is greater than or equal to
Figure 88540DEST_PATH_IMAGE028
Then region of
Figure 160401DEST_PATH_IMAGE023
And (4) wrapping the area. Region to region
Figure 928506DEST_PATH_IMAGE024
And taking the corresponding weld line b to be determined as a final weld line, and taking the area surrounded by the final weld line as a welding area.
As shown in fig. 3, in the case of an irregular welding area, the first side adjacent region of the weld line c to be determined is an image of the surface of the automobile part, and the second side adjacent region of the weld line c to be determined is a heat affected zone. The first side neighborhood of the weld line d to be determined is a heat affected zone, and the second side neighborhood of the weld line d to be determined is a smooth silver surface. When the welding line c to be determined and the welding line d to be determined are subjected to wrapping detection, the area surrounded by the welding line c to be determined is marked as an area due to the fact that the welding line c to be determined contains more pixels, and the area surrounded by the welding line d to be determined is marked as an area due to the fact that the welding line d to be determined contains less pixels
Figure 60410DEST_PATH_IMAGE024
. Area finding
Figure 930277DEST_PATH_IMAGE023
And area
Figure 805829DEST_PATH_IMAGE024
Of intersection of
Figure 756337DEST_PATH_IMAGE025
To find a region
Figure 403350DEST_PATH_IMAGE023
And area
Figure 150726DEST_PATH_IMAGE024
Union of
Figure 689023DEST_PATH_IMAGE026
If there is an intersection
Figure 572666DEST_PATH_IMAGE025
Number and area of middle pixel points
Figure 656160DEST_PATH_IMAGE024
The number ratio of the middle pixel points is more than or equal to
Figure 625253DEST_PATH_IMAGE027
If region
Figure 967241DEST_PATH_IMAGE023
Number and union of middle pixel points
Figure 705390DEST_PATH_IMAGE026
Is greater than or equal to
Figure 225364DEST_PATH_IMAGE028
Then region of
Figure 681753DEST_PATH_IMAGE023
Parcel area
Figure 358591DEST_PATH_IMAGE024
. Region to region
Figure 92192DEST_PATH_IMAGE024
And taking the corresponding weld line d to be determined as a final weld line, and taking the area surrounded by the final weld line as a welding area.
In summary, the present invention provides a method for identifying a weld line in an image of an automobile part, which utilizes a computer vision technique to identify the weld line in the image of the automobile part. The method can accurately identify the welding area of the automobile parts based on the characteristics of the welding area and the morphological and structural characteristics of the area around the welding area, and greatly reduces the false detection rate of the welding area.

Claims (8)

1. A welding identification method for automobile parts is characterized by comprising the following steps:
obtaining an automobile part image, and extracting a plurality of independent contour lines in the automobile part image;
neighborhood detection is carried out on two sides of each independent contour line to obtain neighborhood on two sides of each independent contour line, wherein the neighborhood on two sides comprises a first side neighborhood and a second side neighborhood;
converting the automobile part image into a color LAB image, calculating the color richness of a first side neighborhood and a second side neighborhood of each independent contour line in the color LAB image, and determining a color richness threshold value according to all the obtained color richness;
when the color richness of a first side neighborhood or the color richness of a second side neighborhood of any one independent contour line is larger than a color richness threshold value, the independent contour line is used as an alternative weld line to obtain all alternative weld lines;
calculating the color contrast of the first side neighborhood and the second side neighborhood of each alternative welding line by using the color richness of the first side neighborhood and the color richness of the second side neighborhood of each alternative welding line;
acquiring gray level images of a first side neighborhood and a second side neighborhood, constructing a gray level co-occurrence matrix, extracting texture characteristics of the first side neighborhood and the second side neighborhood of each alternative welding line in the gray level images by using the gray level co-occurrence matrix, and calculating the texture contrast of the first side neighborhood and the second side neighborhood of each alternative welding line;
calculating the total contrast of a first side neighborhood and a second side neighborhood of each alternative weld line by using the color contrast and the texture contrast corresponding to each alternative weld line, and taking the alternative weld line as the weld line to be determined when the total contrast is greater than a preset total contrast threshold;
and (4) detecting the encapsulation of any two weld lines to be determined to identify a final weld line, and taking the area enclosed in the final weld line as a welding area.
2. The method for identifying the welding of the automobile parts according to claim 1, wherein the calculating the color richness of the first side neighborhood and the second side neighborhood of each independent contour line in the color LAB image comprises:
acquiring channel values of each pixel point in a first side neighborhood of each independent contour line in three channels of L, A and B in the color LAB image;
obtaining a color vector of each pixel point in the first side neighborhood according to the channel value of each pixel point in the L, A and B channels in the first side neighborhood, dividing the pixel points corresponding to the same color vector into same category colors, and counting the number of the pixel points in the same category color and the category number of the color in the first side neighborhood;
calculating the channel value mean values of all pixel points in the first side neighborhood in three channels of L, A and B by using the color vector of each pixel point in the first side neighborhood, and forming a reference color vector by the calculated channel value mean values in the three channels;
calculating the distance between the color vector corresponding to each category color in the first side neighborhood and the reference color vector;
extracting gradients of each pixel point in the first side neighborhood on three channels of L, A and B, and calculating the color gradient of each pixel point according to the gradients of each pixel point on the three channels of L, A and B;
calculating the average color gradient of all pixel points in the first side neighborhood according to the color gradient of each pixel point in the first side neighborhood; calculating the color richness of the first side neighborhood of each independent contour line by utilizing the category number of the colors in the first side neighborhood, the number of pixel points in the same category color, the distance between the color vector corresponding to each category color and the reference color vector and the average color gradient of all the pixel points;
and according to the calculation method of the color richness of the first side neighborhood of each independent contour line, calculating the color richness of the first side neighborhood and the second side neighborhood of each independent contour line in the color LAB image.
3. The method for identifying welding of automobile parts according to claim 2, wherein the color richness of the first side neighborhood of each individual contour line is calculated by the following formula:
Figure DEST_PATH_IMAGE001
wherein the content of the first and second substances,
Figure 198910DEST_PATH_IMAGE002
representing the number of categories of colors within the first lateral neighborhood;
Figure DEST_PATH_IMAGE003
representing the number of pixel points in the same category color in the first side neighborhood;
Figure 303001DEST_PATH_IMAGE004
representing the total number of pixel points in the first side neighborhood;
Figure DEST_PATH_IMAGE005
indicating the second in the first side neighborhood
Figure 20421DEST_PATH_IMAGE006
The distance between the color vector corresponding to the color of the individual category and the reference color vector;
Figure DEST_PATH_IMAGE007
representing the average color gradient of all pixel points in the first side neighborhood;
Figure 602581DEST_PATH_IMAGE008
and representing the color richness of the neighborhood of the first side of any one independent contour line.
4. The method for identifying welding of automobile parts according to claim 1, wherein the calculation formula of the color contrast of the first side neighborhood and the second side neighborhood of each candidate welding line is as follows:
Figure DEST_PATH_IMAGE009
wherein the content of the first and second substances,
Figure 89057DEST_PATH_IMAGE010
representing the color richness of the first side neighborhood of any one alternative welding line;
Figure DEST_PATH_IMAGE011
representing the color richness of the second side neighborhood of any one alternative welding line;
Figure 364050DEST_PATH_IMAGE012
to represent
Figure 162242DEST_PATH_IMAGE010
And
Figure 767666DEST_PATH_IMAGE011
minimum value of (1);
Figure DEST_PATH_IMAGE013
to represent
Figure 357917DEST_PATH_IMAGE010
And
Figure 882439DEST_PATH_IMAGE011
maximum value of (1);
Figure 308872DEST_PATH_IMAGE014
representing the color contrast of the first and second side neighborhoods of any one of the candidate weld lines.
5. The method for identifying welding of automobile parts according to claim 1, wherein the calculating the texture contrast of the first side neighborhood and the second side neighborhood of each candidate welding line by using the texture features of the first side neighborhood and the second side neighborhood of each candidate welding line in the gray scale image extracted by the gray scale co-occurrence matrix comprises:
obtaining a first gray level co-occurrence matrix by utilizing the gray level value of the first side neighborhood of each alternative weld line in the gray level image;
obtaining a second gray level co-occurrence matrix by utilizing the gray level value of the second side neighborhood of each alternative weld line in the gray level image;
calculating the energy, entropy, contrast and inverse difference moment of the first gray level co-occurrence matrix and the second gray level co-occurrence matrix by using each numerical value in the first gray level co-occurrence matrix and the second gray level co-occurrence matrix as a texture feature;
calculating the texture structure similarity of the first side neighborhood and the second side neighborhood of each alternative welding line by using the texture characteristics of the first side neighborhood and the second side neighborhood of each alternative welding line in the gray level image;
and calculating the texture contrast of the first side neighborhood and the second side neighborhood of each alternative welding line according to the texture structure similarity of the first side neighborhood and the second side neighborhood of each alternative welding line.
6. The method for identifying the weld of the automobile part as claimed in claim 5, wherein the calculation formula of the texture similarity between the first side adjacent region and the second side adjacent region of each candidate weld line is as follows:
Figure DEST_PATH_IMAGE015
wherein the content of the first and second substances,
Figure 232835DEST_PATH_IMAGE016
texture feature representing the neighborhood of the first side of any one of the candidate weld lines
Figure 21799DEST_PATH_IMAGE006
A numerical value;
Figure DEST_PATH_IMAGE017
second representing texture features adjacent to a second side of any one of the candidate weld lines
Figure 654906DEST_PATH_IMAGE006
A numerical value;
Figure 552323DEST_PATH_IMAGE018
first side neighborhood and second side neighborhood representing any one alternative weld lineTexture similarity of neighborhoods;
the calculation formula of the texture contrast of the first side neighborhood and the second side neighborhood of each candidate welding line is shown as the following formula:
Figure DEST_PATH_IMAGE019
wherein the content of the first and second substances,
Figure 139031DEST_PATH_IMAGE018
representing the texture structure similarity of a first side neighborhood and a second side neighborhood of any one alternative welding line;
Figure 313661DEST_PATH_IMAGE020
representing the texture contrast of the first and second side neighborhoods of any one of the candidate weld lines.
7. The method for identifying a weld of automotive parts according to claim 6, wherein the calculation formula of the total contrast of the first side neighborhood and the second side neighborhood of each candidate weld line is as follows:
Figure DEST_PATH_IMAGE021
wherein the content of the first and second substances,
Figure 835778DEST_PATH_IMAGE014
representing the color contrast of the first side neighborhood and the second side neighborhood of any one alternative weld line;
Figure 299120DEST_PATH_IMAGE020
representing the texture contrast of the first side neighborhood and the second side neighborhood of any one alternative weld line;
Figure 784459DEST_PATH_IMAGE022
representing the total contrast of the first and second side neighborhoods of any one of the candidate weld lines.
8. The method for identifying the welding of the automobile parts according to claim 1, wherein the detecting the wrapping performance of any two weld lines to be determined to identify a final weld line, and the area enclosed in the final weld line is used as a welding area, and the method comprises the following steps:
respectively solving the convex contour line of each weld line to be determined by using a convex hull algorithm;
obtaining an intersection of the areas surrounded by the convex contour lines of any two to-be-determined weld lines;
extracting two regions with intersection, and recording the region with more pixels in the two regions with intersection as the region
Figure DEST_PATH_IMAGE023
In the two regions having intersection, a region having a small number of pixels is defined as a region
Figure 734967DEST_PATH_IMAGE024
Area finding
Figure 37772DEST_PATH_IMAGE023
And area
Figure 394935DEST_PATH_IMAGE024
Of intersection of
Figure DEST_PATH_IMAGE025
To find a region
Figure 792287DEST_PATH_IMAGE023
And area
Figure 824001DEST_PATH_IMAGE024
Union of
Figure 297708DEST_PATH_IMAGE026
If there is an intersection
Figure 142167DEST_PATH_IMAGE025
Number and area of middle pixel points
Figure 93942DEST_PATH_IMAGE024
The number ratio of the middle pixel points is more than or equal to
Figure DEST_PATH_IMAGE027
If region
Figure 19042DEST_PATH_IMAGE023
Number and union of middle pixel points
Figure 866912DEST_PATH_IMAGE026
Is greater than or equal to
Figure 198668DEST_PATH_IMAGE028
Then region of
Figure 954134DEST_PATH_IMAGE023
Parcel area
Figure 671423DEST_PATH_IMAGE024
Region to region
Figure 752512DEST_PATH_IMAGE024
And taking the corresponding weld line to be determined as a final weld line, and taking the area enclosed in the final weld line as a welding area.
CN202210764041.2A 2022-07-01 2022-07-01 Welding identification method for automobile parts Active CN114820629B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210764041.2A CN114820629B (en) 2022-07-01 2022-07-01 Welding identification method for automobile parts

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210764041.2A CN114820629B (en) 2022-07-01 2022-07-01 Welding identification method for automobile parts

Publications (2)

Publication Number Publication Date
CN114820629A true CN114820629A (en) 2022-07-29
CN114820629B CN114820629B (en) 2022-09-02

Family

ID=82523455

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210764041.2A Active CN114820629B (en) 2022-07-01 2022-07-01 Welding identification method for automobile parts

Country Status (1)

Country Link
CN (1) CN114820629B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001053977A (en) * 1999-08-09 2001-02-23 Max Co Ltd Color picture contour line extracting device
CN106469312A (en) * 2016-09-29 2017-03-01 江苏省特种设备安全监督检验研究院 Weld seam visual identity method based on region growing label
CN106558051A (en) * 2015-09-25 2017-04-05 浙江大学 A kind of improved method for detecting road from single image
CN107424142A (en) * 2017-03-30 2017-12-01 上海万如科技发展有限公司 A kind of weld joint recognition method based on saliency detection
CN110298362A (en) * 2019-06-11 2019-10-01 浙江工业大学 A kind of peony feature extracting method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001053977A (en) * 1999-08-09 2001-02-23 Max Co Ltd Color picture contour line extracting device
CN106558051A (en) * 2015-09-25 2017-04-05 浙江大学 A kind of improved method for detecting road from single image
CN106469312A (en) * 2016-09-29 2017-03-01 江苏省特种设备安全监督检验研究院 Weld seam visual identity method based on region growing label
CN107424142A (en) * 2017-03-30 2017-12-01 上海万如科技发展有限公司 A kind of weld joint recognition method based on saliency detection
CN110298362A (en) * 2019-06-11 2019-10-01 浙江工业大学 A kind of peony feature extracting method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
吴易洲等: "基于三维激光扫描的窄搭接焊特征提取与缺陷识别", 《应用激光》 *

Also Published As

Publication number Publication date
CN114820629B (en) 2022-09-02

Similar Documents

Publication Publication Date Title
CN109191459B (en) Automatic identification and rating method for continuous casting billet macrostructure center segregation defect
CN115311176B (en) Night image enhancement method based on histogram equalization
CN101794434B (en) Image processing apparatus and image processing method
US8774503B2 (en) Method for color feature extraction
CN114723701A (en) Gear defect detection method and system based on computer vision
CN112132843A (en) Hematoxylin-eosin staining pathological image segmentation method based on unsupervised deep learning
CN106651872A (en) Prewitt operator-based pavement crack recognition method and system
CN115330645B (en) Welding image enhancement method
CN114972343B (en) Method for detecting production abnormity of laser welding product
CN115345885A (en) Method for detecting appearance quality of metal fitness equipment
CN104794502A (en) Image processing and mode recognition technology-based rice blast spore microscopic image recognition method
CN115100221A (en) Glass defect segmentation method
CN115457037B (en) Raw material quality inspection method for donkey-hide gelatin product production
CN111753805A (en) Method and device for detecting wearing of safety helmet
CN114219805A (en) Intelligent detection method for glass defects
CN116228804B (en) Mineral resource identification method based on image segmentation
CN115018765A (en) Powder metallurgy part finished product detection method based on gray level gradient co-occurrence matrix
CN115049657A (en) Glass defect detection method
CN116091421A (en) Method for automatically dividing and calculating area of blastomere image of in-vitro fertilized embryo
CN116092015A (en) Road construction state monitoring method
CN111709964A (en) PCBA target edge detection method
CN114882034A (en) Fabric dyeing quality evaluation method based on image processing
CN114820629B (en) Welding identification method for automobile parts
CN117152159B (en) Method and system for detecting printing flaws of complex cloth
CN111783673B (en) Video segmentation improvement method based on OSVOS

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