Flexible cable extraction method, device and equipment based on binocular vision
By employing a binocular vision-based flexible cable extraction method, utilizing stereo correction, watershed segmentation algorithms, and skeleton algorithms, the centerline of the flexible cable is extracted and a 3D model is constructed. This solves the feature matching problem under the influence of illumination and occlusion, achieving highly accurate and reliable flexible cable extraction.
Patent Information
- Application Number
- CN202510997891.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-01
- Publication Date
- 2025-11-14
AI Technical Summary
Traditional flexible cable extraction methods are sensitive to factors such as lighting and occlusion, which leads to reduced accuracy and reliability of feature matching.
A binocular vision-based method is adopted to extract the centerline of the flexible cable and construct a 3D model. The image is acquired by a binocular camera for stereo correction. The centerline of the cable is extracted by combining watershed segmentation and skeleton algorithm, the 3D coordinates are calculated and the 3D model is constructed.
Even under the influence of lighting and shading, it can accurately construct a 3D model of flexible cables, improving the accuracy and reliability of feature matching.
Smart Images

Figure CN120953353A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to a method, apparatus and device for extracting flexible cables based on binocular vision. Background Technology
[0002] Traditional flexible cable extraction methods are mostly based on features such as edges and corners, but they require high accuracy in feature matching and are easily affected by factors such as lighting and occlusion. They cannot effectively extract feature points or feature segments of flexible cables, resulting in reduced accuracy and reliability of feature matching. Summary of the Invention
[0003] To address the problems existing in the prior art, this invention provides a method, apparatus, and device for extracting flexible cables based on binocular vision. It abandons traditional feature extraction methods such as edge and corner points, and proposes a method for extracting the center line of the cable and constructing a three-dimensional model of the flexible cable based on the center line. This solves the technical problem in the prior art where the feature points or feature segments of the flexible cable cannot be effectively extracted due to factors such as lighting and occlusion, resulting in reduced accuracy and reliability of feature matching.
[0004] To solve any of the above-mentioned technical problems, the specific technical solution of the present invention is as follows: This invention provides a method for extracting flexible cables based on binocular vision, comprising: Using a binocular camera to acquire images of flexible cables; The image of the flexible cable is stereoscopically corrected according to the calibration parameters of the binocular camera to obtain a stereoscopically corrected image; Extract the center line of the cable in the stereoscopic correction image; Perform a three-dimensional centerline matching on the centerline of the cable to obtain the three-dimensional coordinates of the centerline of the cable. A three-dimensional model of the flexible cable is constructed based on the three-dimensional coordinates of the cable's centerline.
[0005] Furthermore, extracting the cable centerline of the stereoscopic correction image further includes: The stereo-corrected image is segmented into voxels to obtain a binary mask, where 1 represents a cable voxel and 0 represents a background voxel. Calculate the distance between each cable voxel inside the binary mask and the background voxel; Based on the distance, the boundary cable voxels are removed to obtain the cable voxel corresponding to the cable centerline.
[0006] Furthermore, performing centerline 3D matching on the cable centerline to obtain the three-dimensional coordinates of the cable centerline further includes: The radius of the flexible cable is calculated based on the distance between the cable voxel corresponding to the cable centerline and the background voxel. The three-dimensional coordinates of the cable centerline are calculated based on the coordinates of the cable voxel corresponding to the cable centerline and the radius of the flexible cable.
[0007] Furthermore, performing voxel segmentation on the stereo-corrected image to obtain a binary mask further includes: Calculate the gradient vector at each voxel in the stereo-corrected image, and calculate the gradient magnitude based on the gradient vector; The stereoscopic corrected image is marked according to the initial mask of the stereoscopic corrected image to obtain a marked image; A label image for the stereo-corrected image is generated using a watershed segmentation algorithm based on the gradient magnitude at each voxel in the stereo-corrected image and the labeled image. The binary mask is generated based on the initial mask and the label image.
[0008] Furthermore, the process of removing boundary cable voxels based on the distance to obtain the cable voxel corresponding to the cable centerline further includes: The boundary cable voxels in the cable voxels are removed using the skeleton algorithm based on the distance to obtain the cable voxel corresponding to the cable centerline.
[0009] Furthermore, constructing a three-dimensional model of the flexible cable based on the three-dimensional coordinates of the cable centerline further includes: A three-dimensional model of the flexible cable is constructed based on the three-dimensional coordinates of the cable's centerline and the radius of the flexible cable.
[0010] On the other hand, embodiments of this specification also provide a flexible cable extraction device based on binocular vision, the device comprising: A flexible cable image acquisition unit is used to acquire images of flexible cables using a binocular camera. The image stereo correction unit is used to perform stereo correction on the image of the flexible cable according to the calibration parameters of the binocular camera to obtain a stereo corrected image; A cable centerline extraction unit is used to extract the cable centerline of the stereoscopic correction image; The cable centerline three-dimensional coordinate extraction unit is used to perform centerline three-dimensional matching on the cable centerline to obtain the three-dimensional coordinates of the cable centerline. A 3D model building unit is used to build a 3D model of the flexible cable based on the 3D coordinates of the cable centerline.
[0011] On the other hand, embodiments of the present invention also provide a computer device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the above-described method.
[0012] On the other hand, embodiments of this specification also provide a computer storage medium storing a computer program thereon, which, when run by the processor of a computer device, executes instructions according to the method described above.
[0013] On the other hand, embodiments of this specification also provide a computer program product, which includes a computer program that, when executed by a processor, implements the above-described method.
[0014] The embodiments in this specification abandon the traditional method of extracting features from flexible cables through edges, corners, etc., and propose a method to extract the center line of the flexible cable from the stereo-corrected image, perform stereo matching on the center line to obtain the three-dimensional coordinates of the center line, and finally construct a three-dimensional model of the flexible cable based on the three-dimensional coordinates. Even if the flexible cable is affected by factors such as illumination or occlusion, the three-dimensional model of the flexible cable can be accurately constructed, solving the problem of high mismatch rate in stereo matching caused by weak texture and reflection on the surface of the flexible cable. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 The diagram shown is a flowchart of a flexible cable extraction method based on binocular vision in an embodiment of the present invention.
[0017] Figure 2 The diagram shown is a flowchart illustrating the process of extracting the center line of the cable from the stereoscopic correction image in an embodiment of the present invention.
[0018] Figure 3 The diagram shown is a schematic diagram of the process of performing voxel segmentation on the stereo-corrected image to obtain a binary mask in an embodiment of the present invention.
[0019] Figure 4 The diagram shown is a schematic representation of a flexible cable extraction device based on binocular vision in an embodiment of the present invention.
[0020] Figure 5 The diagram shown is a structural schematic of a computer device in an embodiment of the present invention.
[0021] [Explanation of Figure Markers]: 401. Flexible cable image acquisition unit; 402. Image stereo correction unit; 403. Cable centerline extraction unit; 404. Cable centerline three-dimensional coordinate extraction unit; 405. Three-dimensional model building unit; 502. Computer equipment; 504. Processing equipment; 506. Storage resources; 508. Drive mechanism; 510. Input / Output Module; 512. Input devices; 514. Output devices; 516. Presentation equipment; 518. Graphical User Interface; 520. Network interface; 522. Communication link; 524. Communication bus. Detailed Implementation
[0022] 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.
[0023] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, apparatus, product, or device that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.
[0024] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0025] To address the problems existing in the prior art, this invention provides a method for extracting flexible cables based on binocular vision. It abandons traditional feature extraction methods such as edge and corner points, and proposes a method for extracting the center line of the cable and constructing a three-dimensional model of the flexible cable based on the center line. This solves the technical problem in the prior art where the feature points or feature segments of the flexible cable cannot be effectively extracted due to factors such as lighting and occlusion, resulting in reduced accuracy and reliability of feature matching. Figure 1 The diagram illustrates a flowchart of a flexible cable extraction method based on binocular vision according to an embodiment of the present invention. This diagram depicts the process of constructing a 3D model of the flexible cable, but based on conventional or non-creative labor, it may include more or fewer operational steps. The order of steps listed in the embodiment is merely one possible execution order among many and does not represent the only possible execution order. In actual system or device products, the methods shown in the embodiment or the accompanying drawings can be executed sequentially or in parallel. Specifically, as shown... Figure 1 As shown, the method may include: Step 101: Use a binocular camera to acquire images of the flexible cable; Step 102: Perform stereo correction on the image of the flexible cable according to the calibration parameters of the binocular camera to obtain a stereo-corrected image; Step 103: Extract the center line of the cable in the stereoscopic correction image; Step 104: Perform centerline 3D matching on the centerline of the cable to obtain the three-dimensional coordinates of the centerline of the cable; Step 105: Construct a three-dimensional model of the flexible cable based on the three-dimensional coordinates of the cable centerline.
[0026] In the embodiments of this specification, the parameters of the binocular camera are first calibrated, and then the flexible cable is photographed using the calibrated binocular camera to obtain an image of the flexible cable. Then, the image of the flexible cable is stereoscopically corrected according to the calibration parameters of the binocular camera to obtain a stereoscopically corrected image of the flexible cable.
[0027] Then, the center line of the cable is extracted from the obtained stereoscopic corrected image using the watershed segmentation algorithm and the skeleton algorithm.
[0028] Specifically, such as Figure 2 As shown, extracting the cable centerline from the stereoscopic correction image further includes: Step 201: Perform voxel segmentation on the stereo correction image to obtain a binary mask, where 1 represents a cable voxel and 0 represents a background voxel; Step 202: Calculate the distance between each cable voxel inside the binary mask and the background voxel; Step 203: Remove boundary cable voxels based on the distance to obtain the cable voxel corresponding to the cable centerline.
[0029] In the embodiments of this specification, the stereo-corrected image is first segmented into voxels using the watershed segmentation algorithm to obtain a binary mask. The watershed segmentation algorithm can accurately segment the voxels of the target structure in 3D volume data, resulting in a binary mask (1 represents the target structure, and 0 represents the background). The key to the watershed is that it can generate segmentation results with accurate boundaries and good connectivity, and provide a basis for subsequent distance transformation.
[0030] Specifically, such as Figure 3 As shown, performing voxel segmentation on the stereo-corrected image to obtain a binary mask further includes: Step 301: Calculate the gradient vector at each voxel in the stereo-corrected image, and calculate the gradient magnitude based on the gradient vector; Step 302: Mark the stereoscopic correction image according to the initial mask of the stereoscopic correction image to obtain a marked image; Step 303: Generate a label image for the stereo-corrected image using the watershed segmentation algorithm based on the gradient magnitude at each voxel in the stereo-corrected image and the labeled image; Step 304: Generate the binary mask based on the initial mask and the label image.
[0031] In the embodiments of this specification, the input stereo-corrected image is first preprocessed. The input stereo-corrected image is a three-dimensional volume data V(x, y, z), where x, y, z represent three-dimensional coordinates, and V represents a voxel point in the stereo-corrected image. Gaussian filtering, median filtering, or anisotropic diffusion filtering (such as Perona-Malik) is used to reduce noise and improve the robustness of subsequent steps. A coarse initial mask M_rough is obtained using thresholding, region growing, or edge detection as an input marker or constraint for watersheds, which helps prevent oversegmentation.
[0032] Then, watershed segmentation is performed. The watershed algorithm treats the image as a terrain surface, with brightness values representing height. The goal is to find the "watershed" (boundary) between "catchments" (target regions). Specifically, first, a gradient magnitude map is calculated, which is the key input for the watershed and highlights the boundaries of the target structure. Three-dimensional gradient operators (such as Sobel, Prewitt, and Scharr) are used to calculate the gradient vector at each voxel (x, y, z). Then calculate the gradient magnitude (intensity). The G-value is low in areas with flexible cables and uniform backgrounds; it is high at the boundaries.
[0033] Then, seed points (markers) for the target and background are determined manually or automatically. Target markers (M_internal) are located in connected regions within the target structure (which can be extracted from the initial mask M_rough or refined through morphological operations such as opening, closing, and hole filling). Background markers (M_external) are located in regions outside the target structure (usually the complement of the initial mask M_internal after erosion, ensuring no contact with the target). All markers (target and background markers) are combined into a single marker image, Markers, where each connected region has a unique label (a positive integer), and unmarked regions are 0.
[0034] Then, a watershed transformation is applied, using the gradient map G as a topographic map and the marker images Markers as initial water injection points. A 3D watershed algorithm (such as Vincent-Soille's immersion simulation algorithm) is used to process G and Markers, outputting a label image L(x, y, z): L > 0 represents different segmented regions (target or background), and L = 0 or a specific value (such as -1) represents the watershed line (boundary).
[0035] Finally, the target mask is extracted by extracting one or more label regions corresponding to the target structure from the label image L. These regions are set to 1, and other regions (including the watershed line and the background) are set to 0, resulting in a binary segmentation mask, where 1 represents a cable voxel and 0 represents a background voxel.
[0036] Then, the Euclidean distance between each cable voxel inside the binary mask and the background voxel is calculated.
[0037] Finally, the skeleton algorithm is used to remove boundary cable voxels from the cable voxels based on the distance, obtaining the cable voxel corresponding to the cable centerline. The goal of the skeleton algorithm is to iteratively remove boundary voxels that satisfy specific topological and geometric conditions until the structure becomes a single voxel width (in the sense of 26-neighborhood), while maintaining: Topological invariance (unchanged connectivity and number of holes); Structural integrity (the skeleton should be located at the "center" of the original structure); Preserve the original structure's form as much as possible (especially the branch ends).
[0038] The process is as follows: Define one or more direction templates (such as the 6 main directions: up / down / left / right / forward / backward).
[0039] In each iteration, all voxels that belong to the target (value 1) are traversed.
[0040] For each target voxel p: Examine the voxel configuration within its 26-neighborhood.
[0041] Application deletion criteria: Simple condition: Deleting p does not change the topology of the image (number of connected components, number of holes). Determining whether a point is a simple point is usually done by checking the number of connected components formed by the target voxels in its 26-neighborhood (using 6-neighborhood or 26-neighborhood connections) and the number of tunnels / cavities in the background.
[0042] Endpoint protection: If p is an end point (with only one neighbor in the 26-neighborhood), it usually needs to be preserved to prevent the skeleton from shrinking prematurely.
[0043] Boundary conditions: Typically, only voxels located on the "boundary" of a specific direction are considered for deletion (e.g., based on the template of the current traversal direction).
[0044] Voxels that meet the deletion criteria are marked as "deletable".
[0045] After all voxels have been traversed in one iteration, all voxels marked as "removable" are removed (set to background value 0).
[0046] Repeat the above steps until no voxels are marked as removable in a complete iteration.
[0047] Output: A thinned binary image Skeleton_binary(x, y, z), where voxels with a value of 1 form the centerline (skeleton).
[0048] Then, a three-dimensional matching of the centerline of the cable is performed to obtain the three-dimensional coordinates of the centerline of the cable.
[0049] Specifically, such as Figure 3 As shown, performing a three-dimensional centerline matching on the cable centerline to obtain the three-dimensional coordinates of the cable centerline further includes: Step 301: Calculate the radius of the flexible cable based on the distance between the cable voxel corresponding to the cable centerline and the background voxel; Step 302: Calculate the three-dimensional coordinates of the cable centerline based on the coordinates of the cable voxel corresponding to the cable centerline and the radius of the flexible cable.
[0050] In the embodiments of this specification, the distance between the cable voxel corresponding to the cable centerline and the background voxel is the cable diameter at the corresponding position of the cable voxel. The average distance of each cable voxel on the cable centerline can be averaged to obtain the cable diameter, and thus the cable radius. If it is a variable diameter cable, the position of the variable diameter can be marked in advance, so that the cable radius can be calculated segment by segment.
[0051] Then, the three-dimensional coordinates of the cable centerline are calculated using the x and y coordinates of the cable voxel corresponding to the cable centerline and the cable radius (z).
[0052] After obtaining the three-dimensional coordinates of the cable centerline, a three-dimensional model of the flexible cable can be constructed based on the three-dimensional coordinates of the cable centerline and the radius of the flexible cable, thereby completing the accurate extraction of the flexible cable.
[0053] Based on the same inventive concept, embodiments of the present invention also provide a flexible cable extraction device based on binocular vision, such as... Figure 4 As shown, it includes: The flexible cable image acquisition unit 401 is used to acquire images of the flexible cable using a binocular camera. The image stereo correction unit 402 is used to perform stereo correction on the image of the flexible cable according to the calibration parameters of the binocular camera to obtain a stereo corrected image; The cable centerline extraction unit 403 is used to extract the cable centerline of the stereoscopic correction image; The cable centerline three-dimensional coordinate extraction unit 404 is used to perform centerline three-dimensional matching on the cable centerline to obtain the three-dimensional coordinates of the cable centerline. The three-dimensional model building unit 405 is used to build a three-dimensional model of the flexible cable based on the three-dimensional coordinates of the cable centerline.
[0054] The beneficial effects obtained by the above-described device are the same as those obtained by the above-described method, and will not be described in detail in the embodiments of the present invention.
[0055] like Figure 5The diagram illustrates the structure of a computer device according to an embodiment of the present invention. The apparatus in this invention can be the computer device described in this embodiment, executing the method of the present invention as described above. The computer device 502 may include one or more processing devices 504, such as one or more central processing units (CPUs), each processing unit implementing one or more hardware threads. The computer device 502 may also include any storage resource 506 for storing information of any kind, such as code, settings, data, etc. Non-limitingly, for example, the storage resource 506 may include any type of RAM, any type of ROM, flash memory, hard disk, optical disk, etc. More generally, any storage resource can use any technology to store information. Further, any storage resource can provide volatile or non-volatile retention of information. Further, any storage resource may represent a fixed or removable component of the computer device 502. In one case, when the processing device 504 executes associated instructions stored in any storage resource or combination of storage resources, the computer device 502 can perform any operation of the associated instructions. The computer device 502 also includes one or more drive mechanisms 508 for interacting with any storage resource, such as hard disk drive mechanism, optical disk drive mechanism, etc.
[0056] Computer device 502 may also include an input / output module 510 (I / O) for receiving various inputs (via input device 512) and providing various outputs (via output device 514). A specific output mechanism may include a presentation device 516 and an associated graphical user interface (GUI) 518. In other embodiments, the input / output module 510 (I / O), input device 512, and output device 514 may be omitted, and the device may function solely as a computer device within a network. Computer device 502 may also include one or more network interfaces 520 for exchanging data with other devices via one or more communication links 522. One or more communication buses 524 couple the components described above together.
[0057] Communication link 522 can be implemented in any way, such as via a local area network, a wide area network (e.g., the Internet), a point-to-point connection, or any combination thereof. Communication link 522 may include any combination of hardwired links, wireless links, routers, gateway functions, name servers, etc., governed by any protocol or combination of protocols.
[0058] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method.
[0059] This invention also provides a computer-readable instruction, wherein when a processor executes the instruction, the program therein causes the processor to perform the above-described method.
[0060] It should be understood that, in various embodiments of the present invention, the order of the above-mentioned process numbers 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.
[0061] It should also be understood that, in the embodiments of the present invention, the term "and / or" is merely a description of the relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, in the present invention, the character " / " generally indicates that the preceding and following associated objects have an "or" relationship.
[0062] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed in this invention can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0063] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0064] In the embodiments provided by this invention, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, or may be electrical, mechanical, or other forms of connection.
[0065] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of the embodiments of the present invention, depending on actual needs.
[0066] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0067] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0068] Specific embodiments have been used to illustrate the principles and implementation methods of this invention. The descriptions of the embodiments above are only for the purpose of helping to understand the method and core ideas of this invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this invention. Therefore, the content of this invention should not be construed as a limitation of this invention.
Claims
1. A method for extracting flexible cables based on binocular vision, characterized in that, The method includes: Using a binocular camera to acquire images of flexible cables; The image of the flexible cable is stereoscopically corrected according to the calibration parameters of the binocular camera to obtain a stereoscopically corrected image; Extract the center line of the cable in the stereoscopic correction image; Perform a three-dimensional centerline matching on the centerline of the cable to obtain the three-dimensional coordinates of the centerline of the cable. A three-dimensional model of the flexible cable is constructed based on the three-dimensional coordinates of the cable's centerline.
2. The method according to claim 1, characterized in that, Extracting the cable centerline from the stereoscopic correction image further includes: The stereo-corrected image is segmented into voxels to obtain a binary mask, where 1 represents a cable voxel and 0 represents a background voxel. Calculate the distance between each cable voxel inside the binary mask and the background voxel; Based on the distance, the boundary cable voxels are removed to obtain the cable voxel corresponding to the cable centerline.
3. The method according to claim 2, characterized in that, Performing a three-dimensional centerline matching on the cable centerline to obtain the three-dimensional coordinates of the cable centerline further includes: The radius of the flexible cable is calculated based on the distance between the cable voxel corresponding to the cable centerline and the background voxel. The three-dimensional coordinates of the cable centerline are calculated based on the coordinates of the cable voxel corresponding to the cable centerline and the radius of the flexible cable.
4. The method according to claim 2, characterized in that, Voxel segmentation of the stereo-corrected image to obtain a binary mask further includes: Calculate the gradient vector at each voxel in the stereo-corrected image, and calculate the gradient magnitude based on the gradient vector; The stereoscopic corrected image is marked according to the initial mask of the stereoscopic corrected image to obtain a marked image; A label image for the stereo-corrected image is generated using a watershed segmentation algorithm based on the gradient magnitude at each voxel in the stereo-corrected image and the labeled image. The binary mask is generated based on the initial mask and the label image.
5. The method according to claim 2, characterized in that, The process of removing boundary cable voxels based on the distance to obtain the cable voxel corresponding to the cable centerline further includes: The boundary cable voxels in the cable voxels are removed using the skeleton algorithm based on the distance to obtain the cable voxel corresponding to the cable centerline.
6. The method according to claim 3, characterized in that, Constructing a three-dimensional model of the flexible cable based on the three-dimensional coordinates of the cable's centerline further includes: A three-dimensional model of the flexible cable is constructed based on the three-dimensional coordinates of the cable's centerline and the radius of the flexible cable.
7. A flexible cable extraction device based on binocular vision, characterized in that, The device includes: A flexible cable image acquisition unit is used to acquire images of flexible cables using a binocular camera. The image stereo correction unit is used to perform stereo correction on the image of the flexible cable according to the calibration parameters of the binocular camera to obtain a stereo corrected image; A cable centerline extraction unit is used to extract the cable centerline of the stereoscopic correction image; The cable centerline three-dimensional coordinate extraction unit is used to perform centerline three-dimensional matching on the cable centerline to obtain the three-dimensional coordinates of the cable centerline. A 3D model building unit is used to build a 3D model of the flexible cable based on the 3D coordinates of the cable centerline.
8. A computer device comprising a memory, a processor, and a computer program stored in the memory, characterized in that, When the processor executes the computer program, it implements the method according to any one of claims 1 to 6.
9. A computer storage medium having a computer program stored thereon, characterized in that, When the computer program is run by the processor of the computer device, it executes the instructions of the method according to any one of claims 1 to 6.
10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the method of any one of claims 1 to 6.
Citation Information
Patent Citations
Cable bending radius detection method and device
CN113935958A
Steel structure installation and adjustment method and system based on vertical column axis dynamic tracking
CN120429934A
Civil aircraft cable laying quality evaluation method and system based on 3D scanning reconstruction technology
CN120563724A