Online flange detection method and system based on binocular vision

Through the online flange detection method based on binocular vision, the flange casting defect detection model and three-dimensional reconstruction technology are used to solve the problem of high error detection rate of the existing flange detection methods, and the detection efficiency and accuracy are improved.

CN119444689APending Publication Date: 2025-02-14YANCHENG INST OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411487313.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-24
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

The existing flange detection methods have high error detection rates, which affects the quality and efficiency of flange detection, resulting in the quality reliability of flange not being guaranteed.

Method used

The online flange detection method based on binocular vision is adopted. By obtaining the initial image of the flange casting, the flange casting defect detection model is used for detection after preprocessing, and the detection results are reviewed, corrected or confirmed using three-dimensional reconstruction technology.

Benefits of technology

It improves the detection efficiency of flange casting defects and enhances the accuracy and reliability of the detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119444689A_ABST
    Figure CN119444689A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of flange detection, and provides an online flange detection method and system based on binocular vision, and the method comprises the steps: obtaining an initial image of a flange casting; preprocessing the initial image to obtain a preprocessed image; detecting the preprocessed image based on a set flange casting defect detection model to obtain a flange casting defect detection result; and rechecking the defect detection result of the flange casting, and correcting or confirming the defect detection result of the flange casting. According to the method, the initial image of the flange casting is obtained, the flange casting defect detection model is used for detecting the preprocessed image after preprocessing, the three-dimensional reconstruction technology is used for rechecking and correcting the flange casting defect detection result or confirming the flange casting defect detection result, and the detection efficiency of the flange casting defect can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of flange detection, and in particular to an online flange detection method and system based on binocular vision. Background Art

[0002] In the production process of automobile parts, there are many types of flange parts. Forging is generally used in the production process. During the forging operation, a ring rolling machine is needed to roll the flange raw materials into rings. It is an important process link in the quality inspection after forming.

[0003] The existing flange inspection includes appearance inspection, dimension inspection, material identification inspection, quality certificate inspection, acceptance standard inspection and other parts. Among them, the standard of appearance inspection is that the casting surface should be smooth and free of defects such as forging scars and cracks; the sand and scale on the casting surface should be cleaned up, and defects that affect the performance of the casting (such as cracks, shrinkage holes, slag inclusions, etc.) are not allowed; the machined surface should not have burrs, harmful scratches and other defects that reduce the strength and connection reliability of the flange; the sealing surfaces of the ring joint flanges should be checked one by one, and the two sides of the groove should not have surface defects such as cracks, scratches and bumps caused by machining;

[0004] Most existing flange inspection methods process defect plane images to obtain binary images and contours that express defects, which results in a high false positive rate in flange inspection, affecting the quality and efficiency of flange inspection, and making it impossible to ensure the quality reliability of flanges.

[0005] Therefore, it is necessary to provide an online flange detection method and system based on binocular vision. Summary of the invention

[0006] The present invention provides an online flange detection method and system based on binocular vision, which obtains an initial image of a flange casting, detects the preprocessed image using a flange casting defect detection model after preprocessing, and uses three-dimensional reconstruction technology to review the flange casting defect detection result, correct or confirm the flange casting defect detection result, thereby improving the detection efficiency of flange casting defects.

[0007] The present invention provides an online flange detection method based on binocular vision, comprising:

[0008] Obtain an initial image of the flange casting;

[0009] Preprocessing the initial image to obtain a preprocessed image;

[0010] The preprocessed image is detected based on the set flange casting defect detection model to obtain the flange casting defect detection result;

[0011] Review the flange casting defect detection results, and correct or confirm the flange casting defect detection results.

[0012] Further, obtaining an initial image of the flange casting includes:

[0013] Equipped with dual-position binocular cameras;

[0014] Configure two dual-position binocular cameras for different light source scenes;

[0015] Based on a dual-position binocular camera, the initial image of the flange casting is captured under different light source scenes.

[0016] Furthermore, different light source scenes of dual-position binocular cameras are configured separately, including:

[0017] Setting up interconnected processors and light sensors;

[0018] Setting a target position for acquiring an initial image of the flange casting;

[0019] Based on the processor and light sensor, the light intensity, light angle and light uniformity at the target location are collected;

[0020] According to the set adjustment parameters, adjust the light intensity, light angle and light uniformity to obtain different light source scenes corresponding to the dual-position binocular camera.

[0021] Furthermore, based on the dual-position binocular camera, the initial image of the flange casting is captured under different light source scenes, including:

[0022] Based on the first-position binocular camera, a first initial image of the flange casting is captured in a corresponding first light source scene;

[0023] Based on the second camera position binocular camera, under the corresponding second light source scene, a second initial image of the flange casting is captured;

[0024] The first initial image, the second initial image or the third image is used as the initial image; wherein the third image is an image obtained by superimposing the first initial image and the second initial image.

[0025] Further, taking the first initial image, the second initial image or the third image as the initial image includes:

[0026] Based on the structural similarity index, determine the similarity between the first initial image and the second initial image; if the similarity is greater than a set similarity threshold, obtain the first illumination intensity under the first light source scene and the second illumination intensity under the second light source scene respectively;

[0027] If the first illumination intensity is greater than the second illumination intensity, taking the first initial image as the initial image;

[0028] If the first illumination intensity is less than the second illumination intensity, taking the second initial image as the initial image;

[0029] If the similarity is less than the set similarity threshold, the third image is used as the initial image.

[0030] Further, the initial image is preprocessed to obtain a preprocessed image, including:

[0031] Gray-scale processing is performed on the flange image to obtain a gray-scale processed image;

[0032] Performing image enhancement processing on the grayscale processed image to obtain an enhanced processed image;

[0033] The enhanced image is subjected to hybrid filtering and denoising processing to obtain a preprocessed image.

[0034] Furthermore, the preprocessed image is detected based on the set flange casting defect detection model to obtain the flange casting defect detection result, including:

[0035] Based on the qualified finished products of flange castings, take pictures to obtain standard images of flange castings;

[0036] Preprocessing the standard image to obtain a preprocessed standard image;

[0037] The preprocessed image and the preprocessed standard image are respectively input into the flange casting defect detection model to obtain the defect region of interest in the preprocessed image and the corresponding target region in the preprocessed standard image; wherein the flange casting defect detection model is generated based on the YOLOv8 model learning and training;

[0038] Respectively locate and obtain a first key point on the defect region of interest and a second key point on the corresponding target region in the preprocessed standard image;

[0039] Describing the scale, position and direction of the first key point and the second key point as a first eigenvector and a second eigenvector respectively;

[0040] Based on the Euclidean distance metric, calculate the similarity between the first eigenvector and the second eigenvector;

[0041] According to the set similarity threshold, if the similarity is less than the set similarity threshold, it is determined that the flange casting has defects, and the flange casting defect detection result is obtained.

[0042] Further, the flange casting defect detection results are reviewed, and the flange casting defect detection results are corrected or confirmed, including:

[0043] Obtain a target frame selection image containing defects in the flange casting defect detection result;

[0044] The target frame-selected image is subjected to three-dimensional reconstruction processing to obtain a three-dimensional reconstructed casting model;

[0045] Screening target defect representation points in the three-dimensional reconstructed casting model to obtain a target defect representation point set;

[0046] Using a set distance calculation formula, the distance between the target defect characterization point in the target defect characterization point set and the preset flange casting reference surface is calculated to obtain multiple distance values;

[0047] If the spacing value is greater than the set spacing threshold, the target defect characterization point is judged to be a valid defect, and the flange casting defect detection result is confirmed;

[0048] If the spacing value is less than the set spacing threshold, the target defect characterization point is judged as an invalid defect, and the flange casting defect detection result is corrected.

[0049] Furthermore, it also includes marking the flange casting corresponding to the confirmed flange casting defect detection result; the specific steps are:

[0050] Pre-configure the RFID chip at the flange casting defect detection station and set the RFID chip ID number;

[0051] Configure interconnected controllers and marking devices;

[0052] Based on the controller, the RFID chip ID number and the first time detection point on the workstation corresponding to the flange casting defect detection result are obtained;

[0053] According to the moving speed of the flange casting on the detection line of the flange casting defect detection, combined with the RFID chip ID number and the first time detection point, determine the second time point when the target flange casting containing defects in the flange casting defect detection result reaches the set standard reaching device;

[0054] Through the controller, at the second time point, the marking device is controlled to print a label containing the marking content of the unqualified product on the target flange casting for subsequent processing.

[0055] An online flange detection system based on binocular vision, comprising:

[0056] An initial image acquisition module, used for acquiring an initial image of the flange casting;

[0057] A preprocessing image acquisition module is used to preprocess the initial image to obtain a preprocessing image;

[0058] A detection result generation module is used to detect the preprocessed image based on the set flange casting defect detection model to obtain the flange casting defect detection result;

[0059] The detection result correction module is used to review the flange casting defect detection results, and correct or confirm the flange casting defect detection results.

[0060] Compared with the prior art, the present invention has the following advantages and beneficial effects: by acquiring the initial image of the flange casting, detecting the preprocessed image using the flange casting defect detection model after preprocessing, and reviewing the flange casting defect detection result using three-dimensional reconstruction technology, correcting or confirming the flange casting defect detection result, the detection efficiency of the flange casting defects can be improved.

[0061] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description and the accompanying drawings.

[0062] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:

[0064] Figure 1 A schematic diagram of the steps of an online flange detection method based on binocular vision;

[0065] Figure 2 Schematic diagram of the steps of the method for obtaining the initial image of the flange casting;

[0066] Figure 3 This is a structural schematic diagram of an online flange detection system based on binocular vision. DETAILED DESCRIPTION

[0067] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.

[0068] The present invention provides an online flange detection method based on binocular vision, such as Figure 1 As shown, including:

[0069] Obtain an initial image of the flange casting;

[0070] Preprocessing the initial image to obtain a preprocessed image;

[0071] The preprocessed image is detected based on the set flange casting defect detection model to obtain the flange casting defect detection result;

[0072] Review the flange casting defect detection results, and correct or confirm the flange casting defect detection results.

[0073] The working principle of the above technical solution is: in order to realize the online flange detection method based on binocular vision, the present invention first obtains the initial image of the flange casting; then preprocesses the initial image to obtain a preprocessed image; based on the set flange casting defect detection model, the preprocessed image is detected to obtain the flange casting defect detection result; finally, the flange casting defect detection result is reviewed, and the flange casting defect detection result is corrected or confirmed.

[0074] The beneficial effect of the above technical scheme is: by adopting the scheme provided in this embodiment, by acquiring the initial image of the flange casting, using the flange casting defect detection model to detect the preprocessed image after preprocessing, and using the three-dimensional reconstruction technology to review the flange casting defect detection result, correct or confirm the flange casting defect detection result, the detection efficiency of the flange casting defects can be improved.

[0075] In one embodiment, Figure 2 As shown, the initial image of the flange casting is obtained, including:

[0076] Equipped with dual-position binocular cameras;

[0077] Configure two dual-position binocular cameras for different light source scenes;

[0078] Based on a dual-position binocular camera, the initial image of the flange casting is captured under different light source scenes.

[0079] The working principle of the above technical solution is: in order to obtain the initial image of the flange casting, the present invention first configures a dual-position binocular camera; then respectively configures different light source scenes of the dual-position binocular camera; finally, based on the dual-position binocular camera, the initial image of the flange casting is captured and obtained under different light source scenes.

[0080] The beneficial effect of the above technical solution is: by adopting the solution provided in this embodiment, by configuring a binocular camera and a light source scene, it is possible to ensure that an initial image of the flange casting is obtained.

[0081] In one embodiment, different light source scenes of dual-position binocular cameras are configured respectively, including:

[0082] Setting up interconnected processors and light sensors;

[0083] Setting a target position for acquiring an initial image of the flange casting;

[0084] Based on the processor and light sensor, the light intensity, light angle and light uniformity at the target location are collected;

[0085] According to the set adjustment parameters, adjust the light intensity, light angle and light uniformity to obtain different light source scenes corresponding to the dual-position binocular camera.

[0086] The working principle of the above technical solution is as follows: in the present invention, in different light source scenes configured with a dual-position binocular camera, a processor and a light sensor connected to each other are first set; then a target position for obtaining an initial image of the flange casting is set; finally, based on the processor and the light sensor, the light intensity, light angle and light uniformity at the target position are collected and obtained; according to the set adjustment parameters, the light intensity, light angle and light uniformity are adjusted to obtain different light source scenes corresponding to the dual-position binocular camera.

[0087] The beneficial effect of the above technical solution is: by adopting the solution provided in this embodiment, by configuring different light source scenes of the dual-position binocular cameras, a basis is provided for the accurate acquisition of the subsequent initial image of the flange casting.

[0088] In one embodiment, based on a dual-position binocular camera, an initial image of a flange casting is captured and acquired under different light source scenes, including:

[0089] Based on the first-position binocular camera, a first initial image of the flange casting is captured in a corresponding first light source scene;

[0090] Based on the second camera position binocular camera, under the corresponding second light source scene, a second initial image of the flange casting is captured;

[0091] The first initial image, the second initial image or the third image is used as the initial image; wherein the third image is an image obtained by superimposing the first initial image and the second initial image.

[0092] The working principle of the above technical solution is: in order to capture the initial image of the flange casting, the present invention first captures the first initial image of the flange casting based on the first-position binocular camera in the corresponding first light source scene; then captures the second initial image of the flange casting based on the second-position binocular camera in the corresponding second light source scene; finally, the first initial image, the second initial image or the third image is used as the initial image; wherein the third image is an image obtained by superimposing the first initial image and the second initial image.

[0093] The beneficial effect of the above technical solution is: by adopting the solution provided by this embodiment, the accuracy of the target image can be guaranteed by using binocular cameras at two positions to shoot and determine the final target image.

[0094] In one embodiment, taking the first initial image, the second initial image or the third image as the initial image comprises:

[0095] Based on the structural similarity index, determine the similarity between the first initial image and the second initial image; if the similarity is greater than a set similarity threshold, obtain the first illumination intensity under the first light source scene and the second illumination intensity under the second light source scene respectively;

[0096] If the first illumination intensity is greater than the second illumination intensity, taking the first initial image as the initial image;

[0097] If the first illumination intensity is less than the second illumination intensity, taking the second initial image as the initial image;

[0098] If the similarity is less than the set similarity threshold, the third image is used as the initial image.

[0099] The working principle of the above technical solution is: the present invention first determines the similarity between the first initial image and the second initial image based on the structural similarity index; if the similarity is greater than the set similarity threshold, the first light intensity under the first light source scene and the second light intensity under the second light source scene are respectively obtained; then the first light intensity is compared with the second light intensity, if the first light intensity is greater than the second light intensity, the first initial image is used as the initial image; if the first light intensity is less than the second light intensity, the second initial image is used as the initial image; if the similarity is less than the set similarity threshold, the third image is used as the initial image.

[0100] The beneficial effect of the above technical solution is: by adopting the solution provided in this embodiment, by comparing the first light intensity with the second light intensity as the basis for adopting the first initial image or the second initial image, the accuracy of the initial image acquisition can be guaranteed.

[0101] In one embodiment, preprocessing the initial image to obtain a preprocessed image includes:

[0102] Gray-scale processing is performed on the flange image to obtain a gray-scale processed image;

[0103] Performing image enhancement processing on the grayscale processed image to obtain an enhanced processed image;

[0104] The enhanced image is subjected to hybrid filtering and denoising processing to obtain a preprocessed image.

[0105] The working principle of the above technical solution is: in order to preprocess the initial image and obtain the preprocessed image, the present invention successively performs grayscale processing, image enhancement processing and hybrid filtering noise reduction processing on the flange image to obtain the preprocessed image.

[0106] The beneficial effect of the above technical solution is: by adopting the solution provided in this embodiment, it is ensured that an image that meets the requirements is obtained through image processing.

[0107] In one embodiment, the preprocessed image is detected based on the set flange casting defect detection model to obtain the flange casting defect detection result, including:

[0108] Based on the qualified finished products of flange castings, take pictures to obtain standard images of flange castings;

[0109] Preprocessing the standard image to obtain a preprocessed standard image;

[0110] The preprocessed image and the preprocessed standard image are respectively input into the flange casting defect detection model to obtain the defect region of interest in the preprocessed image and the corresponding target region in the preprocessed standard image; wherein the flange casting defect detection model is generated based on the YOLOv8 model learning and training;

[0111] Respectively locate and obtain a first key point on the defect region of interest and a second key point on the corresponding target region in the preprocessed standard image;

[0112] Describing the scale, position and direction of the first key point and the second key point as a first eigenvector and a second eigenvector respectively;

[0113] Based on the Euclidean distance metric, calculate the similarity between the first eigenvector and the second eigenvector;

[0114] According to the set similarity threshold, if the similarity is less than the set similarity threshold, it is determined that the flange casting has defects, and the flange casting defect detection result is obtained.

[0115] The working principle of the above technical scheme is: in order to realize the detection of the preprocessed image and obtain the flange casting defect detection result, the present invention first takes a standard image of the flange casting based on the qualified finished product of the flange casting; then preprocesses the standard image to obtain the preprocessed standard image; then, the preprocessed image and the preprocessed standard image are respectively input into the flange casting defect detection model to obtain the defect region of interest of the preprocessed image and the corresponding target region in the preprocessed standard image; wherein the flange casting defect detection model is generated based on the YOLOv8 model learning and training; finally, the first key point on the defect region of interest and the second key point on the corresponding target region in the preprocessed standard image are respectively located; the scale, position and direction of the first key point and the second key point are respectively described as the first eigenvector and the second eigenvector; then, based on the Euclidean distance metric, the similarity of the first eigenvector and the second eigenvector is calculated; according to the set similarity threshold, if the similarity is less than the set similarity threshold, it is determined that the flange casting has defects, and the flange casting defect detection result is obtained.

[0116] The beneficial effect of the above technical solution is: by adopting the solution provided in this embodiment, by utilizing the flange casting defect detection model, obtaining the defect area of ​​interest in the preprocessed image and the corresponding target area in the preprocessed standard image, obtaining the feature vectors of the key points, and performing similarity comparison, accurate flange casting defect detection results can be obtained.

[0117] In one embodiment, reviewing the flange casting defect detection result, and correcting or confirming the flange casting defect detection result includes:

[0118] Obtain a target frame selection image containing defects in the flange casting defect detection result;

[0119] The target frame-selected image is subjected to three-dimensional reconstruction processing to obtain a three-dimensional reconstructed casting model;

[0120] Screening target defect representation points in the three-dimensional reconstructed casting model to obtain a target defect representation point set;

[0121] Using a set distance calculation formula, the distance between the target defect characterization point in the target defect characterization point set and the preset flange casting reference surface is calculated to obtain multiple distance values;

[0122] If the spacing value is greater than the set spacing threshold, the target defect characterization point is judged to be a valid defect, and the flange casting defect detection result is confirmed;

[0123] If the spacing value is less than the set spacing threshold, the target defect characterization point is judged as an invalid defect, and the flange casting defect detection result is corrected.

[0124] The working principle of the above technical scheme is: in order to ensure the accuracy of flange casting defect detection, the present invention also reviews the flange casting defect detection results, corrects or confirms the flange casting defect detection results, specifically, first obtains the target frame selection image containing defects in the flange casting defect detection results; then performs three-dimensional reconstruction processing on the target frame selection image to obtain a three-dimensional reconstructed casting model; in order to facilitate three-dimensional analysis, the target defect characterization points in the three-dimensional reconstructed casting model are then screened to obtain a target defect characterization point set; finally, using a set distance calculation formula, the target defect characterization points in the target defect characterization point set are calculated and the distance between the target defect characterization points and the preset flange casting reference reference surface is solved to obtain multiple distance values; if the distance value is greater than the set distance threshold, the target defect characterization point is judged to be a valid defect, and the flange casting defect detection result is confirmed; if the distance value is less than the set distance threshold, the target defect characterization point is judged to be an invalid defect, and the flange casting defect detection result is corrected.

[0125] The beneficial effect of the above technical solution is: by adopting the solution provided in this embodiment, by using the three-dimensional reconstructed casting model to further detect and judge the target defect characterization points, the flange casting defect detection results can be corrected or confirmed to further ensure the accuracy of the flange casting defect detection results.

[0126] In one embodiment, it also includes marking the flange casting corresponding to the confirmed flange casting defect detection result; the specific steps are:

[0127] Pre-configure the RFID chip at the flange casting defect detection station and set the RFID chip ID number;

[0128] Configure interconnected controllers and marking devices;

[0129] Based on the controller, the RFID chip ID number and the first time detection point on the workstation corresponding to the flange casting defect detection result are obtained;

[0130] According to the moving speed of the flange casting on the detection line of the flange casting defect detection, combined with the RFID chip ID number and the first time detection point, determine the second time point when the target flange casting containing defects in the flange casting defect detection result reaches the set standard reaching device;

[0131] Through the controller, at the second time point, the marking device is controlled to print a label containing the marking content of the unqualified product on the target flange casting for subsequent processing.

[0132] The working principle of the above technical scheme is: in order to mark the flange casting corresponding to the confirmed flange casting defect detection result for subsequent rejection processing, the present invention first pre-configures the RFID chip on the flange casting defect detection station and sets the RFID chip ID number; and configures a controller and a marking device that are connected to each other; then, based on the controller, the RFID chip ID number and the first time detection point on the station corresponding to the flange casting defect detection result are obtained; according to the moving speed of the flange casting on the detection line of the flange casting defect detection, combined with the RFID chip ID number and the first time detection point, it is determined that the target flange casting with defects in the flange casting defect detection result reaches the set standard-reaching device. The second time point; finally, through the controller, at the second time point, the marking device is controlled to print a label containing unqualified product marking content on the target flange casting for subsequent processing.

[0133] The beneficial effect of the above technical solution is: by adopting the solution provided in this embodiment, the flange castings corresponding to the confirmed flange casting defect detection results are marked, which provides convenience for subsequent rejection processing and improves the detection efficiency.

[0134] An online flange inspection system based on binocular vision, such as Figure 3 As shown, including:

[0135] An initial image acquisition module, used for acquiring an initial image of the flange casting;

[0136] A preprocessing image acquisition module is used to preprocess the initial image to obtain a preprocessing image;

[0137] A detection result generation module is used to detect the preprocessed image based on the set flange casting defect detection model to obtain the flange casting defect detection result;

[0138] The detection result correction module is used to review the flange casting defect detection results, and correct or confirm the flange casting defect detection results.

[0139] The working principle of the above technical scheme is: in order to realize an online flange detection system based on binocular vision, the present invention proposes an initial image acquisition module for acquiring the initial image of the flange casting; proposes a preprocessing image acquisition module for preprocessing the initial image to obtain a preprocessing image; a detection result generation module for detecting the preprocessing image based on a set flange casting defect detection model to obtain a flange casting defect detection result; a detection result correction module for reviewing the flange casting defect detection result, correcting or confirming the flange casting defect detection result.

[0140] The beneficial effect of the above technical scheme is: by adopting the scheme provided in this embodiment, by acquiring the initial image of the flange casting, using the flange casting defect detection model to detect the preprocessed image after preprocessing, and using the three-dimensional reconstruction technology to review the flange casting defect detection result, correct or confirm the flange casting defect detection result, the detection efficiency of the flange casting defects can be improved.

[0141] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. An online flange detection method based on binocular vision, characterized in that: include: Obtain an initial image of the flange casting; Preprocessing the initial image to obtain a preprocessed image; The preprocessed image is detected based on the set flange casting defect detection model to obtain the flange casting defect detection result; Review the flange casting defect detection results, and correct or confirm the flange casting defect detection results.

2. The online flange detection method based on binocular vision according to claim 1 is characterized in that: Get an initial image of the flange casting, including: Equipped with dual-position binocular cameras; Configure two dual-position binocular cameras for different light source scenes; Based on a dual-position binocular camera, the initial image of the flange casting is captured under different light source scenes.

3. The method for online flange detection based on binocular vision according to claim 2 is characterized in that: Different light source scenes of dual-position binocular cameras are configured separately, including: Setting up interconnected processors and light sensors; Setting a target position for acquiring an initial image of the flange casting; Based on the processor and light sensor, the light intensity, light angle and light uniformity at the target location are collected; According to the set adjustment parameters, adjust the light intensity, light angle and light uniformity to obtain different light source scenes corresponding to the dual-position binocular camera.

4. The method for online flange detection based on binocular vision according to claim 2 is characterized in that: Based on dual-position binocular cameras, the initial images of flange castings are captured in different light source scenes, including: Based on the first-position binocular camera, a first initial image of the flange casting is captured in a corresponding first light source scene; Based on the second camera position binocular camera, under the corresponding second light source scene, a second initial image of the flange casting is captured; The first initial image, the second initial image or the third image is used as the initial image; wherein the third image is an image obtained by superimposing the first initial image and the second initial image.

5. The method for online flange detection based on binocular vision according to claim 4 is characterized in that: Using the first initial image, the second initial image, or the third image as the initial image includes: Based on the structural similarity index, determine the similarity between the first initial image and the second initial image; if the similarity is greater than a set similarity threshold, obtain the first illumination intensity under the first light source scene and the second illumination intensity under the second light source scene respectively; If the first illumination intensity is greater than the second illumination intensity, taking the first initial image as the initial image; If the first illumination intensity is less than the second illumination intensity, taking the second initial image as the initial image; If the similarity is less than the set similarity threshold, the third image is used as the initial image.

6. The method for online flange detection based on binocular vision according to claim 1, characterized in that: The initial image is preprocessed to obtain a preprocessed image, including: Gray-scale processing is performed on the flange image to obtain a gray-scale processed image; Performing image enhancement processing on the grayscale processed image to obtain an enhanced processed image; The enhanced image is subjected to hybrid filtering and denoising processing to obtain a preprocessed image.

7. The method for online flange detection based on binocular vision according to claim 1, characterized in that: Based on the set flange casting defect detection model, the preprocessed image is detected to obtain the flange casting defect detection results, including: Based on the qualified finished products of flange castings, take pictures to obtain standard images of flange castings; Preprocessing the standard image to obtain a preprocessed standard image; The preprocessed image and the preprocessed standard image are respectively input into the flange casting defect detection model to obtain the defect region of interest in the preprocessed image and the corresponding target region in the preprocessed standard image; wherein the flange casting defect detection model is generated based on the YOLOv8 model learning and training; Respectively locate and obtain a first key point on the defect region of interest and a second key point on the corresponding target region in the preprocessed standard image; Describing the scale, position and direction of the first key point and the second key point as a first eigenvector and a second eigenvector respectively; Based on the Euclidean distance metric, calculate the similarity between the first eigenvector and the second eigenvector; According to the set similarity threshold, if the similarity is less than the set similarity threshold, it is determined that the flange casting has defects, and the flange casting defect detection result is obtained.

8. The method for online flange detection based on binocular vision according to claim 1, characterized in that: Review the flange casting defect detection results, and correct or confirm the flange casting defect detection results, including: Obtain a target frame selection image containing defects in the flange casting defect detection result; The target frame-selected image is subjected to three-dimensional reconstruction processing to obtain a three-dimensional reconstructed casting model; Screening target defect representation points in the three-dimensional reconstructed casting model to obtain a target defect representation point set; Using a set distance calculation formula, the distance between the target defect characterization point in the target defect characterization point set and the preset flange casting reference surface is calculated to obtain multiple distance values; If the spacing value is greater than the set spacing threshold, the target defect characterization point is judged to be a valid defect, and the flange casting defect detection result is confirmed; If the spacing value is less than the set spacing threshold, the target defect characterization point is judged as an invalid defect, and the flange casting defect detection result is corrected.

9. The method for online flange detection based on binocular vision according to claim 8, characterized in that: The method also includes marking the flange casting corresponding to the confirmed flange casting defect detection result; the specific steps are: Pre-configure the RFID chip at the flange casting defect detection station and set the RFID chip ID number; Configure interconnected controllers and marking devices; Based on the controller, the RFID chip ID number and the first time detection point on the workstation corresponding to the flange casting defect detection result are obtained; According to the moving speed of the flange casting on the detection line of the flange casting defect detection, combined with the RFID chip ID number and the first time detection point, determine the second time point when the target flange casting containing defects in the flange casting defect detection result reaches the set standard reaching device; Through the controller, at the second time point, the marking device is controlled to print a label containing the marking content of the unqualified product on the target flange casting for subsequent processing.

10. An online flange detection system based on binocular vision, characterized in that: include: An initial image acquisition module, used for acquiring an initial image of the flange casting; A preprocessing image acquisition module is used to preprocess the initial image to obtain a preprocessing image; A detection result generation module is used to detect the preprocessed image based on the set flange casting defect detection model to obtain the flange casting defect detection result; The detection result correction module is used to review the flange casting defect detection results, and correct or confirm the flange casting defect detection results.