Optical imaging method and system for ultrasonic detection of welds based on welding process
Through the acoustic wave detection and optical simulation imaging network, the difficulty of optical imaging caused by the high brightness of the weld seam is solved, the accurate detection and image conversion of the weld seam area is achieved, and clear images of the weld seam and welding material are provided.
Patent Information
- Application Number
- CN202410911641.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-09
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2044-07-09
AI Technical Summary
It is difficult to accurately detect the position of the welding seam and obtain the relationship between the gap depth of the welding seam and the change of the corresponding material in the optical image with the existing technology. In particular, due to the high brightness of the welding material and the welding seam, ordinary optical imaging is difficult.
Acoustic wave detection is used to obtain a two-dimensional matrix image of the weld, which is constructed through clustering and three-dimensional images, combined with an optical simulation imaging network, including a boundary convolution network, a convolution network and an optical reconstruction convolution network, to convert the weld information into an optical image. .
It achieves accurate detection of the weld area and conversion of optical images, obtains clear images of the weld and the welded object, and solves the difficult problem of optical imaging of high-brightness welded objects.
Smart Images

Figure CN118463872B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to an optical imaging method and system for ultrasonic detection of welds based on welding technology. Background Art
[0002] At present, since the weld and the weld itself are highly bright, that is, the surface is highly smooth and shiny, it is difficult to shoot with ordinary optical imaging. Therefore, it is necessary to use electromagnetic reflection signals for detection, and then convert them back into optical images for observation. However, it is difficult to accurately detect the position of the weld and obtain the relationship between the depth of the weld gap and the corresponding material changes in the optical image. Summary of the invention
[0003] The purpose of the present invention is to provide an optical imaging method and system for ultrasonic detection of welds based on welding process, so as to solve the above-mentioned problems existing in the prior art.
[0004] In a first aspect, an embodiment of the present invention provides an optical imaging method for detecting welds by acoustic waves based on a welding process, comprising:
[0005] S101: obtaining a two-dimensional acoustic wave ranging matrix in three directions of the object to be welded; the two-dimensional acoustic wave ranging matrix represents an image of the distance of each position of the object to be welded detected by the ultrasonic device; the object to be welded is an object to be welded in advance;
[0006] S102: Based on the acoustic wave ranging two-dimensional matrix, the weld and the weld material are detected by clustering to obtain a two-dimensional weld area and a two-dimensional weld material area;
[0007] Among them, three two-dimensional acoustic wave ranging matrices correspond to three two-dimensional weld areas and three two-dimensional weld material areas;
[0008] S103: constructing a three-dimensional image based on three acoustic wave ranging two-dimensional matrices to obtain a first weld three-dimensional image;
[0009] S104: Based on the three weld two-dimensional regions and the first weld three-dimensional image, three weld regions and three weld material regions are obtained by detecting the positions of the welds and the weld dimensions in whole and in part;
[0010] S105: simulating optical imaging based on the weld area and the corresponding weld material area through an optical simulation imaging network to obtain a converted optical image; three converted optical images are obtained corresponding to the three weld areas; the converted optical image is an optical image taken by a simulated camera device for the weld and the weld material;
[0011] The optical simulation imaging network includes a boundary convolutional network, a first convolutional network and an optical reconstruction convolutional network.
[0012] Optionally, the training method of the optical simulation imaging network includes:
[0013] A plurality of training images to be converted and corresponding annotated images are obtained; the training images to be converted represent images containing optical information of regions of the training object excluding the region with the gap and the pixel value of the region with the gap is 255; the annotated images are optical images of the training object taken by a camera; the training object is an object that can be photographed by the camera used for training;
[0014] Obtaining a border width and a border height; the border width represents the width of the set pre-acquired training image to be converted; the border height represents the height of the set pre-acquired training image to be converted;
[0015] The pixel values of the area from the left position of the boundary to the right position of the boundary, and from the upper position of the boundary to the lower position of the boundary of the training image to be converted are all set to 255, and the boundary area is extracted to obtain a boundary image; the left position of the boundary is the position of the center point minus the boundary width; the right position of the boundary is the position of the center point plus the boundary width; the upper position of the boundary is the position of the center point minus the boundary height; and the lower position of the boundary is the position of the center point plus the boundary height;
[0016] Inputting the boundary image into a boundary convolution network to extract boundary features to obtain boundary features;
[0017] Inputting the training image to be converted into a first convolutional network to extract overall features to obtain overall features;
[0018] Superimposing the overall feature and the boundary feature to obtain a training feature;
[0019] Inputting the training features into an optical reconstruction convolutional network, adding optical features, and obtaining a reconstructed optical image;
[0020] The loss value is calculated for the reconstructed optical image and the annotated image, and the optical simulation imaging network is trained by backpropagation to obtain a trained optical simulation imaging network.
[0021] Optionally, the detecting the weld and the weld material by clustering based on the acoustic wave ranging two-dimensional matrix to obtain the weld two-dimensional area and the weld material two-dimensional area includes:
[0022] Clustering the values in the acoustic wave ranging two-dimensional matrix to obtain a set of different positions of the object to be welded that are away from the ultrasonic device, and obtaining a plurality of matrix position sets; the values in the matrix position sets represent positions in the acoustic wave ranging two-dimensional matrix;
[0023] According to the matrix position set, the position of the acoustic wave ranging two-dimensional matrix is marked to obtain a marking matrix; the marking matrix includes a plurality of marking areas; an area corresponding to an identical value in the marking matrix is a marking area; the size of the marking matrix is the same as the size of the acoustic wave ranging two-dimensional matrix;
[0024] Based on the marking matrix, the distance between the object to be welded and the ultrasonic device is determined, and the marking matrix is segmented to obtain a weld area to be detected and a plurality of weld areas to be detected;
[0025] The connected regions in the multiple weld seam regions to be detected are set as one region to obtain multiple updated weld seam regions;
[0026] Find the center point in the updated weld area, and obtain a line segment from a point on the boundary of the updated weld area to the center point as an updated line segment; multiple updated weld areas correspond to multiple updated line segments;
[0027] Based on the multiple updated line segments, the multiple updated weld areas and the acoustic wave ranging two-dimensional matrix, determine the position change, and obtain an updated weld distance set and m-1 updated weld differences;
[0028] A weld two-dimensional region is obtained based on the m-1 updated weld differences, the updated weld distance set and a plurality of updated weld regions.
[0029] Optionally, judging the position change based on the multiple updated line segments, the multiple updated weld areas and the acoustic wave ranging two-dimensional matrix to obtain an updated weld distance set and m-1 updated weld differences includes:
[0030] The position where the updated line segment passes in the updated weld area is taken as the updated position;
[0031] The distance of the ultrasonic device corresponding to the update position in the two-dimensional matrix of acoustic wave ranging is taken as the update distance; a plurality of update distances are obtained corresponding to one update line segment;
[0032] Putting multiple updated distances into an updated weld distance set; obtaining multiple updated weld distance sets corresponding to multiple updated weld regions;
[0033] The values of adjacent positions in the updated weld distance set are subtracted in sequence to obtain updated weld differences; m updated weld distance sets correspond to m-1 updated weld differences.
[0034] Optionally, judging the distance between the object to be welded and the ultrasonic device based on the marking matrix, segmenting the marking matrix to obtain a weld area to be detected and a plurality of weld areas to be detected, includes:
[0035] The average value of the values in the matrix position set is taken as the average distance; multiple average distances are obtained corresponding to multiple matrix position sets;
[0036] An average distance smaller than other average distances among the multiple average distances is taken as a first average distance;
[0037] The marked area corresponding to the first average distance is set as the welding area to be detected;
[0038] The area of the plurality of marking areas except the weld area to be inspected is set as the weld area to be inspected.
[0039] Optionally, the simulating optical imaging based on the weld area and the corresponding weld material area through the optical simulation imaging network to obtain a converted optical image includes:
[0040] According to the acoustic wave ranging two-dimensional matrix, an image with a width equal to the number of rows of the acoustic wave ranging two-dimensional matrix, a length equal to the number of columns of the acoustic wave ranging two-dimensional matrix, and pixel values all being 255 is constructed as an initial optical image;
[0041] Obtaining a welding optical image; the welding optical image is an image containing a material corresponding to the object to be welded;
[0042] Copying pixel values of a part of the image in the welding optical image in the welding object area in the initial optical image to obtain an image of the object to be welded;
[0043] Based on the image of the object to be welded, optical information of the weld position at different depths and different viewing angles is added through an optical simulation imaging network to obtain a converted optical image; the converted optical image represents an image in which the weld information detected by ultrasonic wave is converted to an optical image.
[0044] Optionally, obtaining a weld two-dimensional area based on the m-1 updated weld differences, the updated weld distance set and the multiple updated weld areas includes:
[0045] If the absolute value of the difference between the m-1 updated weld differences is less than the updated distance threshold, the updated weld area corresponding to the updated weld distance set is used as the weld two-dimensional area;
[0046] If the absolute value of the difference between the m-1 updated weld differences is greater than or equal to the updated distance threshold, the updated weld area corresponding to the updated weld distance set is used as the two-dimensional area of the weld.
[0047] Optionally, constructing a three-dimensional image based on three acoustic wave ranging two-dimensional matrices to obtain a first weld three-dimensional image includes:
[0048] The number of rows and the number of columns of the three acoustic wave ranging two-dimensional matrices are used as the number of rows, the number of columns and the number of pages of a three-dimensional matrix respectively; the initial value of the three-dimensional matrix is 0;
[0049] According to the difference of the values in the two-dimensional matrix of acoustic wave ranging, the distance between the weld to be measured and the ultrasonic device is found, and the corresponding position in the three-dimensional matrix is set to 1 to obtain the first weld three-dimensional matrix;
[0050] The first weld three-dimensional matrix is used as a binary image to obtain a first weld three-dimensional image.
[0051] Optionally, obtaining the weld area and the weld material area based on the three weld two-dimensional areas and the first weld three-dimensional image includes:
[0052] Inputting the first weld three-dimensional image into a three-dimensional convolutional network, extracting features of the three-dimensional region, and obtaining a first three-dimensional feature map;
[0053] Rotate the first three-dimensional feature map to the left to obtain a second three-dimensional feature map; rotate the first three-dimensional feature map to the right to obtain a third three-dimensional feature map;
[0054] Input the first three-dimensional feature map, the second three-dimensional feature map and the third three-dimensional feature map into the three-dimensional classifier respectively to obtain three three-dimensional regions of the weld;
[0055] The overlapping area between the three-dimensional weld area and the corresponding two-dimensional weld area is taken as the weld area;
[0056] The area other than the weld area in the first weld seam three-dimensional image is set as the weld material area.
[0057] In a second aspect, an embodiment of the present invention provides an optical imaging system for ultrasonic detection of welds based on a welding process, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor.
[0058] Compared with the prior art, the embodiments of the present invention achieve the following beneficial effects:
[0059] The embodiment of the present invention also provides an optical imaging method and system for detecting welds by acoustic waves based on welding process, the method comprising: obtaining an acoustic wave ranging two-dimensional matrix of the object to be welded in three directions; the acoustic wave ranging two-dimensional matrix represents an image of the distance of each position of the object to be welded detected by the ultrasonic equipment; the object to be welded is an object to be welded in advance; based on the acoustic wave ranging two-dimensional matrix, the weld and the weld are detected by clustering to obtain a two-dimensional weld area and a two-dimensional weld area; wherein three acoustic wave ranging two-dimensional matrices correspond to obtaining three two-dimensional weld areas and three two-dimensional weld areas; based on the three acoustic wave ranging two-dimensional matrices , construct a three-dimensional image to obtain a first weld three-dimensional image; based on the three weld two-dimensional areas and the first weld three-dimensional image, the positions of the weld and the weld dimension are detected overall and locally to obtain three weld areas and three weld material areas; through an optical simulation imaging network, based on the weld areas and the corresponding weld material areas, optical imaging is simulated to obtain converted optical images; three weld areas are correspondingly obtained with three converted optical images; the converted optical images are optical images taken by a simulated camera device for the weld and the weld material; the optical simulation imaging network includes a boundary convolution network, a first convolution network and an optical reconstruction convolution network.
[0060] The present invention obtains the value of the distance of the object to be welded detected by the ultrasonic device in different directions from the ultrasonic device. The weld area is directly detected by a two-dimensional acoustic wave ranging two-dimensional matrix. The weld area is detected by constructing a binary image, that is, a three-dimensional image, from the two-dimensional acoustic wave ranging two-dimensional matrix. The two together obtain a more accurate weld area. According to the different distances detected by the ultrasonic device, the acoustic wave ranging two-dimensional matrix is divided into different areas, so as to find the area where the weld is located in the object to be welded. And the area where the distance mutation occurs is used as the weld area by updating the line segment. The optical simulation imaging network corresponding to the gradual change of the optical image of the depth until the deeper and darker the RGB value changes is trained by using materials that can be photographed by the camera equipment during training and a large gap so that the result of high brightness is not caused. And the pixel value of the optical image corresponding to the material of the object to be welded is copied, and the optical image of the weld is polished and obtained by the optical simulation imaging network. The technical effect of obtaining the optical image more accurately is achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] Figure 1 It is a flow chart of an optical imaging method for ultrasonic detection of welds based on welding process provided by an embodiment of the present invention.
[0062] Figure 2 It is a schematic diagram of the relationship between a three-dimensional matrix and a first acoustic wave ranging two-dimensional matrix, a second acoustic wave ranging two-dimensional matrix and a third acoustic wave ranging two-dimensional matrix in an optical imaging method for acoustic wave detection of welds based on a welding process provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0063] The present invention will be described in detail below in conjunction with the accompanying drawings.
[0064] Example 1
[0065] like Figure 1 As shown, an embodiment of the present invention provides an optical imaging method for detecting welds by using acoustic waves based on a welding process, the method comprising:
[0066] S101: Obtaining a two-dimensional acoustic wave ranging matrix of three directions of the object to be welded; the two-dimensional acoustic wave ranging matrix represents an image of the distance of each position of the object to be welded detected by the ultrasonic device; the object to be welded is an object to be welded in advance.
[0067] The welding optical image can be an image captured by a camera.
[0068] The two-dimensional acoustic wave ranging matrix is used to measure the distance of the object to be welded which is placed parallel to the ultrasonic wave equipment.
[0069] The welding optical image is an optical image captured by a camera at any direction. In this embodiment, the three directions are the top, left side and right side of the welding object.
[0070] The weld of the object to be welded is highly shiny, so ordinary camera equipment cannot capture the actual situation.
[0071] In this embodiment, when detecting the weld, only the weld and the weld exist in the matrix and image set.
[0072] There is no obstruction between the ultrasonic device and the camera device and the object to be welded.
[0073] S102: Based on the acoustic wave ranging two-dimensional matrix, the weld and the weld material are detected by clustering to obtain a two-dimensional weld area and a two-dimensional weld material area;
[0074] Among them, three two-dimensional acoustic wave ranging matrices correspond to three two-dimensional weld areas and three two-dimensional weld material areas;
[0075] S103: constructing a three-dimensional image based on three acoustic wave ranging two-dimensional matrices to obtain a first weld three-dimensional image;
[0076] S104: Based on the three weld two-dimensional regions and the first weld three-dimensional image, three weld regions and three weld material regions are obtained by detecting the positions of the welds and weld dimensions both globally and locally.
[0077] Among them, one weld area corresponds to one weld material area.
[0078] S105: Based on the weld area and the corresponding weld material area, optical imaging is simulated through an optical simulation imaging network to obtain a converted optical image; three converted optical images are obtained corresponding to the three weld areas; the converted optical image is an optical image taken by a simulated camera device for the weld and the weld material.
[0079] The optical simulation imaging network includes a boundary convolutional network, a first convolutional network and an optical reconstruction convolutional network.
[0080] The welding material refers to the object other than the welding seam used for welding. For example, when welding two thin plates, the welding material is the thin plates, and the welding seam is the gap between the two thin plates.
[0081] Optionally, the training method of the optical simulation imaging network includes:
[0082] A plurality of training images to be converted and corresponding annotated images are obtained; the training images to be converted represent images containing optical information of regions of the training object excluding regions with gaps and pixels of the regions with gaps having values of 255; the annotated images are optical images of the training object taken by a camera; and the training object is an object that can be photographed by a camera used for training.
[0083] Obtaining a border width and a border height; the border width represents the width of the set pre-acquired training image to be converted; the border height represents the height of the set pre-acquired training image to be converted;
[0084] The pixel values of the area from the left position of the boundary to the right position of the boundary, and from the upper position of the boundary to the lower position of the boundary of the training image to be converted are all set to 255, the boundary area is extracted, and a boundary image is obtained; the left position of the boundary is the position of the center point minus the boundary width; the right position of the boundary is the position of the center point plus the boundary width; the upper position of the boundary is the position of the center point minus the boundary height; the lower position of the boundary is the position of the center point plus the boundary height.
[0085] The pixel values of the area are all set to 255, that is, RGB is set to (255, 255, 255), which means that the middle area is set to white, and only the boundary area is retained to obtain a boundary image.
[0086] Inputting the boundary image into a boundary convolution network to extract boundary features to obtain boundary features;
[0087] Wherein, the boundary convolution network is a convolutional neural network (CNN).
[0088] Inputting the training image to be converted into a first convolutional network to extract overall features to obtain overall features;
[0089] The training image to be converted is a convolutional neural network (CNN) having a structure and parameters different from those of a boundary convolutional network.
[0090] The overall feature and the boundary feature are superimposed to obtain a training feature.
[0091] The overall feature and the boundary feature are superimposed in the page direction.
[0092] The training features are input into an optical reconstruction convolutional network, and optical features are added to obtain a reconstructed optical image.
[0093] The optical reconstruction convolutional network is a convolutional neural network (CNN). The optical reconstruction network uses a convolution kernel whose size is larger than the training feature to perform convolution to obtain a reconstructed optical image.
[0094] The loss value is calculated for the reconstructed optical image and the annotated image, and the optical simulation imaging network is trained by backpropagation to obtain a trained optical simulation imaging network.
[0095] The cross entropy loss function is used to calculate the pixel points at the same position of the reconstructed optical image and the annotated image to obtain the loss value.
[0096] Through the above method, due to different depths, the area in the weld that is closer to the center of the weld is more black in color, and the area that is farther from the center of the weld is more similar to the color of the weld. Using a training object with a larger area at a common position to train the optical image training optical simulation imaging network can obtain an optical image produced by a relatively clear position that can detect acoustic wave detection;
[0097] Optionally, the detecting the weld and the weld material by clustering based on the acoustic wave ranging two-dimensional matrix to obtain the weld two-dimensional area and the weld material two-dimensional area includes:
[0098] Clustering the values in the acoustic wave ranging two-dimensional matrix to obtain a set of different positions of the object to be welded that are away from the ultrasonic device, and obtaining a plurality of matrix position sets; the values in the matrix position sets represent positions in the acoustic wave ranging two-dimensional matrix;
[0099] Wherein, the ultrasonic device is an ultrasonic device for obtaining the sound wave ranging two-dimensional matrix.
[0100] In this embodiment, k-means algorithm is used for clustering. In this embodiment, Euclidean distance is used for clustering, and the values of Euclidean distance less than the distance threshold are taken as a set. In this embodiment, the distance threshold is 0.5 mm.
[0101] According to the matrix position set, the position of the acoustic wave ranging two-dimensional matrix is marked to obtain a marking matrix; the marking matrix includes multiple marking areas; an area corresponding to an identical value in the marking matrix is a marking area; the size of the marking matrix is the same as the size of the acoustic wave ranging two-dimensional matrix.
[0102] Wherein, a region corresponding to a same value in the marking matrix corresponds to a matrix position set;
[0103] Among them, in the marking matrix, the positions corresponding to a matrix position set in the acoustic wave ranging two-dimensional matrix are set to the same value, such as all set to 1; the positions corresponding to another matrix position set in the acoustic wave ranging two-dimensional matrix are set to the same value and different from the set marks, such as all set to 2.
[0104] Based on the marking matrix, the distance between the object to be welded and the ultrasonic device is determined, and the marking matrix is segmented to obtain a weld area to be detected and a plurality of weld areas to be detected;
[0105] The connected areas among the multiple weld areas to be detected are set as one area to obtain multiple updated weld areas.
[0106] An updated weld area represents an area where the weld is located in the object to be welded.
[0107] Among them, by judging whether the eight values around a value in a marked area in the marking matrix are values in another marked area, such as the value labeled 1 has a value labeled 2 in the upper left corner, the area labeled 1 and the area labeled 2 are set to be connected and set as one area.
[0108] Find the center point in the updated weld area, and obtain a line segment from a point on the boundary of the updated weld area to the center point as an updated line segment; multiple updated weld areas correspond to multiple updated line segments;
[0109] The center point of the updated weld area is the center point of the smallest bounding box that includes the updated weld area.
[0110] Based on the multiple updated line segments, the multiple updated weld areas and the acoustic wave ranging two-dimensional matrix, determine the position change, and obtain an updated weld distance set and m-1 updated weld differences;
[0111] Wherein, m is a natural number greater than 0.
[0112] A two-dimensional weld area is obtained based on the m-1 updated weld differences, the updated weld distance set and the updated weld area.
[0113] Optionally, the simulating optical imaging based on the weld area and the corresponding weld material area through the optical simulation imaging network to obtain the converted optical image includes:
[0114] According to the acoustic wave ranging two-dimensional matrix, an image with a width equal to the number of rows of the acoustic wave ranging two-dimensional matrix, a length equal to the number of columns of the acoustic wave ranging two-dimensional matrix, and pixel values all being 255 is constructed as an initial optical image;
[0115] Wherein, the RGB value of the converted optical image is (255, 255, 255).
[0116] Obtaining a welding optical image; the welding optical image is an image containing a material corresponding to the object to be welded;
[0117] Copying pixel values of a part of the image in the welding optical image in the welding object area in the initial optical image to obtain an image of the object to be welded;
[0118] Wherein, the partial image in the welding optical image is the image of the portion where the weld is located.
[0119] The image of the object to be welded is an image obtained by finding and marking an area where the welding object of the object to be welded is located in the area where the object to be welded is located in the welding optical image.
[0120] Based on the image of the object to be welded, optical information of the weld position at different depths and different viewing angles is added through an optical simulation imaging network to obtain a converted optical image; the converted optical image represents an image in which the weld information detected by ultrasonic wave is converted to an optical image.
[0121] Optionally, the determining of the position change based on the updated line segment, the updated weld area, and the acoustic wave ranging two-dimensional matrix to obtain multiple updated weld differences includes:
[0122] The position where the updated line segments coincide in the updated weld area is taken as the updated position;
[0123] The distance of the ultrasonic device corresponding to the update position in the two-dimensional matrix of acoustic wave ranging is taken as the update distance; a plurality of update distances are obtained corresponding to one update line segment;
[0124] Putting multiple updated distances into an updated weld distance set; obtaining multiple updated weld distance sets corresponding to multiple updated weld regions;
[0125] Subtracting the values of adjacent positions in the updated weld distance set in sequence to obtain updated weld differences; m updated weld distance sets correspond to obtaining m-1 updated weld differences;
[0126] Among them, if the update line segment passes through [2,2], [3,3], and [4,4], then the adjacent positions are subtracted, that is, the value corresponding to [3,3] in the acoustic wave ranging two-dimensional matrix is subtracted from the value corresponding to the position [2,2], and the value corresponding to [4,4] is subtracted from the value corresponding to the position [3,3].
[0127] Optionally, judging the distance between the object to be welded and the ultrasonic device based on the marking matrix, segmenting the marking matrix to obtain a weld area to be detected and a plurality of weld areas to be detected, includes:
[0128] The average value of the values in the matrix position set is taken as the average distance; multiple average distances are obtained corresponding to multiple matrix position sets.
[0129] The average distance represents the average value of the distance between the area corresponding to the matrix position set and the ultrasonic device.
[0130] The values in the matrix position set represent the positions in the acoustic wave ranging two-dimensional matrix.
[0131] An average distance smaller than other average distances among the multiple average distances is taken as a first average distance;
[0132] The first average distance represents the smallest average distance among multiple average distances.
[0133] The marked area corresponding to the first average distance is set as the welding object area to be detected.
[0134] Since the first average distance represents the area of the object to be welded that is closest to the ultrasonic device, and the weld of the object to be welded is a concave part of the object to be welded, the marked area corresponding to the first average distance is the weld area to be detected.
[0135] Among them, multiple matrix position sets correspond to multiple average distances corresponding to multiple marking areas in the marking matrix.
[0136] The area of the plurality of marking areas except the weld area to be inspected is set as the weld area to be inspected.
[0137] According to the above method, since the objects to be welded are placed parallel to the template for detection by the surrounding ultrasonic equipment, and the weld area to be detected is smooth, it can be known that the distance between the weld area to be detected and the ultrasonic equipment is almost the same, and the position of the weld area to be detected is in a matrix position set, and the average distance corresponding to the weld area to be detected is the first average distance. The positions of the gaps corresponding to the weld area to be detected are different from the distance of the ultrasonic equipment, so multiple matrix position sets can be formed. Therefore, the areas other than the weld area to be detected are all weld areas to be detected.
[0138] The area closest to the ultrasonic device is set as the weld area. In this embodiment, when the weld is detected, only the weld and the weld exist in the matrix and image set.
[0139] Optionally, the simulating optical imaging based on the weld area and the corresponding weld material area through the optical simulation imaging network to obtain a converted optical image includes:
[0140] According to the acoustic wave ranging two-dimensional matrix, an image with a width equal to the number of rows of the acoustic wave ranging two-dimensional matrix, a length equal to the number of columns of the acoustic wave ranging two-dimensional matrix, and pixel values all being 255 is constructed as an initial optical image;
[0141] Obtaining a welding optical image; the welding optical image is an image containing a material corresponding to the object to be welded;
[0142] Copying pixel values of a part of the image in the welding optical image in the welding object area in the initial optical image to obtain an image of the object to be welded;
[0143] Based on the image of the object to be welded, optical information of the weld position at different depths and different viewing angles is added through an optical simulation imaging network to obtain a converted optical image; the converted optical image represents an image in which the weld information detected by ultrasonic wave is converted to an optical image.
[0144] Optionally, obtaining a weld two-dimensional area based on the m-1 updated weld differences, the updated weld distance set and the multiple updated weld areas includes:
[0145] If the absolute value of the difference between the m-1 updated weld differences is less than the updated distance threshold, the updated weld area corresponding to the updated weld distance set is taken as the weld two-dimensional area.
[0146] In this embodiment, the update distance threshold is 0.2 mm.
[0147] If the absolute value of the difference between the m-1 updated weld differences is greater than or equal to the updated distance threshold, the updated weld area corresponding to the updated weld distance set is used as the two-dimensional area of the weld.
[0148] Optionally, constructing a three-dimensional image based on three acoustic wave ranging two-dimensional matrices to obtain a first weld three-dimensional image includes:
[0149] The number of rows and the number of columns of the three acoustic wave ranging two-dimensional matrices are used as the number of rows, the number of columns and the number of pages of a three-dimensional matrix respectively; the initial value of the three-dimensional matrix is 0;
[0150] Among them, because the three acoustic wave ranging two-dimensional matrices use matrices detected by ultrasonic devices at the top, left and right. The three acoustic wave ranging two-dimensional matrices are respectively the first acoustic wave ranging two-dimensional matrix, the second acoustic wave ranging two-dimensional matrix and the third acoustic wave ranging two-dimensional matrix. The first acoustic wave ranging two-dimensional matrix is a matrix detected by the ultrasonic device at the top, and the second acoustic wave ranging two-dimensional matrix is a matrix detected by the ultrasonic device on the left. The third acoustic wave ranging two-dimensional matrix is a matrix detected by the ultrasonic device on the right. Therefore, the number of rows of the three-dimensional matrix is equal to the number of rows of the first acoustic wave ranging two-dimensional matrix, the number of columns of the three-dimensional matrix is equal to the number of rows of the second acoustic wave ranging two-dimensional matrix is equal to the number of rows of the third acoustic wave ranging two-dimensional matrix, and the number of pages of the three-dimensional matrix is equal to the number of columns of the second acoustic wave ranging two-dimensional matrix is equal to the number of columns of the third acoustic wave ranging two-dimensional matrix.
[0151] Among them, the three-dimensional matrix includes three dimensions: row, column, and page.
[0152] Among them, the relationship between the three-dimensional matrix and the first acoustic wave ranging two-dimensional matrix, the second acoustic wave ranging two-dimensional matrix and the third acoustic wave ranging two-dimensional matrix is as follows: Figure 2 shown.
[0153] According to the difference of the values in the acoustic wave ranging two-dimensional matrix, the distance between the weld to be measured and the ultrasonic device is found, and the corresponding position in the three-dimensional matrix is set to 1 to obtain the first weld three-dimensional matrix.
[0154] For example, the position closest to the ultrasonic device is set to 1 at the position corresponding to the outermost layer of the three-dimensional matrix.
[0155] The first weld three-dimensional matrix is used as a binary image to obtain a first weld three-dimensional image.
[0156] Optionally, obtaining the weld area and the weld material area based on the three weld two-dimensional areas and the first weld three-dimensional image includes:
[0157] The first weld three-dimensional image is input into a three-dimensional convolutional network, the features of the three-dimensional region are extracted, and a first three-dimensional feature map is obtained; and the corresponding region is found.
[0158] In this embodiment, the three-dimensional convolutional network is a three-dimensional convolutional neural network (3D Convolutional Neural Networks, 3DCNN).
[0159] Rotate the first three-dimensional feature map to the left to obtain a second three-dimensional feature map; rotate the first three-dimensional feature map to the right to obtain a third three-dimensional feature map;
[0160] The first three-dimensional feature map, the second three-dimensional feature map and the third three-dimensional feature map are respectively input into a three-dimensional classifier to obtain three three-dimensional regions of the weld.
[0161] In this embodiment, the three-dimensional classifier is a fully connected neural network (FCN).
[0162] Among them, the three weld three-dimensional regions are the first weld three-dimensional region, the second weld three-dimensional region and the third weld three-dimensional region. The first three-dimensional feature map corresponds to the first weld three-dimensional region. The second three-dimensional feature map corresponds to the second weld three-dimensional region. The third three-dimensional feature map corresponds to the third weld three-dimensional region.
[0163] By using the above method, the three-dimensional weld area corresponding to each surface in the first three-dimensional weld image is found.
[0164] The overlapping area between the three-dimensional weld area and the corresponding two-dimensional weld area is taken as the weld area;
[0165] In this embodiment, the weld area is determined by calculating the overlapping position between the three-dimensional weld area and the two-dimensional weld area.
[0166] Among them, the first weld 2D area corresponds to the first weld 3D area. Because the first 3D feature map rotated to the left is equivalent to detecting the area corresponding to the surface on the right side of the first weld 3D image, the second weld 2D area corresponds to the second weld 3D area. Because the first 3D feature map rotated to the right is equivalent to detecting the area corresponding to the surface on the left side of the first weld 3D image, the third weld 2D area corresponds to the third weld 3D area.
[0167] The area other than the weld area in the first weld seam three-dimensional image is set as the weld material area.
[0168] The area of the surface corresponding to the first weld three-dimensional area in the first weld three-dimensional image, except the first weld three-dimensional area, is set as the first weld material area. The area of the surface corresponding to the second weld three-dimensional area in the first weld three-dimensional image, except the second weld three-dimensional area, is set as the second weld material area. The area of the surface corresponding to the third weld three-dimensional area in the first weld three-dimensional image, except the third weld three-dimensional area, is set as the third weld material area.
[0169] Example 2
[0170] Based on the above-mentioned optical imaging method for detecting welds by acoustic waves based on welding process, an embodiment of the present invention also provides an optical imaging system for detecting welds by acoustic waves based on welding process, the system comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor comprising an acquisition module, a two-dimensional detection module, a three-dimensional detection module, a fusion detection module and an optical simulation module.
[0171] The acquisition module is used to obtain a two-dimensional matrix of acoustic wave ranging in three directions of the object to be welded; the two-dimensional matrix of acoustic wave ranging represents an image of the distance of each position of the object to be welded detected by the ultrasonic device; the object to be welded is an object to be welded in advance;
[0172] The two-dimensional detection module is used to detect the weld and the welded material by clustering based on the acoustic wave ranging two-dimensional matrix to obtain a two-dimensional weld area and a two-dimensional weld area; wherein three two-dimensional weld areas and three two-dimensional weld areas are obtained correspondingly by three two-dimensional acoustic wave ranging matrices;
[0173] The three-dimensional detection module is used to construct a three-dimensional image based on three acoustic wave ranging two-dimensional matrices to obtain a first weld three-dimensional image;
[0174] The fusion detection module is used to obtain three weld areas and three weld material areas by detecting the positions of the welds and the weld dimensions in whole and in part based on the three weld two-dimensional areas and the first weld three-dimensional image;
[0175] The optical simulation module is used to simulate optical imaging based on the weld area and the corresponding weld area through an optical simulation imaging network to obtain a converted optical image; three converted optical images are obtained corresponding to three weld areas; the converted optical image is an optical image taken by a simulated camera device for the weld and weld. The optical simulation imaging network includes a boundary convolution network, a first convolution network and an optical reconstruction convolution network.
Claims
1. An optical imaging method for ultrasonic detection of welds based on welding process, characterized in that: include: S101: Obtaining a two-dimensional matrix of acoustic wave ranging in three directions of the object to be welded; The acoustic wave ranging two-dimensional matrix represents an image of the distance of each position of the object to be welded detected by the ultrasonic device; the object to be welded is an object to be welded in advance; S102: Based on the acoustic wave ranging two-dimensional matrix, the weld and the weld material are detected by clustering to obtain a two-dimensional weld area and a two-dimensional weld material area; Among them, three two-dimensional acoustic wave ranging matrices correspond to three two-dimensional weld areas and three two-dimensional weld material areas; S103: constructing a three-dimensional image based on three acoustic wave ranging two-dimensional matrices to obtain a first weld three-dimensional image; S104: Based on the three weld two-dimensional regions and the first weld three-dimensional image, three weld regions and three weld material regions are obtained by detecting the positions of the welds and the weld dimensions in whole and in part; S105: simulating optical imaging based on the weld area and the corresponding weld material area through an optical simulation imaging network to obtain a converted optical image; three converted optical images are obtained corresponding to the three weld areas; the converted optical image is an optical image taken by a simulated camera device for the weld and the weld material; The optical simulation imaging network includes a boundary convolutional network, a first convolutional network and an optical reconstruction convolutional network; The method of detecting the weld and the weld material by clustering based on the acoustic wave ranging two-dimensional matrix to obtain the weld two-dimensional area and the weld material two-dimensional area includes: Clustering the values in the acoustic wave ranging two-dimensional matrix to obtain a set of different positions of the object to be welded that are away from the ultrasonic device, and obtaining a plurality of matrix position sets; the values in the matrix position sets represent positions in the acoustic wave ranging two-dimensional matrix; According to the matrix position set, the position of the acoustic wave ranging two-dimensional matrix is marked to obtain a marking matrix; the marking matrix includes a plurality of marking areas; an area corresponding to an identical value in the marking matrix is a marking area; the size of the marking matrix is the same as the size of the acoustic wave ranging two-dimensional matrix; Based on the marking matrix, the distance between the object to be welded and the ultrasonic device is determined, and the marking matrix is segmented to obtain a weld area to be detected and a plurality of weld areas to be detected; The connected regions in the multiple weld seam regions to be detected are set as one region to obtain multiple updated weld seam regions; Find the center point in the updated weld area, and obtain a line segment from a point on the boundary of the updated weld area to the center point as an updated line segment; multiple updated weld areas correspond to multiple updated line segments; Based on the multiple updated line segments, the multiple updated weld areas and the acoustic wave ranging two-dimensional matrix, determine the position change, and obtain an updated weld distance set and m-1 updated weld differences; Obtaining a weld two-dimensional region based on the m-1 updated weld differences, the updated weld distance set and a plurality of updated weld regions; The method of determining the position change based on the multiple updated line segments, the multiple updated weld areas and the acoustic wave ranging two-dimensional matrix to obtain an updated weld distance set and m-1 updated weld differences includes: The position where the updated line segment passes in the updated weld area is taken as the updated position; The distance of the ultrasonic device corresponding to the update position in the two-dimensional matrix of acoustic wave ranging is taken as the update distance; a plurality of update distances are obtained corresponding to one update line segment; Putting multiple updated distances into an updated weld distance set; obtaining multiple updated weld distance sets corresponding to multiple updated weld regions; Subtracting the values of adjacent positions in the updated weld distance set in sequence to obtain updated weld differences; m updated weld distance sets correspond to obtaining m-1 updated weld differences; The method of determining the distance between the object to be welded and the ultrasonic device based on the marking matrix and segmenting the marking matrix to obtain a weld area to be detected and a plurality of weld areas to be detected includes: The average value of the values in the matrix position set is taken as the average distance; multiple average distances are obtained corresponding to multiple matrix position sets; An average distance smaller than other average distances among the multiple average distances is taken as a first average distance; Setting the marked area corresponding to the first average distance as the welding area to be detected; The areas other than the weld area to be detected in the plurality of marking areas are set as the weld area to be detected; The step of obtaining a two-dimensional weld area based on the m-1 updated weld differences, the updated weld distance set and the multiple updated weld areas comprises: If the absolute value of the difference between the m-1 updated weld differences is less than the updated distance threshold, the updated weld area corresponding to the updated weld distance set is used as the weld two-dimensional area; If the absolute value of the difference between the m-1 updated weld differences is greater than or equal to the updated distance threshold, the updated weld area corresponding to the updated weld distance set is used as the two-dimensional area of the weld; The optical simulation imaging network simulates optical imaging based on the weld area and the corresponding weld material area to obtain a converted optical image, including: According to the acoustic wave ranging two-dimensional matrix, an image with a width equal to the number of rows of the acoustic wave ranging two-dimensional matrix, a length equal to the number of columns of the acoustic wave ranging two-dimensional matrix, and pixel values all being 255 is constructed as an initial optical image; Obtaining a welding optical image; the welding optical image is an image containing a material corresponding to the object to be welded; Copying pixel values of a part of the image in the welding optical image in the welding object area in the initial optical image to obtain an image of the object to be welded; Based on the image of the object to be welded, optical information of the weld position at different depths and different viewing angles is added through an optical simulation imaging network to obtain a converted optical image; the converted optical image represents an image in which the weld information detected by ultrasonic wave is converted to an optical image.
2. The optical imaging method for ultrasonic detection of welds based on welding process according to claim 1 is characterized in that: The training method of the optical simulation imaging network comprises: A plurality of training images to be converted and corresponding annotated images are obtained; the training images to be converted represent images containing optical information of regions of the training object excluding the region with the gap and the pixel value of the region with the gap is 255; the annotated images are optical images of the training object taken by a camera; the training object is an object that can be photographed by the camera used for training; Obtaining a border width and a border height; the border width represents the width of the set pre-acquired training image to be converted; the border height represents the height of the set pre-acquired training image to be converted; The pixel values of the area from the left position of the boundary to the right position of the boundary, and from the upper position of the boundary to the lower position of the boundary of the training image to be converted are all set to 255, and the boundary area is extracted to obtain a boundary image; the left position of the boundary is the position of the center point minus the boundary width; the right position of the boundary is the position of the center point plus the boundary width; the upper position of the boundary is the position of the center point minus the boundary height; and the lower position of the boundary is the position of the center point plus the boundary height; Inputting the boundary image into a boundary convolution network to extract boundary features to obtain boundary features; Inputting the training image to be converted into a first convolutional network to extract overall features to obtain overall features; Superimposing the overall feature and the boundary feature to obtain a training feature; Inputting the training features into an optical reconstruction convolutional network, adding optical features, and obtaining a reconstructed optical image; The loss value is calculated for the reconstructed optical image and the annotated image, and the optical simulation imaging network is trained by backpropagation to obtain a trained optical simulation imaging network.
3. The optical imaging method for ultrasonic detection of welds based on welding process according to claim 1 is characterized in that: The method of constructing a three-dimensional image based on three acoustic wave ranging two-dimensional matrices to obtain a first weld three-dimensional image includes: The number of rows and the number of columns of the three acoustic wave ranging two-dimensional matrices are used as the number of rows, the number of columns and the number of pages of a three-dimensional matrix respectively; the initial value of the three-dimensional matrix is 0; According to the difference of the values in the two-dimensional matrix of acoustic wave ranging, the distance between the weld to be measured and the ultrasonic device is found, and the corresponding position in the three-dimensional matrix is set to 1 to obtain the first weld three-dimensional matrix; The first weld three-dimensional matrix is used as a binary image to obtain a first weld three-dimensional image.
4. The optical imaging method for ultrasonic detection of welds based on welding process according to claim 1 is characterized in that: The step of obtaining a weld area and a weld material area based on the three weld two-dimensional areas and the first weld three-dimensional image comprises: Inputting the first weld three-dimensional image into a three-dimensional convolutional network, extracting features of the three-dimensional region, and obtaining a first three-dimensional feature map; Rotate the first three-dimensional feature map to the left to obtain a second three-dimensional feature map; rotate the first three-dimensional feature map to the right to obtain a third three-dimensional feature map; Input the first three-dimensional feature map, the second three-dimensional feature map and the third three-dimensional feature map into the three-dimensional classifier respectively to obtain three three-dimensional regions of the weld; The overlapping area between the three-dimensional weld area and the corresponding two-dimensional weld area is taken as the weld area; The area other than the weld area in the first weld three-dimensional image is set as the weld material area.
5. An optical imaging system for ultrasonic detection of welds based on welding process, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the steps of the method according to any one of claims 1 to 4 are implemented when the processor executes the program.
