Background
The anode for electrolytic aluminium is an important component forming the electrolytic aluminium production system and consists of an anode guide rod, a steel claw, an explosive welding block, cast ferrophosphorus and an anode carbon block. In the production of electrolytic aluminum, the lower part of an anode carbon block needs to be immersed in a high-temperature electrolyte in a molten state in an electrolytic bath, the whole anode needs to be continuously moved downwards along with the continuous consumption of the anode carbon block, and the temperature of a steel claw connected with the anode carbon block is increased along with the continuous consumption of the anode carbon block. When the anode carbon block is consumed to the specified residual thickness, the whole anode needs to be taken out of the electrolytic bath, and after the anode carbon block is cooled and the residual anode carbon block and the cast ferrophosphorus are removed, an anode guide rod group consisting of an anode guide rod, a steel claw and an explosive welding block is put into the next recycling.
The aluminum electrolysis production is a continuous production process, the anode replacement is an indispensable technological process in the aluminum electrolysis production process, the process has great influence on the stable production of aluminum electrolysis, particularly the determination of the installation position of a new anode has great influence on the current distribution of an electrolytic cell and the conduction cycle of the new anode, six times of new anode positioning modes in the current market are mainly two, the first mode is a manual marking mode, and the second mode is a mode of replacing an anode system installation position detection system and manufacturing a special anode bottom support detection system. However, both of the two positioning modes have certain disadvantages, and therefore, the positioning system provided by the chinese patent with the publication number of "CN 107587164A", entitled "anode height measurement positioning system and method in the process of pole changing of aluminum electrolysis cell" comprises a distance measuring device and a position detecting device of an anode changing device, and the two sets of devices realize data communication through wireless communication.
However, the deformation is easy to occur in the processes of transportation, installation, replacement and residual anode pressure-disengaging of the new and old anode guide rods, mainly the middle part is bent, the normal assembly work is influenced due to the bending deformation of the anode guide rods, the node voltage drop is increased, if the node voltage drop is not repaired in time, the reactive power consumption of electric energy is increased, and the current work efficiency is reduced. At present, the detection of the spatial posture of the anode guide rod of a certain part of electrolytic aluminum enterprises still stays at the level of manual visual detection, the detection efficiency is low, the labor intensity is high, the product quality is influenced by human factors, and the omission factor is high.
Disclosure of Invention
The invention aims to provide a method and a device for detecting the spatial posture of an anode rod, which are used for solving the problem of low efficiency in detecting the spatial posture of the anode rod in the prior art.
In order to achieve the purpose, the invention provides a method for detecting the spatial posture of an anode rod, which comprises the following steps:
1) taking the extending direction of the anode guide rod as a Z axis, acquiring images of the anode guide rod in a Y-Z plane and/or an X-Z plane, and selecting at least two research areas which are vertical to the Z axis and are intersected with the images of the anode guide rod on the plane images;
2) and calculating the coordinates of the centroids of the research regions on the Z axis, performing image binarization processing on the research regions, calculating the coordinates of the centroids of the research regions on the X axis and/or the Y axis, calculating the inverse slopes of the straight lines where the centroids of any two research regions are located, selecting the maximum slope, and if the maximum slope is greater than a set value, determining that the spatial posture of the anode guide rod is inclined.
Further, an image acquisition device is adopted in the step 1) to acquire images, and when the anode guide rod runs right in front of the image acquisition device, the images of the steel claw of the anode guide rod are acquired.
Further, the coordinates of the study area on the X-axis are represented as:
when a (i, j) is 0, the image pixel value in the corresponding detection area is larger than the set pixel threshold value; and when a (i, j) is 1, the pixel value of the image in the corresponding detection area is smaller than the set pixel threshold value, i is a point on a coordinate axis where the arrangement direction of the steel claws is located, j is a point on a coordinate axis where the extension direction of the anode guide rod is located, n is the width of the image in the self-defined area, and m is the height of the image in the self-defined area.
And further, sorting out the anode rods with the inclined spatial postures after judging that the spatial postures of the anode rods are inclined.
Furthermore, after binarization processing is carried out on the images of the research areas, denoising processing is also carried out.
Further, before the image is collected, a background screen is arranged as the shooting background of the anode guide rod.
The invention also provides a device for detecting the spatial posture of the anode guide rod, which comprises an image acquisition device and an image processing device, wherein the image acquisition device is connected with the image processing device and is used for acquiring images of the anode guide rod in a Y-Z plane and/or an X-Z plane by taking the extension direction of the anode guide rod as a Z axis and selecting at least two research areas which are vertical to the Z axis and are intersected with the images of the anode guide rod on the plane images; the image processing device is used for solving the coordinates of the centroids of all the research areas on the Z axis, carrying out image binarization processing on all the research areas, solving the coordinates of the centroids of all the research areas on the X axis and/or the Y axis, calculating the inverse slope of the straight line where the centroids of any two research areas are located, selecting the maximum slope, and if the maximum slope is larger than a set value, determining that the spatial posture of the anode guide rod is inclined.
And when the anode guide rod runs right in front of the image acquisition device, the trigger device triggers the image acquisition device to acquire the image of the anode guide rod steel claw.
Further, the coordinates of the study area on the X-axis are represented as:
when a (i, j) is 0, the image pixel value in the corresponding detection area is larger than the set pixel threshold value; and when a (i, j) is 1, the pixel value of the image in the corresponding detection area is smaller than the set pixel threshold value, i is a point on a coordinate axis where the arrangement direction of the steel claws is located, j is a point on a coordinate axis where the extension direction of the anode guide rod is located, n is the width of the image in the self-defined area, and m is the height of the image in the self-defined area.
The sorting device is connected with the image processing device and used for sorting the anode guide rods with the inclined spatial postures according to the processing result of the image processing device.
Further, the device also comprises a background screen used for shooting the background as the anode guide rod.
Further, a light source is arranged on the background screen.
Further, the image acquisition device is a camera.
Further, the trigger device is a proximity switch.
The invention has the beneficial effects that:
the method comprises the steps of taking the extending direction of an anode guide rod as a Z axis, obtaining images of the anode guide rod in a Y-Z plane and/or an X-Z plane, and selecting at least two research areas which are vertical to the Z axis and intersect with the images of the anode guide rod on the plane images; and calculating the coordinates of the centroids of the research regions on the Z axis, performing image binarization processing on the research regions, calculating the coordinates of the centroids of the research regions on the X axis and/or the Y axis, calculating the inverse slopes of the straight lines where the centroids of any two research regions are located, selecting the maximum slope, and if the maximum slope is greater than a set value, determining that the spatial posture of the anode guide rod is inclined. The invention has simple structure, small calculated amount, reliable performance and high detection efficiency.
After the anode guide rod is judged to be inclined in the spatial posture, the anode guide rod inclined in the spatial posture is sorted out, and the production quality of the anode guide rod is ensured. After the binarization processing is carried out on the images of all the detection areas, the denoising processing is also carried out on the images, so that the precision of the image processing is improved.
The background screen is arranged before the anode guide rod image is collected, so that when the anode guide rod steel claw image is collected, objects around the anode guide rod can be shielded, the collected image only contains the anode guide rod steel claw image, and the collection precision of the anode guide rod steel claw image is ensured. And the background screen is also provided with a light source, so that the collection of the anode guide rod image can be normally finished in a dark environment.
The image acquisition device is a high-speed camera, the high-speed camera realizes the rapid and comprehensive acquisition of the steel claw image, and a good basis is provided for the image processing device to process the steel claw image.
Detailed Description
The following further describes embodiments of the present invention with reference to the drawings:
along with the penetration of computer technology to nondestructive testing technology, machine vision becomes a rather vital branch in the nondestructive testing technology, an automatic detection system is formed by means of electromechanical integration technology, machine vision technology and the like, the anode guide rod space attitude detection device is provided, the automatic detection and sorting of the anode guide rod steel claw are realized, and the device is simple in structure, small in calculated amount, reliable in performance, high in detection efficiency and high in automation degree.
The image acquisition device is connected with the image processing device and used for acquiring images of the anode guide rod in a Y-Z plane and/or an X-Z plane by taking the extension direction of the anode guide rod as a Z axis, and selecting at least two research areas which are vertical to the Z axis and intersect with the images of the anode guide rod on the plane images; the image processing device is used for solving the coordinates of the centroids of all the research areas on the Z axis, carrying out image binarization processing on all the research areas, solving the coordinates of the centroids of all the research areas on the X axis and/or the Y axis, calculating the inverse slope of the straight line where the centroids of any two research areas are located, selecting the maximum slope, and if the maximum slope is larger than a set value, determining that the spatial posture of the anode guide rod is inclined.
The anode rod steel claw attachment detection device further comprises a trigger device, and the trigger device is connected with the image acquisition device.
The anode rod space attitude detection device of the embodiment further comprises a sorting device, the sorting device is connected with the image processing device, the sorting device sorts the steel claws according to the processing result of the image processing device, and the steel claws which do not meet the requirements are removed.
On the basis of the structure, in order to avoid collecting objects around the anode guide rod steel claw when the image of the anode guide rod steel claw is collected, a background screen serving as an anode guide rod shooting background is arranged, the background screen is provided with a light source, and the light source can be turned on when the image of the anode guide rod steel claw is collected in a dark environment, so that the collected image is not influenced by the dark environment.
The image acquisition device of the embodiment is a high-speed camera, and the high-speed camera can acquire images of the anode guide rod steel claw in real time and efficiently; as other embodiments, other image capturing devices having the same function may be employed. And the trigger device connected with the image acquisition device is a proximity switch, the proximity switch is suspended between the high-speed camera and the anode guide rod, the setting position of the proximity switch needs to ensure that the high-speed camera can acquire a complete image on the front side of the anode guide rod, namely when the anode guide rod runs to the front of the high-speed camera to shield the proximity switch, the proximity switch sends a trigger signal to the high-speed camera, and the high-speed camera acquires the image of the anode guide rod after receiving the trigger signal.
The spatial posture of the anode guide rod may incline in an X-Z plane or in a Y-Z plane, the anode guide rod may be photographed on only one plane (such as the X-Z plane) in the transportation process, whether the spatial posture of the anode guide rod inclines in the X-Z plane or not is judged, if the anode guide rod inclines, the anode guide rod is judged to be a defective product, if the anode guide rod does not incline, if the anode guide rod is judged to be normal, misjudgment may be caused, therefore, in order to guarantee the accuracy of the detection result, the anode guide rod in the other plane (the Y-Z plane) is photographed, whether the spatial posture of the anode guide rod inclines in the plane is judged, and if the spatial posture of the anode guide rod inclines in the Y-Z plane, the anode guide rod is still judged to be a defective product.
In the embodiment, whether the spatial postures of the anode rod in the X-Z plane and the Y-Z plane are inclined or not is taken as an example, as shown in fig. 1, a coordinate system X-Y-Z is established, the anode rod spatial posture detection device comprises a background screen 3 with a light source, a centering trigger proximity switch, a high-speed camera 1 and a high-speed camera 2, the high-speed camera 1 acquires a spatial posture image a of the anode rod 4 in the Y-Z plane, and the high-speed camera 2 acquires a spatial posture image B of the anode rod in the X-Z plane. The anode guide rod space posture detection device of the embodiment further comprises an image processing board and a sorting device, when the anode guide rod triggers a centering proximity switch signal in the moving process, the high-speed camera 1 and the high-speed camera 2 start to take pictures and store the pictures, and the embedded image processing board carries out image preprocessing, image segmentation, feature extraction and classification on the taken pictures.
When the image processing device processes the shot image, at least a research area is selected in an X-Z plane and at least two research areas are selected in a Y-Z plane respectively, and the centroid coordinates of the research areas in the X-Z plane and the Y-Z plane are obtained respectively. Calculating the slopes of straight lines where centroids of any two study areas are located for the X-Z plane, selecting the maximum slope, comparing the maximum slope with a corresponding set value, and if the maximum slope is greater than the corresponding set value, judging that the anode guide rod is inclined in the space attitude of the X-Z plane; and for the Y-Z plane, calculating the slopes of straight lines where the centroids of any two study areas are located, selecting the maximum slope, comparing the maximum slope with the corresponding set value, and if the maximum slope is greater than the corresponding set value, judging that the anode guide rod is inclined in the space attitude of the Y-Z plane. And after the defective products with the spatial attitude inclination are calculated, the defective products are automatically removed by a sorting device.
Next, taking two research areas selected on the X-Z plane and the Y-Z plane respectively as an example, as shown in fig. 5, the method for detecting the spatial attitude by using the anode rod spatial attitude detection apparatus includes the following steps:
1. and in the process of horizontal movement of the anode guide rod steel claw, triggering a proximity switch, sending a working start signal to the high-speed camera by the trigger switch, starting to acquire an image of the anode guide rod in an X-Z plane and an image of the anode guide rod in a Y-Z plane after the high-speed camera receives the signals, sending the acquired gray level images to an image processing board, and carrying out binarization processing on the images by the image processing board.
1) Tilt in X-Z plane
As shown in FIG. 3, two study areas,
study area 1 and study area 2, were selected in the X-Z plane, and the coordinates of
centroid 1 of each of the two study areas were obtained
Coordinates of centroid 2
Connecting
centroid 1 and centroid 2 yields a line L1.
2) Tilt in the Y-Z plane
As shown in FIG. 2, two study areas,
study area 1 and study area 2, were selected in the Y-Z plane, and the coordinates of the
centroid 1 of each of the two study areas were obtained
Coordinates of centroid 2
Connecting centroid 1 and centroid 2 yields a line L2.
2. Extracting centroid coordinates
1) Coordinates of the centroid of the investigation region on the Z-axis
Selecting a starting line Z of the
investigation region 1 in the X-Z plane
1And end row Z
2The centroid coordinates of the
investigation region 1 can be obtained
The centroid coordinates of the investigation region 2 of the X-Z plane can be obtained in the same way
2) Coordinates of centroid of study region on X-axis
As shown in fig. 4, the process of the binarization processing is: the research area 1 is defined as an m × n matrix Q, m is equal to the height (unit is pixel) of the image of the self-defining area, n is equal to the width (unit is pixel) of the image of the self-defining area, a (i, j) represents an element in the matrix Q, i is a point on a coordinate axis (namely Y axis) where the arrangement direction of the steel claws is located, and j is a point on a coordinate axis (namely Z axis) where the extension direction of the anode guide rod is located. b (i, j) represents the pixel value in the self-defined area, a proper threshold value K is selected, if the pixel value of a certain point in the detection area is greater than the threshold value K, the corresponding element value in the matrix Q is 0, if the pixel value of a certain point in the detection area is less than the threshold value K, the corresponding element value in the matrix Q is 1, and the corresponding relation between the pixel value and the element value of the matrix Q is represented as:
after binarization, denoising processing based on OpenCV is carried out on the binarized image, and the matrix Q is converted into:
obtaining an image 0-1 matrix of the region after binarization and denoising processing of the region, and then obtaining the centroid position coordinate of the region in the x-axis direction according to a matrix centroid solving method as follows:
similarly, by means of binary image processing, the centroid coordinate of the research area 2 on the X axis can be obtained
The method in the step 1) and the step 2) can be adopted to obtain the
research areas 1 and 2 in the Y-Z plane on the Y axisCoordinates of (2)
And coordinates on the Z axis
3) Calculating the inverse slope of a straight line
The centroid position of the
investigation region 1 in the X-Z plane is
The centroid position of the investigation region 2 is
Therefore, the inverse slope of the line L1 is expressed as
The steel claw is naturally perpendicular to the X-axis in the standard state, i.e. X1=x2,kxzWhen the steel claw is inclined in the X-Z plane, k is 0xzIs not equal to 0; by determining k at which maximum tilt is allowedxz *When | kxz|>kxz *Namely, the steel claw is judged to be inclined in the X-Z plane.
The centroid position of the
investigation region 1 in the Y-Z plane is
The centroid position of the investigation region 2 is
Therefore, the inverse slope of the line L2 is expressed as
The steel claw is naturally perpendicular to the Y-axis in the normal state, i.e.
k
yzWhen the steel claw is inclined in the Y-Z plane, k is 0
yzIs less than 0; by determining k at which maximum tilt is allowed
yz *When | k
yz|>k
yz *When the steel claw is inclined in the Y-Z plane, the steel claw is judged to be inclined in the Y-Z plane. As long as the steel claw inclines in a plane, the steel claw can be judged to incline too much and not meet the production requirements, and the steel claw is removed by the sorting device.
The specific embodiments are given above, but the present invention is not limited to the above-described embodiments. The basic idea of the present invention lies in the above basic scheme, and it is obvious to those skilled in the art that no creative effort is needed to design various modified models, formulas and parameters according to the teaching of the present invention. Variations, modifications, substitutions and alterations may be made to the embodiments without departing from the principles and spirit of the invention, and still fall within the scope of the invention.