Disclosure of Invention
The invention provides a welding track tracking method and device based on visual tracking and a computer readable storage medium, and mainly aims to solve the problem that welding quality and welding efficiency are reduced due to the fact that a welding gun deviates from a welding position.
In order to achieve the above object, the present invention provides a welding track tracking method based on visual tracking, which includes:
sending out line laser by using a pre-constructed structured light sensor, and scanning and welding a workpiece by using the line laser to obtain a laser reflection band;
capturing the laser reflection light band by using the structured light type sensor to obtain a laser reflection image frame set;
judging whether a laser reflection image frame with the broken laser reflection light band exists in the laser reflection image frame set or not;
if the laser reflection image frame with the broken laser reflection light band does not exist in the laser reflection image frame set, returning to the step of capturing the laser reflection light band by using the structured light type sensor;
if the laser reflection image frame with the broken laser reflection light band exists in the laser reflection image frame set, extracting the first laser reflection image frame with the broken laser reflection light band in the laser reflection image frame set;
filtering the laser reflection image frame with the first laser reflection light band broken to obtain a filtered laser reflection image frame, and performing binarization processing on the filtered laser reflection image frame to obtain a binarized laser reflection image frame;
extracting coordinates of a lower left corner point of an upper light band and coordinates of an upper left corner point of a lower light band in the binaryzation laser reflection image frame;
and calculating the coordinate of the current welding seam center point by using the coordinates of the lower left corner point of the upper light band and the coordinates of the upper left corner point of the lower light band according to a pre-constructed welding seam center calculation formula.
And tracking the welding center point of the welding workpiece by using the structured light type sensor according to the current welding center point coordinate to obtain the welding track of the welding workpiece.
Optionally, the capturing the laser reflection light band by using the structured light sensor to obtain a laser reflection image frame set includes:
determining an acquisition frame rate and an acquisition time interval of image acquisition equipment in the structured light sensor;
and tracking and recording the scanning position of the laser reflection light band according to the acquisition frame rate and the acquisition time interval to obtain the laser reflection image frame set.
Optionally, the filtering the laser reflection image frame with the broken laser reflection light band to obtain a filtered laser reflection image frame includes:
constructing a gray value extraction template according to a preset pixel size;
sequentially extracting pixel points to be filtered from the laser reflection image frames with the broken laser reflection light bands;
the center of the gray value extraction template is overlapped with the pixel point to be filtered, and the gray value of the pixel point around the pixel point to be filtered is extracted from the laser reflection image frame with the broken laser reflection light band according to the gray value extraction template to obtain a peripheral gray value set;
sequencing the gray values in the peripheral gray value set according to the sequence from small to large to obtain a peripheral gray sequence;
extracting the median gray of the peripheral gray sequence, and resetting the gray value of the pixel point to be filtered to the median gray;
and finishing the gray value resetting operation of all pixel points in the laser reflection image frame with the broken laser reflection light band to obtain the filtering laser reflection image frame.
Optionally, the binarizing the filtered laser reflection image frame to obtain a binarized laser reflection image frame includes:
dividing pixel point gray values in the filtering laser reflection image frame according to a preset gray level to obtain a graded gray level set;
randomly selecting a gray segmentation threshold, and classifying the graded gray set by using the gray segmentation threshold to obtain a first gray set and a second gray set;
calculating the gray level mean values of the first gray level set, the second gray level set and the graded gray level set by using a pre-constructed gray level mean value calculation formula;
calculating the optimal gray segmentation threshold value of the graded gray set according to the first gray set, the second gray set and the gray mean value of the graded gray set by utilizing a pre-constructed inter-class variance formula;
and carrying out binarization processing on the gray values of all pixel points in the filtered laser reflection image frame by using the optimal gray segmentation threshold value to obtain the binarization laser reflection image frame.
Optionally, the gray average calculation formula is as follows:
wherein,
representing the mean value of the gray levels of a first set of gray levels, t representing the gray level segmentation threshold, i representing the gray levels of a different set of gray levels,
number of pixel points representing gray level value iThe ranking scales the number of all pixels in the gray level set,
representing the proportion of the number of pixels in the first gray set to the number of all pixels in the graded gray set,
represents a mean value of the gray levels of the second set of gray levels, m represents a gray level value of m,
representing the proportion of the number of pixels in the second gray level set to the number of all pixels in the graded gray level set,
a mean value of the grays representing the set of graded grays.
Optionally, the tracking, by using the structured light sensor, of the welding center point of the welding workpiece according to the current weld center point coordinate to obtain the welding track of the welding workpiece includes:
taking the current welding central point coordinate as the initial scanning position of the line laser;
scanning the welding workpiece by using the line laser from the initial scanning position to obtain a tracking laser emission band;
capturing the tracking laser light emission band by using the structured light sensor to obtain a tracking laser reflection image frame set;
judging whether an image frame with a broken tracking laser emission band exists in the tracking laser reflection image frame set;
if the tracking laser reflection image frame set does not have the image frame with the fractured tracking laser emission band, returning to the step of capturing the tracking laser emission band by using the structured light type sensor;
if the tracking laser reflection image frame set has an image frame with a broken tracking laser emission band, extracting a first image frame with a broken tracking laser emission band in the tracking laser reflection image frame set;
determining coordinates of a lower left corner point of an upper light band and an upper left corner point of a lower light band in the image frame of the tracking laser emission light band with fracture;
calculating the coordinate of the center point of the tracking weld joint by using the coordinate of the lower left corner point of the upper light band and the coordinate of the upper left corner point of the lower light band in the image frame of the fracture of the tracking laser emission light band;
updating the current welding seam center point coordinate to the tracking welding seam center point coordinate, and returning to the step of using the current welding center point coordinate as the initial scanning position of the line laser until the current welding center point coordinate is updated to the welding end point;
and fitting all the current welding center point coordinates and the tracking welding seam center point coordinates to obtain the welding track of the welding workpiece.
Optionally, the determining coordinates of a lower left corner point of an upper optical band and a lower left corner point of a lower optical band in the image frame with the broken tracking laser emission band includes:
filtering the image frame with the fractured tracking laser emission band to obtain a filtered tracking image frame;
carrying out binarization processing on the filtering tracking image frame to obtain a binarization tracking image frame;
and extracting the coordinates of the lower left corner point of the upper light band and the coordinates of the upper left corner point of the lower light band in the binaryzation tracking image frame.
In order to solve the above problems, the present invention also provides a welding track tracking device based on visual tracking, the device comprising:
the laser reflection light band capturing module is used for sending out line laser by using a pre-constructed structured light sensor and scanning and welding a workpiece by using the line laser to obtain a laser reflection light band; capturing the laser reflection light band by using the structured light type sensor to obtain a laser reflection image frame set;
the laser reflection light band fracture judging module is used for judging whether a laser reflection image frame with the fractured laser reflection light band exists in the laser reflection image frame set; if the laser reflection image frame with the broken laser reflection light band does not exist in the laser reflection image frame set, returning to the step of capturing the laser reflection light band by using the structured light type sensor; if the laser reflection image frame with the broken laser reflection light band exists in the laser reflection image frame set, extracting the first laser reflection image frame with the broken laser reflection light band in the laser reflection image frame set;
the filtering binarization module is used for filtering the laser reflection image frame with the fracture of the first laser reflection light band to obtain a filtered laser reflection image frame, and performing binarization processing on the filtered laser reflection image frame to obtain a binarization laser reflection image frame;
the current welding seam center point coordinate calculation module is used for extracting the coordinates of the lower left corner point of the upper light band and the coordinates of the upper left corner point of the lower light band in the binaryzation laser reflection image frame; calculating the coordinate of the center point of the current welding line by utilizing the coordinates of the lower left corner point of the upper light band and the coordinates of the upper left corner point of the lower light band according to a pre-constructed welding line center calculation formula;
and the welding center point tracking module is used for tracking the welding center point of the welding workpiece by using the structured light type sensor according to the current welding seam center point coordinate to obtain the welding track of the welding workpiece.
In order to solve the above problem, the present invention also provides an electronic device, including:
at least one processor; and (c) a second step of,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to implement the visual tracking based welding trajectory tracking method described above.
In order to solve the above problem, the present invention further provides a computer-readable storage medium having at least one instruction stored therein, where the at least one instruction is executed by a processor in an electronic device to implement the welding track tracking method based on visual tracking described above.
Compared with the background art: the method comprises the steps of emitting line laser through a structured light type sensor, scanning a welded workpiece by using the line laser to obtain a laser reflection light band capable of detecting a welding line, capturing the laser reflection light band by using the structured light type sensor to obtain a laser reflection light frame set, judging whether a laser reflection image frame with the broken laser reflection light band exists in the laser reflection image frame set or not because the laser reflection image frame with the broken laser reflection light band exists when the laser reflection light band is broken, if not, continuously capturing, if so, extracting a laser reflection image frame with the broken laser reflection light band in the first laser reflection image frame set, if so, extracting the first laser reflection image frame in the laser reflection image frame set, if so, extracting the first laser reflection image frame, if so, extracting the first laser image frame, if so, extracting the quality of the image frame is influenced by noise and the like, filtering and binarizing to obtain a binarized laser reflection image frame, calculating the coordinates of a left upper point and a lower left lower point of a welding point of the upper corner of the upper point of the laser reflection light band according to the welding line laser reflection image frame, calculating the current welding point of the welding line laser reflection image frame, and calculating the coordinates of the current welding point of the welding line laser reflection image frame, and calculating the current welding point. Therefore, the welding track tracking method, the welding track tracking device, the electronic equipment and the computer readable storage medium based on visual tracking can solve the problem that welding quality and welding efficiency are reduced because a welding gun is usually deviated from a welding position due to external influences such as metal smoke, noise, workpiece assembly precision and the like.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The embodiment of the application provides a welding track tracking method based on visual tracking. The executing subject of the welding track tracking method based on visual tracking includes, but is not limited to, at least one of the electronic devices of a server, a terminal, and the like, which can be configured to execute the method provided by the embodiments of the present application. In other words, the welding trace tracking method based on visual tracking may be performed by software or hardware installed in a terminal device or a server device. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like.
Example 1:
referring to fig. 1, a flowchart of a welding track tracking method based on visual tracking according to an embodiment of the present invention is shown. In this embodiment, the welding track tracking method based on visual tracking includes:
s1, emitting line laser by using a pre-constructed structured light sensor, and scanning and welding a workpiece by using the line laser to obtain a laser reflection light band.
The structured light sensor can be used for emitting light with a specific wavelength by a laser when working, a plane linear structured light is formed after the light is refracted by a lens and irradiates on a workpiece, so that a laser reflection light band with a certain width is formed, and the light band is reflected or scattered and then passes through a filter with the specific wavelength and enters a camera for imaging.
In an embodiment of the present invention, the obtaining of the laser reflection band by scanning and welding the workpiece with the line laser includes:
determining the scanning range of the line laser according to the size of a preset welding platform;
and according to a preset scanning speed, according to the scanning range, utilizing the line laser to carry out reciprocating scanning on the welding workpiece to obtain the laser reflection light band, wherein the laser reflection light band is approximately vertical to the welding direction of the welding workpiece.
Understandably, the scanning range of the line laser can be determined according to the size of the welding platform, and the phenomenon of useless scanning is avoided. The line laser emitting device may be a laser, and the angular speed of movement of the laser may regulate the scanning speed, which may typically approximate the welding speed. The laser reflection light band is approximately vertical to the welding line, so that the line laser can be conveniently divided by the welding line, and the detection of the welding line is realized.
S2, capturing the laser reflection light band by using the structured light sensor to obtain a laser reflection image frame set.
Understandably, the laser reflected band of light can be captured with a camera in the structured light sensor.
In detail, referring to fig. 2, the capturing the laser reflection light band by the structured light sensor to obtain a laser reflection image frame set includes:
s21, determining an acquisition frame rate and an acquisition time interval of image acquisition equipment in the structured light sensor;
s22, tracking and recording the scanning position of the laser reflection light band according to the acquisition frame rate and the acquisition time interval to obtain the laser reflection image frame set.
It should be understood that the frame rate of the image capturing device refers to the number of video frames captured per second during the capturing process of the camera. The acquisition time interval can be 1s, and because the welding position needs to be positioned again in real time after the welding position is calculated when the welding seam is captured subsequently, the acquisition time interval needs to be compressed as much as possible, and the real-time positioning speed is accelerated.
And S3, judging whether the laser reflection image frame with the broken laser reflection light band exists in the laser reflection image frame set.
Explainably, when the laser reflection image frame is concentrated with the laser reflection image frame with the broken laser reflection light band, it indicates that the camera has captured the real-time position of the welding, because the welding seam can cut off the line laser, thereby generating the phenomenon that the laser reflection light band is broken.
And if the laser reflection image frame with the broken laser reflection light band does not exist in the laser reflection image frame set, returning to the step of capturing the laser reflection light band by using the structured light type sensor.
Understandably, when no laser reflection image frame with the broken laser reflection light band exists in the laser reflection image frame set, the real-time welding position of the welding is captured, and the welding seam is not captured, so that the broken laser reflection light band needs to be captured again.
And if the laser reflection image frame with the broken laser reflection light band exists in the laser reflection image frame set, executing S4, and extracting the first laser reflection image frame with the broken laser reflection light band in the laser reflection image frame set.
Understandably, since the line laser may scan the unwelded weld seam within the acquisition time interval after scanning the real-time welding position, a plurality of laser reflection image frames in which the laser reflection optical band is broken may be captured, and at this time, it is only necessary to extract the laser reflection image frame in which the first laser reflection optical band is broken.
And S5, filtering the laser reflection image frame with the first laser reflection light band broken to obtain a filtered laser reflection image frame, and performing binarization processing on the filtered laser reflection image frame to obtain a binarized laser reflection image frame.
Understandably, because the laser reflection image frame may have poor image quality caused by factors such as noise and the like, the image quality can be improved through median filtering, welding seams and non-welding seams can be displayed in a distinguishing manner through binarization processing, and the extraction of the center position of the welding seams is convenient.
In an embodiment of the present invention, the filtering the laser reflection image frame with a broken laser reflection light band to obtain a filtered laser reflection image frame includes:
constructing a gray value extraction template according to a preset pixel size;
sequentially extracting pixel points to be filtered from the laser reflection image frames with the broken laser reflection light bands;
the center of the gray value extraction template is superposed with the pixel point to be filtered, and the gray value of the pixel point around the pixel point to be filtered is extracted from the laser reflection image frame with the broken laser reflection light band according to the gray value extraction template to obtain a peripheral gray value set;
sequencing the gray values in the peripheral gray value set according to the sequence from small to large to obtain a peripheral gray sequence;
extracting the median gray of the peripheral gray sequence, and resetting the gray value of the pixel point to be filtered to the median gray;
and finishing the gray value resetting operation of all pixel points in the laser reflection image frame with the broken laser reflection light band to obtain the filtering laser reflection image frame.
In detail, the pixel size of the grayscale value extraction template can be set according to practical situations, for example: 3 x 3 dimensional pixel size.
In an embodiment of the present invention, the binarizing the filtered laser reflection image frame to obtain a binarized laser reflection image frame includes:
dividing the gray value of a pixel point in the filtering laser reflection image frame according to a preset gray level to obtain a graded gray level set;
randomly selecting a gray segmentation threshold, and classifying the graded gray set by using the gray segmentation threshold to obtain a first gray set and a second gray set;
calculating the gray level mean values of the first gray level set, the second gray level set and the graded gray level set by using a pre-constructed gray level mean value calculation formula;
calculating the optimal gray segmentation threshold value of the graded gray set according to the first gray set, the second gray set and the gray mean value of the graded gray set by utilizing a pre-constructed inter-class variance formula;
and carrying out binarization processing on the gray values of all pixel points in the filtered laser reflection image frame by using the optimal gray segmentation threshold value to obtain the binarization laser reflection image frame.
Understandably, the gray value of the pixel point in the filtering laser reflection image frame can be divided into sets of different gray levels, so that the subsequent calculation is facilitated. The binarization processing process is the prior art and is not described herein again. The weld may be indicated as white and the background black.
In the embodiment of the present invention, the gray level mean value calculation formula is as follows:
wherein,
representing the mean value of the gray levels of a first set of gray levels, t representing the gray level segmentation threshold, i representing the gray levels of a different set of gray levels,
the number of pixels representing a gray level value i is a proportion of the number of all pixels in the set of graded grays,
representing the proportion of the number of pixels in the first gray level set to the number of all pixels in the graded gray level set,
represents a mean value of the gray levels of the second set of gray levels, m represents a gray level value of m,
representing the proportion of the number of pixels in the second gray level set to the number of all pixels in the graded gray level set,
a mean value of the grays representing the set of graded grays.
In the embodiment of the present invention, the inter-class variance formula is as follows:
wherein,
representing the optimal gray scale division threshold.
And S6, extracting coordinates of a lower left corner point of an upper light band and coordinates of an upper left corner point of a lower light band in the binaryzation laser reflection image frame.
Understandably, the laser reflection light band in the binaryzation laser reflection image frame is broken, so that the upper light band and the lower light band exist, the upper light band and the lower light band are similar to rectangular strips, and the coordinates of the lower left corner point of the upper light band and the coordinates of the upper left corner point of the lower light band can represent a weld crater of a real-time welding part, so that extraction is needed.
And S7, calculating the coordinate of the center point of the current welding seam by using the coordinates of the lower left corner point of the upper light band and the coordinates of the upper left corner point of the lower light band according to a pre-constructed welding seam center calculation formula.
In the embodiment of the invention, the weld center calculation formula is as follows:
wherein (X, Y) represents the current weld center point coordinates (X, Y) ((X, Y))
) Coordinates of the upper left corner point representing the lower band of light, ((ii))
) Representing the coordinates of the lower left corner point of the upper band.
Understandably, the coordinates of the lower left corner point of the upper light band and the coordinates of the upper left corner point of the lower light band can be averaged, so that the coordinates of the center point of the current weld joint are approximately obtained.
And S8, tracking the welding center point of the welding workpiece by using the structured light type sensor according to the current welding center point coordinate to obtain the welding track of the welding workpiece.
In an embodiment of the present invention, the tracking, by using the structured light sensor, the welding center of the welding workpiece according to the current weld center coordinate to obtain the welding track of the welding workpiece includes:
taking the current welding central point coordinate as the initial scanning position of the line laser;
scanning the welding workpiece by using the line laser from the initial scanning position to obtain a tracking laser emission band;
capturing the tracking laser light emission band by using the structured light sensor to obtain a tracking laser reflection image frame set;
judging whether an image frame with a broken tracking laser emission band exists in the tracking laser reflection image frame set;
if the tracking laser reflection image frame set does not have an image frame with a fractured tracking laser emission band, returning to the step of capturing the tracking laser emission band by using the structured light type sensor;
if the tracking laser reflection image frame set has an image frame with a broken tracking laser emission band, extracting a first image frame with a broken tracking laser emission band in the tracking laser reflection image frame set;
determining coordinates of a lower left corner point of an upper light band and coordinates of an upper left corner point of a lower light band in an image frame of the tracking laser emission light band which is broken;
calculating the coordinate of the center point of the tracking weld joint by using the coordinate of the lower left corner point of the upper light band and the coordinate of the upper left corner point of the lower light band in the image frame of the fracture of the tracking laser emission light band;
updating the current welding seam center point coordinate to the tracking welding seam center point coordinate, and returning to the step of using the current welding center point coordinate as the initial scanning position of the line laser until the current welding center point coordinate is updated to the welding end point;
and fitting all the current welding center point coordinates and the tracking welding seam center point coordinates to obtain the welding track of the welding workpiece.
Understandably, after the current welding seam center point coordinate is obtained, the current welding seam center point coordinate at the moment needs to be recorded, and the workpiece is scanned again according to the current welding seam center point coordinate, so that the real-time tracking of the welding position is realized.
In detail, referring to fig. 3, the determining coordinates of a lower left corner point of an upper light band and coordinates of an upper left corner point of a lower light band in an image frame where the tracking laser emission light band is broken includes:
s81, filtering the image frame with the broken tracking laser emission band to obtain a filtering tracking image frame;
s82, carrying out binarization processing on the filtering tracking image frame to obtain a binarization tracking image frame;
and S83, extracting coordinates of a lower left corner point of the upper light band and coordinates of an upper left corner point of the lower light band in the binaryzation tracking image frame.
Compared with the background art: the method comprises the steps of emitting line laser through a structured light type sensor, scanning a welded workpiece by using the line laser to obtain a laser reflection light band capable of detecting a welding line, capturing the laser reflection light band by using the structured light type sensor to obtain a laser reflection image frame set, wherein when the laser reflection light band is broken, the laser reflection image frame set indicates that the welding line exists, and when the laser reflection light band is not broken, the laser reflection image frame set indicates that the welding line does not exist, so that whether the laser reflection image frame set has the laser reflection image frame with the laser reflection light band broken or not needs to be judged, if the laser reflection image frame set does not exist, the laser reflection image frame set continues to be captured, if the laser reflection image frame set exists, the laser reflection image frame set extracts a first laser reflection image frame with the laser reflection image band broken, and therefore needs to be extracted, because the laser reflection image frame set possibly comprises a plurality of laser reflection image frames with the laser reflection image bands broken, the first image frame needs to be extracted, because the quality of the first laser reflection image frame is influenced by noise and the center point of the upper left corner of the welded point of the welded line is calculated according to the coordinate of the welded point of the welded workpiece, and the current welding line coordinate of the welded point of the welded workpiece is calculated, and the current welded workpiece is calculated by using the current welding point of the current welding line. Therefore, the welding track tracking method, the welding track tracking device, the electronic equipment and the computer readable storage medium based on visual tracking can solve the problem that welding quality and welding efficiency are reduced because a welding gun is often deviated from a welding position due to external influences of metal smoke, noise, workpiece assembly precision and the like.
Example 2:
fig. 4 is a functional block diagram of a welding track tracking device based on visual tracking according to an embodiment of the present invention.
The welding trace tracking device 100 based on visual tracking according to the present invention may be installed in an electronic device. According to the realized function, the welding track tracking device 100 based on visual tracking may include a laser reflection band capture module 101, a laser reflection band fracture judgment module 102, a filtering binarization module 103, a current weld center point coordinate calculation module 104 and a welding center point tracking module 105. The module of the present invention, which may also be referred to as a unit, refers to a series of computer program segments that can be executed by a processor of an electronic device and that can perform a fixed function, and that are stored in a memory of the electronic device.
The laser reflection light band capturing module 101 is used for sending out line laser by using a pre-constructed structured light sensor, and scanning and welding a workpiece by using the line laser to obtain a laser reflection light band; capturing the laser reflection light band by using the structured light type sensor to obtain a laser reflection image frame set;
the laser reflection light band fracture judging module 102 is configured to judge whether a laser reflection image frame with a fractured laser reflection light band exists in the laser reflection image frame set; if the laser reflection image frame with the broken laser reflection light band does not exist in the laser reflection image frame set, returning to the step of capturing the laser reflection light band by using the structured light type sensor; if the laser reflection image frame with the broken laser reflection light band exists in the laser reflection image frame set, extracting a first laser reflection image frame with the broken laser reflection light band in the laser reflection image frame set;
the filtering binarization module 103 is configured to perform filtering processing on the laser reflection image frame with the broken laser reflection light band to obtain a filtered laser reflection image frame, and perform binarization processing on the filtered laser reflection image frame to obtain a binarization laser reflection image frame;
the current welding seam center point coordinate calculation module 104 is used for extracting coordinates of a lower left corner point of an upper light band and coordinates of an upper left corner point of a lower light band in the binary laser reflection image frame; calculating the coordinate of the center point of the current welding line by utilizing the coordinates of the lower left corner point of the upper light band and the coordinates of the upper left corner point of the lower light band according to a pre-constructed welding line center calculation formula;
and the welding center point tracking module 105 is configured to track a welding center point of the welding workpiece by using the structured light sensor according to the current welding seam center point coordinate, so as to obtain a welding track of the welding workpiece.
In detail, when the modules in the welding track tracking device 100 based on visual tracking according to the embodiment of the present invention are used, the same technical means as the welding track tracking method based on visual tracking described in fig. 1 above are adopted, and the same technical effects can be produced, which is not described herein again.
Example 3:
fig. 5 is a schematic structural diagram of an electronic device for implementing a welding track tracking method based on visual tracking according to an embodiment of the present invention.
The electronic device 1 may comprise a processor 10, a memory 11, a bus 12 and a communication interface 13, and may further comprise a computer program, such as a welding trajectory tracking program based on visual tracking, stored in the memory 11 and executable on the processor 10.
The memory 11 includes at least one type of readable storage medium, which includes flash memory, removable hard disk, multimedia card, card type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device 1, e.g. a removable hard disk of the electronic device 1. The memory 11 may also be an external storage device of the electronic device 1 in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, provided on the electronic device 1. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device 1. The memory 11 may be used not only to store application software installed in the electronic device 1 and various types of data, such as codes of a welding trajectory tracking program based on visual tracking, etc., but also to temporarily store data that has been output or is to be output.
The processor 10 may be formed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or may be formed of a plurality of integrated circuits packaged with the same function or different functions, including one or more Central Processing Units (CPUs), microprocessors, digital Processing chips, graphics processors, and combinations of various control chips. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various components of the whole electronic device by using various interfaces and lines, and executes various functions and processes data of the electronic device 1 by running or executing programs or modules (for example, a welding trace tracking program based on visual tracking, etc.) stored in the memory 11 and calling data stored in the memory 11.
The bus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is arranged to enable connection communication between the memory 11 and at least one processor 10 or the like.
Fig. 5 only shows an electronic device with components, and it will be understood by a person skilled in the art that the structure shown in fig. 5 does not constitute a limitation of the electronic device 1, and may comprise fewer or more components than shown, or a combination of certain components, or a different arrangement of components.
For example, although not shown, the electronic device 1 may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so as to implement functions of charge management, discharge management, power consumption management, and the like through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The electronic device 1 may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
Further, the electronic device 1 may further include a network interface, and optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a bluetooth interface, etc.), which are generally used for establishing a communication connection between the electronic device 1 and other electronic devices.
Optionally, the electronic device 1 may further comprise a user interface, which may be a Display (Display), an input unit (such as a Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable, among other things, for displaying information processed in the electronic device 1 and for displaying a visualized user interface.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The welding trajectory tracking program based on visual tracking stored by the memory 11 in the electronic device 1 is a combination of instructions that, when executed in the processor 10, may implement:
sending out line laser by using a pre-constructed structured light sensor, and scanning and welding a workpiece by using the line laser to obtain a laser reflection light band;
capturing the laser reflection light band by using the structured light type sensor to obtain a laser reflection image frame set;
judging whether a laser reflection image frame with the broken laser reflection light band exists in the laser reflection image frame set or not;
if no laser reflection image frame with the broken laser reflection light band exists in the laser reflection image frame set, returning to the step of capturing the laser reflection light band by using the structured light type sensor;
if the laser reflection image frame with the broken laser reflection light band exists in the laser reflection image frame set, extracting the first laser reflection image frame with the broken laser reflection light band in the laser reflection image frame set;
filtering the laser reflection image frame with the first laser reflection light band broken to obtain a filtered laser reflection image frame, and performing binarization processing on the filtered laser reflection image frame to obtain a binarized laser reflection image frame;
extracting coordinates of a lower left corner point of an upper light band and coordinates of an upper left corner point of a lower light band in the binaryzation laser reflection image frame;
and calculating the coordinate of the current welding seam center point by using the coordinates of the lower left corner point of the upper light band and the coordinates of the upper left corner point of the lower light band according to a pre-constructed welding seam center calculation formula.
And tracking the welding center point of the welding workpiece by using the structured light type sensor according to the current welding seam center point coordinate to obtain the welding track of the welding workpiece.
Specifically, the specific implementation method of the processor 10 for the instruction may refer to the description of the relevant steps in the embodiments corresponding to fig. 1 to fig. 4, which is not repeated herein.
Further, the integrated modules/units of the electronic device 1 may be stored in a computer-readable storage medium if they are implemented in the form of software functional units and sold or used as separate products. The computer readable storage medium may be volatile or non-volatile. For example, the computer-readable medium may include: any entity or device capable of carrying said computer program code, a recording medium, a usb-disk, a removable hard disk, a magnetic diskette, an optical disk, a computer Memory, a Read-Only Memory (ROM).
The present invention also provides a computer-readable storage medium, storing a computer program which, when executed by a processor of an electronic device, may implement:
sending out line laser by using a pre-constructed structured light sensor, and scanning and welding a workpiece by using the line laser to obtain a laser reflection light band;
capturing the laser reflection light band by using the structured light type sensor to obtain a laser reflection image frame set;
judging whether a laser reflection image frame with the broken laser reflection light band exists in the laser reflection image frame set;
if no laser reflection image frame with the broken laser reflection light band exists in the laser reflection image frame set, returning to the step of capturing the laser reflection light band by using the structured light type sensor;
if the laser reflection image frame with the broken laser reflection light band exists in the laser reflection image frame set, extracting a first laser reflection image frame with the broken laser reflection light band in the laser reflection image frame set;
filtering the laser reflection image frame with the first laser reflection light band broken to obtain a filtered laser reflection image frame, and performing binarization processing on the filtered laser reflection image frame to obtain a binarized laser reflection image frame;
extracting coordinates of a lower left corner point of an upper light band and coordinates of an upper left corner point of a lower light band in the binaryzation laser reflection image frame;
and calculating the coordinate of the current welding seam center point by utilizing the coordinates of the lower left corner point of the upper light band and the coordinates of the upper left corner point of the lower light band according to a pre-constructed welding seam center calculation formula.
And tracking the welding center point of the welding workpiece by using the structured light type sensor according to the current welding center point coordinate to obtain the welding track of the welding workpiece.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
Finally, it should be noted that the above embodiments are only intended to illustrate the technical solutions of the present invention and not to limit the same, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.