A binocular vision inspection method and system for refractory bricks

By using a binocular vision inspection method and system, refractory bricks can be automatically measured in three dimensions and defects can be detected. This solves the shortcomings of manual inspection, improves inspection efficiency and accuracy, reduces safety hazards, and is suitable for automated production lines of refractory bricks.

CN115578310BActive Publication Date: 2025-12-02WUHAN TEXTILE UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211011100.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-23
Publication Date
2025-12-02
Estimated Expiration
2042-08-23

AI Technical Summary

Technical Problem

In the current technology, the production quality inspection of refractory bricks relies on manual measurement and visual judgment, which is labor-intensive, time-consuming, has a high error rate, a high product defect rate, and poses significant safety hazards. Furthermore, the existing dual-camera inspection method is difficult to effectively detect defects such as surface cracks.

Method used

A binocular vision inspection method is adopted, which uses two industrial cameras to capture left and right images of refractory bricks. Defects are detected through image processing and algorithms, and three-dimensional dimensions are measured, including distortion correction, template matching, binocular stereo matching and three-dimensional dimension calculation. Combined with a motion control system, automated inspection is carried out.

Benefits of technology

It has enabled automated three-dimensional dimensional measurement and defect detection of refractory bricks, improving detection efficiency and accuracy, reducing safety hazards and error rates of manual operation, and enhancing economic benefits.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115578310B_ABST
    Figure CN115578310B_ABST
Patent Text Reader

Abstract

This invention discloses a binocular vision inspection method and system for refractory bricks. The method includes the following steps: S1, using two industrial cameras respectively positioned at the upper left and upper right of the refractory brick to be tested, two grayscale images of the refractory brick to be tested are captured, and the captured images are transmitted to an industrial control computer; S2, the industrial control computer processes the captured images of the refractory brick to be tested, and then performs image detection to determine whether the image detection of the refractory brick to be tested is qualified. If qualified, proceed to step S3; otherwise, proceed directly to step S4; S3, perform three-dimensional dimension measurement of the refractory brick to be tested based on binocular vision, and determine whether the dimension of the refractory brick to be tested is qualified; S4, store the determination result of whether the refractory brick is qualified into a database, and transport qualified and unqualified refractory bricks to different areas.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of machine vision inspection, and in particular to a binocular vision inspection method and system for refractory bricks. Background Technology

[0002] Refractory bricks are a crucial component of steel ladle structures, affecting the service life and condition of each working layer. They can withstand various mechanical forces and physicochemical changes at high temperatures and are widely used in power plants, metal smelting, and chemical processes. Therefore, the quality of refractory brick production is of paramount importance.

[0003] Currently, on refractory brick production lines, before products are packaged, defects such as surface scratches, chipped edges, and missing corners are judged manually using measuring tapes and visually. However, the vibration and noise from the presses during production pose significant health risks to workers, and many defects are judged based on experience, making it difficult to establish a unified evaluation standard.

[0004] Another method for measuring the three-dimensional dimensions and detecting defects in refractory bricks is the dual-camera inspection method. This method involves placing a monocular camera above and another to the side of the refractory brick to achieve two-dimensional measurements of the upper and lower surfaces, thus acquiring three-dimensional data. However, this method has certain requirements for lighting conditions; both the upper and lower surface outlines of the refractory brick must be clearly visible. Furthermore, this method is also difficult to detect defects such as cracks on the surface of the refractory brick. Summary of the Invention

[0005] To address the problems mentioned in the background section, the present invention provides a binocular vision inspection method for refractory bricks, comprising the following steps:

[0006] S1. Using two industrial cameras respectively positioned at the upper left and upper right of the refractory brick to be tested, two grayscale images of the refractory brick to be tested are captured, and the captured images are transmitted to the industrial control computer.

[0007] S2. The industrial control computer will process the captured image of the refractory brick to be tested, and then perform image detection to determine whether the image detection of the refractory brick to be tested is qualified. If it is qualified, proceed to step S3; otherwise, proceed directly to step S4.

[0008] S3. Perform three-dimensional dimensional measurement of the refractory brick to be tested based on binocular vision, and determine whether the dimensions of the refractory brick to be tested are qualified.

[0009] S4. Store the results of the test to determine whether the refractory bricks are qualified into the database, and transport qualified and unqualified refractory bricks to different areas.

[0010] In some embodiments, before step S1, the method further includes the step of: pre-storing a standard template image of refractory bricks in an industrial control computer;

[0011] Step S2 specifically includes the following steps:

[0012] S21. Using the initial intrinsic parameters and distortion coefficients of the two industrial cameras, perform distortion correction on the left and right images to obtain the distortion-corrected left and right images.

[0013] S22. Read the pre-stored standard template image of refractory bricks, find the refractory brick region to be tested in the left and right images after distortion correction through the template matching algorithm, and process the left and right images respectively through affine transformation to obtain the reconstructed image that overlaps with the standard template image.

[0014] S23. Perform differential processing on the reconstructed image and the standard template image to obtain the remaining area after the differential operation. Then determine whether the area of ​​the remaining area is greater than the preset threshold. If the area of ​​the remaining area is not greater than the preset threshold, proceed to step S24 for further detection. Otherwise, determine that the defect detection of the refractory brick to be tested is unqualified and directly proceed to step S4.

[0015] S24. The reconstructed image obtained in step S22 is smoothed, and the smoothed image is subtracted from the image before processing and multiplied by a correction factor to show the scratched areas in the image.

[0016] S25. Using a global threshold segmentation image algorithm, extract the scratch area, then disconnect the connected components, and obtain the area of ​​the largest scratch through feature extraction. Determine whether the length and area of ​​the largest scratch area are greater than the preset threshold. If the length and area of ​​the largest scratch area are not greater than the preset threshold, proceed to step S3; otherwise, determine that the defect detection of the refractory brick to be tested is unqualified, and directly proceed to step S4.

[0017] In some embodiments, before step S1, the method further includes the step of: performing dual-target calibration on the two industrial cameras, and setting the camera calibration file and related parameters in the industrial control computer based on the dual-target calibration results;

[0018] The specific steps for dual-target localization of two industrial cameras include:

[0019] Multiple standard calibration board images are captured simultaneously by two industrial cameras. The row and column coordinates of the Mark points in each calibration board image are recorded. Then, bi-target calibration is performed using the calibration board description file and the initial intrinsic and extrinsic parameters of the two industrial cameras. After successful bi-target calibration, the intrinsic parameters and relative position and attitude of the two industrial cameras are obtained.

[0020] In some embodiments, step S3 first obtains the length and width of the refractory brick to be tested, specifically including the following steps:

[0021] S31. Obtain the reconstructed image obtained in step S22. Combine the reconstructed image from a grayscale image into an RGB color space image. Then convert it from the RGB color space to the HSV color space. Use the binary threshold segmentation method in the brightness channel to obtain the upper surface area of ​​the refractory brick to be tested. Obtain the outline of the upper surface area. Then fit the upper surface area with a rectangle to obtain the row and column coordinates of the four vertices after fitting. Then convert the pixel coordinates into world coordinates and calculate the length and width of the refractory brick to be tested.

[0022] In some embodiments, step S3 further includes the following steps after step S31:

[0023] S32. Perform binocular correction on the left and right images, and step S32 specifically includes:

[0024] Obtain the distortion-corrected left and right images in step S21. Using the camera intrinsic parameters and relative pose after binocular calibration, obtain the mapping matrix of the left and right images. Transform the left and right images respectively to obtain the left and right mapped images after binocular calibration.

[0025] Display the binocular calibration result and obtain the epipolar error based on the binocular calibration result. Determine whether it is greater than the preset threshold. If the epipolar error is not greater than the preset threshold, the binocular calibration and correction is successful. Then proceed to step S33. If the epipolar error is greater than the preset threshold, the binocular calibration and correction fails, the process is stopped and the operator is notified.

[0026] S33, Perform binocular stereo matching, and step S33 specifically includes;

[0027] Define the window size and parallax range D, convert the left and right mapped images into floating-point numbers, and obtain the pixel grayscale value matrix of the left and right mapped images;

[0028] The gray values ​​of pixels within the neighborhood window of the left-mapped image are compared with the gray value of the center pixel of the window, and the resulting Boolean value is mapped into a bit string.

[0029] Then, within the disparity range of the right-mapped image, grayscale values ​​are compared and Boolean values ​​are mapped one by one to obtain the bit string under each disparity.

[0030] Finally, the bit string of the left mapped image and the bit string of the right mapped image under each disparity are XORed, and the number of 1s after the XOR operation is counted, which is the Hamming distance C.

[0031] S34. Aggregate the influence of pixel grayscale values ​​within the neighboring window on the grayscale value of the center pixel of the window, and step S34 specifically includes:

[0032] Create a mean convolution kernel with the same size as the window, average the pixel gray values ​​in the left mapped image window to obtain the mean of the pixel gray values ​​in the window, then subtract the mean from the gray values ​​of each pixel in the window and sum them up to obtain the accumulated value a1.

[0033] Then, within the disparity range of the right-mapped image, the gray values ​​of the pixels in the window of the right-mapped image are averaged one by one to obtain the average gray values ​​of the pixels in the window under different disparities. Then, the gray values ​​of each pixel in the window under each disparity are subtracted from the average value under that disparity and then summed to obtain the accumulated value a2.

[0034] Next, the smoothing coefficient S is calculated using the following formula:

[0035] S = ||a1 / a2|-1|;

[0036] Finally, the Hamming distance C obtained in step S33 is multiplied by the preset weight P1, and then the smoothing coefficient S is multiplied by the preset penalty value P2 to obtain the energy function E:

[0037] E = C*P1 + S*P2;

[0038] The energy function E under different parallaxes is sorted by size, and the center pixel of the right map window with the minimum value Emin is the best matching point of the center pixel of the left map window.

[0039] S35. Optimize the best matching point and eliminate erroneous parallax. Step S35 specifically includes:

[0040] By sorting the energy function E in step S34, the minimum and second minimum values ​​of the energy function are obtained. The minimum value is subtracted from the second minimum value. If the result is greater than the preset threshold, the disparity under this matching point is the optimal disparity dp. If the result is less than or equal to the preset threshold, this matching point is removed.

[0041] Then, the accuracy is improved by using the best matching point obtained in step S34, and the corresponding sub-pixel disparity F is obtained: the energy function Emin of this matching point is compared with the energy function E1 under the previous disparity and the energy function E2 under the next disparity. The function graph is then plotted with disparity D as the horizontal axis and energy function E as the vertical axis. The point with the minimum sum of distances to two points (dp-1, E1) and (dp+1, E2) is found on the line E = Emin. The horizontal coordinate value of this point is obtained. If the obtained result is greater than dp+0.5, the sub-pixel disparity is considered to be dp+0.5. If the obtained result is less than or equal to dp+0.5 and greater than or equal to dp-0.5, the sub-pixel disparity is considered to be this result. If the obtained result is less than dp-0.5, the sub-pixel disparity is considered to be dp-0.5.

[0042] After optimizing the sub-pixel disparity, the final pixel matching point is obtained, the disparity of the left and right images is calculated to obtain the disparity map, and finally a median convolution kernel is created to perform median filtering to suppress noise, and then proceed to step S36.

[0043] S36. In the disparity map obtained by disparity calculation in step S35 above, the disparity value of each pixel is stored, that is, the left image pixel minus the right image pixel. Then, through the initial pose of the two industrial cameras after binocular positioning, the baseline of the two industrial cameras is calculated. Combined with the focal length of the industrial cameras, the binocular vision principle is used to calculate the distances Z1 and Z2 from the upper surface of the refractory brick to be tested and the background to the baseline. Subtracting Z1 from Z2, the height of the refractory brick to be tested is obtained.

[0044] S37. The length and width of the refractory brick to be tested obtained in step S31 are compared with the height of the refractory brick to be tested obtained in step S36. If the three-dimensional dimensions of the refractory brick to be tested are within the standard range, the three-dimensional dimension test of the refractory brick to be tested is deemed qualified; otherwise, the three-dimensional dimension test is deemed unqualified.

[0045] Another aspect of the present invention provides a binocular vision inspection system for refractory bricks, including an industrial computer, a hub, a motion control system, and an image acquisition system;

[0046] The industrial control computer is wired to the hub, and the hub is wired to the motion control system and the image acquisition system respectively. The industrial control computer is used to control the operation of the motion control system and the image acquisition system.

[0047] The motion control system is used to drive the movement of the refractory brick under the control of the industrial computer;

[0048] The image acquisition system includes a ring light source and two industrial cameras;

[0049] Furthermore, the binocular vision inspection system for refractory bricks can complete the binocular vision inspection of refractory bricks according to the aforementioned binocular vision inspection method.

[0050] Compared with the prior art, the beneficial effects of the present invention are:

[0051] The binocular vision inspection method and system for refractory bricks provided by this invention utilizes binocular stereo vision to perform three-dimensional dimensional measurement and defect detection of refractory bricks. Two industrial cameras obtain two images of the upper surface of the refractory bricks, which are then processed and analyzed using visual image algorithms. This allows for three-dimensional dimensional measurement of the refractory bricks and detection of defects such as scratches, chipping, and missing corners and edges on the refractory brick surface. It solves a series of problems caused by manual operation, such as high labor intensity, long time, high error rate, and high product defect rate, thereby improving economic efficiency while reducing safety hazards. Attached Figure Description

[0052] Figure 1 This is a schematic flowchart of the binocular vision inspection method for refractory bricks provided by the present invention. Detailed Implementation

[0053] To make the technical means, creative features, objectives and effects of this invention easier to understand, the following description, in conjunction with the accompanying drawings and specific embodiments, further explains how this invention is implemented.

[0054] Reference Figure 1 As shown, the present invention provides a binocular vision inspection method for refractory bricks, characterized by comprising the following steps:

[0055] S1. Using two industrial cameras positioned at the upper left and upper right of the refractory brick to be tested respectively, two grayscale images of the refractory brick to be tested are captured, and the captured images are transmitted to the industrial control computer.

[0056] S2. The industrial control computer processes the captured image of the refractory brick to be tested, and then performs image detection to determine whether the image detection of the refractory brick to be tested is qualified. If it is qualified, proceed to step S3; otherwise, proceed directly to step S4.

[0057] S3. Perform three-dimensional dimensional measurement of the refractory brick to be tested based on binocular vision, and determine whether the dimensions of the refractory brick to be tested are qualified.

[0058] S4. Store the results of the test to determine whether the refractory bricks are qualified into the database, and transport qualified and unqualified refractory bricks to different areas.

[0059] Furthermore, before step S1, the method also includes the step of pre-storing a standard template image of refractory bricks in the industrial control computer;

[0060] Step S2 specifically includes the following steps:

[0061] S21. Using the initial intrinsic parameters and distortion coefficients of the two industrial cameras, perform distortion correction on the left and right images to obtain the distortion-corrected left and right images.

[0062] S22. Read the pre-stored standard template image of refractory bricks, find the refractory brick region to be tested in the left and right images after distortion correction through the template matching algorithm, and process the left and right images respectively through affine transformation to obtain the reconstructed image that overlaps with the standard template image.

[0063] S23. Perform differential processing on the reconstructed image and the standard template image to obtain the remaining area after the differential operation. Then, determine whether the area of ​​the remaining area is greater than a preset threshold. If the area of ​​the remaining area is not greater than the preset threshold, proceed to step S24 for further detection; otherwise, determine that the defect detection of the refractory brick under test is unqualified and directly proceed to step S4. It can be understood that through this step, it is possible to detect whether the refractory brick under test has defects such as missing corners or chipped edges.

[0064] S24. The reconstructed image obtained in step S22 is smoothed, and then the smoothed image is subtracted from the image before processing and multiplied by a correction factor to display the scratched areas in the image.

[0065] S25. Using a global threshold segmentation image algorithm, the scratch region is extracted, then connected components are broken. Through feature extraction, the region with the largest scratch is obtained. It is determined whether the length and area of ​​the region with the largest scratch are greater than a preset threshold. If the length and area of ​​the region with the largest scratch are not greater than the preset threshold, proceed to step S3; otherwise, the defect detection of the refractory brick under test is deemed unqualified, and the process proceeds directly to step S4. It can be understood that this step can detect whether the refractory brick under test has defects with large scratches.

[0066] Furthermore, before step S1, the procedure includes the following steps: performing dual-target calibration on the two industrial cameras, and setting the camera calibration file and related parameters in the industrial control computer based on the dual-target calibration results;

[0067] The specific steps for dual-target localization of two industrial cameras include:

[0068] Multiple standard calibration board images are captured simultaneously by two industrial cameras. The row and column coordinates of the Mark points in each calibration board image are recorded. Then, bi-target calibration is performed using the calibration board description file and the initial intrinsic and extrinsic parameters of the two industrial cameras. After successful bi-target calibration, the intrinsic parameters and relative position and attitude of the two industrial cameras are obtained.

[0069] Further, in step S3, the length and width of the refractory brick to be tested are first obtained, specifically including the following steps:

[0070] S31. Obtain the reconstructed image obtained in step S22. Combine the reconstructed image from a grayscale image into an RGB color space image. Then convert it from the RGB color space to the HSV color space. Use the binary threshold segmentation method in the brightness channel to obtain the upper surface area of ​​the refractory brick to be tested. Obtain the outline of the upper surface area. Then fit the upper surface area with a rectangle to obtain the row and column coordinates of the four vertices after fitting. Then convert the pixel coordinates into world coordinates and calculate the length and width of the refractory brick to be tested.

[0071] Furthermore, in step S3, the following steps are included after step S31:

[0072] S32. Perform binocular correction on the left and right images, and step S32 specifically includes:

[0073] Obtain the distortion-corrected left and right images in step S21. Using the camera intrinsic parameters and relative pose after binocular calibration, obtain the mapping matrix of the left and right images. Transform the left and right images respectively to obtain the left and right mapped images after binocular calibration.

[0074] The binocular calibration results are displayed, and the epipolar error is obtained based on these results. It is then determined whether the error exceeds a preset threshold. If the epipolar error is not greater than the preset threshold, the binocular calibration is successful, and the process proceeds to step S33. If the epipolar error exceeds the preset threshold, the binocular calibration fails, the process is terminated, and the operator is notified. After the process is terminated, depending on the actual situation, the process can be ended, and the refractory brick to be tested can be manually processed; alternatively, binocular calibration can be performed again on the two industrial cameras, and after completion, the image can be retaken and step S32 can be executed again until the binocular calibration is successfully completed.

[0075] S33, Perform binocular stereo matching, and step S33 specifically includes;

[0076] Define the window size and parallax range D, convert the left and right mapped images into floating-point numbers, and obtain the pixel grayscale value matrix of the left and right mapped images;

[0077] The gray values ​​of pixels within the neighborhood window of the left-mapped image are compared with the gray value of the center pixel of the window, and the resulting Boolean value is mapped into a bit string.

[0078] Then, within the disparity range of the right-mapped image, grayscale values ​​are compared and Boolean values ​​are mapped one by one to obtain the bit string under each disparity.

[0079] Finally, the bit string of the left mapped image is XORed with the bit string of the right mapped image under each disparity, and the number of 1s after the XOR operation is counted, which is the Hamming distance C.

[0080] S34. Aggregate the influence of pixel grayscale values ​​within the neighboring window on the grayscale value of the center pixel of the window, and step S34 specifically includes:

[0081] Create a mean convolution kernel with the same size as the window, average the pixel gray values ​​in the left mapped image window to obtain the mean of the pixel gray values ​​in the window, then subtract the mean from the gray values ​​of each pixel in the window and sum them up to obtain the accumulated value a1.

[0082] Then, within the disparity range of the right-mapped image, the gray values ​​of the pixels in the window of the right-mapped image are averaged one by one to obtain the average gray values ​​of the pixels in the window under different disparities. Then, the gray values ​​of each pixel in the window under each disparity are subtracted from the average value under that disparity and then summed to obtain the accumulated value a2.

[0083] Next, the smoothing coefficient S is calculated using the following formula:

[0084] S = ||a1 / a2|-1|;

[0085] Finally, the Hamming distance C obtained in step S33 is multiplied by the preset weight P1, and then the smoothing coefficient S is multiplied by the preset penalty value P2 to obtain the energy function E:

[0086] E = C*P1 + S*P2;

[0087] The energy functions E under different parallaxes are sorted by size, and the center pixel of the right map window with the minimum value Emin is the best matching point of the center pixel of the left map window.

[0088] S35. Optimize the best matching point and eliminate erroneous parallax. Step S35 specifically includes:

[0089] By sorting the energy function E in step S34, the minimum and second minimum values ​​of the energy function are obtained. The minimum value is subtracted from the second minimum value. If the result is greater than the preset threshold, the disparity under this matching point is the optimal disparity dp. If the result is less than or equal to the preset threshold, this matching point is removed.

[0090] Then, the accuracy is improved by using the best matching point obtained in step S34, and the corresponding sub-pixel disparity F is obtained: the energy function Emin of this matching point is compared with the energy function E1 under the previous disparity and the energy function E2 under the next disparity. The function graph is then plotted with disparity D as the horizontal axis and energy function E as the vertical axis. The point with the minimum sum of distances to two points (dp-1, E1) and (dp+1, E2) is found on the line E = Emin. The horizontal coordinate value of this point is obtained. If the obtained result is greater than dp+0.5, the sub-pixel disparity is considered to be dp+0.5. If the obtained result is less than or equal to dp+0.5 and greater than or equal to dp-0.5, the sub-pixel disparity is considered to be this result. If the obtained result is less than dp-0.5, the sub-pixel disparity is considered to be dp-0.5.

[0091] After optimizing and obtaining the sub-pixel disparity, the final pixel matching point is obtained, and the disparity of the left and right images is calculated to obtain the disparity map. Finally, a median convolution kernel is created and median filtering is performed to suppress noise, and then the process proceeds to step S36.

[0092] S36. In the disparity map obtained by disparity calculation in step S35 above, the disparity value of each pixel is stored, that is, the left image pixel minus the right image pixel. Then, the baseline of the two industrial cameras is calculated by using the initial pose of the two industrial cameras after binocular positioning. Combined with the focal length of the industrial cameras, the distances Z1 and Z2 from the upper surface of the refractory brick to be tested and the background to the baseline are calculated to obtain the distances Z1 and Z2 respectively. Subtracting Z1 from Z2 gives the height of the refractory brick to be tested.

[0093] S37. The length and width of the refractory brick to be tested obtained in step S31 are compared with the height of the refractory brick to be tested obtained in step S36. If the three-dimensional dimensions of the refractory brick to be tested are within the standard range, the three-dimensional dimension test of the refractory brick to be tested is deemed qualified; otherwise, the three-dimensional dimension test is deemed unqualified.

[0094] Understandably, completing steps S1-S4 above completes the single-sided defect detection and three-dimensional dimensional inspection of the refractory brick to be tested. If necessary, the refractory brick can then be reversed, and step S2 can be repeated to complete the double-sided defect detection. After inspecting one refractory brick, qualified bricks can be transported to the qualified section for processing; unqualified bricks can be transported to the unqualified section and then manually processed. Then, while waiting for the next refractory brick to be tested, if it is necessary to change the standard template for the next refractory brick to be tested, the standard template needs to be selected or reset in the industrial control computer.

[0095] Another aspect of the present invention provides a binocular vision inspection system for refractory bricks, including an industrial computer, a hub, a motion control system, and an image acquisition system; the industrial computer is wiredly connected to the hub, and the hub is wiredly connected to both the motion control system and the image acquisition system; the industrial computer is used to control the operation of the motion control system and the image acquisition system; the motion control system is used to drive the movement of the refractory brick to be tested under the control of the industrial computer; the image acquisition system includes a ring light source and two industrial cameras; and this binocular vision inspection system for refractory bricks can complete the binocular vision inspection of refractory bricks according to the above-described binocular vision inspection method for refractory bricks.

[0096] Understandably, in visual measurement systems, monocular vision measurement systems based on a single camera can only solve the problem of measuring the two-dimensional dimensions of simple, regular objects. Compared with monocular vision measurement technology, the binocular stereo vision measurement technology used in this invention can obtain more comprehensive image information. By applying image processing and stereo matching techniques, it can effectively solve the problem of measuring the three-dimensional dimensions of objects. Binocular vision measurement systems are also widely used due to their advantages of being non-contact, having high measurement accuracy, fast operating speed, high degree of automation, and no human intervention.

[0097] Furthermore, in its matching cost algorithm, this invention calculates and aggregates matching costs by utilizing the correlation between image pixels and matching image grayscale information, effectively reducing the impact of illumination on image comparison results. In sub-pixel disparity optimization, this invention improves disparity accuracy by seeking the optimal sub-pixel disparity under the optimal disparity. This invention also significantly improves the accuracy of refractory brick inspection. Compared to traditional manual inspection methods and other mechanical inspection methods, it greatly reduces the workload of workers, improves enterprise efficiency and economic benefits, and aligns with the construction and development of intelligent factories in the Industry 4.0 era.

[0098] In summary, the binocular vision inspection method and system for refractory bricks provided by this invention utilizes binocular stereo vision to perform three-dimensional dimensional measurement and defect detection of refractory bricks. Two industrial cameras obtain two images of the upper surface of the refractory bricks, which are then processed and analyzed using visual image algorithms. This allows for three-dimensional dimensional measurement of the refractory bricks and detection of defects such as scratches, chipping, and missing corners and edges on the refractory brick surface. It solves a series of problems caused by manual operation, such as high labor intensity, long time, high error rate, and high product defect rate, thereby improving economic efficiency while reducing safety hazards.

[0099] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A binocular vision inspection method for refractory bricks, characterized in that, Includes the following steps: S1. Using two industrial cameras respectively positioned at the upper left and upper right of the refractory brick to be tested, two grayscale images of the refractory brick to be tested are captured, and the captured images are transmitted to the industrial control computer. S2. The industrial control computer will process the captured image of the refractory brick to be tested, and then perform image detection to determine whether the image detection of the refractory brick to be tested is qualified. If it is qualified, proceed to step S3; otherwise, proceed directly to step S4. S3. Perform three-dimensional dimensional measurement of the refractory brick to be tested based on binocular vision, and determine whether the dimensions of the refractory brick to be tested are qualified. S4. Store the results of the test of whether the refractory bricks are qualified into the database, and transport qualified and unqualified refractory bricks to different areas. Before step S1, the method also includes the step of pre-storing a standard template image of refractory bricks in the industrial control computer; Step S2 specifically includes the following steps: S21. Using the initial intrinsic parameters and distortion coefficients of the two industrial cameras, perform distortion correction on the left and right images to obtain the distortion-corrected left and right images. S22. Read the pre-stored standard template image of refractory bricks, find the refractory brick region to be tested in the left and right images after distortion correction through the template matching algorithm, and process the left and right images respectively through affine transformation to obtain the reconstructed image that overlaps with the standard template image. S23. Perform differential processing on the reconstructed image and the standard template image to obtain the remaining area after the differential operation. Then determine whether the area of ​​the remaining area is greater than the preset threshold. If the area of ​​the remaining area is not greater than the preset threshold, proceed to step S24 for further detection. Otherwise, determine that the defect detection of the refractory brick to be tested is unqualified and directly proceed to step S4. S24. The reconstructed image obtained in step S22 is smoothed, and the smoothed image is subtracted from the image before processing and multiplied by a correction factor to show the scratched areas in the image. S25. Using a global threshold segmentation image algorithm, extract the scratch area, then disconnect the connected components, and obtain the area of ​​the largest scratch through feature extraction. Determine whether the length and area of ​​the largest scratch area are greater than the preset threshold. If the length and area of ​​the largest scratch area are not greater than the preset threshold, proceed to step S3; otherwise, determine that the defect detection of the refractory brick to be tested is unqualified and proceed directly to step S4. Step S3 specifically includes the following steps: S31. Obtain the reconstructed image obtained in step S22. Combine the reconstructed image from a grayscale image into an image in RGB color space. Then convert it from RGB color space to HSV color space. Use the binary threshold segmentation method in the brightness channel to obtain the upper surface area of ​​the refractory brick to be tested. Obtain the outline of the upper surface area. Then fit the upper surface area with a rectangle to obtain the row and column coordinates of the four vertices after fitting. Then convert the pixel coordinates into world coordinates and calculate the length and width of the refractory brick to be tested. S32. Perform binocular correction on the left and right images; S33, Perform binocular stereo matching; S34. Aggregate the influence of pixel grayscale values ​​within the neighboring window on the grayscale value of the center pixel of the window; S35. Optimize for the best matching point and eliminate erroneous parallax; S36. In the disparity map obtained by disparity calculation in step S35 above, the disparity value of each pixel is stored, that is, the left image pixel minus the right image pixel. Then, through the initial pose of the two industrial cameras after binocular positioning, the baseline of the two industrial cameras is calculated. Combined with the focal length of the industrial cameras, the binocular vision principle is used to calculate the distances Z1 and Z2 from the upper surface of the refractory brick to be tested and the background to the baseline. Subtracting Z1 from Z2, the height of the refractory brick to be tested is obtained. S37. The length and width of the refractory brick to be tested obtained in step S31 are compared with the height of the refractory brick to be tested obtained in step S36. If the three-dimensional dimensions of the refractory brick to be tested are within the standard range, the three-dimensional dimension test of the refractory brick to be tested is deemed qualified; otherwise, the three-dimensional dimension test is deemed unqualified.

2. The binocular vision inspection method for refractory bricks according to claim 1, characterized in that, Before step S1, the procedure also includes the following steps: performing dual-target calibration on the two industrial cameras, and setting the camera calibration file and related parameters in the industrial control computer based on the dual-target calibration results; The specific steps for dual-target localization of two industrial cameras include: Multiple standard calibration board images are captured simultaneously by two industrial cameras. The row and column coordinates of the Mark points in each calibration board image are recorded. Then, bi-target calibration is performed using the calibration board description file and the initial intrinsic and extrinsic parameters of the two industrial cameras. After successful bi-target calibration, the intrinsic parameters and relative position and attitude of the two industrial cameras are obtained.

3. The binocular vision inspection method for refractory bricks according to claim 2, characterized in that, Step S32 specifically includes: Obtain the distortion-corrected left and right images in step S21. Using the camera intrinsic parameters and relative pose after binocular calibration, obtain the mapping matrix of the left and right images. Transform the left and right images respectively to obtain the left and right mapped images after binocular calibration. Display the binocular calibration result and obtain the epipolar error based on the binocular calibration result. Determine whether it is greater than the preset threshold. If the epipolar error is not greater than the preset threshold, the binocular calibration and correction is successful. Then proceed to step S33. If the epipolar error is greater than the preset threshold, the binocular calibration and correction fails, the process is stopped and the operator is notified. Step S33 specifically includes: Define the window size and parallax range D, convert the left and right mapped images into floating-point numbers, and obtain the pixel grayscale value matrix of the left and right mapped images; The gray values ​​of pixels within the neighborhood window of the left-mapped image are compared with the gray value of the center pixel of the window, and the resulting Boolean value is mapped into a bit string. Then, within the disparity range of the right-mapped image, grayscale values ​​are compared and Boolean values ​​are mapped one by one to obtain the bit string under each disparity. Finally, the bit string of the left mapped image and the bit string of the right mapped image under each disparity are XORed, and the number of 1s after the XOR operation is counted, which is the Hamming distance C. Step S34 specifically includes: Create a mean convolution kernel with the same size as the window, average the pixel gray values ​​in the left mapped image window to obtain the mean of the pixel gray values ​​in the window, then subtract the mean from the gray values ​​of each pixel in the window and sum them up to obtain the accumulated value a1. Then, within the disparity range of the right-mapped image, the gray values ​​of the pixels in the window of the right-mapped image are averaged one by one to obtain the average gray values ​​of the pixels in the window under different disparities. Then, the gray values ​​of each pixel in the window under each disparity are subtracted from the average value under that disparity and then summed to obtain the accumulated value a2. Next, the smoothing coefficient S is calculated using the following formula: ; Finally, the Hamming distance C obtained in step S33 is multiplied by the preset weight P1, and then the smoothing coefficient S is multiplied by the preset penalty value P2 to obtain the energy function E: ; The energy function E under different parallaxes is sorted by size, and the center pixel of the right map window with the minimum value Emin is the best matching point of the center pixel of the left map window. Step S35 specifically includes: By sorting the energy function E in step S34, the minimum and second minimum values ​​of the energy function are obtained. The minimum value is subtracted from the second minimum value. If the result is greater than the preset threshold, the disparity under this matching point is the optimal disparity dp. If the result is less than or equal to the preset threshold, this matching point is removed. Then, the accuracy is improved by using the best matching point obtained in step S34, and the corresponding sub-pixel disparity F is obtained: the energy function Emin of this matching point is compared with the energy function E1 under the previous disparity and the energy function E2 under the next disparity. The function graph is then plotted with disparity D as the horizontal axis and energy function E as the vertical axis. The point with the minimum sum of distances to two points (dp-1, E1) and (dp+1, E2) is found on the line E=Emin. The horizontal coordinate value of this point is obtained. If the obtained result is greater than dp+0.5, the sub-pixel disparity is considered to be dp+0.

5. If the obtained result is less than or equal to dp+0.5 and greater than or equal to dp-0.5, the sub-pixel disparity is considered to be this result. If the obtained result is less than dp-0.5, the sub-pixel disparity is considered to be dp-0.

5. After optimizing and obtaining the sub-pixel disparity, the final pixel matching point is obtained, and the disparity of the left and right images is calculated to obtain the disparity map. Finally, a median convolution kernel is created and median filtering is performed to suppress noise, and then the process proceeds to step S36.

4. A binocular vision inspection system for refractory bricks, characterized in that, This includes industrial computers, hubs, motion control systems, and image acquisition systems; The industrial control computer is wired to the hub, and the hub is wired to the motion control system and the image acquisition system respectively. The industrial control computer is used to control the operation of the motion control system and the image acquisition system. The motion control system is used to drive the movement of the refractory brick under the control of the industrial computer; The image acquisition system includes a ring light source and two industrial cameras; Furthermore, the binocular vision inspection system for refractory bricks can perform binocular vision inspection of refractory bricks according to the binocular vision inspection method for refractory bricks as described in any one of claims 1-3.