Converter copper smelting sampling drill rod image correction and extraction method and system

By introducing an automatic correction and extraction method for the drill rod image during the converter copper smelting process, the problem of inconsistent drill rod image acquisition was solved, the standardized processing of drill rod images was achieved, the automation and safety of the copper smelting process were improved, and the accuracy of endpoint determination was increased.

CN121685339APending Publication Date: 2026-03-17山东浪潮智能生产技术有限公司
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202511533477.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-24
Publication Date
2026-03-17

AI Technical Summary

Technical Problem

In the current copper smelting process in converters, the position and angle of the captured images of the drill rod are not fixed, which affects the training and prediction accuracy of deep learning models. Furthermore, manual judgment relies on experience and cannot achieve continuous real-time monitoring, posing a safety hazard.

Method used

Images of the drill rod are acquired using an industrial camera, scaled, and then a mask is generated using the difference between the red and blue channels and a binarization threshold. The drill rod region is identified by combining morphological erosion and connected component analysis. The center line of the drill rod is fitted using the least squares method, and the image pose is corrected by affine transformation and then cropped to a standard size.

Benefits of technology

It enables automatic correction and extraction of drill rod images, improves the automation and intelligence of the copper smelting process, enhances the accuracy and safety of endpoint determination, and reduces the safety risks of manual operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121685339A_ABST
    Figure CN121685339A_ABST
Patent Text Reader

Abstract

The invention provides a converter copper smelting sampling drill rod image correction and extraction method and system, and belongs to the technical field of converter copper smelting. The method comprises the steps that a sampling drill rod RGB image is collected and scaled, and a preprocessed image is obtained; extracting a red channel and a blue channel of the preprocessed image, calculating a difference image, and carrying out binarization threshold processing to generate a preliminary binary mask; performing morphological corrosion operation and connected domain analysis on the preliminary binary mask, and removing a background connected domain to obtain an accurate binary mask; on the precise binary mask, selecting a sampling column and calculating a vertical coordinate centroid to obtain a two-dimensional coordinate point set; performing linear fitting on the two-dimensional coordinate point set to obtain a mathematical equation, and calculating the inclination angle and the center point of the drill rod; and taking the center point as a rotation center, performing affine transformation on the preprocessed image based on the inclination angle, and taking the center point of the drill rod after rotation correction as a reference to cut a standardized drill rod image. According to the invention, automatic correction and extraction of the drill rod image are realized, precision is improved, and safety is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of converter copper smelting technology, specifically relating to a method and system for correcting and extracting images of sampling rods in converter copper smelting. Background Technology

[0002] In the converter copper smelting process, the blowing process is divided into the slag-forming period and the copper-forming period, with the determination of the end point of the slag-forming period being a crucial step. Currently, the industry mainly uses the manual rod analysis method, where operators insert steel rods into the converter to take samples and subjectively judge the end point of the slag-forming period based on their experience by observing the color, shape, thickness, and other visual characteristics of the samples. This method has the following drawbacks: First, the judgment result is highly dependent on the operator's experience and lacks objective standards, which may lead to differences between different operators; second, the sampling, observation, and judgment process is time-consuming and cannot achieve continuous real-time monitoring; third, workers need to be in close contact with the high-temperature converter, posing safety hazards; and fourth, manual inspection methods hinder the development of intelligent manufacturing in the copper smelting process. To overcome these shortcomings, the introduction of machine vision and deep learning has become a feasible direction. However, in practical applications, the rod images captured by industrial cameras have inconsistent positions, angles, and sizes, and this inconsistency can seriously interfere with the training and prediction accuracy of subsequent deep learning models.

[0003] Therefore, there is an urgent need for a method that can automatically and robustly correct and extract drill rod images from complex industrial backgrounds to provide standardized input data and improve the automation level and accuracy of slag formation endpoint determination. Summary of the Invention

[0004] In a first aspect, embodiments of this application provide a method for correcting and extracting images of sampling rods in copper smelting in a converter, comprising the following steps: S1. Acquire the original RGB image containing the sampling rod using an industrial camera, and scale the original RGB image to obtain a preprocessed image; S2. Extract the red and blue channels of the preprocessed image, calculate the difference between the pixel values ​​of the two channels to obtain the difference image, and then perform binarization thresholding on the difference image to generate a preliminary binary mask that initially distinguishes the foreground and background of the rod. S3. Perform morphological erosion on the initial binary mask to remove noise, and then perform connected component analysis on the eroded image to identify and remove background connected components connected to the image boundary, so as to obtain an accurate binary mask containing only the rod region. S4. On the precise binary mask, select several sampling columns along the length of the drill rod, and calculate the centroid of the vertical coordinate of the pixel belonging to the drill rod region for each sampling column, so as to obtain a set of two-dimensional coordinate points representing the trend of the drill rod centerline. S5. The least squares method is used to perform linear fitting on the two-dimensional coordinate point set to obtain the mathematical equation characterizing the center line of the drill rod, and the tilt angle and center point position of the drill rod are calculated based on the mathematical equation. S6. Using the center point as the rotation center, perform an affine transformation on the preprocessed image based on the tilt angle to rotate and correct the drill rod to a horizontal state. Then, using the center point of the rotated and corrected drill rod as a reference, cut out a rectangular area of ​​a preset size and output a standardized drill rod image.

[0005] Furthermore, the specific steps of step S1 are as follows: S11. Acquire a frame of raw RGB image containing the drill rod using an industrial camera. ; S12. Process the original RGB image The image is scaled in both the horizontal and vertical directions to obtain the preprocessed image. To adjust the original RGB image The aspect ratio is adjusted to adapt to the shape of the drill rod and reduce the amount of computation.

[0006] Furthermore, the specific steps of step S2 are as follows: S21. Extract the preprocessed image Red channel image and blue channel image ; S22. Calculate the pixel value difference between the red channel and the blue channel to obtain the difference image. :

[0007] in, It is an absolute value function; S23. Use preset experience thresholds For difference images Perform binarization to generate a preliminary binary mask. Among them, the pixel value is greater than the preset empirical threshold. Pixels with a value of 1 are set to foreground; pixel values ​​less than or equal to a preset empirical threshold are considered foreground. The pixel is set to 0 to represent the background.

[0008] Furthermore, the specific steps of step S3 are as follows: S31. Initial binary mask Perform morphological erosion using a 3×3 matrix of all ones as the structuring element to obtain the eroded image. This is done to remove noise pixels with an area smaller than the structuring element and to smooth the edges of the main body area of ​​the rod. S32. Image after erosion Perform connected component analysis and assign a unique label to each individual white pixel region; S33. Inspect the image after etching. The labels of the pixels in the first and last rows are used to identify the eroded image. Connected regions with their upper and lower boundaries are identified, and all pixel values ​​of the identified connected regions are set to 0 to obtain an optimized, precise binary mask containing only the rod region. .

[0009] Furthermore, the specific steps of step S4 are as follows: S41. In a precise binary mask From left to right along the length of the rod, N sampling columns are selected sequentially, where N is a preset positive integer; S42. For each sampling column Calculate the sampling column The ordinate of the centroid of all white pixels :

[0010] Where i is the row number of the pixel. For position pixel values, Represents column The ordinate of the centroid; S43. Collect all valid sample columns. and the corresponding ordinate of the centroid This forms a two-dimensional coordinate point set representing the centerline of the drill rod. .

[0011] Furthermore, step S4 also includes the following steps: S44. When calculating the ordinate of the centroid of a sampling column according to step S42, if a certain sampling column If the total number of white pixels on the sampled column is lower than a preset first threshold, then the sampled column is determined to be... Invalid and ignored; If the total number of valid two-dimensional coordinate points collected is less than the preset second threshold, the image acquisition and processing is deemed a failure and the process ends.

[0012] Furthermore, the specific steps of step S5 are as follows: S51. Using the least squares method on a two-dimensional coordinate point set Linear regression analysis was performed to fit a straight line representing the centerline of the drill rod. The straight line From direction vector and center point Jointly expressed; S52. Based on direction vector Calculate the tilt angle of the drill rod in the image. :

[0013] in, It is the arctangent function in the four quadrants.

[0014] Furthermore, step S6 is detailed as follows: S61. Center point Let it be P, based on the calculated center point P and tilt angle. Calculate the rotation matrix The rotation matrix Rotation around center point P, with an angle of θ. ; S62. Rotate the matrix Preprocessed images Perform an affine transformation to obtain the rotated image. To the rotated image The lieutenant general's drill rod was corrected to a horizontal position; S63. Calculate the image of the center point P after rotation. The new coordinates P′ are used as the center, and a rectangular area with a preset width w and a preset height h is cropped out to obtain the final output, size-standardized drill rod image. .

[0015] Furthermore, step S6 also includes the following steps: S64. Standardized image of the drill bit. The output is fed into a pre-trained deep learning model to automatically predict the end point of the slagging period in copper smelting in a converter, and the prediction results are compared with size-normalized images. It is also displayed on the user interface.

[0016] Secondly, embodiments of this application also provide a converter copper smelting sampling rod image correction and extraction system, including: The image acquisition and preprocessing module is used to acquire the original RGB image containing the sampling rod through an industrial camera, and to scale the original RGB image to obtain a preprocessed image. The region segmentation module is used to extract the red and blue channels of the preprocessed image, calculate the difference between the pixel values ​​of the two channels to obtain a difference image, and then perform binarization thresholding on the difference image to generate a preliminary binary mask that initially distinguishes the foreground and background of the rod. The mask optimization module is used to perform morphological erosion on the initial binary mask to remove noise, and then perform connected component analysis on the eroded image to identify and remove background connected components connected to the image boundary, so as to obtain an accurate binary mask containing only the rod region. The center point set calculation module is used to select several sampling columns along the length of the drill rod on the precise binary mask, and calculate the centroid of the vertical coordinate of the pixel belonging to the drill rod region for each sampling column, thereby obtaining a two-dimensional coordinate point set that represents the trend of the drill rod centerline. The centerline fitting module is used to perform linear fitting on the two-dimensional coordinate point set using the least squares method to obtain the mathematical equation characterizing the centerline of the drill rod, and to calculate the tilt angle and center point position of the drill rod based on the mathematical equation. The correction output module is used to perform an affine transformation on the preprocessed image based on the tilt angle, with the center point as the rotation center, to rotate and correct the drill rod to a horizontal state. Then, with the center point of the rotated and corrected drill rod as the reference, a rectangular area of ​​a preset size is cropped out, and a standardized drill rod image is output.

[0017] As can be seen from the above technical solutions, this application has the following advantages: The method and system for image correction and extraction of copper smelting sample rods provided in this application realize fully automated processing from raw images to standardized analysis samples, replacing the tedious manual observation process, improving detection efficiency, and achieving intelligent and automated copper smelting process. Through image processing using color channel difference, connected component analysis, and least squares fitting, the posture of the sample rod can be accurately located and measured, effectively eliminating interference from complex industrial backgrounds and noise. It is highly adaptable to positional translation, angular rotation, and even slight bending of the sample rod within the field of view. By outputting sample rod images with uniform posture and fixed size, the influence of irrelevant variables on deep learning models is eliminated, providing high-quality, standardized data input for model training and prediction, and improving the accuracy and stability of endpoint prediction. It reduces the need for manual close contact with the high-temperature converter, lowering safety risks, while the automated processing is more stable and reliable, avoiding misjudgments and operational errors caused by human factors. Attached Figure Description

[0018] To more clearly illustrate the technical solution of this application, the accompanying drawings used in the description will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a schematic flowchart of the converter copper smelting sampling rod image correction and extraction method of the present invention.

[0020] Figure 2 This is a schematic diagram of the original RGB image containing the drill rod of the present invention.

[0021] Figure 3 This is a schematic diagram of the preliminary binary mask image of the present invention.

[0022] Figure 4 This is a schematic diagram of a precise binary mask image containing the probe region according to the present invention.

[0023] Figure 5 This is a schematic diagram of the size-standardized drill rod image, which is the final output of this invention.

[0024] Figure 6 This is a schematic diagram of the converter copper smelting sampling rod image correction and extraction system of the present invention. Detailed Implementation

[0025] The various embodiments of this disclosure will be described more fully in the following detailed description of the specific steps of the method for correcting and extracting images from sampling rods in copper smelting in a converter. This disclosure may have various embodiments, and adjustments and changes may be made therein. However, it should be understood that there is no intention to limit the various embodiments of this disclosure to the specific embodiments disclosed herein, but rather this disclosure should be understood to cover all adjustments, equivalents, and / or alternatives falling within the spirit and scope of the various embodiments of this disclosure.

[0026] For example, in the converter copper smelting process, the blowing process is divided into the slag-forming period and the copper-forming period, with the determination of the end point of the slag-forming period being a crucial step. Currently, the industry mainly uses the manual probe analysis method, where operators insert a steel probe into the converter to take a sample and subjectively judge the end point of the slag-forming period based on their experience by observing the sample's color, shape, thickness, and other visual characteristics. This method has the following drawbacks: First, the judgment result is highly dependent on the operator's experience, lacking objective and unified standards, and there are differences between different operators; second, the sampling, observation, and judgment process is time-consuming, making continuous real-time monitoring impossible; third, workers need to be in close contact with the high-temperature converter, posing safety hazards; and fourth, manual inspection methods are difficult to automate, hindering the development of intelligent manufacturing in the copper smelting process. To overcome these shortcomings, introducing machine vision and deep learning technologies has become a feasible direction. However, in practical applications, the probe images captured by industrial cameras have problems with inconsistent positions, angles, and sizes, and this inconsistency can seriously interfere with the training and prediction accuracy of subsequent deep learning models. Therefore, there is an urgent need for a method that can automatically and robustly correct and extract drill rod images from complex industrial backgrounds to provide standardized input data and improve the automation level and accuracy of slag formation endpoint determination.

[0027] To address the aforementioned issues, this embodiment provides a method for correcting and extracting sampling rod images in converter copper smelting. This method enables automatic correction and extraction of sampling rod images in converter copper smelting, improving the level of automated copper smelting, enhancing accuracy, safety, production efficiency, and the accuracy of endpoint determination.

[0028] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0029] Please see Figure 1 The diagram shows a flowchart of a method for image correction and extraction from a copper smelting sampling rod in a converter, according to a specific embodiment. The method includes the following steps: S1. Acquire the original RGB image containing the sampling rod using an industrial camera, and scale the original RGB image to obtain a preprocessed image; It should be noted that by acquiring raw RGB images through an industrial camera and scaling them, a clear image containing the drill rod can be obtained, and the aspect ratio of the image can be adjusted to fit the shape of the drill rod. At the same time, the amount of computation is reduced, providing high-quality input data for subsequent image processing and improving the efficiency of the entire processing. S2. Extract the red and blue channels of the preprocessed image, calculate the difference between the pixel values ​​of the two channels to obtain the difference image, and then perform binarization thresholding on the difference image to generate a preliminary binary mask that initially distinguishes the foreground and background of the rod. It should be noted that this step of image segmentation and analysis provides a clearer basis, improves the accuracy of image segmentation, and facilitates accurate identification and extraction of the rod region; S3. Perform morphological erosion on the initial binary mask to remove noise, and then perform connected component analysis on the eroded image to identify and remove background connected components connected to the image boundary, so as to obtain an accurate binary mask containing only the rod region. It should be noted that this step optimizes the accuracy of the mask, provides more reliable data for center point calculation and fitting, and improves the accuracy of the image processing process. S4. On the precise binary mask, select several sampling columns along the length of the drill rod, and calculate the centroid of the vertical coordinate of the pixel belonging to the drill rod region for each sampling column, so as to obtain a set of two-dimensional coordinate points representing the trend of the drill rod centerline. It should be noted that this step can accurately capture the position information of the drill rod's centerline, providing key data for centerline fitting, enabling precise measurement of the drill rod's attitude, and facilitating accurate determination of the drill rod's centerline and attitude. S5. The least squares method is used to perform linear fitting on the two-dimensional coordinate point set to obtain the mathematical equation characterizing the center line of the drill rod, and the tilt angle and center point position of the drill rod are calculated based on the mathematical equation. It should be noted that the least squares method has high calculation accuracy and good stability. This step can accurately describe the attitude of the drill rod in the image, providing parameter basis for subsequent rotation correction and ensuring the accuracy and reliability of rotation correction. S6. Using the center point as the rotation center, perform an affine transformation on the preprocessed image based on the tilt angle to rotate and correct the drill rod to a horizontal state. Then, using the rotated and corrected center point of the drill rod as a reference, cut out a rectangular area of ​​a preset size and output a standardized drill rod image. It should be noted that this step ensures that the output drill rod images have a uniform pose and size, which facilitates analysis and processing by deep learning models and also makes them easier to display intuitively on the user interface, thus improving the user experience.

[0030] This embodiment achieves automatic correction and extraction of the drill rod image through color channel difference, morphological corrosion, connected component analysis, and least squares fitting, thereby improving the automation level of copper smelting sampling in converters, enhancing accuracy, safety, production efficiency, and endpoint determination accuracy, and realizing intelligent copper smelting process.

[0031] Furthermore, as a refinement and extension of the specific implementation of the above embodiments, in order to fully illustrate the specific implementation process in this embodiment, another method for correcting and extracting images of copper smelting sampling rods in a converter is provided. This method includes the following steps: S1. Acquire the original RGB image containing the sampling probe using an industrial camera, and scale the original RGB image to obtain a preprocessed image; the specific steps of step S1 are as follows: S11. Acquire a frame of raw RGB image containing the drill rod using an industrial camera. ,like Figure 2 As shown; For example, an industrial camera of a certain model, equipped with an 8mm fixed-focus lens, is set up to the side of the converter operating platform, avoiding the area of ​​direct high-temperature radiation. The frame rate is set to 10fps and the exposure time to 10ms, and a single frame of raw RGB image is captured. The resolution is 2448×2048. The rod in the image is a steel cylinder with a diameter of 10mm. The surface is covered with samples from the slag-forming period. The background includes the converter body and the guardrail of the operating platform. S12. Process the original RGB image The image is scaled in both the horizontal and vertical directions to obtain the preprocessed image. To adjust the original RGB image The aspect ratio is adjusted to adapt to the shape of the drill rod and reduce the amount of computation. For example, based on the shape of the drill rod in the original image, such as approximately 2000 pixels in length and 30 pixels in width, the original image is scaled by 0.4 times horizontally and 0.4 times vertically to obtain a preprocessed image of 979×819. After scaling, the length of the probe is about 800 pixels, occupying 82% of the horizontal direction of the image, and the width is about 12 pixels. The image data size is reduced from about 15MB (2448×2048×3 bytes) to about 2.4MB, and the subsequent image processing time is shortened from 0.8s to 0.15s. S2. Extract the red and blue channels of the preprocessed image, calculate the pixel value difference between the two channels to obtain a difference image, and then perform binarization thresholding on the difference image to generate a preliminary binary mask that initially distinguishes the foreground and background of the rod; the specific steps of step S2 are as follows: S21. Extract the preprocessed image Red channel image and blue channel image ; For example, from a preprocessed image of 979×819 In this example, the R, G, and B channels are separated using OpenCV's split function to obtain the red channel image. and blue channel image ;exist In the middle, the pixel value of the drill rod area is approximately 70-100, and the pixel value of the background furnace body area is approximately 180-210; in In the middle, the pixel value of the drill rod area is about 140-170, and the pixel value of the background furnace body area is about 160-190; S22. Calculate the pixel value difference between the red channel and the blue channel to obtain the difference image. :

[0032] in, It is an absolute value function; For example, for and Calculate the difference for each pixel ; drill rod area Values ​​are concentrated in the 60-90 range (e.g.) =85、 When =155, =70), background furnace area Values ​​are concentrated in the range of 10-40 (e.g.) =195、 When =175, =20), reflective area of ​​the guardrail The value is approximately 45-55, resulting in a clear difference in grayscale. S23. Use preset experience thresholds For difference images Perform binarization to generate a preliminary binary mask. ,like Figure 3 As shown, the pixel value is greater than a preset empirical threshold. Pixels with a value of 1 are set to foreground; pixel values ​​less than or equal to a preset empirical threshold are considered foreground. Pixels that are set to 0 are represented as the background; For example, through multiple experiments, it has been verified that when a preset experience threshold is reached... When the value is 50, the difference between the rod and the background can be distinguished to the greatest extent; for the difference image Binarization: Pixels >50 are set to 1 (foreground), and pixels ≤50 are set to 0 (background); this generates a preliminary binary mask. In the foreground, the rod area is complete and continuous, with an area of ​​approximately 60,000 pixels; in the background, only a small number of reflective areas of the guardrail (foreground pixels, with an area of ​​approximately 1,200 pixels) and isolated noise points (e.g., 1-3 pixels, totaling approximately 50) remain. S3. Perform morphological erosion on the initial binary mask to remove noise, then perform connected component analysis on the eroded image to identify and remove background connected components connected to the image boundaries, obtaining an accurate binary mask containing only the rod region; the specific steps of step S3 are as follows: S31. Initial binary mask Perform morphological erosion using a 3×3 matrix of all ones as the structuring element to obtain the eroded image. This is done to remove noise pixels with an area smaller than the structuring element and to smooth the edges of the main body area of ​​the rod. For example, calling OpenCV's erode function, using a 3×3 matrix of all ones as the structuring element, performs... One erosion operation is performed; isolated noise points of 1-3 pixels in the background are completely removed; the area of ​​the reflective area of ​​the guardrail (e.g., 1200 pixels) is reduced to about 800 pixels after erosion; the jagged protrusions on the edge of the rod area are eliminated, and the edge smoothness is improved by about 60%. S32. Image after erosion Perform connected component analysis and assign a unique label to each individual white pixel region; For example, using OpenCV's connectedComponentsWithStats function, connected component analysis was performed on the eroded image, with the connectivity mode set to 8-neighborhood; two independent white pixel regions were identified, and labeled 1 (i.e., the rod region, with an area of ​​approximately 58,000 pixels and center point coordinates (480, 400)) and 2 (i.e., the reflective area of ​​the guardrail, with an area of ​​approximately 800 pixels and center point coordinates (120, 650)). S33. Inspect the image after etching. The labels of the pixels in the first and last rows are used to identify the eroded image. Connected regions with their upper and lower boundaries are identified, and all pixel values ​​of the identified connected regions are set to 0 to obtain an optimized, precise binary mask containing only the rod region. ,like Figure 4 As shown; For example, traverse all pixels in the first row (row number 0) and the last row (row number 818) of the eroded image and check their labels; it is found that in the last row, the pixels with column numbers 110-130 are labeled as 2 (the reflective area of ​​the guardrail), that is, this connected component is connected to the lower boundary of the image; set all pixel values ​​corresponding to label 2 to 0 to obtain the accurate binary mask. Only the drill rod area corresponding to label 1 is retained, with no background interference, and the integrity of the drill rod area is maintained at over 98%. S4. On the precise binary mask, select several sampling columns along the length of the drill rod, and calculate the centroid of the vertical coordinate of the pixels belonging to the drill rod region for each sampling column, thereby obtaining a set of two-dimensional coordinate points representing the trend of the drill rod's centerline; the specific steps of step S4 are as follows: S41. In a precise binary mask From left to right along the length of the rod, N sampling columns are selected sequentially, where N is a preset positive integer; For example, N=196 (i.e., 979 columns ÷ 5 ≈ 196), and along the length of the rod (i.e., the horizontal direction of the image), one sampling column is selected every 5 columns from left to right, with the sampling column numbers being 5, 10, 15, ..., 975, for a total of 196 sampling columns, covering the entire length range of the rod (column numbers 50-920). S42. For each sampling column Calculate the sampling column The ordinate of the centroid of all white pixels :

[0033] Where i is the row number of the pixel. For position pixel values, Represents column The ordinate of the centroid; For example, taking sample column j=100 as an example, the white pixels in this column ( =1) The row number range is 280-520, a total of 240 pixels; the centroid of the vertical coordinate is calculated according to the formula: y=(280×1+281×1+...+520×1)÷240=(280+520)×240÷2÷240=400, that is, the vertical coordinate of the centroid of this sampling column is 400; S43. Collect all valid sample columns. and the corresponding ordinate of the centroid This forms a two-dimensional coordinate point set representing the centerline of the drill rod. ; For example, the centroid ordinates of 196 sample columns are calculated sequentially, resulting in coordinate points such as (5,398), (10,399), (15,399), ..., (975,402), forming a two-dimensional coordinate point set. These points show a slight tilting trend, consistent with the actual posture of the drill bit; S44. When calculating the ordinate of the centroid of a sampling column according to step S42, if a certain sampling column If the total number of white pixels on the sampled column is lower than a preset first threshold, then the sampled column is determined to be... Invalid and ignored; If the total number of valid two-dimensional coordinate points collected is less than the preset second threshold, the image acquisition and processing is deemed a failure and the process ends. For example, the first threshold is preset to 15 and the second threshold is preset to 150; wherein, the first threshold is set according to the width of the probe rod, which is about 12 pixels, and the second threshold reserves a certain amount of redundancy to ensure fitting accuracy; in 196 sampling columns, the number of white pixels in sampling column j=970 (i.e., column number 970) is only 8 (i.e., lower than the first threshold of 15), so the column is determined to be invalid and ignored; the remaining 195 sampling columns are all valid, and the total number of valid coordinate points is 195 (i.e., higher than the second threshold of 150), so subsequent processing continues; if there are only 120 valid coordinate points in a batch of images (i.e., lower than 150), then the processing is determined to have failed, and the industrial camera is triggered to re-acquire images; S5. The least squares method is used to perform linear fitting on the two-dimensional coordinate point set to obtain the mathematical equation characterizing the center line of the drill rod, and the tilt angle and center point position of the drill rod are calculated based on the mathematical equation. The specific steps of step S5 are as follows: S51. Using the least squares method on a two-dimensional coordinate point set Linear regression analysis was performed to fit a straight line representing the centerline of the drill rod. The straight line From direction vector and center point Jointly expressed; For example, using Python's `numpy.polyfit` function, a first-order linear regression (least squares method) is performed on 195 valid coordinate points (j, y) to obtain the coefficients of the fitted line: slope k ≈ 0.0041, intercept b ≈ 397.8, and the mathematical equation is y = 0.0041j + 397.8; taking two points (100, 401.9) and (600, 402.3) on the line, the direction vector is calculated. =(600-100,402.3-401.9)=(500,0.4); The center point is the average value of all sampled columns j ((5+10+...+975)÷195≈490) and the average value of the corresponding y ((398+399+...+402)÷195≈400.1), that is, the coordinates of the center point are (490,400.1); S52. Based on direction vector Calculate the tilt angle of the drill rod in the image. :

[0034] in, It is the arctangent function in the four quadrants; For example, the direction vector ( =500, Substitute 0.4 into the formula, ≈0.0458° (equivalent to approximately 0°2′45″ in degrees, minutes, and seconds), meaning the drill rod is slightly tilted to the right in the image, with a tilt angle of approximately 0.0458°. S6. Using the center point as the rotation center, perform an affine transformation on the preprocessed image based on the tilt angle to rotate and correct the drill rod to a horizontal state. Then, using the rotated and corrected center point of the drill rod as a reference, cut out a rectangular area of ​​a preset size and output a standardized drill rod image. The specific steps of step S6 are as follows: S61. Center point Let it be P, based on the calculated center point P and tilt angle. Calculate the rotation matrix The rotation matrix Rotation around center point P, with an angle of θ. ; For example, the center point P has coordinates of (490, 400.1) and a rotation angle of -α ≈ -0.0458°; the rotation matrix M is calculated according to the affine transformation formula: M=[cos(-0.0458°),-sin(-0.0458°),490-490×cos(-0.0458°)-400.1×(-sin(-0.0458°))] [sin(-0.0458°),cos(-0.0458°),400.1-490×sin(-0.0458°)-400.1×cos(-0.0458°)] The calculated values ​​are cos(-0.0458°)≈0.999996, sin(-0.0458°)≈-0.0008. Substituting these values ​​into the equations, the parameters of the M matrix are approximately: [0.999996, 0.0008, 490 - 490 × 0.999996 - 400.1 × 0.0008 ≈ 490 - 0.49 - 0.32 ≈ 489.19] [-0.0008, 0.999996, 400.1 - 490 × (-0.0008) - 400.1 × 0.999996 ≈ 400.1 + 0.39 - 400.1 ≈ 0.39]; S62. Rotate the matrix Preprocessed images Perform an affine transformation to obtain the rotated image. To the rotated image The lieutenant general's drill rod was corrected to a horizontal position; For example, calling OpenCV's warpAffine function applies a rotation matrix M to a preprocessed image of 979×819. To obtain the rotated image By comparing the center line of the drill rod before and after rotation, the center line after rotation is parallel to the horizontal direction of the image (i.e., the x-axis), the tilt state is completely corrected, and the texture direction of the sample on the surface of the drill rod is also horizontal, without stretching or deformation distortion. S63. Calculate the image of the center point P after rotation. The new coordinates P′ are used as the center, and a rectangular area with a preset width w and a preset height h is cropped out to obtain the final output, size-standardized drill rod image. ,like Figure 5 As shown; For example, due to the extremely small rotation angle (approximately -0.0458°), the new coordinates of the center point P after rotation are P′≈(490, 400.1); the preset standardized image size is 800×200 (w=800, h=200). Centered on P′, the coordinates of the upper left corner of the cropped area are calculated as (490-400, 400.1-100) = (90, 300.1), and the coordinates of the lower right corner are (490+400, 400.1+100) = (890, 500.1). The image is cropped to obtain a standardized 800×200 image of the drill rod. The image resolution is fixed, the drill rod is centered and horizontal, and only a small amount of non-interfering neutral background is retained. S64. Standardized image of the drill bit. The output is fed into a pre-trained deep learning model to automatically predict the end point of the slagging period in copper smelting in a converter, and the prediction results are compared with size-normalized images. Simultaneously displayed on the user interface; For example, a standardized 800×200 image of the drill rod is input into a pre-trained ResNet-50 deep learning model; the ResNet-50 deep learning model outputs a prediction result of "approximately 2 minutes remaining in the slag-forming period, not yet reaching the endpoint", and displays this result along with the standardized image on the human-machine interface (1920×1080 resolution display screen) in the control room. The image display area occupies 60% of the left side of the interface, and the prediction result is displayed in red font on the right side for easy real-time monitoring by the operator; It should be noted that the ResNet-50 deep learning model was trained on 10,000 images of the drill rod at different slag-forming stages, and the endpoint determination accuracy reached 96%.

[0035] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0036] like Figure 6 As shown, the following are embodiments of the converter copper smelting sampling rod image correction and extraction system provided in this disclosure. This system and the converter copper smelting sampling rod image correction and extraction methods described above belong to the same inventive concept. For details not described in detail in the embodiments of the converter copper smelting sampling rod image correction and extraction system, please refer to the embodiments of the converter copper smelting sampling rod image correction and extraction methods described above.

[0037] The system includes: The image acquisition and preprocessing module is used to acquire the original RGB image containing the sampling rod through an industrial camera, and to scale the original RGB image to obtain a preprocessed image. The region segmentation module is used to extract the red and blue channels of the preprocessed image, calculate the difference between the pixel values ​​of the two channels to obtain a difference image, and then perform binarization thresholding on the difference image to generate a preliminary binary mask that initially distinguishes the foreground and background of the rod. The mask optimization module is used to perform morphological erosion on the initial binary mask to remove noise, and then perform connected component analysis on the eroded image to identify and remove background connected components connected to the image boundary, so as to obtain an accurate binary mask containing only the rod region. The center point set calculation module is used to select several sampling columns along the length of the drill rod on the precise binary mask, and calculate the centroid of the vertical coordinate of the pixel belonging to the drill rod region for each sampling column, thereby obtaining a two-dimensional coordinate point set that represents the trend of the drill rod centerline. The centerline fitting module is used to perform linear fitting on the two-dimensional coordinate point set using the least squares method to obtain the mathematical equation characterizing the centerline of the drill rod, and to calculate the tilt angle and center point position of the drill rod based on the mathematical equation. The correction output module is used to perform an affine transformation on the preprocessed image based on the tilt angle, with the center point as the rotation center, to rotate and correct the drill rod to a horizontal state. Then, with the center point of the rotated and corrected drill rod as the reference, a rectangular area of ​​a preset size is cropped out, and a standardized drill rod image is output.

[0038] This embodiment achieves automatic correction and extraction of copper smelting sampling rod images in converters through the interactive collaboration of image acquisition and preprocessing modules, region segmentation modules, mask optimization modules, center point set calculation modules, center line fitting modules, and correction output modules. This improves automation, accuracy, safety, production efficiency, and endpoint determination accuracy.

[0039] The method for image correction and extraction of copper smelting sampling rods provided in this application can be applied to electronic devices. Those skilled in the art will understand that the electronic device structure involved in the embodiments of this invention does not constitute a limitation on the electronic device. An electronic device may include more or fewer components than illustrated, or combine certain components, or have different component arrangements. In the embodiments of this invention, the electronic device includes, but is not limited to, laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the embodiments of this application described and / or claimed herein.

[0040] Electronic devices may include processors, external memory interfaces, internal memory, universal serial bus (USB) interfaces, charging management modules, power management modules, batteries, wireless communication modules, audio modules, speakers, microphones, sensor modules, buttons, cameras, displays, and SIM card interfaces, etc.

[0041] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device. In other embodiments of this application, the electronic device may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0042] A processor may include one or more processing units, such as a central processing unit (CPU), an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors.

[0043] The processor can serve as the nerve center and command center of an electronic device. The controller can generate operation control signals based on the instruction opcode and timing signals to control the fetching and execution of instructions.

[0044] The processor may also include memory for storing instructions and data. In some embodiments, the memory in the processor is a cache memory. This memory can store instructions or data that the processor has just used or that are used repeatedly. If the processor needs to use the instruction or data again, it can retrieve it directly from this memory. This avoids repeated accesses, reduces processor latency, and thus improves system efficiency.

[0045] The aforementioned electronic device implements the method for image correction and extraction of copper smelting sampling rods in this application. It acquires the original RGB image containing the sampling rod using an industrial camera, scales the original RGB image to obtain a preprocessed image, extracts the red and blue channels of the preprocessed image, calculates the pixel value difference between the two channels to obtain a difference image, performs binarization thresholding on the difference image to generate a preliminary binary mask that initially distinguishes the foreground and background of the rod, performs morphological erosion on the preliminary binary mask to remove noise, and then performs connected component analysis on the eroded image to identify and remove background connected components connected to the image boundary, obtaining a precise binary mask containing only the rod region. On the precise binary mask, along the length of the rod... A technical solution involves selecting several sampling columns and calculating the centroid of the ordinate of pixels belonging to the drill rod region for each sampling column, thereby obtaining a two-dimensional coordinate point set representing the trend of the drill rod's centerline. The two-dimensional coordinate point set is then linearly fitted using the least squares method to obtain a mathematical equation representing the drill rod's centerline. Based on this mathematical equation, the tilt angle and center point position of the drill rod are calculated. Using the center point position as the rotation center, an affine transformation is performed on the preprocessed image based on the tilt angle to rotate and correct the drill rod to a horizontal state. Then, using the rotated and corrected center point of the drill rod as a reference, a rectangular region of a preset size is cropped, outputting a standardized drill rod image. This achieves the beneficial effects of automated processing, improved accuracy, enhanced safety, and increased production efficiency.

[0046] The storage medium provided in this application stores a program product capable of implementing a method for correcting and extracting images of sampling rods in copper smelting in a converter.

[0047] The method for image correction and extraction of copper smelting sample rods in a converter includes: acquiring an original RGB image containing the sample rods using an industrial camera, scaling the original RGB image to obtain a preprocessed image; extracting the red and blue channels of the preprocessed image, calculating the pixel value difference between the two channels to obtain a difference image, then performing binarization thresholding on the difference image to generate a preliminary binary mask that initially distinguishes the foreground and background of the sample rods; performing morphological erosion on the preliminary binary mask to remove noise, then performing connected component analysis on the eroded image to identify and remove background connected components connected to the image boundaries, obtaining an accurate binary mask containing only the sample rod region; and further refining the image based on the sample rods' appearance. On the binary mask, several sampling columns are selected along the length of the drill rod, and the centroid of the vertical coordinate of the pixel belonging to the drill rod region is calculated for each sampling column, thus obtaining a two-dimensional coordinate point set representing the trend of the drill rod centerline. The two-dimensional coordinate point set is linearly fitted using the least squares method to obtain the mathematical equation representing the drill rod centerline, and the tilt angle and center point position of the drill rod are calculated based on the mathematical equation. Using the center point position as the rotation center, the preprocessed image is subjected to an affine transformation based on the tilt angle to rotate and correct the drill rod to a horizontal state. Then, using the rotated and corrected center point of the drill rod as the reference, a rectangular area of ​​a preset size is cropped, and a standardized drill rod image is output.

[0048] In some possible implementations, the converter copper smelting sampling rod image correction and extraction method of this disclosure can be implemented as a program product, which includes program code. When the program product is run on a terminal device, the program code is used to cause the terminal device to perform the steps described in the "Exemplary Methods" section above according to various exemplary embodiments of this disclosure.

[0049] The storage medium disclosed herein may be any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof.

[0050] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for image correction and extraction of a sampling lance in a copper converter, characterized in that, The method comprises the following steps: S1. Collecting an original RGB image containing a sampling drill rod by an industrial camera, and performing scaling processing on the original RGB image to obtain a preprocessed image; S2. Extracting a red channel and a blue channel of the preprocessed image, calculating a pixel value difference of the two channels to obtain a difference image, and performing binary threshold processing on the difference image to generate a preliminary binary mask preliminarily distinguishing the foreground of the drill rod from the background; S3. Performing a morphological erosion operation on the preliminary binary mask to remove noise, and performing connected domain analysis on the eroded image to identify and remove background connected domains connected to the image boundary, thereby obtaining an accurate binary mask containing only the drill rod region; S4. On the accurate binary mask, a plurality of sampling columns are selected along the length direction of the drill rod, and the vertical coordinate centroid of the pixels belonging to the drill rod region is calculated for each sampling column, thereby obtaining a two-dimensional coordinate point set representing the trend of the center line of the drill rod; S5. Linear fitting is performed on the two-dimensional coordinate point set by using the least square method to obtain a mathematical equation representing the center line of the drill rod, and the inclination angle and the center point position of the drill rod are calculated based on the mathematical equation; S6. Affine transformation is performed on the preprocessed image based on the inclination angle with the center point position as the rotation center, the drill rod is rotated and corrected to a horizontal state, and a rectangular region of a predetermined size is cropped with the center point of the rotated and corrected drill rod as the reference, thereby outputting a standardized drill rod image.

2. The method according to claim 1, wherein the method is characterized by: The specific steps of step S1 are as follows: S11. Collecting a frame of original RGB image containing the drill rod by an industrial camera ; S12. The original RGB image is scaled in the horizontal and vertical directions to obtain a preprocessed image S13. The preprocessed image is converted into a YUV image S14. The YUV image is scaled in the horizontal and vertical directions to adjust the aspect ratio of the original RGB image, adapt to the morphology of the drill rod, and reduce the amount of computation. ​ 3. The method for image correction and extraction of copper smelting sampling rods in a converter as described in claim 2, characterized in that, The specific steps of step S2 are as follows: S21. Extracting pre-processed images of the red channel image and the blue channel image ; S22. Calculate the difference of pixel values of red channel and blue channel, and get the difference image : wherein is an absolute value function; S23. Use preset experience thresholds For difference images Perform binarization to generate a preliminary binary mask. Among them, the pixel value is greater than the preset empirical threshold. Pixels with a value of 1 are set to foreground; pixel values ​​less than or equal to a preset empirical threshold are considered foreground. The pixel is set to 0 to represent the background.

4. The method of claim 1, wherein the method further comprises: determining a position of the sampling lance in the converter; and determining a position of the sampling lance in the image. The specific steps of step S3 are as follows: S31. To the preliminary binary mask Perform morphological erosion operation using a 3x3 all-1 matrix as the structuring element to obtain the eroded image to remove noise pixels with area smaller than the structuring element and smooth the edges of the solder stick body region; S32. The image after erosion A connected component analysis is performed, and each independent white pixel region is assigned a unique label. S33. Check the image after corrosion The labels of the pixels in the first and last rows of the image after corrosion are identified, and the connected components that are connected to the upper and lower boundaries of the image after corrosion are identified. The pixel values of the identified connected components are all set to 0, and an optimized precise binary mask containing only the solder stick region is obtained The labels of the pixels in the first and last rows of the image after corrosion are identified, and the connected components that are connected to the upper and lower boundaries of the image after corrosion are identified. The pixel values of the identified connected components are all set to 0, and an optimized precise binary mask containing only the solder stick region is obtained .

5. The method of claim 4, wherein the method further comprises: determining a center of the image; and determining a center of the sample. The specific steps of step S4 are as follows: S41. In the precise binary mask From left to right along the length direction of the soldering stick, N sampling columns are sequentially selected, where N is a preset positive integer. S42. For each sampling column , calculate the ordinate of the centroid of all white pixels in the sampling column :​ Where i is the row number of the pixel. For position pixel values, Represents column The ordinate of the centroid; S43. Collect all valid sampling columns and the longitudinal coordinate of the corresponding centroid , forming a set of two-dimensional coordinate points representing the centerline of the drill rod .

6. The method of claim 5, wherein the method further comprises: determining a center of the image; and determining a center of the sample. The specific steps of step S4 are as follows: S44. In calculating the longitudinal coordinate of the centroid of a sample column according to step S42, if the total number of white pixels on the sample column is lower than a preset first threshold value, it is determined that the sample column is invalid and is ignored. If the total number of effective two-dimensional coordinate points finally collected is less than the preset second threshold value, it is determined that the current image acquisition and processing fails, and the process ends.

7. The method of claim 5, wherein the method further comprises: determining a center of the image; and determining a center of the sample area. The specific steps of step S5 are as follows: S51. Linear regression analysis is performed on the two-dimensional coordinate point set using the least squares method to fit a straight line representing the centerline of the drill rod ; the straight line ; the straight line is represented by a direction vector and a center point ; S52. Based on the direction vector , the tilt angle of the drill rod in the image is calculated : wherein is the four-quadrant arctangent function.

8. The method for image correction and extraction of copper smelting sampling rods in a converter as described in claim 7, characterized in that, The specific steps of step S6 are as follows: S61. Calculate the center point P is denoted as P, a rotation matrix R is calculated according to the calculated center point P and the tilt angle , the rotation matrix R with the center point P as the rotation center and the rotation angle ;​ S62. Rotate the matrix Preprocessed images Perform an affine transformation to obtain the rotated image. In the rotated image The lieutenant general's drill rod was corrected to a horizontal position; S63. Calculate the new coordinate P' of the center point P in the rotated image, and crop a rectangular region with a preset width w and a preset height h centered at the new coordinate P' to obtain the final output, size-standardized drill rod image. .​ 9. The method for image correction and extraction of copper smelting sampling rods in a converter as described in claim 8, characterized in that, The specific steps of step S6 are as follows: S64. Size-normalized rod image Output to a pre-trained deep learning model for automatic prediction of the end of the converter copper-making slagging phase, and display the prediction result on the user interface simultaneously with the size-normalized image Output to a pre-trained deep learning model for automatic prediction of the end of the converter copper-making slagging phase, and display the prediction result on the user interface simultaneously with the size-normalized image 10. A converter copper sampling lance rod image correction and extraction system, characterized by, It comprises: An image acquisition and preprocessing module for collecting an original RGB image containing a sampling drill rod by an industrial camera, and performing scaling processing on the original RGB image to obtain a preprocessed image; A region segmentation module for extracting a red channel and a blue channel of the preprocessed image, calculating a pixel value difference of the two channels to obtain a difference image, and performing binary threshold processing on the difference image to generate a preliminary binary mask preliminarily distinguishing the foreground of the drill rod from the background; A mask optimization module for performing a morphological erosion operation on the preliminary binary mask to remove noise, and performing connected domain analysis on the eroded image to identify and remove background connected domains connected to the image boundary, thereby obtaining an accurate binary mask containing only the drill rod region; A center point set calculation module for selecting a plurality of sampling columns along the length direction of the drill rod on the accurate binary mask, and calculating the vertical coordinate centroid of the pixels belonging to the drill rod region for each sampling column, thereby obtaining a two-dimensional coordinate point set representing the trend of the center line of the drill rod; A center line fitting module for performing linear fitting on the two-dimensional coordinate point set by using the least square method to obtain a mathematical equation representing the center line of the drill rod, and calculating the inclination angle and the center point position of the drill rod based on the mathematical equation; The correction output module is configured to perform an affine transformation on the pretreated image based on the tilt angle with the center point position as a rotation center, correct the drill rod to a horizontal state, and cut out a rectangular region with a preset size with the center point of the rotation-corrected drill rod as a reference to output a standardized drill rod image.

Citation Information

Patent Citations

  • Correction method of angle inclination of linear array camera

    CN103256919A

  • Quasi-circular particulate matter counting method based on Android platform

    CN107909138A

  • Finger vein ROI region extraction method and device

    CN113516096A

  • Method and device for automatic tilt correction of document image of scanning equipment

    CN118823789A