A method and device for detecting foreign matter blocking an electrolytic cell
By calculating the average grayscale value and stability of the target area of the electrolytic cell, the accuracy of foreign object occlusion detection in electrolytic cell temperature monitoring is solved, and reliable judgment of the occlusion condition of the electrolytic cell is achieved.
Patent Information
- Application Number
- CN202510022978.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-07
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2045-01-07
AI Technical Summary
In electrolytic cell temperature monitoring, it is difficult for the prior art to accurately detect foreign object occlusion, especially when occlusion of truss vehicles and staff, which affects the accuracy of fault detection.
By acquiring the current frame image of the electrolytic cell, obtaining the target area according to the preset rules, calculating the first average grayscale value and the second average grayscale value of the target area, calculating the stationary degree, and making an occlusion judgment based on the stationary degree, and finally updating the second average grayscale value.
Effectively distinguish the changes brought about by the operation of the electrolytic cell itself from the changes brought about by occlusion, and improve the accuracy and reliability of occlusion detection.
Smart Images

Figure CN119417834B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a method and device for detecting foreign matter occlusion in an electrolytic cell. Background Art
[0002] Electrolysis technology is a key industrial method for extracting and refining metals. However, during the electrolysis process, structural damage or uneven current density may occur inside the electrolytic cell, which can lead to short circuits and excessive heating of the electrodes, seriously affecting production quality and efficiency. To address this challenge, there are currently some technologies that use infrared images and image processing technology to detect whether the electrolytic cell is malfunctioning. These technologies identify potential problem areas by analyzing the temperature distribution in infrared images, thereby performing preventive maintenance.
[0003] However, in actual applications, when the electrolytic cell is covered with a cloth, or when a gantry truck (equipment for transporting the electrolytic cell) and staff enter the screen to be tested, there will be errors between the infrared image of the electrolytic cell and the actual situation. These errors will interfere with the accuracy of fault detection and affect the final monitoring results. The Chinese patent "Infrared Image Validity Judgment Method for Electrolytic Cell Plate Detection" (CN113344908A) judges the validity of the cover cloth and the exposed area based on whether the electrolytic cell is covered with a cloth, which can ensure the reliability of image validity recognition. When in use, invalid images are eliminated before faulty plate analysis to avoid false detection and missed detection of faults caused by foreign objects. However, this solution can only deal with the cover cloth, and cannot deal with the situation of occlusion by the gantry truck and staff.
[0004] In addition, some common existing foreign body occlusion algorithms mostly use the method of comparing with template images to determine whether there is occlusion. This solution is not suitable for electrolytic cells because as the electrolytic cell runs, its own image will change. How to distinguish between changes during operation and changes caused by foreign body occlusion is a problem that needs to be solved urgently. Summary of the invention
[0005] In view of the above defects of the prior art, the present invention provides a method and device for detecting foreign matter obstruction in an electrolytic cell, so as to solve the technical problem that obstruction cannot be accurately detected during temperature monitoring of the electrolytic cell.
[0006] To achieve the above-mentioned purpose and other related purposes, the present invention provides a method for detecting foreign body occlusion in an electrolytic cell, comprising: acquiring a current frame image of the electrolytic cell; obtaining a target area in the current frame image according to preset rules; calculating a first average grayscale value of the current frame image in the target area; obtaining the smoothness of the target area according to the first average grayscale value and the second average grayscale value of the target area in the most recent unobstructed state; performing occlusion judgment based on the smoothness of the target area and a preset smoothness threshold to obtain a judgment result; and issuing an alarm or updating the second average grayscale value of the target area in the most recent unobstructed state according to the judgment result.
[0007] In one embodiment of the present invention, obtaining the target region in the current frame image according to a preset rule includes: obtaining a marked region according to a pre-marked electrolytic cell region of interest, and using the marked region as the target region.
[0008] In one embodiment of the present invention, according to preset rules, a target area in the current frame image is obtained, including: obtaining a marked area according to a pre-marked electrolytic cell area of interest; obtaining a motion foreground ratio of the marked area according to the current frame image and a preset template image; obtaining a marked area of suspected screen change according to the motion foreground ratio of the marked area and a preset motion threshold, and using it as the target area.
[0009] In one embodiment of the present invention, the motion foreground ratio of the annotated area is obtained according to the current frame image and the preset template image, including: obtaining a motion foreground map according to the current frame image and the template image; obtaining the motion foreground ratio of the annotated area according to the foreground area of the motion foreground map of the annotated area and the total area of the annotated area.
[0010] In one embodiment of the present invention, a motion foreground image is obtained based on the current frame image and the template image, including: performing differential processing on the current frame image and the template image to obtain a frame difference image; and performing binarization and opening operations on the frame difference image to obtain the motion foreground image.
[0011] In one embodiment of the present invention, according to preset rules, a target area in the current frame image is obtained, including: obtaining a marked area according to a pre-marked electrolytic cell area of interest; obtaining an occlusion ratio of the marked area according to the current frame image; obtaining a suspicious marked area according to the occlusion ratio of the marked area and a preset ratio threshold, and using it as the target area.
[0012] In one embodiment of the present invention, the occlusion ratio of the annotated area is obtained according to the current frame image, including: sending the current frame image to a trained segmentation model to segment it into an electrolytic cell area and a background area to obtain a mask image; and obtaining the occlusion ratio of the annotated area according to the electrolytic cell area area of the mask image of the annotated area and the total area of the annotated area.
[0013] In one embodiment of the present invention, according to preset rules, a target area in the current frame image is obtained, including: obtaining a marked area according to a pre-marked electrolytic cell area of interest; obtaining a motion foreground ratio of the marked area according to the current frame image and a preset template image; obtaining a marked area of suspected screen change according to the motion foreground ratio of the marked area and a preset motion threshold; obtaining an occlusion ratio of the marked area of suspected screen change according to the current frame image; obtaining a suspicious marked area according to the occlusion ratio of the marked area of suspected screen change and a preset ratio threshold, and using it as the target area.
[0014] In one embodiment of the present invention, the first average grayscale value of the current frame image in the target area is calculated, including: performing perspective transformation and median filtering on the current frame image in the target area, and then calculating the average grayscale value of all pixels in the target area to obtain the first average grayscale value.
[0015] To achieve the above-mentioned purpose and other related purposes, the present invention also provides an electrolytic cell foreign body occlusion detection device, comprising: an image acquisition unit, used to acquire a current frame image of the electrolytic cell; a target area acquisition unit, used to obtain a target area in the current frame image according to a preset rule; a first calculation unit, used to calculate a first average grayscale value of the current frame image in the target area; a second calculation unit, used to obtain the smoothness of the target area according to the first average grayscale value and the second average grayscale value of the target area in the most recent unobstructed state; a determination unit, used to perform occlusion determination based on the smoothness of the target area and a preset smoothness threshold to obtain a determination result; and a processing unit, used to issue an alarm or update the second average grayscale value of the target area in the most recent unobstructed state according to the determination result.
[0016] Beneficial effects of the present invention: The present invention proposes a method and device for detecting foreign matter occlusion in an electrolytic cell. The method obtains a target area through a preset rule, calculates the smoothness according to the first average grayscale value and the second average grayscale value of the target area, and judges whether the electrolytic cell is obstructed based on the smoothness. Finally, the second average grayscale value is updated in time, which can effectively distinguish whether the change is caused by the operation of the electrolytic cell itself or the change is caused by occlusion, thereby ensuring the reliability and accuracy of the occlusion detection result. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0018] Figure 1 A flow chart of a foreign body occlusion detection method provided by an embodiment of the present invention;
[0019] Figure 2 A schematic diagram of a pre-marked electrolytic cell region of interest provided for one embodiment of the present invention;
[0020] Figure 3 A second acquisition flow chart of a target area provided by an embodiment of the present invention;
[0021] Figure 4 A flow chart for calculating the proportion of a moving foreground image provided by an embodiment of the present invention;
[0022] Figure 5 A flow chart of obtaining a motion foreground image provided by an embodiment of the present invention;
[0023] Figure 6 A comparison diagram of a moving foreground image with and without occlusion provided by an embodiment of the present invention;
[0024] Figure 7 A third acquisition flow chart of a target area provided by an embodiment of the present invention;
[0025] Figure 8 A flowchart for calculating an occlusion ratio according to an embodiment of the present invention;
[0026] Fig. 9 A comparison diagram of each stage based on occlusion analysis and updating of the target area provided by an embodiment of the present invention;
[0027] Fig.10 A fourth acquisition flow chart of a target area provided by an embodiment of the present invention;
[0028] Fig.11 A schematic diagram of a foreign object obstruction detection device provided in one embodiment of the present invention.
[0029] Explanation of the reference numerals: 101, image acquisition unit; 102, target area acquisition unit; 103, first calculation unit; 104, second calculation unit; 105, determination unit; 106, processing unit. DETAILED DESCRIPTION
[0030] The following describes the embodiments of the present invention through specific specific embodiments, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. It should be noted that the following embodiments and the features in the embodiments can be combined with each other without conflict. In addition to the specific methods, equipment, and materials used in the embodiments, according to the technical personnel in this technical field's grasp of the prior art and the records of the present invention, any methods, equipment, and materials of the prior art that are similar or equivalent to the methods, equipment, and materials described in the embodiments of the present invention can also be used to implement the present invention.
[0031] It should be understood that the terms used in the embodiments of the present invention are for describing specific embodiments rather than for limiting the scope of protection of the present invention. Unless otherwise defined, all technical and scientific terms used in the present invention have the same meaning as those generally understood by those skilled in the art.
[0032] In the following description, numerous details are discussed to provide a more thorough explanation of the embodiments of the present invention. However, it is obvious to those skilled in the art that the embodiments of the present invention can be implemented without these specific details. In some of the embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present invention difficult to understand.
[0033] The flowchart and block diagram in the accompanying drawings illustrate the system architecture, functions and operations that may be implemented according to the methods and computer program products of various embodiments disclosed in the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment, or a part of a code, and the module, the program segment, or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of the boxes in the block diagram and / or the flowchart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0034] See also Figure 1 , Figure 1 A method for detecting foreign matter obstruction in an electrolytic cell provided in an embodiment of the present invention includes steps S100 to S600.
[0035] Step S100, obtaining the current frame image of the electrolytic cell. In this step, the image can be captured by an infrared camera, and the subject (such as a computer, an industrial computer or a microcontroller unit) that executes the foreign body occlusion detection method is connected to the infrared camera to obtain the image. Subsequent detection of foreign body occlusion is based on the current frame image. In actual application, an image can be captured at regular intervals, that is, detection of occlusion is performed at regular intervals.
[0036] When shooting the current frame image of the electrolytic cell, the image may include a single electrolytic cell, multiple electrolytic cells, and a certain area of background. It should be noted that the shooting range of the picture should be the same as the shooting range of the image used for the pre-marked electrolytic cell area of interest in the subsequent steps. In actual processing, the current frame image, subsequent template images, and images used for pre-marking the area of interest are shot using the camera in the same position.
[0037] The format of the current frame image taken by the infrared camera is related to the infrared camera. Different infrared cameras may output grayscale images, pseudo-color images, multi-band images, enhanced images or images in other formats. The subsequent processes in this application are all aimed at processing grayscale images. Therefore, it can be understood that if the current frame image of the electrolytic cell is a pseudo-color or other format image, it needs to be processed into a grayscale image first.
[0038] Step S200, according to the preset rules, obtain the target area in the current frame image. The concept of target area is introduced here, and the target area can be understood as the electrolytic cell area that needs to be paid attention to. It can refer to all electrolytic cell areas in the current frame image, or it can refer to the electrolytic cell area marked in the current frame image (some electrolytic cells do not need to be detected, but are also photographed), or it can be the electrolytic cell area suspected to be blocked after preliminary detection. The following provides a variety of embodiments for detailed description.
[0039] In a specific embodiment of the present invention, step S200 includes: obtaining a marked area according to the pre-marked electrolytic cell area of interest, and using it as the target area. This corresponds to the first method of obtaining the target area in the present invention, that is, directly using the pre-marked electrolytic cell area of interest as the target area. For example, Figure 2In the embodiment, the pre-marked electrolytic cell region of interest is shown in the yellow box in the figure. Although the figure also involves other electrolytic cells, the electrolytic cells that we need to perform occlusion detection are manually pre-marked. The pre-marked electrolytic cell region of interest is referred to as the ROI frame below. The reason why the entire image is not detected is that the detection of the entire image may cause smaller moving objects such as pedestrians to be ignored. In order to solve this problem, in this embodiment, the region of interest of the electrolytic cell is pre-marked, and the infrared image is divided into several small areas, so as to perform occlusion detection on these small areas.
[0040] See also Figure 3 This is the second method for acquiring the target area in the present invention. In a specific embodiment of the present invention, step S200 includes steps S210 to S230.
[0041] Step S210: Obtain the marked region according to the pre-marked electrolytic cell region of interest, that is, obtain the above-mentioned ROI frame.
[0042] Step S220: Obtain the motion foreground ratio of the marked area according to the current frame image and the preset template image. Step S230: Obtain the marked area of suspected image change according to the motion foreground ratio of the marked area and the preset motion threshold, and use it as the target area.
[0043] In these two steps, the motion foreground ratio is calculated and compared with the preset motion threshold to preliminarily determine whether there are any changes in the picture in these marked areas. Then, in the subsequent occlusion judgment step, only the marked areas suspected of picture changes are judged for occlusion. This is because if the picture has not changed, then there is naturally no occlusion. Using the motion foreground ratio to determine whether the picture has changed is faster and more accurate than subsequent occlusion judgment. Therefore, using it to achieve preliminary screening can not only reduce the computing power occupied by the entire algorithm, but also improve the accuracy of detection.
[0044] The template image preset in step S220 may be an initial image of the electrolytic cell in an unobstructed state. The pre-annotation of the annotated area in step S210 is also performed on the template image. Therefore, the template image may be understood as an image without a yellow frame. Figure 2 The image in .
[0045] See also Figure 4 In a specific embodiment of the present invention, step S220 includes: S221, obtaining a motion foreground map according to the current frame image and the template image; S222, obtaining a motion foreground proportion of the marked area according to the foreground area of the motion foreground map of the marked area and the total area of the marked area. The motion foreground proportion is calculated based on the motion foreground map, so here the motion foreground map is obtained first, and then the proportion is calculated.
[0046] See also Figure 5 In a specific embodiment of the present invention, step S221 includes: S221a, performing differential processing on the current frame image and the template image to obtain a frame difference image; S221b, performing binarization and opening operation processing on the frame difference image to obtain a motion foreground image.
[0047] In step S221a, the template image is an unobstructed image. After the current frame image is subjected to differential processing, the area with a calculation result of 0 corresponds to the unchanged area, and the area with a calculation result other than 0 corresponds to the changed area. Since these images are grayscale images, grayscale rubbing and rubbing processing is performed. In addition, since the grayscale transformation of infrared images in the electrolysis workshop is relatively stable without obstruction, there is no need to perform differential calculation on the previous and next frames. In the frame difference image obtained after differential processing, it is necessary to perform binarization processing according to a preset threshold, and then use an open operation (first erosion, then expansion) to remove isolated noise points, so that a motion foreground image can be obtained.
[0048] Sports prospect map Figure 6 As shown, the motion foreground map can be calculated for both the pictures with and without changes. Figure 6 In the figure, the upper row illustrates the processing of the motion foreground map with picture changes, and the lower row illustrates the processing of the motion foreground map without picture changes. It is not difficult to find from the figure that the motion foreground map with no picture changes is basically black, that is, the calculation results when doing differential processing are almost 0 (except for some noise points that have not been removed), while in the motion foreground map with picture changes, the white area corresponds to the picture change area.
[0049] In step S222, each marked area needs to be calculated independently. The specific steps are as follows:
[0050] (1) Set the pixels in the yellow box corresponding to the marked area to 1:
[0051] ;
[0052] (2) Perform AND operations on each annotated area and the image S(x, y) after the motion foreground image is inverted, and obtain the image S of each annotated area. ROI (x,y), expressed as:
[0053] ;
[0054] (3) Calculate the ratio of the foreground area of the motion foreground map of the marked area to the total area of the marked area, as shown in the following formula:
[0055] ,
[0056] ,
[0057] ,
[0058] In the above formula, S fg That is, the foreground area of the motion foreground image of a certain marked area, A total is the total area of the marked area, and the ratio of the two is the motion foreground proportion S of the marked area. Percentage .
[0059] In step S230, the calculated motion foreground proportion S of the marked area A is Percentage With the preset motion threshold T motion Comparison is performed. If the threshold is not exceeded, it is determined that there is no motion and the marked area A does not need to perform subsequent occlusion analysis. If the threshold is exceeded, the marked area A is suspected of screen change and is used as the target area for subsequent occlusion analysis.
[0060] In the previous embodiment, each marked area is directly used as the target area. In this case, occlusion detection will be performed on each marked area later, which will undoubtedly increase the workload. In this embodiment, occlusion analysis is only performed on the marked areas suspected of image changes, thereby reducing a lot of workload.
[0061] See also Figure 7 This is the third method for acquiring the target area in the present invention. In a specific embodiment of the present invention, step S200 includes step S210, step S240 and step S250.
[0062] Step S210: Obtain the marked region according to the pre-marked electrolytic cell region of interest. This step is the same as the previous one and will not be described in detail here.
[0063] Step S240: Obtain the occlusion ratio of the marked area according to the current frame image. In this step, the occlusion ratio of each marked area is calculated, and then the suspicious marked area is preliminarily determined according to the occlusion ratio.
[0064] See also Figure 8 In a specific embodiment of the present invention, step S240 includes: S241, sending the current frame image to the trained segmentation model to segment it into the electrolytic cell area and the background area to obtain a mask image; S242, obtaining the occlusion ratio of the marked area according to the electrolytic cell area area of the mask image of the marked area and the total area of the marked area.
[0065] In this embodiment, the trained segmentation model is first used to segment the current frame image to obtain a mask image, such as the formula:
[0066] ,
[0067] Among them, M(x,y) represents the pixel value of the mask image at (x,y), 0 represents the background, and 1 represents the electrolytic cell area. Since the shape contours of foreign objects such as gantry trucks and pedestrians entering the image are unknown, they are also classified as background. The segmentation model can be, for example, a DeepLabv3p semantic segmentation model, or other classification models such as Unet and FCN. In this step, after the segmentation model is introduced, the electrolytic cell area can be well segmented, and in actual use, the model can be trained using actual pictures of the scene, or different models can be selected to achieve more accurate segmentation. After obtaining the mask image, a morphological opening operation can be performed on the mask image to eliminate the burrs caused by the model segmentation.
[0068] In step S242, it is also necessary to perform independent calculations on each marked area. The specific steps are as follows:
[0069] (1) Set the pixels in the yellow box corresponding to the marked area to 1:
[0070] ;
[0071] (2) Perform AND operations on each annotated region and the semantic segmentation result M(x, y) in turn to obtain the mask image M of each annotated region. ROI (x,y), expressed as:
[0072] ;
[0073] (3) Calculate the ratio of the foreground area of the motion foreground map of the marked area to the total area of the marked area, as shown in the following formula:
[0074] ,
[0075] ,
[0076] ,
[0077] In the above formula, A mask A represents the total number of pixels with a value of 1 in the mask image (pixel area of the electrolytic cell area). total is the total area of the marked area, and r represents the area ratio of the occluder in the marked area.
[0078] Step S250: According to the occlusion ratio of the marked area and the preset ratio threshold, a suspicious marked area is obtained and used as the target area. Specifically, when the occlusion ratio of the marked area exceeds the ratio threshold, it indicates that it is a suspicious situation and further occlusion analysis needs to be performed through the following steps. Otherwise, no subsequent occlusion analysis is required.
[0079] In this embodiment, the determination of the occlusion ratio of the marked area is equivalent to making a preliminary determination, which is also for the purpose of reducing the computing power occupied by the entire algorithm and improving the accuracy of the detection. Figure 3 Compared with the corresponding embodiments, one uses a motion foreground image to make a preliminary judgment, and the other uses a semantic segmentation model to make a preliminary judgment.
[0080] Fig. 9 A comparison diagram of each stage based on occlusion analysis and updating of the target area provided by an embodiment of the present invention, in which the current frame image (the first image) is first semantically segmented to obtain a mask image (the second image), and then the suspicious annotated area is found through area analysis, such as the blue frame area in the third image, and the green frame area corresponds to the non-suspicious area. In step S250, the blue frame area in the third image is used as the target area to perform subsequent processing procedures. Fig. 9 The fourth picture in the figure corresponds to the step of updating the second average grayscale value when calculating the smoothness in the subsequent processing, that is, the second average grayscale value in the red frame area needs to be updated, and the second average grayscale value in the green frame area does not need to be updated.
[0081] See also Fig.10 This is the fourth method for acquiring the target area in the present invention. In a specific embodiment of the present invention, step S200 includes step S210, step S220, step S230', step S240' and step S250'.
[0082] Step S210: Obtain a marked region according to the pre-marked electrolytic cell region of interest.
[0083] Step S220, obtaining the motion foreground ratio of the marked area according to the current frame image and the preset template image;
[0084] Step S230', based on the motion foreground ratio of the marked area and the preset motion threshold, obtain the marked area suspected of picture change. This step is similar to the previous step S230, except that in step S230, the marked area suspected of picture change is directly used as the target area, while in this step, the marked area suspected of picture change is used as the preliminary determination result.
[0085] Step S240', based on the current frame image, obtain the occlusion ratio of the marked area suspected of image change. This step is similar to the previous step S240, except that in step S240, the occlusion ratio of all marked areas is calculated, while in this step, only the occlusion ratio of the marked area suspected of image change is calculated, which is equivalent to continuing to make a second determination on the preliminary determination result.
[0086] Step S250': Obtain the suspicious marked area according to the occlusion ratio of the marked area suspected of image change and the preset ratio threshold, and use it as the target area. This step is similar to the previous step S250.
[0087] In this embodiment, the two solutions of using the motion foreground image to make a preliminary judgment and using the semantic segmentation model to make a preliminary judgment are combined, that is, in this embodiment, there are three major steps, the first major step is to find the marked area of suspected picture changes, the second major step is to find the suspicious marked area from the marked area of suspected picture changes, and the third major step is to perform occlusion detection in the suspicious marked area according to steps S300~S600. These steps have been described in detail in the previous embodiments, and will not be repeated here.
[0088] The steps S300 to S600 are described below. It can be understood that the steps S300 to S600 are to be executed for each suspicious marked area.
[0089] Step S300, calculate the first average gray value of the current frame image in the target area. It can be expressed as follows:
[0090] ,
[0091] In the formula, t represents the timing of the current frame, u t is the first average gray value, N represents the total number of pixels in the target area, x i,t Indicates the grayscale value of the i-th pixel in the target area of the current frame image.
[0092] In a specific embodiment of the present invention, step S300 includes: after performing perspective transformation and median filtering on the current frame image in the target area, the average grayscale value of all pixels in the target area is calculated to obtain a first average grayscale value. The perspective transformation process is to ensure the accuracy of the final calculation result, and the median filtering process is to remove isolated points.
[0093] Step S400: Obtain the stability of the target area according to the first average grayscale value and the second average grayscale value of the target area in the most recent unobstructed state.
[0094] The calculation formula for the second average grayscale value in the most recent unobstructed state is as follows:
[0095] ,
[0096] In the formula, t-1 represents the time sequence of the most recent unobstructed state. At the beginning of the algorithm, the template image mentioned above can be used as the initial most recent unobstructed state image, and the value will be continuously updated in the subsequent step S600. Taking the initial state as an example, x i,t-1 represents the gray value of the i-th pixel of the template image in the target area. Since u t , when updating later, there is no need to calculate again, just use u t The value of u is used as the next t-1 .
[0097] With the first average gray value u t And the second average gray value u t-1 After that, the difference of the average gray value of the target area can be calculated according to the following steps:
[0098] ,
[0099] Then the stability is calculated according to the following formula:
[0100] ,
[0101] Where, T Stable (u) is the stability, and its calculation result range is [0,1]. The smaller the stability, the closer the two areas are, and vice versa. φ is the stability coefficient, and its value range is also [0,1]. According to different on-site working conditions, a suitable value in the range of 0~1 is selected as the stability coefficient φ and substituted into the above formula.
[0102] Step S500, perform occlusion determination according to the stability of the target area and a preset stability threshold to obtain a determination result. After the stability of the target area is calculated, the occlusion determination can be performed according to the preset threshold. If a significant change occurs, that is, the stability of the target area exceeds the preset stability threshold, it is finally determined to be occluded, otherwise, it is considered to be unoccluded.
[0103] Step S600: According to the determination result, an alarm is issued or the second average grayscale value of the target area in the most recent unobstructed state is updated. When the determination result is obstruction, an alarm operation can be performed, such as sound and light alarm prompts, or the target area can be marked in the image. When the determination result is unobstructed, the first average grayscale value u obtained in this calculation process can be used. t To update the second average gray value u t-1, that is, the current frame mean of the target area is added to the time series, replacing the mean calculated from the initial manually selected picture.
[0104] In one of the above embodiments, the motion foreground image is used for preliminary judgment, and the semantic segmentation model is used for secondary judgment. In a specific embodiment of the present invention, when executing the alarm process in step S600, different alarm levels can be set in combination with the two parameters of the motion foreground ratio and the occlusion ratio calculated previously. For example, if the motion foreground ratio is large, the occlusion ratio is large, and the stability exceeds the set threshold, a high-level alarm can be issued; if the motion foreground ratio is small, the occlusion ratio is small, and the stability exceeds the set threshold, a low-level alarm can be issued.
[0105] It should be noted that the step division of the above methods is only for clear description. When implemented, they can be combined into one step or some steps can be split and decomposed into multiple steps. As long as they contain the same logical relationship, they are all within the scope of protection of this patent; adding insignificant modifications to the algorithm or process or introducing insignificant designs without changing the core design of the algorithm and process are all within the scope of protection of this patent.
[0106] See also Fig.11 , Fig.11 A foreign body occlusion detection device for an electrolytic cell provided in an embodiment of the present invention comprises an image acquisition unit 101, a target region acquisition unit 102, a first calculation unit 103, a second calculation unit 104, a determination unit 105 and a processing unit 106. The image acquisition unit 101 is used to acquire a current frame image of the electrolytic cell; the target region acquisition unit 102 is used to obtain a target region in the current frame image according to a preset rule; the first calculation unit 103 is used to calculate a first average gray value of the current frame image in the target region; the second calculation unit 104 is used to obtain the stability of the target region according to the first average gray value and the second average gray value of the target region in the most recent unobstructed state; the determination unit 105 is used to perform an occlusion determination according to the stability of the target region and a preset stability threshold to obtain a determination result; the processing unit 106 is used to issue an alarm or update the second average gray value of the target region in the most recent unobstructed state according to the determination result.
[0107] It should be noted that the foreign object obstruction detection device of the present embodiment is a device corresponding to the above-mentioned foreign object obstruction detection method, and the functional modules in the foreign object obstruction detection device may correspond to the corresponding steps in the foreign object obstruction detection method. The foreign object obstruction detection device of the present embodiment can be implemented in conjunction with the foreign object obstruction detection method, that is, in the absence of conflict, the relevant technical details mentioned in the foreign object obstruction detection method of the above-mentioned embodiment can also be applied to the foreign object obstruction detection device of the present embodiment.
[0108] In general, the present invention first uses motion detection technology to determine whether the current picture has changed. This is not only simple and efficient, but also reduces the occupation of computing resources. At the same time, the currently popular deep learning semantic segmentation technology is combined with traditional image processing technology to complement each other well and obtain suspected occlusion areas. Finally, the timing analysis technology is introduced to finally determine whether it is occluded by comparing the smoothness of the occluded part, which can greatly improve the robustness of the algorithm.
[0109] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by a person of ordinary skill in the art without departing from the spirit and technical concept disclosed by the present invention shall still be covered by the claims of the present invention.
Claims
1. A method for detecting foreign matter obstruction in an electrolytic cell, characterized in that: include: Obtain the current frame image of the electrolytic cell; According to a preset rule, a target area in the current frame image is obtained; Calculating a first average grayscale value of the current frame image in the target area; Obtaining the stability of the target area according to the first average grayscale value and the second average grayscale value of the target area in the most recent unobstructed state; Performing an occlusion determination according to the smoothness of the target area and a preset smoothness threshold to obtain a determination result, wherein if the smoothness of the target area exceeds the smoothness threshold, the determination result is occlusion, otherwise, the determination result is not occluded; According to the judgment result, an alarm is issued or the second average grayscale value of the target area in the most recent unobstructed state is updated. If the judgment result is occlusion, an alarm is issued. If the judgment result is unobstructed, the second average grayscale value is updated using the first average grayscale value obtained in this calculation process.
2. The method for detecting foreign matter obstruction in an electrolytic cell according to claim 1, characterized in that: According to a preset rule, a target area in the current frame image is obtained, including: According to the pre-marked electrolytic cell region of interest, a marked region is obtained and used as the target region.
3. The method for detecting foreign matter obstruction in an electrolytic cell according to claim 1, characterized in that: According to a preset rule, a target area in the current frame image is obtained, including: Obtaining a marked region according to the pre-marked electrolytic cell region of interest; According to the current frame image and a preset template image, obtaining a motion foreground ratio of the marked area; According to the motion foreground ratio of the marked area and a preset motion threshold, a marked area suspected of picture change is obtained and used as the target area.
4. The method for detecting foreign matter obstruction in an electrolytic cell according to claim 3, characterized in that: Obtaining the motion foreground ratio of the marked area according to the current frame image and the preset template image, including: Obtaining a motion foreground image according to the current frame image and the template image; The motion foreground proportion of the marked area is obtained according to the foreground area of the motion foreground image of the marked area and the total area of the marked area.
5. The method for detecting foreign matter obstruction in an electrolytic cell according to claim 4, characterized in that: Obtaining a motion foreground image according to the current frame image and the template image, including: Performing difference processing on the current frame image and the template image to obtain a frame difference image; The frame difference image is binarized and opened to obtain the motion foreground image.
6. The method for detecting foreign matter obstruction in an electrolytic cell according to claim 1, characterized in that: According to a preset rule, a target area in the current frame image is obtained, including: Obtaining a marked region according to the pre-marked electrolytic cell region of interest; Obtaining an occlusion ratio of the marked area according to the current frame image; According to the occlusion ratio of the marked area and a preset ratio threshold, a suspicious marked area is obtained and used as the target area.
7. The method for detecting foreign matter obstruction in an electrolytic cell according to claim 6, characterized in that: Obtaining the occlusion ratio of the marked area according to the current frame image includes: Sending the current frame image to a trained segmentation model to segment it into an electrolytic cell area and a background area to obtain a mask image; The shielding ratio of the marked area is obtained according to the electrolytic cell area area of the mask image of the marked area and the total area of the marked area.
8. The method for detecting foreign matter obstruction in an electrolytic cell according to claim 1, characterized in that: According to a preset rule, a target area in the current frame image is obtained, including: Obtaining a marked region according to the pre-marked electrolytic cell region of interest; According to the current frame image and a preset template image, obtaining a motion foreground ratio of the marked area; Obtaining a marked area suspected of image change according to the motion foreground ratio of the marked area and a preset motion threshold; Obtaining, according to the current frame image, an occlusion ratio of the marked area of the suspected image change; According to the occlusion ratio of the marked area suspected of image change and a preset ratio threshold, a suspicious marked area is obtained and used as the target area.
9. The method for detecting foreign matter obstruction in an electrolytic cell according to claim 1, characterized in that: Calculating a first average grayscale value of the current frame image in the target area includes: After performing perspective transformation and median filtering on the current frame image in the target area, the average grayscale value of all pixels in the target area is calculated to obtain the first average grayscale value.
10. A device for detecting foreign matter blocking an electrolytic cell, characterized in that: include: An image acquisition unit, used for acquiring a current frame image of the electrolytic cell; A target region acquisition unit, configured to obtain the target region in the current frame image according to a preset rule; A first calculation unit, used for calculating a first average gray value of the current frame image in the target area; A second calculation unit, configured to obtain the stability of the target area according to the first average grayscale value and a second average grayscale value of the target area in a most recent unobstructed state; A determination unit, configured to perform an occlusion determination according to the stability of the target area and a preset stability threshold, and obtain a determination result. If the stability of the target area exceeds the stability threshold, the determination result is occlusion; otherwise, the determination result is non-occlusion; A processing unit is used to issue an alarm or update the second average grayscale value of the target area in the most recent unobstructed state according to the judgment result. If the judgment result is occlusion, an alarm is issued. If the judgment result is unobstructed, the second average grayscale value is updated using the first average grayscale value obtained in this calculation process.
Citation Information
Patent Citations
Infrared image validity judgment method for electrolytic bath pole plate detection
CN113344908A
Method for detecting faulted polar plate of electrolytic cell
CN113549958A