An automatic calibration method and device for an endoscope
By setting preset marks on the endoscope and performing image recognition adjustments, the problem of low efficiency and poor accuracy in the automatic calibration of existing endoscopes has been solved, achieving efficient and accurate alignment of the camera and handle, and improving the doctor's operating experience.
Patent Information
- Application Number
- CN202510118142.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-23
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2045-01-23
AI Technical Summary
Existing automatic calibration methods for endoscopes are inefficient and inaccurate, resulting in improper installation of the camera and handpiece, which affects the doctor's comfort during operation.
By setting preset marks on the calibration plate, images are captured by the endoscope camera for image recognition, the angle is calculated and the orientation of the insertion part is adjusted until the preset angle threshold is reached, thus achieving automatic calibration.
It improves the efficiency and accuracy of automatic endoscope calibration, ensures the alignment of the camera and handpiece, and enhances the operator's comfort.
Smart Images

Figure CN119969924B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of automatic calibration, in particular to an automatic calibration method of an endoscope and a device thereof. BACKGROUND
[0002] An endoscope is a detection instrument integrating traditional optics, human engineering, precision machinery, modern electronics, mathematics and software, which is composed of image sensors, optical lenses, light sources, illumination and mechanical devices. The endoscope can enter the stomach through the mouth or other natural orifices, and can show lesions that X-rays cannot show, which is very useful for doctors' diagnosis and treatment. For example, doctors can observe ulcers or tumors in the stomach with the help of an endoscope, and accordingly develop the best treatment plan.
[0003] A medical endoscope usually includes an insertion part and an operating part. The top of the insertion part, i.e. the head end, is provided with a camera, and the operating part includes a handle. When assembling the endoscope, the camera at the head end needs to be aligned vertically with the handle. If the camera and the handle are not installed in place, the direction of the camera will be deflected, which will make the doctor feel that the sense of the hand holding the handle and the eye is not uniform during use, affecting the comfort of the doctor's operation. Therefore, the direction of the camera and the handle must be aligned and calibrated when the endoscope is shipped to ensure that the doctor does not feel uncomfortable during use of the endoscope.
[0004] The existing alignment and calibration method is to continuously rotate the insertion part containing the lens by artificial means to gradually achieve alignment with the handle. This existing alignment and calibration method is low in efficiency and poor in alignment and calibration accuracy.
[0005] Therefore, it is necessary to improve the existing technology. SUMMARY
[0006] The technical problem solved by the present application is how to improve the accuracy and efficiency of automatic calibration of an endoscope. The present application provides an automatic calibration method of an endoscope and a device thereof.
[0007] According to a first aspect, an embodiment provides an automatic calibration method of an endoscope. The handle of the operating part of the endoscope is directed to a first preset direction, and the axial direction of the insertion part of the endoscope is perpendicular to the plane on which the calibration plate is located; wherein the calibration plate is provided with a preset mark for indicating a second preset direction, the preset mark including a plurality of straight line segments, one of the plurality of straight line segments being used to represent the second preset direction, and the angle between the first preset direction and the second preset direction being ninety degrees; the method comprises:
[0008] The step of collecting: controlling a camera on the insertion part to collect an image of the preset mark; obtaining the image, performing image recognition on the image to obtain the preset mark in the image; determining a direction vector of a straight line segment in the image for representing the second preset direction, and calculating an angle between the direction vector of the straight line segment in the image for representing the second preset direction and a direction vector of the preset mark in the calibration plate; wherein the direction vector of the preset mark in the calibration plate is predetermined;
[0009] The step of judging: judging whether the absolute value of the angle is less than a preset angle threshold; wherein, if the absolute value is not less than the preset angle threshold, driving the insertion part to rotate around the axial direction by the angle, and repeating the steps of collecting to judging; if the absolute value is less than the preset angle threshold, stopping automatic calibration.
[0010] In an embodiment, the image recognition on the image to obtain the preset mark in the image comprises:
[0011] Preprocessing the image to obtain a preprocessed image;
[0012] Performing edge detection on the preprocessed image to obtain a plurality of edge pixel points;
[0013] Performing double-threshold detection and connected edge processing on the plurality of edge pixel points to obtain an edge image;
[0014] Processing the edge image to obtain the preset mark in the image.
[0015] In an embodiment, the preprocessing the image to obtain a preprocessed image comprises:
[0016] Performing grayscale processing on the image to obtain a grayscale processed image;
[0017] Performing Gaussian filtering on the grayscale processed image to obtain a Gaussian filtered image;
[0018] Performing global binarization processing on the Gaussian filtered image to obtain the preprocessed image.
[0019] In an embodiment, the processing the edge image to obtain the preset mark in the image comprises:
[0020] Converting all pixel points in the edge image from a rectangular coordinate system to a Hough parameter space to obtain a plurality of straight lines in the Hough parameter space; determining an intersection point of the plurality of straight lines; and determining the preset mark in the image according to the intersection point.
[0021] In an embodiment, the first preset direction is a vertical upward direction; and the driving the insertion portion to rotate by the angle about the axial direction thereof includes:
[0022] If the angle is positive, the insertion portion is driven to rotate counterclockwise by the absolute value about the axial direction thereof; and if the angle is negative, the insertion portion is driven to rotate clockwise by the absolute value about the axial direction thereof.
[0023] According to a second aspect, an embodiment provides an automatic calibration device of an endoscope, comprising:
[0024] a calibration board, wherein a preset mark for indicating a second preset direction is arranged on the calibration board, and the preset mark comprises a plurality of straight line segments, and one straight line segment of the plurality of straight line segments is used to represent the second preset direction;
[0025] a first fixing portion configured to fix an operating portion of the endoscope, so that a handle of the operating portion faces the first preset direction; wherein an axial direction of an insertion portion of the endoscope is perpendicular to a plane on which the calibration board is located, and an angle between the first preset direction and the second preset direction is ninety degrees;
[0026] a driving portion configured to drive the insertion portion to rotate about the axial direction thereof;
[0027] a control portion configured to perform the steps of: controlling a camera on the insertion portion to collect an image of the preset mark; obtaining the image, performing image recognition on the image to obtain the preset mark in the image; determining a direction vector of one straight line segment in the image for representing the second preset direction, and calculating an angle between the direction vector of the one straight line segment in the image for representing the second preset direction and a direction vector of the preset mark in the calibration board; wherein the direction vector of the preset mark in the calibration board is predetermined; and performing the steps of: judging whether an absolute value of the angle is less than a preset angle threshold.
[0028] If the absolute value is not less than the preset angle threshold, the control portion controls the driving portion to drive the insertion portion to rotate by the angle about the axial direction thereof, and the steps of collecting and judging are repeated; and if the absolute value is less than the preset angle threshold, the automatic calibration is stopped.
[0029] In an embodiment, the automatic calibration device further comprises a second fixing portion, and the second fixing portion comprises a fixing seat for clamping the insertion portion.
[0030] In an embodiment, the second fixing portion further comprises a gear ring, the gear ring is sleeved on a circumferential surface of the fixing seat, and the driving portion comprises a motor and a gear; wherein the motor drives the gear ring to rotate through the gear, so that the gear ring drives the insertion portion to rotate by the angle about the axial direction.
[0031] In an embodiment, the first preset direction is a vertical upward direction; and if the absolute value is not less than a preset angle threshold, the driving part is controlled to drive the insertion part to rotate the angle around the axial direction of the insertion part.
[0032] If the angle is positive, the driving part is controlled to drive the insertion part to rotate the absolute value counterclockwise around the axial direction of the insertion part; and if the angle is negative, the driving part is controlled to drive the insertion part to rotate the absolute value clockwise around the axial direction of the insertion part.
[0033] According to a third aspect, in an embodiment, a computer-readable storage medium is provided. The computer-readable storage medium includes a program. The program is executable by a processor to implement the method according to any embodiment described herein.
[0034] The application has the following beneficial effects:
[0035] Before the automatic calibration method is performed, the handle of the operation part of the endoscope is oriented towards a first preset direction, and the axial direction of the insertion part of the endoscope is perpendicular to the plane on which the calibration plate is located; wherein the calibration plate is provided with a preset mark for indicating a second preset direction, the preset mark including a plurality of straight line segments, one of the plurality of straight line segments being used to represent the second preset direction, and the angle between the first preset direction and the second preset direction being ninety degrees; the method includes: a step of collecting: controlling a camera on the insertion part to collect an image of the preset mark; a step of performing image recognition on the image to obtain the preset mark in the image; a step of determining a direction vector of the straight line segment in the image that is used to represent the second preset direction, and calculating the angle between the direction vector of the straight line segment in the image that is used to represent the second preset direction and the direction vector of the preset mark in the calibration plate; a step of judging: judging whether the absolute value of the angle is less than a preset angle threshold; if the absolute value is not less than the preset angle threshold, driving the insertion part to rotate the angle around the axial direction of the insertion part, and repeating the steps of collecting and judging; and if the absolute value is less than the preset angle threshold, stopping the automatic calibration; the method quickly adjusts the orientation of the camera on the insertion part through image recognition and using the result of image recognition, i.e. the steps of collecting and judging, thereby improving the efficiency and accuracy of automatic calibration of the endoscope. BRIEF DESCRIPTION OF DRAWINGS
[0036] Figure 1 A flowchart of an embodiment of the automatic calibration method;
[0037] Figure 2 A flowchart of an embodiment of performing image recognition on the image to obtain the preset mark in the image;
[0038] Figure 3A flowchart of an embodiment of a process of pre-processing an image to obtain a pre-processed image;
[0039] Figure 4 A flowchart of an embodiment of a process of processing the edge image to obtain a preset mark in the image;
[0040] Figure 5 A structural diagram of an automatic calibration device of an endoscope of an embodiment;
[0041] Figure 6 A diagram of a preset mark on a calibration board and a recognized preset mark of an embodiment. DETAILED DESCRIPTION
[0042] The application will be described in further detail below with reference to the drawings. Like elements in different embodiments are denoted by like reference numerals. In the following embodiments, many details are described in order to provide a better understanding of the application. However, it can be readily apparent to those skilled in the art that some features in different embodiments can be omitted, or replaced by other elements, materials, methods, etc. In some cases, some operations related to the application are not shown or described in the specification in order to avoid the core of the application being obscured by too much description, and it is not necessary to describe these operations in detail for those skilled in the art based on the description in the specification and general technical knowledge in the art.
[0043] In addition, features, operations or characteristics described in the specification can be combined in any appropriate manner to form various embodiments. Meanwhile, steps or actions in the method description can also be sequentially adjusted or changed in a manner that is apparent to those skilled in the art. Therefore, the order in the specification and the drawings is only for clear description of an embodiment, and does not mean a necessary order, unless otherwise stated that a certain order must be followed.
[0044] In this document, the serial numbers of components, such as "first", "second", etc., are only used to distinguish the described objects, and do not have any sequential or technical meaning. Unless otherwise specified, "connected" or "coupled" in this application includes direct and indirect connections (couplings).
[0045] The technical solutions of the application will be described in detail below with reference to the embodiments.
[0046] The application provides an automatic calibration method of an endoscope. Before the automatic calibration method is performed, a handle of an operating part of the endoscope is directed to a first preset direction, and an axial direction of an insertion part of the endoscope is perpendicular to a plane on which a calibration board is located; wherein the calibration board is provided with a preset mark for indicating a second preset direction, the preset mark comprises a plurality of straight line segments, one of the plurality of straight line segments is used to represent the second preset direction, and an angle between the first preset direction and the second preset direction is ninety degrees. Please refer to Figure 1 The automatic calibration method comprises the following steps.
[0047] Step S100: The insertion part collects an image of the preset mark.
[0048] Step S200: The preset mark in the image is obtained.
[0049] Step S300: An angle between a direction vector of one straight line segment in the image for representing the second preset direction and a direction vector of the preset mark in the calibration board is calculated.
[0050] Step S400: Whether an absolute value of the angle is smaller than a preset angle threshold value is judged, and a camera of the insertion part is adjusted accordingly.
[0051] Specifically, the collecting step S100 comprises: controlling the camera on the insertion part to collect the image of the preset mark.
[0052] Specifically, the step S200 comprises: obtaining the image, and performing image recognition on the image to obtain the preset mark in the image.
[0053] Specifically, the step S300 comprises: determining the direction vector of one straight line segment in the image for representing the second preset direction, and calculating the angle between the direction vector of one straight line segment in the image for representing the second preset direction and the direction vector of the preset mark in the calibration board. The direction vector of the preset mark in the calibration board is determined in advance.
[0054] Specifically, the judging step S400 comprises: if the absolute value is not smaller than the preset angle threshold value, the insertion part is driven to rotate around the axial direction by the angle, and the collecting step S100 to the judging step S400 are repeated; if the absolute value is smaller than the preset angle threshold value, the automatic calibration is stopped. After the automatic calibration is stopped, the insertion part at this time can be fixed to the operating part through a nut.
[0055] In some embodiments, the first preset direction can be a vertically upward direction. The first preset direction can also be determined by a person skilled in the art according to an application scenario. The calibration board can be installed along the vertical direction. A person skilled in the art can determine the size, shape and other parameters of the calibration board.
[0056] In some embodiments, before the automatic calibration method is performed, the operation part and the insertion part of the endoscope can be preliminarily connected, and at this time, the insertion part can be rotated around the axial direction thereof under the action of an external force.
[0057] It can be understood that the purpose of making the axial direction of the insertion part perpendicular to the plane on which the calibration plate is located before the automatic calibration method is performed is to ensure that the image captured by the insertion part in step S100 is not distorted, and to further ensure that the preset mark in the image can be accurately identified subsequently.
[0058] It should be noted that the reason why the above-mentioned preset mark includes a plurality of straight line segments is to ensure that the subsequent image recognition step can correctly recognize the preset mark, that is, to ensure that the plurality of straight lines obtained in the Hough parameter space in step S240 subsequently have at least one intersection point, and one intersection point in the Hough parameter space corresponds to one straight line in the image captured in step S100.
[0059] In some embodiments, the above-mentioned preset mark can be a straight line segment. The direction indicated by the straight line segment is the second preset direction. The direction indicated by the straight line segment can also be other fixed directions.
[0060] In some embodiments, the above-mentioned preset mark can be composed of two straight line segments. For example, the preset mark can be two straight line segments in the shape of a cross, and one of the two straight line segments can point to the second preset direction (such as vertically upward or horizontally to the right).
[0061] In some embodiments, the above-mentioned preset mark can also have other shapes as long as the preset mark includes one or more straight line segments. For example, the preset mark can be an arrow, and the arrow can point to the second preset direction.
[0062] In some embodiments, the second preset direction can be the same as the first preset direction.
[0063] In some embodiments, the second preset direction can also be different from the first preset direction. For example, the first preset direction is vertically upward, and the second preset direction is horizontally to the right.
[0064] In some embodiments, please refer to Figure 2 In step S200, the image recognition is performed on the image to obtain the preset mark in the image, which includes:
[0065] Step S210: pre-processing the image to obtain a pre-processed image;
[0066] Step S220: performing edge detection on the pre-processed image to obtain a plurality of edge pixels;
[0067] Step S230: performing double-threshold detection and connected edge processing on the plurality of edge pixels to obtain an edge image;
[0068] Step S240: processing the edge image to obtain a preset mark in the image.
[0069] In some embodiments, referring to Figure 3 In step S210, the image is preprocessed to obtain a preprocessed image, including:
[0070] Step S211: performing grayscale processing on the image to obtain a grayscale-processed image.
[0071] Step S212: performing Gaussian filtering on the grayscale-processed image to obtain a Gaussian-filtered image.
[0072] Step S213: performing global binarization processing on the Gaussian-filtered image to obtain the preprocessed image.
[0073] In some embodiments, in step S211, the following expression can be used to perform grayscale processing on the image to obtain the grayscale-processed image: Gray(i, j) = 0.299R(i, j) + 0.587G(i, j) + 0.114B(i, j); where Gray represents the grayscale value of a pixel in the grayscale-processed image, i and j represent the horizontal and vertical coordinates of a pixel in the color image (e.g., the image collected in step S100), and R, G, and B represent the numerical values of the red, green, and blue channels of the color image, respectively.
[0074] It can be understood that in step S211, other grayscale processing methods can be used, and the grayscale processing method is not limited herein.
[0075] In some embodiments, in step S212, the following formula of a two-dimensional Gaussian function can be used to perform Gaussian filtering to obtain the Gaussian-filtered image:
[0076]
[0077] And (x, y) represents the relative coordinates of the pixel, i.e., the distance between the pixel and the center point, and σ represents the standard deviation of the Gaussian distribution, which determines the width of the Gaussian function.
[0078] It should be noted that the specific process of Gaussian filtering in step S212 and the specific process of global binarization processing in step S213 both belong to conventional technical means in the art, and therefore will not be described herein.
[0079] In some embodiments, in step S220, the preprocessed image can be subjected to edge detection to obtain a plurality of edge pixel points by using a Sobel edge detection algorithm. The Sobel edge detection algorithm is a classical image processing method mainly used for detecting edges in an image. For example, a horizontal and a vertical convolution kernel of a Sobel operator can be used to perform convolution operation on the image to obtain gradient amplitudes in horizontal and vertical directions, respectively. The expression of the horizontal convolution kernel can be:
[0080]
[0081] The horizontal convolution kernel is used to calculate the gradient in the x direction. The expression of the vertical convolution kernel can be:
[0082]
[0083] The vertical convolution kernel is used to calculate the gradient in the y direction. For a pixel point (x, y) in the image, the gradient amplitude G(x, y) of the pixel point can be calculated according to the following formula: Gradient direction
[0084] In some embodiments, in step S220, other edge detection algorithms can also be used to perform edge detection on the preprocessed image to obtain a plurality of edge pixel points.
[0085] It should be noted that the specific process of edge detection in step S220 is a conventional means in the art, and thus will not be described here.
[0086] It should be noted that the double-threshold detection in step S230 is an image processing technique mainly used for edge detection. It distinguishes edges in an image by setting two thresholds (such as a high threshold and a low threshold). The high threshold is used to detect strong edges (i.e., very obvious edges), and the low threshold is used to detect weak edges (i.e., not so obvious edges). The connecting edge processing in step S230 is to connect the edge pixel points determined by the double-threshold detection to form continuous edge lines to obtain a complete edge image, thereby facilitating better display of object contour information and the like in the image. Since the specific processes of the above double-threshold detection and connecting edge processing both belong to conventional means in the art, they will not be described here.
[0087] Since for a straight line in a rectangular coordinate system, the equation of the straight line can be expressed as y = kx + b; and in the Hough parameter space, the straight line in the above rectangular coordinate system becomes a point, the expression of the point is b = -xk + y, that is, for each point (x, y) in the original image, there is a straight line in the parameter space (k, b), therefore, in some embodiments, all pixel points in the edge image are converted from the rectangular coordinate system to the Hough parameter space to obtain a preset identifier in the image. Please refer to Figure 4, in step S240, the edge image is processed to obtain a preset mark in the image, including:
[0088] In step S241, all pixel points in the edge image are converted from the rectangular coordinate system to the Hough parameter space to obtain a plurality of straight lines in the Hough parameter space.
[0089] In step S242, the intersection points of the plurality of straight lines are determined.
[0090] In step S243, the preset mark in the image is determined according to the intersection points.
[0091] In some embodiments, in step S241, the following operations are performed on each pixel point (x, y) in the edge image respectively: according to the straight line equation y = kx + b in the rectangular coordinate system, it is converted to the Hough parameter space (k, b), that is, b = -xk + y, so that each pixel point corresponds to a straight line in the Hough parameter space.
[0092] It can be understood that after determining the plurality of straight lines in the Hough parameter space, the intersection points of the plurality of straight lines can be directly determined (except for the case without intersection points).
[0093] In step S243, since one intersection point in the Hough parameter space corresponds to a straight line or a straight line segment in the rectangular coordinate system, the preset mark in the image or the direction indicated by the preset mark can be determined based on the intersection points obtained in step S242. For example, the intersection points obtained in step S242 can be first mapped from the Hough parameter space back to the rectangular coordinate system, and then a plurality of straight line segments in the rectangular coordinate system are obtained. If one intersection point is obtained in step S242, the preset mark is a straight line segment in the rectangular coordinate system; if two intersection points are obtained in step S242, the preset mark is two straight line segments in the rectangular coordinate system, and so on.
[0094] In some embodiments, please refer to Figure 6 In step S300, it is assumed that the preset mark on the calibration board is two straight line segments in the form of a cross, that is, Figure 6 two dashed lines in the form of a cross in FIG. 10, the intersection point of the two straight line segments is the origin of the rectangular coordinate system, the first preset direction is the vertically upward direction, the second preset direction indicated by the preset mark is the horizontally right direction (for example, Figure 6 the horizontal dashed line in FIG. 10 is used to represent the second preset direction, and the coordinates of a point a on the horizontal dashed line are (x1, 0)), and the direction vector of the preset mark on the calibration board is (1, 0). For each straight line segment in the preset mark of the image identified in step S243 (for example, Figure 6The intersection of the two straight line segments of the preset mark is the origin of the Cartesian coordinate system, i.e., b is equal to 0, and the coordinates (x1, y1) of a point a on the straight line segment in the preset mark of the image for representing the second preset direction are obtained, so the direction vector of the straight line segment in the preset mark of the image for representing the second preset direction is (x1, y1), which is the direction vector of the straight line segment in the preset mark of the image for representing the second preset direction. The angle between the direction vector of the straight line segment in the preset mark of the image for representing the second preset direction and the direction vector of the preset mark of the calibration plate can be calculated by the dot product formula of vectors:
[0095]
[0096] The angle θ can be obtained If the angle θ is positive, it means that the driving part needs to be controlled to drive the insertion part to rotate around the axial direction by the absolute value of the angle θ in the counterclockwise direction; if the angle θ is negative, it means that the driving part needs to be controlled to drive the insertion part to rotate around the axial direction by the absolute value of the angle θ in the clockwise direction.
[0097] It can be understood that a person skilled in the art can determine a straight line segment in the plurality of straight line segments of the preset mark for representing the second preset direction in a pre-specified manner, for example, a straight line segment with the longest length in the two straight line segments is specified to represent the second preset direction.
[0098] It can be understood that the preset mark on the calibration plate can be a straight line segment, and the straight line segment directly represents the second preset direction.
[0099] In some embodiments, in step S400, the first preset direction is a vertically upward direction. If the absolute value is not less than a preset angle threshold, driving the insertion part to rotate around the axial direction by the angle includes: if the angle is positive, driving the insertion part to rotate around the axial direction in the counterclockwise direction by the absolute value; if the angle is negative, driving the insertion part to rotate around the axial direction in the clockwise direction by the absolute value.
[0100] In some embodiments, in step S400, a person skilled in the art can determine the specific value of the preset angle threshold according to the actual scene demand. For example, the preset angle threshold can be one degree.
[0101] It can be seen that in some embodiments, in order to quickly automatically align the angle between the camera of the endoscope and the handle, the automatic calibration method of the present application quickly adjusts the orientation of the camera on the insertion part through image recognition and using the result of image recognition, i.e., steps S100 to S400, thereby improving the efficiency and accuracy of automatic calibration of the endoscope.
[0102] The above is a description of an automatic calibration method of an endoscope. Please refer to Figure 5 The application also discloses an automatic calibration device of an endoscope, comprising:
[0103] a calibration board 100, wherein a preset mark 100a for indicating a second preset direction is arranged on the calibration board 100, and the preset mark 100a comprises a plurality of straight line segments, and one straight line segment is used to represent the second preset direction;
[0104] a first fixing part 200, configured to fix an operating part A of an endoscope, so that a handle of the operating part A faces a first preset direction; wherein an insertion part B of the endoscope faces the calibration board 100, an axial direction of the insertion part B is perpendicular to a plane where the calibration board 100 is located, and an angle between the first preset direction and the second preset direction is ninety degrees;
[0105] a driving part 300, configured to drive the insertion part B to rotate around the axial direction thereof;
[0106] a control part 400, configured to perform the steps of collecting: controlling a camera on the insertion part B to collect an image of the preset mark 100a; obtaining the image, performing image recognition on the image to obtain the preset mark 100a in the image; determining a direction vector of a straight line segment of the preset mark 100a in the image, which is used to represent the second preset direction; calculating an angle between the direction vector of the straight line segment of the preset mark 100a in the image, which is used to represent the second preset direction, and a direction vector of a straight line segment of the preset mark 100a in the calibration board 100, which is used to represent the second preset direction; wherein the direction vector of the straight line segment of the preset mark 100a in the calibration board 100, which is used to represent the second preset direction, is determined in advance; performing the steps of judging: whether an absolute value of the angle is less than a preset angle threshold; wherein if the absolute value is not less than the preset angle threshold, the driving part 300 is controlled to drive the insertion part B to rotate around the axial direction thereof by the angle, and the steps of collecting and judging are repeated; if the absolute value is less than the preset angle threshold, the automatic calibration is stopped.
[0107] In some embodiments, please refer to Figure 5The automatic calibration device further comprises a second fixing part 600, which comprises a fixing seat 610 for clamping the insertion part B and a tooth ring 620. The fixing seat 610 is used for clamping the insertion part B. The circumferential surface of the fixing seat 610 is sleeved with the tooth ring 620. The insertion part B can pass through the tooth ring 620. The cross section of the fixing seat 610 can be in a U shape, that is, the fixing seat 610 has a groove. The fixing seat 610 can clamp the insertion part B through the groove. The shape and structure of the fixing seat 610 can be determined according to actual needs by those skilled in the art, and the shape and structure are not limited here.
[0108] In some embodiments, the second fixing part can be a tooth ring. The tooth ring can be used to clamp the insertion part.
[0109] In some embodiments, referring to Figure 5 The driving part 300 comprises a motor 310 and a gear 320. The motor 310 drives the tooth ring 620 to rotate through the gear 320, and the tooth ring 620 can drive the insertion part B to rotate by the angle around the axial direction thereof. After stopping the automatic calibration, the insertion part B at this time can be fixed to the operation part A by a fixing nut b.
[0110] In some embodiments, the control part can acquire the image acquired by the camera in the insertion part in a wireless manner.
[0111] In some embodiments, the automatic calibration device further comprises an adapter wire. The camera in the insertion part can send the image acquired thereby to the control part.
[0112] In some embodiments, the first preset direction is a vertically upward direction. If the absolute value is not less than a preset angle threshold, the driving part is controlled to drive the insertion part to rotate by the angle around the axial direction thereof, comprising:
[0113] If the angle is positive, the driving part is controlled to drive the insertion part to rotate by the absolute value counterclockwise around the axial direction thereof; if the angle is negative, the driving part is controlled to drive the insertion part to rotate by the absolute value clockwise around the axial direction thereof.
[0114] It should be noted that the specific processing procedures and technical effects of the steps of collecting to judging performed by the control part are substantially the same as those of the steps S100 of collecting to the steps S400 of judging in the foregoing automatic calibration method, and thus will not be described here.
[0115] Some embodiments of the present application further disclose a computer readable storage medium comprising a program, which can be executed by a processor to implement the method of any one of the embodiments.
[0116] Various exemplary embodiments are described herein. However, it will be recognized by those skilled in the art that changes and modifications can be made to the exemplary embodiments without departing from the scope of the present disclosure. For example, various operational steps and components for carrying out the operational steps can be implemented in different sequences and / or omitted, combined, or combined in various ways than presented in the figures and / or descriptions without departing from the principles of the present disclosure.
[0117] In the above-described embodiments, all or part can be implemented by software, hardware, firmware, or any combination thereof. In addition, as understood by those skilled in the art, the principles herein can be reflected in a computer program product on a computer readable storage medium preloaded with computer readable program code. Any tangible, non-transitory computer readable storage medium can be used, including magnetic storage devices (hard disk, floppy disk, etc.), optical storage devices (CD-ROM, DVD, Blu Ray disc, etc.), flash memory, and / or the like. These computer program instructions can be loaded onto a general purpose computer, a special purpose computer, or other programmable data processing apparatus to produce a machine, so that these instructions executed on the computer or other programmable data processing apparatus can generate a device that implements the specified functions. These computer program instructions can also be stored in a computer readable memory that can instruct the computer or other programmable data processing apparatus to operate in a specific manner, so that the instructions stored in the computer readable memory can form a manufactured item that includes an implementation device that implements the specified functions. Computer program instructions can also be loaded onto a computer or other programmable data processing apparatus, so as to execute a series of operational steps on the computer or other programmable data processing apparatus to generate a computer-implemented process, so that the instructions executed on the computer or other programmable data processing apparatus can provide steps for implementing the specified functions.
[0118] Although the principles herein have been illustrated in various embodiments, many modifications in structure, arrangement, proportions, elements, materials, and components specially adapted to specific environments and operational requirements can be used without departing from the principles and scope of the present disclosure. The above modifications and other changes or modifications will be included within the scope of the principles herein.
[0119] The foregoing detailed description has been presented for purposes of illustration and description. However, various modifications and changes are possible in the implementation of the disclosure. Accordingly, the disclosure is intended to embrace all modifications and alterations within the scope and spirit of the disclosure. Thus, the scope of the disclosure is not intended to be limited to the particular form set forth herein, but includes all features that might be provided within the scope and spirit of the disclosure. Likewise, a variety of advantages and features have been set forth in the description herein with reference to the various embodiments. It is to be understood that not necessarily all advantages can be achieved in accordance with any particular embodiment. Further, solutions to problems can be appreciated by one skilled in the art upon reading the disclosure. Any feature, structure, material, or combination thereof described herein is meant to be illustrative and not restrictive. The scope of the disclosure is therefore intended to cover any variations, uses, or adaptations of the application including such departures from the present disclosure as come within known or customary practice in the art to which the disclosure pertains. The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting. The use of the terms "including", "comprising", or "having" and variations thereof herein is meant to encompass the items listed thereafter and equivalents thereof as well as additional items. Further, the use of the terms "coupled" and variations thereof is meant to encompass a direct connection between two elements and / or an indirect connection between two elements through one or more intervening elements.
[0120] Those skilled in the art will recognize that many modifications and variations of the described implementations can be made. It is therefore intended that the scope of the application be limited only by the breadth of the claims.
Claims
1. An automatic calibration method for an endoscope, characterized in that, The handle of the endoscope's operating part faces a first preset direction, and the axial direction of the endoscope's insertion part is perpendicular to the plane of the calibration plate; wherein, the calibration plate is provided with a preset mark for indicating a second preset direction, the preset mark comprising a plurality of straight line segments, one of which is used to characterize the second preset direction, and the angle between the first preset direction and the second preset direction is ninety degrees; this method includes: The acquisition steps are as follows: control the camera on the insertion part to acquire an image of the preset mark; acquire the image, perform image recognition on the image to obtain the preset mark in the image; determine the direction vector of a straight line segment in the image that represents the second preset direction, and calculate the angle between the direction vector of the straight line segment in the image that represents the second preset direction and the direction vector of the preset mark in the calibration plate; wherein, the direction vector of the preset mark in the calibration plate is predetermined; The judgment steps are as follows: determine whether the absolute value of the angle is less than a preset angle threshold; if the absolute value is not less than the preset angle threshold, drive the insertion part to rotate the angle around its axial direction, and repeat the acquisition steps to the judgment steps; if the absolute value is less than the preset angle threshold, stop automatic calibration.
2. The method as described in claim 1, characterized in that, The process of obtaining a preset identifier in the image through image recognition includes: The image is preprocessed to obtain a preprocessed image; Edge detection is performed on the preprocessed image to obtain multiple edge pixels; An edge image is obtained by performing dual threshold detection and edge connection processing on the multiple edge pixels; The edge image is processed to obtain the preset identifier in the image.
3. The method as described in claim 2, characterized in that, The process of preprocessing the image to obtain the preprocessed image includes: The image is converted to grayscale to obtain the grayscale image. The image after grayscale processing is subjected to Gaussian filtering to obtain the Gaussian filtered image. The preprocessed image is obtained by performing global binarization on the Gaussian filtered image.
4. The method as described in claim 2, characterized in that, The process of processing the edge image to obtain the preset identifier in the image includes: Transform all pixels in the edge image from the Cartesian coordinate system to the Hough parameter space to obtain multiple straight lines in the Hough parameter space; Determine the intersection point of the multiple lines; The preset identifier in the image is determined based on the intersection point.
5. The method as described in claim 1, characterized in that, The first preset direction is a vertically upward direction; the step of driving the insertion part to rotate around its axial direction by that angle if the absolute value is not less than a preset angle threshold includes: If the angle is positive, the insertion part is driven to rotate counterclockwise by the absolute value around its axial direction; if the angle is negative, the insertion part is driven to rotate clockwise by the absolute value around its axial direction.
6. An automatic calibration device for an endoscope, characterized in that, include: A calibration plate is provided with a preset mark for indicating a second preset direction. The preset mark includes several straight line segments, one of which is used to represent the second preset direction. The first fixing part is configured to fix the operating part of the endoscope, such that the handle of the operating part faces the first preset direction; wherein the axial direction of the insertion part of the endoscope is perpendicular to the plane where the calibration plate is located, and the angle between the first preset direction and the second preset direction is ninety degrees. The drive unit is configured to drive the insertion unit to rotate about its axial direction; The control unit is configured to perform the following steps: controlling the camera on the insertion unit to acquire an image of the preset identifier; acquiring the image, performing image recognition on the image to obtain the preset identifier in the image; determining the direction vector of a straight line segment in the image that represents the second preset direction, and calculating the angle between the direction vector of the straight line segment in the image that represents the second preset direction and the direction vector of the preset identifier in the calibration plate; wherein the direction vector of the preset identifier in the calibration plate is predetermined; performing the following judgment steps: judging whether the absolute value of the angle is less than a preset angle threshold; if the absolute value is not less than the preset angle threshold, controlling the drive unit to drive the insertion unit to rotate by the angle around its axial direction, and repeating the acquisition steps up to the judgment steps; if the absolute value is less than the preset angle threshold, stopping automatic calibration.
7. The automatic calibration device as described in claim 6, characterized in that, The automatic calibration device also includes a second fixing part, which includes a fixing seat for clamping the insertion part.
8. The automatic calibration device as described in claim 7, characterized in that, The second fixing part also includes a toothed ring, which is sleeved on the circumferential surface of the fixing seat. The driving part includes a motor and a gear; wherein the motor drives the toothed ring to rotate through the gear, so that the toothed ring drives the insertion part to rotate by the angle about its axial direction.
9. The automatic calibration device as described in claim 6, characterized in that, The first preset direction is a vertically upward direction; the step of controlling the driving unit to drive the insertion part to rotate around its axial direction by that angle if the absolute value is not less than a preset angle threshold includes: If the angle is positive, the control drive unit drives the insertion part to rotate counterclockwise by the absolute value around its axial direction; if the angle is negative, the control drive unit drives the insertion part to rotate clockwise by the absolute value around its axial direction.
10. A computer-readable storage medium, characterized in that, Includes a program that can be executed by a processor to implement the method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Method and device for calibrating external parameters of vehicle-mounted camera
CN108805934A
Method for identifying and positioning bolt of mechanical arm of tower-climbing robot, storage medium and terminal
CN115205286A