3D endoscope image cable connection reversal detection method and device and 3D endoscope system

By setting the detection position and acquiring parallax in the 3D endoscope, the problem of difficult detection due to reversed image cable connections is solved, ensuring the accuracy and comfort of image display.

CN116489334BActive Publication Date: 2026-04-28ZHEJIANG HEALNOC TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHEJIANG HEALNOC TECH CO LTD
Filing Date
2023-04-11
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

The 3D endoscope image cable is easily reversed during assembly, resulting in reversed positive and negative parallax in the image, which is difficult to accurately identify and correct through signal detection methods.

Method used

By determining the zero parallax distance between the two cameras, setting the first and second detection positions, obtaining the parallax of the left and right views, determining whether the cables are connected in reverse based on the relationship between the magnitudes of the parallax, and exchanging the cable connections or views to correct the problem if necessary.

Benefits of technology

It enables rapid and accurate detection and correction of reversed cable connections in 3D endoscope images, improving assembly efficiency and image display comfort.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116489334B_ABST
    Figure CN116489334B_ABST
Patent Text Reader

Abstract

The application relates to a 3D endoscope image cable connection detection method and device, a 3D endoscope system and a storage medium. The method is applied to a 3D endoscope system, and the method comprises the following steps: determining a first detection position and a second detection position based on the zero parallax distance of the two cameras; the distance between the first detection position and the camera device is less than the zero parallax distance, and the distance between the second detection position and the camera device is greater than the zero parallax distance; determining the parallax of the two cameras at the first detection position and the second detection position respectively based on the left view and the right view respectively acquired by the two cameras at the first detection position and the second detection position; and determining whether the two image cables are connected reversely based on the size relationship between the parallax of the two cameras at the first detection position and the second detection position and the zero parallax, so that the problem that the 3D endoscope image cable connection is difficult to detect is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of medical devices, and in particular to a method, apparatus, 3D endoscope system, and storage medium for detecting reversed cable connections in 3D endoscope images. Background Technology

[0002] 3D endoscopes provide stereoscopic images through binocular cameras. Doctors can view the 3D images through a naked-eye 3D monitor or by wearing other auxiliary display devices. The perception of the internal organs being examined is more three-dimensional and realistic, increasing the precision and safety of the surgery. The binocular cameras of a 3D endoscope correspond to two image sensors to acquire image signals from the binocular field of view. The acquired image signals are processed and then transmitted to the display device for display. Because the endoscope needs to enter the body to acquire images of the examined areas, the image processing unit and the two image sensors at the front of the 3D endoscope are usually connected via image cables to transmit the image signals to the image processing unit. These image cables can be connected via connectors at the camera end and / or the image processing unit end. Due to manufacturing limitations, during the assembly of the 3D endoscope, one image cable may be connected to the connector corresponding to the other image cable, resulting in the two image cables being connected in reverse. If this occurs, the normal calibration process may result in reversed positive and negative parallax in the image; that is, positive parallax occurs closer to the lens, and negative parallax occurs farther away, leading to poor 3D effect and viewing comfort. Since both image cables are used to transmit image signals, it is difficult to detect reversed image cable connections using signal detection methods.

[0003] There is currently no effective solution to the problem of difficulty in detecting reversed 3D endoscope image cables in related technologies. Summary of the Invention

[0004] This embodiment provides a method, device, 3D endoscope system, and storage medium for detecting reversed cable connections in 3D endoscope images, in order to solve the problem of difficulty in detecting reversed cable connections in 3D endoscope images in related technologies.

[0005] Firstly, this embodiment provides a method for detecting reversed connection of 3D endoscope image cables. The method is applied to a 3D endoscope system, which includes a camera device and an image processing device. The camera device includes two cameras, and the image processing device is connected to the two cameras via two image cables. The method includes:

[0006] Based on the zero parallax distance between the two cameras, a first detection position and a second detection position are determined; the distance between the first detection position and the camera device is less than the zero parallax distance, and the distance between the second detection position and the camera device is greater than the zero parallax distance;

[0007] Based on the left and right views obtained by the two cameras at the first detection position and the second detection position respectively, the parallax of the two cameras at the first detection position and the second detection position is determined respectively;

[0008] Based on the relationship between the parallax and zero parallax of the two cameras at the first detection position and the second detection position, it is determined whether the two image cables are connected in reverse.

[0009] In some embodiments, determining whether the two image cables are connected in reverse based on the relationship between the parallax and zero parallax of the two cameras at the first detection position and the second detection position includes:

[0010] If the parallax of the two cameras at the first detection position is greater than 0 and the parallax at the second detection position is less than 0, it is determined that the two image cables are reversed.

[0011] If the parallax between the two cameras at the first detection position is less than 0 and the parallax at the second detection position is greater than 0, it is determined that the two image cables are connected correctly.

[0012] In some embodiments, determining the parallax of the two cameras at the first detection position and the second detection position based on the left and right views respectively acquired by the two cameras at the first detection position and the second detection position includes:

[0013] Based on the left and right views obtained by the two cameras at the same detection position, the positions of the feature points in the left and right views are determined.

[0014] Obtain the first horizontal coordinate of the feature point in the left view and the second horizontal coordinate in the right view;

[0015] Based on the difference between the first horizontal coordinate and the second horizontal coordinate, the parallax of the two cameras at the detection position is determined.

[0016] In some embodiments, determining the position of the feature point in the left and right views obtained by the two cameras at the same detection position includes:

[0017] Obtain the grayscale left view corresponding to the left view and the grayscale right view corresponding to the right view;

[0018] Based on the grayscale values ​​of each pixel in the grayscale left view and the grayscale right view, the position of the feature point in the grayscale left view and the grayscale right view is determined;

[0019] The position of the feature point in the left and right views is determined based on the position of the feature point in the grayscale left view and the grayscale right view.

[0020] In some embodiments, before determining the first detection position and the second detection position based on the zero parallax distance between the two cameras, the method further includes:

[0021] Based on the parallax of the two cameras at the third detection position, it is determined whether the two cameras have completed calibration; wherein, the distance between the third detection position and the camera device is equal to the zero parallax distance.

[0022] In some embodiments, after determining whether the two cameras have completed calibration based on the parallax of the two cameras at the third detection position, the method further includes:

[0023] If the absolute value of the parallax between the two cameras at the third detection position is greater than a preset threshold, the two cameras are calibrated.

[0024] In some embodiments, after determining whether the two image cables are reversed based on the relationship between the parallax and zero parallax of the two cameras at the first detection position and the second detection position, the method further includes:

[0025] If it is determined that the two image cables are reversed, the two image cables are swapped at one end of the image processing device or at one end of the camera; or the views corresponding to the two image cables are swapped in the image processing device.

[0026] Based on the swapped views, the two cameras are recalibrated.

[0027] Secondly, this embodiment provides a 3D endoscope image cable reverse connection detection device. The device is applied to a 3D endoscope system, which includes a camera device and an image processing device. The camera device includes two cameras, and the image processing device is connected to the two cameras respectively via two image cables. The device includes:

[0028] The first determining module is used to determine a first detection position and a second detection position based on the zero parallax distance between the two cameras; the distance between the first detection position and the camera device is less than the zero parallax distance, and the distance between the second detection position and the camera device is greater than the zero parallax distance;

[0029] The second determining module is used to determine the parallax of the two cameras at the first detection position and the second detection position based on the left and right views obtained by the two cameras at the first detection position and the second detection position, respectively.

[0030] The third determining module is used to determine whether the two image cables are connected in reverse based on the relationship between the parallax and zero parallax of the two cameras at the first detection position and the second detection position.

[0031] Thirdly, this embodiment provides a 3D endoscope system, including two cameras for acquiring binocular images, an image processing device connected to the two cameras respectively via two image cables, a display device for displaying 3D images, and a 3D endoscope image cable reverse connection detection device as described in the second aspect.

[0032] Fourthly, this embodiment provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the 3D endoscope image cable reversal detection method described in the first aspect.

[0033] Compared with related technologies, the 3D endoscope image cable reversal detection method provided in this embodiment determines a first detection position and a second detection position based on the zero parallax distance between two cameras. The distance between the first detection position and the camera device is less than the zero parallax distance, while the distance between the second detection position and the camera device is greater than the zero parallax distance. This means that cable reversal detection is performed based on the correspondence between the parallax of the 3D endoscope camera and the shooting distance. The parallax of the two cameras at the first and second detection positions is determined based on the left and right views obtained by the two cameras at the first and second detection positions, respectively, establishing a correspondence between the camera's parallax value and the detection position. The method determines whether the two image cables are reversed based on the relationship between the parallax of the two cameras at the first and second detection positions and zero parallax. By detecting the wiring of the image cables according to the correspondence between the positive and negative parallax values ​​and the detection positions, the method solves the problem of difficulty in detecting 3D endoscope image cable reversal.

[0034] Details of one or more embodiments of this application are set forth in the following drawings and description to make other features, objects and advantages of this application more readily apparent. Attached Figure Description

[0035] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments of this application and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0036] Figure 1 This is a schematic diagram of a 3D endoscope system to which the 3D endoscope image cable reversal detection method of some embodiments of this application is applied;

[0037] Figure 2 This is a flowchart of a 3D endoscope image cable reversal detection method according to some embodiments of this application;

[0038] Figure 3 This is a schematic diagram showing the relative positions of the 3D endoscope binocular camera and the observation point in some embodiments of this application;

[0039] Figure 4 This is a schematic diagram showing the relative positions of the first and second detection positions and the camera device in some embodiments of this application;

[0040] Figure 5 This is a flowchart illustrating how to determine whether an image cable is reversed based on parallax in some embodiments of this application;

[0041] Figure 6 This is a flowchart illustrating the determination of parallax based on left and right views in some embodiments of this application;

[0042] Figure 7 This is a flowchart illustrating the determination of feature point positions based on left and right views in some embodiments of this application;

[0043] Figure 8 This is a flowchart of a method for detecting reversed cable connections in 3D endoscope images according to some preferred embodiments of this application;

[0044] Figure 9 This is a structural block diagram of a 3D endoscope image cable reverse connection detection device according to some embodiments of this application. Detailed Implementation

[0045] To better understand the purpose, technical solution, and advantages of this application, the application is described and illustrated below in conjunction with the accompanying drawings and embodiments.

[0046] Unless otherwise defined, the technical or scientific terms used in this application shall have the general meaning as understood by one of ordinary skill in the art to which this application pertains. Words such as “a,” “an,” “an,” “the,” “the,” and “these,” used in this application, do not indicate quantitative limitation and may be singular or plural. The terms “comprising,” “including,” “having,” and any variations thereof used in this application are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that comprises a series of steps or modules (units) is not limited to the listed steps or modules (units) but may include steps or modules (units) not listed, or may include other steps or modules (units) inherent to such processes, methods, products, or devices. The terms “connected,” “linked,” and “coupled,” used in this application, are not limited to physical or mechanical connections but may include electrical connections, whether direct or indirect. The term “multiple” used in this application refers to two or more. The "and / or" operator describes the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: A alone, A and B simultaneously, and B alone. Typically, the character " / " indicates that the objects before and after it are in an "or" relationship. The terms "first," "second," and "third," etc., used in this application are merely for distinguishing similar objects and do not represent a specific ordering of the objects.

[0047] The method embodiments provided in this example can be applied to, for example... Figure 1 The 3D endoscope system shown. Figure 1 This is a connection diagram of the 3D endoscope system in this embodiment, as shown below. Figure 1 As shown, the 3D endoscope system includes a camera device 11, an image processing device 13, and an image display device 15. The camera device 11 includes two cameras 110, and the image processing device 13 is connected to each of the two cameras 110 via two image cables. The image processing device 13 processes the video images captured by the two cameras 110 in 3D and then sends them to the image display device 15 for display. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the 3D endoscope system described above. The 3D endoscope system may also include other devices or modules, such as devices or modules for providing a light source, controlling camera movement, etc., and this embodiment does not impose any limitations.

[0048] The 3D endoscope image cable reverse connection detection method provided in this embodiment can be executed in the image processing device 13, or in other computers or terminals that can receive and process video images captured by the camera 110. In this embodiment, the image processing device 13 is used as an example for explanation.

[0049] The image processing apparatus 13, or other computer, terminal, etc., running this method embodiment may include one or more processors (processors may include, but are not limited to, microprocessors such as MCUs or programmable logic devices such as FPGAs), a memory for storing data, and a transmission device for communication functions. Optionally, it may also include input / output devices. The memory may be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the 3D endoscope image cable reversal detection method in this embodiment of the invention. The processor executes various functional applications and data processing by running the computer program stored in the memory, thereby implementing the above-described method. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some embodiments, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to a traffic data management system via a network. Examples of the above-described networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0050] The transmission device is used to receive or send data via a network. This network includes wireless networks provided by the communication provider of the 3D endoscope system. In one example, the transmission device includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device may be a Radio Frequency (RF) module used for wireless communication with the Internet.

[0051] This embodiment provides a method for detecting reversed cable connections in 3D endoscope images. Figure 2 This is a flowchart of the 3D endoscope image cable reversal detection method in this embodiment, as follows: Figure 2 As shown, the process includes the following steps:

[0052] Step S201: Based on the zero parallax distance between the two cameras, determine the first detection position and the second detection position; the distance between the first detection position and the camera device is less than the zero parallax distance, and the distance between the second detection position and the camera device is greater than the zero parallax distance.

[0053] When the camera device of a 3D endoscope acquires images of the area to be observed, the binocular cameras in the camera device acquire images of the same area to be observed, and the acquired views can be called the left view and the right view. Figure 3 This is a schematic diagram showing the relative positions of the binocular cameras and the observation point of a 3D endoscope. For example... Figure 3 As shown, O Land O R These are the optical centers of the two cameras, and the line connecting them is called the baseline. The distance between the two optical centers is denoted by b. The plane containing the two optical centers is called the projection plane, f is the focal length of the camera, and L is the imaging width. The observation point P in three-dimensional space is located at the imaging points of the left and right cameras, respectively. L and P R The observation point P is the intersection of the lines connecting the optical centers of the two cameras and the imaging point. Line segment X... L and X R These are the distances from the imaging points of the left and right cameras to the left imaging plane, respectively.

[0054] The position of the same observation point P differs slightly between the left and right views. This discrepancy arises from the difference in position between the two cameras relative to the area being observed. The difference in position of the same point within the area being observed between the left and right views is called parallax. Parallax can be divided into horizontal parallax and vertical parallax, referring to the difference in position of the same point in the horizontal and vertical directions in the left and right views, respectively. Horizontal parallax helps viewers develop a sense of space and plays a crucial role in 3D reconstruction. For example, Figure 3 ZhongX L and X R The difference between the horizontal and vertical parallax is called horizontal parallax. Vertical parallax affects the quality of the synthesized 3D video, resulting in image blurring and negatively impacting viewing comfort. Vertical parallax can usually be eliminated through epipolar correction.

[0055] Horizontal parallax can be categorized into positive parallax, negative parallax, and zero parallax. When a target point is shifted to the right in the left view and to the left in the right view, the viewer's binocular focus (convergence point) is guided to fall in front of the display, creating a visual "jump-out" effect, known as negative parallax. Conversely, when the target object is shifted to the left in the left view and to the right in the right view, the viewer's binocular focus is guided to fall behind the display, creating a visual "depth" effect, known as positive parallax. When the target object's positions overlap in the left and right views, the viewer's binocular focus is guided to fall on the display, known as zero parallax. Zero parallax distance refers to the distance between the target point and the plane where the camera is located when the parallax of the target object in the left and right views is 0.

[0056] In this embodiment, the zero parallax distance can be preset or adjusted within a certain range according to the usage scenario. The first detection position and the second detection position are determined based on the preset zero parallax distance. Figure 4 This is a schematic diagram showing the relative positions of the first detection position, the second detection position, and the camera device in some embodiments of this application. For example... Figure 4As shown, the zero parallax distance of the endoscopic camera device 41 is L1. The distance from the first detection position 43 to the endoscopic camera device 41 is L0, which is less than the zero parallax distance L1. The distance from the second detection position 42 to the endoscopic camera device 41 is L2, which is greater than the zero parallax distance L1. It should be noted here that... Figure 4 To illustrate the relative positions of the detection positions and the camera device, the first detection position, the second detection position, and the endoscopic camera device are arranged on the same straight line. However, in reality, the angles of the first and second detection positions relative to the camera device can be different. This embodiment does not limit the angles of the first and second detection positions relative to the camera.

[0057] Step S202: Based on the left and right views obtained by the two cameras at the first and second detection positions respectively, determine the parallax of the two cameras at the first and second detection positions respectively.

[0058] In practical applications, the 3D endoscope image cable reversal detection method of this embodiment is typically used in the production and assembly process of 3D endoscopes. A pre-set observation target can usually be used as the detection tool, placed at the first and second detection positions. The observation target can be an image with feature points or patterns, or it can be some objects or scenes; this embodiment does not impose any restrictions on this.

[0059] The target is placed at both the first and second detection positions, and left and right views of the target are acquired using a binocular camera. The disparity of the binocular camera at each detection position is determined based on the position of the same feature point on the target in the left and right views. This disparity is horizontal disparity, which can be calculated by the difference in the horizontal coordinates of the feature point in the left and right views. Feature points can be pre-defined points or patterns with significant color or brightness differences from the background, or points in an image of an object or scene that possess shape, color, brightness, or other characteristics. Different targets and feature points can be set at the two detection positions, but the target and feature points at the same detection position should be identical. Since the feature points have significant color or brightness differences from the background, the positions of the feature points in the left and right views can be obtained using simple algorithms, such as image binarization based on brightness or color difference. Alternatively, block matching or feature point detection methods can be used to obtain the position of the feature points and the disparity between the feature points in the left and right views.

[0060] Step S203: Based on the relationship between the parallax and zero parallax of the two cameras at the first detection position and the second detection position, determine whether the two image cables are connected in reverse.

[0061] Two image cables are used to transmit image signals for the left and right views, respectively. If the two image cables are connected in reverse, the left and right views are reversed, and the disparity value of the same feature point is the opposite of the value when they are connected correctly. Since the distances from the first and second detection positions to the camera device are less than and greater than the zero disparity distance, respectively, the disparity of the feature points corresponding to the first and second detection positions should be one negative and one positive. Therefore, the sign of the disparity value can be used to determine whether the two image cables are connected in reverse.

[0062] Through the above steps S201 to S203, the first detection position and the second detection position are determined based on the zero parallax distance between the two cameras. The distance between the first detection position and the camera device is less than the zero parallax distance, and the distance between the second detection position and the camera device is greater than the zero parallax distance. That is, the cable reversal detection is performed based on the correspondence between the parallax of the 3D endoscope camera and the shooting distance. Based on the left and right views obtained by the two cameras at the first and second detection positions respectively, the parallax of the two cameras at the first and second detection positions is determined, and the correspondence between the parallax value of the camera and the detection position is determined. Based on the relationship between the magnitude of the parallax of the two cameras at the first and second detection positions and the zero parallax, it is determined whether the two image cables are reversed. The problem of difficult detection of reversed image cables in 3D endoscopes is solved by detecting whether the image cables are reversed based on the correspondence between the positive and negative values ​​of the parallax values ​​and the detection positions.

[0063] In some of these embodiments, Figure 5 This is a flowchart illustrating how some embodiments of this application determine whether an image cable is reversed based on parallax, such as... Figure 5 As shown, the process includes the following steps:

[0064] Step S401: If the parallax of the two cameras at the first detection position is greater than 0 and the parallax at the second detection position is less than 0, determine that the two image cables are reversed.

[0065] Based on the correspondence between parallax magnitude and shooting distance, zero parallax distance corresponds to 0 parallax. The distance between the first detection position and the camera device is less than the zero parallax distance, while the distance between the second detection position and the camera device is greater than the zero parallax distance. Therefore, assuming the image cables are connected correctly, the parallax corresponding to the first detection position should be less than 0, and the parallax corresponding to the second detection position should be greater than 0. However, if the image cables are connected in reverse, and the left and right views are swapped, the sign of the parallax value is opposite to that when it is correct. Therefore, if the parallax corresponding to the first detection position is greater than 0 and the parallax corresponding to the second detection position is less than 0, it can be determined that the two image cables are connected in reverse.

[0066] In step S402, if the parallax of the two cameras at the first detection position is less than 0 and the parallax at the second detection position is greater than 0, it is determined that the two image cables are connected correctly.

[0067] The order of steps S401 and S402 can be reversed.

[0068] Through the above steps S401 to S402, if the parallax between the two cameras at the first detection position is greater than 0 and the parallax at the second detection position is less than 0, it is determined that the two image cables are connected in reverse. If the parallax between the two cameras at the first detection position is less than 0 and the parallax at the second detection position is greater than 0, it is determined that the two image cables are connected correctly. The method of detecting whether the image cables are connected in reverse by the parallax value corresponding to the two detection positions being greater than 0 or less than 0 is simple and quick. It can determine whether the image cables are connected in reverse without the need for image signal detection or comparison of left and right views, thus improving the assembly efficiency of 3D endoscopes.

[0069] In some of these embodiments, Figure 6 This is a flowchart illustrating the determination of parallax based on left and right views in some embodiments of this application, such as... Figure 6 As shown, the process includes the following steps:

[0070] Step S501: Based on the left and right views obtained by the two cameras at the same detection position, determine the position of the feature point in the left and right views respectively.

[0071] Feature points can be points with characteristics from a pre-determined observation target, or points obtained by filtering based on the content of the left and right views. Each detection location must correspond to at least one feature point. Feature points at different detection locations can be different, while feature points at the same detection location can be the same. For example, the observation target can be a pre-determined calibration board, with a feature point set on the calibration board whose color or brightness differs significantly from the color or brightness of the calibration board itself; or the same object can be photographed in both the left and right views, using the object's outline or corner points as feature points. The position of the feature point in the left and right views can be determined based on the difference between the feature point's color or brightness and the observation background, or the position can be determined using feature point detection algorithms, block matching algorithms, etc.

[0072] Step S502: Obtain the first horizontal coordinate of the feature point in the left view and the second horizontal coordinate in the right view.

[0073] Based on the position of the feature point in the left and right views, obtain the horizontal coordinate of the pixel corresponding to the feature point in the view.

[0074] Step S503: Based on the difference between the first horizontal coordinate and the second horizontal coordinate, determine the parallax of the two cameras at the detection position.

[0075] The difference between the first horizontal coordinate corresponding to the left view and the second horizontal coordinate corresponding to the right view is taken as the disparity corresponding to the detection position.

[0076] Through the above steps S501 to S503, the positions of feature points in the left and right views respectively obtained by the two cameras at the same detection position are determined, and image cable reversal detection is performed by feature point localization; the position of the feature point in the view is obtained by obtaining the first horizontal coordinate of the feature point in the left view and the second horizontal coordinate in the right view; the disparity between the two cameras at the detection position is determined by the difference between the first and second horizontal coordinates, providing a data basis for subsequent determination of whether the image cable is reversed. The disparity is obtained by a simple feature point localization method, which does not require too much resource for calculation, thus improving the efficiency of obtaining the disparity value.

[0077] In some of these embodiments, Figure 7 This is a flowchart illustrating the determination of feature point positions based on left and right views in some embodiments of this application, such as... Figure 7 As shown, the process includes the following steps:

[0078] Step S601: Obtain the grayscale left view corresponding to the left view and the grayscale right view corresponding to the right view.

[0079] When the color or brightness of a feature point differs significantly from the color or brightness of other pixels in the left and right views, the location of the feature point can be obtained through image binarization. This involves converting the left and right views into corresponding grayscale images.

[0080] Step S602: Based on the grayscale values ​​of each pixel in the grayscale left view and grayscale right view, determine the position of the feature point in the grayscale left view and grayscale right view.

[0081] Due to the color or brightness differences between feature points and other pixels, the grayscale value of feature points in a grayscale image also differs significantly from that of other pixels. By setting a grayscale threshold or comparing the grayscale value of a pixel with the average grayscale value of the entire grayscale view, the position coordinates of the feature points in the grayscale left and grayscale right views can be obtained.

[0082] Step S603: Determine the position of the feature point in the left and right views based on the position of the feature point in the grayscale left and grayscale right views.

[0083] Through the above steps S601 to S603, the color view is converted into the corresponding grayscale view by obtaining the grayscale left view corresponding to the left view and the grayscale right view corresponding to the right view; the position of the feature point in the grayscale left view and grayscale right view is determined based on the grayscale values ​​of each pixel in the grayscale left view and grayscale right view, and the position of the feature point is determined by the difference between the grayscale values ​​of the feature point and the grayscale values ​​of other pixels; by determining the position of the feature point in the left view and grayscale right view based on the position of the feature point in the grayscale left view and grayscale right view, a data basis is provided for obtaining the disparity corresponding to the detection position, and the feature point position is obtained without the need for a complex feature point matching algorithm, thus improving the acquisition efficiency.

[0084] In some embodiments, it is necessary to determine whether the camera device of the 3D endoscope has been calibrated. Calibration includes establishing the transformation relationship between the image coordinate system and the real-world coordinate system of the two cameras, transforming the positional relationship between the two cameras, and ensuring that the optical axes of the two cameras are parallel. The calibration steps include obtaining basic calibration parameters through epipolar correction, confirming the zero parallax distance according to application requirements, and optimizing the basic calibration parameters. If the two cameras are not calibrated, the correct parallax value cannot be obtained, and therefore, the detection of reversed image cable connections cannot be performed. Therefore, before determining the first and second detection positions based on the zero parallax distance of the two cameras, the method further includes:

[0085] Based on the parallax of the two cameras at the third detection position, it is determined whether the two cameras have completed calibration; wherein, the distance between the third detection position and the camera device is equal to the zero parallax distance.

[0086] A third detection position is set at the zero parallax distance of the camera device, and an observation target is set at this third detection position. This observation target can be the same as or different from the observation target at the first or second detection position. The two cameras capture images of the observation target to obtain corresponding left and right views. The parallax is obtained using the method described in the above embodiment, for example, by locating feature points to obtain the parallax corresponding to the third detection position. If the parallax is equal to 0, or its absolute value is less than or equal to a preset small threshold, it can be determined that the two cameras have completed calibration.

[0087] The 3D endoscope image cable reversal detection method provided in this embodiment sets a third detection position at the zero parallax distance of the camera device and obtains the parallax at the third detection position. Based on the parallax, it determines whether the camera device has been calibrated. This provides a simple method for determining whether the camera device has been calibrated. Furthermore, it can be combined with the parallax acquisition methods of the first and second detection positions in the previous embodiment to obtain the corresponding parallax, and the parallax of the three detection positions can be comprehensively judged, saving time in obtaining the image cable reversal detection result.

[0088] Furthermore, if the absolute value of the disparity corresponding to the third detection position is greater than the preset threshold, it can be determined that the two cameras have not completed calibration. After this, the method further includes:

[0089] The two cameras are calibrated if the absolute value of the parallax between the two cameras at the third detection position is greater than a preset threshold.

[0090] If the absolute value of the parallax at the third detection position exceeds a preset threshold, it can be determined that the camera has not been correctly calibrated. In this case, the parallax calculation may be incorrect, and the accuracy of the image cable reversal detection result cannot be guaranteed. Therefore, the calibration of both cameras should be completed first, and then the image cable reversal detection should be performed to ensure the accuracy of the image cable reversal detection result. The calibration method will not be described in detail here.

[0091] In some embodiments, a method for correcting the reversal of two image cables is also provided, the method comprising the following steps:

[0092] Step S11: If it is determined that the two image cables are reversed, swap the connection of the two image cables at one end of the image processing device or the camera end; or swap the views corresponding to the two image cables in the image processing device.

[0093] If it is determined that the two image cables are reversed, and if the 3D endoscope's image cable has a corresponding connector at the image processing device end, the connection can be corrected by swapping the image cable and the connector; or if the camera end has a corresponding connector, the connection can also be corrected by swapping the image cable and the connector; if the cables cannot be swapped due to assembly limitations, the connection can be corrected by swapping the corresponding views of the two image cables in the image processing device.

[0094] Step S12: Based on the swapped views, recalibrate the two cameras.

[0095] Through steps S11 to S12, the 3D endoscope image cable reverse connection detection method provided in this embodiment corrects the reverse connection problem by swapping the connectors corresponding to the two image cables or swapping the left and right views in the image processing device. This satisfies the requirement for the correctness of the left and right views during the reconstruction of 3D images and avoids the problem of blurred image display and reduced viewing comfort caused by the inversion of the left and right views. Based on the swapped views, the two cameras are recalibrated to eliminate image distortion.

[0096] The present embodiment will now be described and illustrated through preferred embodiments.

[0097] The method for detecting reverse connection of 3D endoscope image cables in this preferred embodiment is applied to a 3D endoscope system, which includes a camera device and an image processing device. The camera device includes two cameras, and the image processing device is connected to the two cameras through two image cables respectively. Figure 8 is a flowchart of the method for detecting reverse connection of 3D endoscope image cables in this preferred embodiment. As Figure 8 shown, this process includes the following steps:

[0098] Step S701, calibrate the camera device of the 3D endoscope and write the obtained calibration parameters into the 3D endoscope system;

[0099] Step S702, set the zero parallax distance of the camera device according to the application scenario;

[0100] Step S703, set a detection scenario with a single background color. In the detection scenario, set 3 feature points with different distances from the camera device. The feature points have a large difference in color or brightness from the background of the scenario; the distances between the feature points and the projection plane of the camera device are L0, L1, and L2 respectively; where L0 < L1 < L2, and L1 is equal to the zero parallax distance;

[0101] Step S704, capture the left view and the right view of the detection scenario at the positions corresponding to the three distances respectively;

[0102] Step S705, perform image binaryzation processing on the left view and the right view to obtain the corresponding grayscale views;

[0103] Step S706, determine the positions of the feature points in the grayscale views according to the grayscale values of the pixel points in the grayscale views;

[0104] Step S707, determine the positions of the feature points in the left view and the right view according to the positions of the feature points in the grayscale views;

[0105] Step S708, obtain the first abscissa of the feature point in the left view and the second abscissa of the feature point in the right view;

[0106] Step S709, based on the difference between the first abscissa and the second abscissa, determine the parallax of the two cameras at this detection position, and obtain the values of the parallax ST0, ST1, and ST2 corresponding to L0, L1, and L2 respectively;

[0107] Step S710, if the absolute value of ST1 is equal to 0 or less than or equal to the preset threshold, and ST0 < 0, ST2 > 0, then the wiring of the image cables is correct;

[0108] Step S711, if the absolute value of ST1 is equal to 0 or less than or equal to the preset threshold, and ST0 > 0, ST2 < 0, then the two image cables are reversely connected;

[0109] Step S712: If the absolute value of ST1 is greater than the preset threshold, then the execution will start from step S701.

[0110] Step S713: For the 3D endoscope where the image cable is detected to be reversed, swap the corresponding connectors of the two cables at one end of the image processing device.

[0111] Through the above steps S701 to S713, the accuracy of the detection data is ensured by calibration before detection; three detection positions corresponding to the shooting distance are set according to the pre-set zero parallax distance, and the corresponding parallax is obtained. The cable reversal detection is performed by the correspondence between the parallax of the binocular camera and the shooting distance; by comparing the parallax corresponding to the three detection positions with 0, it is determined whether the two image cables are connected in reverse; if they are connected in reverse, the connection is corrected by swapping the cables. This solves the problem of difficult detection of reversed 3D endoscope image cables. Moreover, the detection is performed through the scene setting of the assembly process, which can be completed without complex calculations. This avoids the problem of weak stereoscopic effect and uncomfortable viewing of 3D reconstructed images caused by reversed image cables.

[0112] It should be noted that the steps shown in the above process or in the flowchart of the accompanying figures 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.

[0113] In some embodiments, this application also provides a 3D endoscope image cable reverse connection detection device, applied to a 3D endoscope system. The 3D endoscope system includes a camera device and an image processing device. The camera device includes two cameras, and the image processing device is connected to the two cameras respectively via two image cables. This 3D endoscope image cable reverse connection detection device is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. The terms "module," "unit," and "subunit" used below refer to combinations of software and / or hardware that perform predetermined functions.

[0114] In some embodiments, Figure 9 This is a structural block diagram of the 3D endoscope image cable reverse connection detection device in this embodiment, as shown below. Figure 9 As shown, the device includes:

[0115] The first determining module 81 is used to determine a first detection position and a second detection position based on the zero parallax distance between the two cameras; the distance between the first detection position and the camera device is less than the zero parallax distance, and the distance between the second detection position and the camera device is greater than the zero parallax distance;

[0116] The second determining module 82 is used to determine the parallax of the two cameras at the first detection position and the second detection position based on the left view and the right view obtained by the two cameras at the first detection position and the second detection position, respectively.

[0117] The third determining module 83 is used to determine whether the two image cables are connected in reverse based on the relationship between the parallax and zero parallax of the two cameras at the first detection position and the second detection position.

[0118] The 3D endoscope image cable reversal detection device in this embodiment determines a first detection position and a second detection position based on the zero parallax distance between the two cameras using a first determining module 81. The distance between the first detection position and the camera device is less than the zero parallax distance, while the distance between the second detection position and the camera device is greater than the zero parallax distance. This means the cable reversal detection is performed based on the correspondence between the parallax of the 3D endoscope camera and the shooting distance. The second determining module 82 determines the parallax of the two cameras at the first and second detection positions based on the left and right views obtained by the two cameras respectively, establishing a correspondence between the camera parallax values ​​and the detection positions. The third determining module 83 determines whether the two image cables are reversed based on the relationship between the parallax of the two cameras at the first and second detection positions and the zero parallax distance. By detecting whether the image cables are reversed based on the correspondence between the positive and negative parallax values ​​and the detection positions, the device solves the problem of difficulty in detecting reversed 3D endoscope image cables.

[0119] In some embodiments, the third determining module includes a first determining submodule and a second determining submodule. The first determining submodule is used to determine that the two image cables are reversed when the parallax of the two cameras at the first detection position is greater than 0 and the parallax at the second detection position is less than 0. The second determining submodule is used to determine that the two image cables are correctly connected when the parallax of the two cameras at the first detection position is less than 0 and the parallax at the second detection position is greater than 0.

[0120] The 3D endoscope image cable reverse connection detection device in this embodiment determines that the two image cables are reversed when the parallax between the two cameras at the first detection position is greater than 0 and the parallax at the second detection position is less than 0, using a first determining submodule. It determines that the two image cables are correctly connected when the parallax between the two cameras at the first detection position is less than 0 and the parallax at the second detection position is greater than 0, using a second determining submodule. The device detects whether the image cables are reversed by checking if the parallax value at the two detection positions is greater than or less than 0. This method is simple and quick, eliminating the need for image signal detection or comparison of left and right views, thus improving the assembly efficiency of the 3D endoscope.

[0121] In some embodiments, the second determining module includes a third determining submodule, a first acquiring submodule, and a fourth determining submodule. The third determining submodule is used to determine the position of the feature point in the left and right views respectively acquired by the two cameras at the same detection position. The first acquiring submodule is used to acquire the first abscissa of the feature point in the left view and the second abscissa in the right view. The fourth determining submodule is used to determine the parallax of the two cameras at the detection position based on the difference between the first abscissa and the second abscissa.

[0122] The 3D endoscope image cable reversal detection device in this embodiment uses a third determining submodule to determine the position of feature points in the left and right views obtained by the two cameras at the same detection position, respectively, and performs image cable reversal detection by feature point localization. A first acquiring submodule obtains the first abscissa of the feature point in the left view and the second abscissa in the right view to obtain the position of the feature point in the view. A fourth determining submodule determines the parallax of the two cameras at the detection position based on the difference between the first and second abscissas, providing a data basis for subsequent determination of whether the image cable is reversed. Obtaining parallax through a simple feature point localization method does not require excessive computational resources, thus improving the efficiency of obtaining parallax values.

[0123] In some embodiments, the third determining submodule includes a first acquisition unit, a first determining unit, and a second determining unit. The first acquisition unit is used to acquire a grayscale left view corresponding to the left view and a grayscale right view corresponding to the right view. The first determining unit is used to determine the position of the feature point in the grayscale left view and the grayscale right view based on the grayscale values ​​of each pixel in the grayscale left view and the grayscale right view. The second determining unit is used to determine the position of the feature point in the left view and the right view based on the position of the feature point in the grayscale left view and the grayscale right view.

[0124] The 3D endoscope image cable reversal detection device in this embodiment acquires a grayscale left view corresponding to the left view and a grayscale right view corresponding to the right view through a first acquisition unit, converting the color view into the corresponding grayscale view; a first determination unit determines the position of the feature point in the grayscale left view and grayscale right view based on the grayscale values ​​of each pixel in the grayscale left view and grayscale right view, and determines the position of the feature point by the difference between the grayscale value of the feature point and the grayscale value of other pixels; a second determination unit determines the position of the feature point in the left view and grayscale right view based on the position of the feature point in the grayscale left view and grayscale right view, providing a data basis for obtaining the disparity corresponding to the detection position, and without the need to obtain the feature point position through a complex feature point matching algorithm, thus improving the acquisition efficiency.

[0125] In some embodiments, the 3D endoscope image cable reverse connection detection device further includes a fourth determination module, which is used to determine whether the two cameras have completed calibration based on the parallax of the two cameras at the third detection position; wherein the distance between the third detection position and the camera device is equal to the zero parallax distance.

[0126] The 3D endoscope image cable reversal detection device in this embodiment sets a third detection position at the zero parallax distance of the camera device through the fourth determination module, and obtains the parallax of the third detection position. Based on the parallax, it determines whether the camera device has completed calibration, providing a simple method to determine whether the camera device has completed calibration. It can also be combined with the parallax acquisition method of the first and second detection positions in the previous embodiment to obtain the corresponding parallax, and comprehensively judge the parallax of the three detection positions, saving time in obtaining the image cable reversal detection result.

[0127] In some embodiments, the 3D endoscope image cable reverse connection detection device further includes a first calibration module, which is used to calibrate the two cameras when the absolute value of the parallax between the two cameras at the third detection position is greater than a preset threshold.

[0128] The 3D endoscope image cable reverse connection detection device provided in this embodiment calibrates the two cameras by means of a first calibration module when the absolute value of the parallax at the third detection position is greater than a preset threshold, so as to ensure the correctness of the image cable reverse connection detection result.

[0129] In some embodiments, the 3D endoscope image cable reverse connection detection device further includes a switching module and a second calibration module. The switching module is used to switch the connection of the two image cables at one end of the image processing device or the camera end when it is determined that the two image cables are reversed; or to switch the views corresponding to the two image cables in the image processing device. The second calibration module is used to recalibrate the two cameras based on the swapped views.

[0130] The 3D endoscope image cable reverse connection detection device provided in this embodiment corrects the reverse connection problem by exchanging the connectors corresponding to the two image cables through the exchange module, or by exchanging the left and right views in the image processing device. This satisfies the requirement for the correctness of the left and right views during the reconstruction of 3D images and avoids the problems of blurred image display and reduced viewing comfort caused by the inversion of the left and right views. The second calibration module recalibrates the two cameras based on the exchanged views to eliminate image distortion.

[0131] In some embodiments, this application also provides a 3D endoscope system, which includes two cameras for acquiring binocular images, an image processing device connected to the two cameras respectively via two image cables, a display device for displaying 3D images, and a 3D endoscope image cable reverse connection detection device as described in the above embodiments.

[0132] The 3D endoscope system provided in this embodiment acquires left and right views of the observed target through two cameras. An image processing device obtains the parallax corresponding to the detection position based on the left and right views, and determines whether the two image cables are reversed by comparing the magnitude of the parallax with 0. If the image cables are not reversed, 3D reconstruction is performed on the left and right views to obtain a 3D view. The 3D view is displayed through a display device, avoiding the problem of blurred 3D image display and reduced viewing comfort caused by reversed image cables.

[0133] Furthermore, in conjunction with the 3D endoscope image cable reversal detection method provided in the above embodiments, this embodiment can also provide a storage medium for implementation. This storage medium stores a computer program; when executed by a processor, the computer program implements any of the 3D endoscope image cable reversal detection methods in the above embodiments.

[0134] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated in this embodiment.

[0135] It should be understood that the specific embodiments described herein are merely illustrative of the application and not intended to limit it. All other embodiments derived by those skilled in the art based on the embodiments provided in this application without inventive effort are within the scope of protection of this application.

[0136] Obviously, the accompanying drawings are merely some examples or embodiments of this application. Those skilled in the art can apply this application to other similar situations based on these drawings without any creative effort. Furthermore, it is understood that although the work done in this development process may be complex and lengthy, for those skilled in the art, certain design, manufacturing, or production modifications made based on the technical content disclosed in this application are merely conventional technical means and should not be considered as insufficient disclosure of this application.

[0137] The term "embodiment" in this application refers to a specific feature, structure, or characteristic described in connection with an embodiment that may be included in at least one embodiment of this application. The appearance of this phrase in various places in the specification does not necessarily imply the same embodiment, nor does it imply that it is mutually exclusive with or independent of other embodiments. It will be clearly or implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments without conflict.

[0138] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of patent protection. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the appended claims.

Claims

1. A method for detecting reversed connection of 3D endoscope image cables, the method being applied to a 3D endoscope system, the 3D endoscope system including a camera device and an image processing device, the camera device including two cameras, the image processing device being connected to the two cameras respectively via two image cables, characterized in that... The method includes: Based on the zero parallax distance between the two cameras, a first detection position and a second detection position are determined; the distance between the first detection position and the camera device is less than the zero parallax distance, and the distance between the second detection position and the camera device is greater than the zero parallax distance; Based on the left and right views obtained by the two cameras at the first detection position and the second detection position respectively, the parallax of the two cameras at the first detection position and the second detection position is determined respectively; Based on the relationship between the parallax and zero parallax of the two cameras at the first detection position and the second detection position, it is determined whether the two image cables are connected in reverse. The step of determining whether the two image cables are connected in reverse, based on the relationship between the parallax and zero parallax of the two cameras at the first detection position and the second detection position, includes: If the parallax of the two cameras at the first detection position is greater than 0 and the parallax at the second detection position is less than 0, it is determined that the two image cables are reversed. If the parallax between the two cameras at the first detection position is less than 0 and the parallax at the second detection position is greater than 0, it is determined that the two image cables are connected correctly.

2. The method according to claim 1, characterized in that, The determination of the parallax of the two cameras at the first detection position and the second detection position, based on the left and right views respectively obtained by the two cameras at the first detection position and the second detection position, includes: Based on the left and right views obtained by the two cameras at the same detection position, the positions of the feature points in the left and right views are determined. Obtain the first horizontal coordinate of the feature point in the left view and the second horizontal coordinate in the right view; Based on the difference between the first horizontal coordinate and the second horizontal coordinate, the parallax of the two cameras at the detection position is determined.

3. The method according to claim 2, characterized in that, The determination of the position of the feature point in the left and right views obtained by the two cameras at the same detection position includes: Obtain the grayscale left view corresponding to the left view and the grayscale right view corresponding to the right view; Based on the grayscale values ​​of each pixel in the grayscale left view and the grayscale right view, the position of the feature point in the grayscale left view and the grayscale right view is determined; The position of the feature point in the left and right views is determined based on the position of the feature point in the grayscale left view and the grayscale right view.

4. The method according to claim 1, characterized in that, Before determining the first detection position and the second detection position based on the zero parallax distance between the two cameras, the method further includes: Based on the parallax of the two cameras at the third detection position, it is determined whether the two cameras have completed calibration; wherein, the distance between the third detection position and the camera device is equal to the zero parallax distance.

5. The method according to claim 4, characterized in that, After determining whether the two cameras have completed calibration based on the parallax of the two cameras at the third detection position, the method further includes: If the absolute value of the parallax between the two cameras at the third detection position is greater than a preset threshold, the two cameras are calibrated.

6. The method according to claim 1, characterized in that, After determining whether the two image cables are connected in reverse based on the relationship between the parallax and zero parallax of the two cameras at the first detection position and the second detection position, the method further includes: If it is determined that the two image cables are reversed, the two image cables are swapped at one end of the image processing device or at one end of the camera; or the views corresponding to the two image cables are swapped in the image processing device. Based on the swapped views, the two cameras are recalibrated.

7. A 3D endoscope image cable reverse connection detection device, the device being applied to a 3D endoscope system, the 3D endoscope system including a camera device and an image processing device, the camera device including two cameras, the image processing device being connected to the two cameras respectively via two image cables, characterized in that, The 3D endoscope image cable reverse connection detection device includes: The first determining module is used to determine a first detection position and a second detection position based on the zero parallax distance between the two cameras; the distance between the first detection position and the camera device is less than the zero parallax distance, and the distance between the second detection position and the camera device is greater than the zero parallax distance; The second determining module is used to determine the parallax of the two cameras at the first detection position and the second detection position based on the left and right views obtained by the two cameras at the first detection position and the second detection position, respectively. The third determining module is used to determine whether the two image cables are connected in reverse based on the relationship between the parallax and zero parallax of the two cameras at the first detection position and the second detection position. The third determining module includes a first determining submodule and a second determining submodule. The first determining submodule is used to determine that the two image cables are reversed when the parallax of the two cameras at the first detection position is greater than 0 and the parallax at the second detection position is less than 0. The second determining submodule is used to determine that the two image cables are correctly connected when the parallax of the two cameras at the first detection position is less than 0 and the parallax at the second detection position is greater than 0.

8. A 3D endoscope system, characterized in that, The device includes two cameras for acquiring binocular images, an image processing device connected to the two cameras via two image cables, a display device for displaying 3D images, and a 3D endoscope image cable reverse connection detection device as described in claim 7.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the 3D endoscope image cable reverse connection detection method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Cable detection method, robot and storage device

    CN111667463A

  • Method and device for correcting translation error of images picked up by two cameras

    WO2012092758A1