CN108938086A - Endoscope distortion correction method and operation navigation device - Google Patents

Endoscope distortion correction method and operation navigation device Download PDF

Info

Publication number
CN108938086A
CN108938086A CN201810590186.9A CN201810590186A CN108938086A CN 108938086 A CN108938086 A CN 108938086A CN 201810590186 A CN201810590186 A CN 201810590186A CN 108938086 A CN108938086 A CN 108938086A
Authority
CN
China
Prior art keywords
endoscope
center
visual field
field profile
mirror tube
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201810590186.9A
Other languages
Chinese (zh)
Inventor
杨峰
武潺
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ari Mai Di Medical Technology (beijing) Co Ltd
Original Assignee
Ari Mai Di Medical Technology (beijing) Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ari Mai Di Medical Technology (beijing) Co Ltd filed Critical Ari Mai Di Medical Technology (beijing) Co Ltd
Priority to CN201810590186.9A priority Critical patent/CN108938086A/en
Publication of CN108938086A publication Critical patent/CN108938086A/en
Pending legal-status Critical Current

Links

Classifications

    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B34/00Computer-aided surgery; Manipulators or robots specially adapted for use in surgery
    • A61B34/20Surgical navigation systems; Devices for tracking or guiding surgical instruments, e.g. for frameless stereotaxis
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B1/00Instruments for performing medical examinations of the interior of cavities or tubes of the body by visual or photographical inspection, e.g. endoscopes; Illuminating arrangements therefor
    • A61B1/00002Operational features of endoscopes
    • A61B1/00004Operational features of endoscopes characterised by electronic signal processing
    • A61B1/00009Operational features of endoscopes characterised by electronic signal processing of image signals during a use of endoscope
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B1/00Instruments for performing medical examinations of the interior of cavities or tubes of the body by visual or photographical inspection, e.g. endoscopes; Illuminating arrangements therefor
    • A61B1/00002Operational features of endoscopes
    • A61B1/0002Operational features of endoscopes provided with data storages
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B1/00Instruments for performing medical examinations of the interior of cavities or tubes of the body by visual or photographical inspection, e.g. endoscopes; Illuminating arrangements therefor
    • A61B1/00002Operational features of endoscopes
    • A61B1/00057Operational features of endoscopes provided with means for testing or calibration
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B1/00Instruments for performing medical examinations of the interior of cavities or tubes of the body by visual or photographical inspection, e.g. endoscopes; Illuminating arrangements therefor
    • A61B1/04Instruments for performing medical examinations of the interior of cavities or tubes of the body by visual or photographical inspection, e.g. endoscopes; Illuminating arrangements therefor combined with photographic or television appliances
    • G06T5/80
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/80Analysis of captured images to determine intrinsic or extrinsic camera parameters, i.e. camera calibration
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B34/00Computer-aided surgery; Manipulators or robots specially adapted for use in surgery
    • A61B34/20Surgical navigation systems; Devices for tracking or guiding surgical instruments, e.g. for frameless stereotaxis
    • A61B2034/2046Tracking techniques
    • A61B2034/2055Optical tracking systems
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B34/00Computer-aided surgery; Manipulators or robots specially adapted for use in surgery
    • A61B34/20Surgical navigation systems; Devices for tracking or guiding surgical instruments, e.g. for frameless stereotaxis
    • A61B2034/2046Tracking techniques
    • A61B2034/2065Tracking using image or pattern recognition
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B2576/00Medical imaging apparatus involving image processing or analysis

Abstract

The present invention provides endoscope distortion correction method and operation navigation device, this method comprises: obtaining the inner parameter matrix K of camera0And distortion parameter, and determine visual field profile Ω0Center w0And endoscope mark position p0;Determine the visual field profile Ω of the endoscope mirror tube under current locationiCenter wiAnd endoscope mark position pi;According to center w0And center w0, endoscope mark position p0And endoscope mark position pi, determine the angle that endoscope mirror tube is rotated from initial position to current location;According to spin matrix R and inner parameter matrix K0Determine the inner parameter matrix K of camera under current locationi;Based on inner parameter matrix KiDistortion parameter is corrected.Method and apparatus provided by the invention, the inner parameter matrix for capableing of rotation angle and camera based on endoscope correct the distortion parameter of image, eliminate influence of the distortion parameter to image.

Description

Endoscope distortion correction method and operation navigation device
Technical field
The present invention relates to surgical navigational field more particularly to a kind of endoscope distortion correction method and operation navigation devices.
Background technique
With the hair at full speed of Minimally Invasive Surgical Technology and accurate medical technology, the surgical navigation equipment based on image by Gradually become the important medical system of surgical operation.Surgical navigation equipment based on image is mainly believed using various medical images Breath, such as CT scan (Computed Tomography, CT), Magnetic resonance imaging (Magnetic Resonance Imaging, MRI), digital subtraction angiography (Digital Subtraction Angiography, DSA), The technologies such as positron e mission computed tomography (Positron Emission Computed Tomography, PET), Navigate for surgical instrument, provide the information of operative site attachment as far as possible for surgeon, by two-dimensional medical image with Connection is established between actual operation position, is reduced surgery operating wound to realize, shortens operating time and is improved surgical quality Purpose.
Existing Minimally Invasive Surgical Technology can carry out Minimally Invasive Surgery by medical endoscope, and medical rigid pipe endoscope passes through micro- Interior tissue is observed in small wound or natural hole road, for sufferer, has operative incision small, surgical procedure distress level is opposite For relatively low, the features such as post-operative recovery is fast, response light, patient can be greatly improved to the acceptance level of operation;To medical matters people For member, have many advantages, such as that the visual field is big, easy to operate, small in size.Medical endoscope is also widely used for auxiliary operation and auxiliary Treatment increases operation accuracy and safety.It is convenient in order to observe body cavity inner tissue or diseased organ when clinical use, it is medical Rigid pipe endoscope generally has different viewing directional angles, and common angle is 0 °, 25 °, 30 °, 45 °, 70 °, 90 ° and 110 °.Doctor exists Using different viewing directional angles rigid pipe endoscope when, can rotate endoscope often to observe the tissue of different directions.
Since endoscope lens are smaller, image radial distortion can be caused, interfere surgical navigational process.Radial distortion makes image Nonlinear geometry distortion occurs, pixel can be from picture centre along moving radially, such as straight line is due to radial distortion meeting Become a curved line.Violent image radial distortion will affect judgement of the doctor to organ shape size and depth, also can Influence doctor to image scene whether the judgement of plane.As it can be seen that existing endoscope lens asking there are endoscope radial distortion Topic.
Summary of the invention
The purpose of the present invention is to provide a kind of endoscope distortion correction method and operation navigation devices, solve in existing There is endoscope radial distortion in sight glass camera lens.
In order to solve the above technical problems, the present invention provides a kind of endoscope distortion correction methods, comprising:
S1, in the case where endoscope mirror tube and camera are in initial position, obtain the inner parameter matrix K of camera0And Distortion parameter, and determine the visual field profile Ω of the endoscope mirror tube described under the initial position0Center w0And endoscope mark Position p0
S2, in the case where endoscope mirror tube and camera are in current location, determine described under current location endoscope The visual field profile Ω of mirror tubeiCenter wiAnd endoscope mark position pi
S3, center wi, endoscope mark position p according to center w0 and visual field profile the Ω i of visual field profile Ω 00 And endoscope mark position pi, determine that the endoscope mirror tube is revolved from the initial position to the current location The angle turned;
S4, spin matrix R is determined based on the angle, according to the spin matrix R and the inner parameter matrix K0Really The inner parameter matrix K of the camera under settled front positioni
S5, it is based on the inner parameter matrix KiThe distortion parameter is corrected.
Preferably, the visual field profile Ω of the determination endoscope mirror tube0And endoscope mark position p0The step of Include:
S11, in the case where endoscope mirror tube and camera are in initial position, pass through the camera obtain picture frame;
S12, initialization elliptical image is obtained on described image frame;
S13, the initialization elliptical image is mapped as using the short axle of the initialization elliptical image as the circle of radius Image;
S14, the circular image is converted into the first image under polar coordinate system, by a line picture every in the first image The maximum pixel of gray-value variation maps back described image frame in vegetarian refreshments;
S15, the pixel mapped back in described image frame is fitted by RANSAC algorithm, is obtained ellipse Circle contour;
S16, using elliptic contour as the initialization elliptical image, re-execute n times step S13 to step S15, obtain The visual field profile Ω 0 of the endoscope mirror tube, and determine that the center w0 of the visual field profile Ω 0, the N are positive integer;
S17, the visual field profile Ω by the endoscope mirror tube0It is mapped as the visual field profile Ω 0 with the endoscope mirror tube Short axle be radius target circular image;
S18, the target circular image is transformed into the second image under polar coordinate system, by polar diameter in second image Maximum point is mapped to the corresponding target point of described image frame, using the target point position as the endoscope mark institute In position p0
Preferably, the S3, according to visual field profile Ω0Center w0And visual field profile ΩiCenter wi, endoscope mark Position p0And endoscope mark position pi, determine that the endoscope mirror tube is worked as from the initial position to described The angle that front position is rotated, comprising:
S31, by visual field profile Ω0Center w0, visual field profile ΩiCenter wiLine perpendicular bisector, peeped with interior Mirror mark position p0And endoscope mark position piLine perpendicular bisector intersection point as rotation in The heart;
S32, according to the rotation center, endoscope mark position p0 and endoscope mark position pi, Determine the angle rotated from the initial position to the current location.
Preferably, the S3, according to visual field profile Ω0Center w0And visual field profile ΩiCenter wi, endoscope mark Position p0And endoscope mark position pi, determine that the endoscope mirror tube is worked as from the initial position to described The angle that front position is rotated, comprising:
S33, in the case where endoscope mirror tube and camera are in transitional intermediate positions, determine under transitional intermediate positions institute State the visual field profile Ω of endoscope mirror tubehCenter wh, the transitional intermediate positions are described in the rotation endoscope mirror tube makes The relative position of endoscope and camera is adjusted from the initial position to any position during the current location;
S34, to visual field profile Ω0Center w0, visual field profile ΩiCenter wiAnd visual field profile ΩhCenter whIn Two centers carry out line, the first line segment is obtained, by visual field profile Ω0Center w0, visual field profile ΩiCenter wiAnd Visual field profile ΩhCenter whIn an endpoint of the not center on first line segment and first line segment carry out line, Second line segment is obtained, by the first perpendicular bisector of first line segment, with the second perpendicular bisector of the second line segment Intersection point is as rotation center;
S35, according to the rotation center, endoscope mark position p0 and endoscope mark position pi, Determine the angle rotated from the initial position to the current location.
Preferably, the S4, spin matrix R determined based on the angle, according to the spin matrix R and described internal join Matrix number K0Determine the inner parameter matrix K of the camera under current locationi, comprising:
S41, spin matrix R is calculated according to formula (1):
Wherein, R is spin matrix, and α is rotation angle, qxAnd qyFor the coordinate of rotary shaft subpoint;
S42, inner parameter matrix K is calculated according to formula (2)i: Ki=RK0
Wherein, R is spin matrix, KiFor inner parameter matrix Ki, K0For inner parameter matrix K0
In order to solve the above technical problems, the present invention also provides a kind of operation navigation devices, comprising:
Processing module, in the case where endoscope mirror tube and camera are in initial position, obtaining the inside ginseng of camera Matrix number K0And distortion parameter, and determine the visual field profile Ω of the endoscope mirror tube described under the initial position0Center w0And Endoscope mark position p0
First determining module, for determining in present bit in the case where endoscope mirror tube and camera are in current location Set the visual field profile Ω of the lower endoscope mirror tubeiCenter wiAnd endoscope mark position pi
Second determining module, for according to visual field profile Ω0Center w0And visual field profile ΩiCenter wi, endoscope mark Will position p0And endoscope mark position pi, determine the endoscope mirror tube from the initial position to described The angle that current location is rotated;
Third determining module, for determining spin matrix R based on the angle, according to the spin matrix R and it is described in Portion parameter matrix K0Determine the inner parameter matrix K of the camera under current locationi
Rectification module, for being based on the inner parameter matrix KiThe distortion parameter is corrected.
Preferably, the processing module includes:
First acquisition submodule, for passing through the phase in the case where endoscope mirror tube and camera are in initial position Machine obtains picture frame;
Second acquisition submodule, for obtaining initialization elliptical image on described image frame;
First mapping submodule, for being mapped as the initialization elliptical image with the short of the initialization elliptical image Axis is the circular image of radius;
First transform subblock, for the circular image to be converted to the first image under polar coordinate system, by described The maximum pixel of gray-value variation maps back described image frame in every a line pixel in one image;
It is fitted submodule, for carrying out by RANSAC algorithm to the pixel mapped back in described image frame Fitting, obtains elliptic contour;
Submodule is repeated, for controlling the first mapping submodule using elliptic contour as the initialization elliptical image Block, transform subblock and the fitting submodule successively re-execute n times movement, obtain the visual field profile of the endoscope mirror tube Ω 0, and determine that the center w0 of the visual field profile Ω 0, the N are positive integer;
Second mapping submodule, for by the visual field profile Ω of the endoscope mirror tube0It is mapped as with the endoscope The short axle of the visual field profile Ω 0 of pipe is the target circular image of radius;
Second transform subblock, for the target circular image to be transformed into the second image under polar coordinate system, by institute State the maximum point of polar diameter in the second image and be mapped to the corresponding target point of described image frame, using the target point position as Endoscope mark position p0
Preferably, second determining module includes:
First processing submodule, is used for visual field profile Ω0Center w0, visual field profile ΩiCenter wiLine hang down Straight bisector, with endoscope mark position p0And endoscope mark position piLine perpendicular bisector Intersection point is as rotation center;
First determines submodule, for according to the rotation center, endoscope mark position p0 and the endoscope Indicate position pi, determines the angle rotated from the initial position to the current location.
Preferably, second determining module includes:
Second processing submodule, for determining in the case where endoscope mirror tube and camera are in transitional intermediate positions The visual field profile Ω of the endoscope mirror tube under transitional intermediate positionshCenter wh, the transitional intermediate positions are to rotate in described Sight glass mirror tube adjusts the relative position of the endoscope and camera to the current location from the initial position Any position;
Second determines submodule, for visual field profile Ω0Center w0, visual field profile ΩiCenter wiAnd visual field Profile ΩhCenter whIn two centers carry out line, the first line segment is obtained, by visual field profile Ω0Center w0, visual field wheel Wide ΩiCenter wiAnd visual field profile ΩhCenter whIn the not center on first line segment and first line segment An endpoint carry out line, second line segment is obtained, by the first perpendicular bisector of first line segment, with the second line segment The second perpendicular bisector intersection point as rotation center;
Third determines submodule, according to the rotation center, endoscope mark position p0 and the endoscope mark Position pi determines the angle rotated from the initial position to the current location.
Preferably, the third determining module includes:
First computational submodule, for calculating spin matrix R according to formula (1):
Wherein, R is spin matrix, and α is rotation angle, qxAnd qyFor the coordinate of rotary shaft subpoint;
Second computational submodule, for calculating inner parameter matrix K according to formula (2)i: Ki=RK0
Wherein, R is spin matrix, KiFor inner parameter matrix Ki, K0For inner parameter matrix K0
The third aspect the present invention provides a kind of electronic equipment, including processor, memory and is stored in the memory Computer program that is upper and can running on the processor, the computer program is realized above-mentioned when being executed by the processor Endoscope distortion correction method the step of.
Fourth aspect, the present invention provides a kind of computer readable storage medium, on the computer readable storage medium It is stored with computer program, the computer program realizes the step of above-mentioned endoscope distortion correction method when being executed by processor Suddenly.
Endoscope distortion correction method provided by the invention and operation navigation device, can be based on the rotation angle of endoscope And the inner parameter matrix of camera corrects the distortion parameter of image, influence of the distortion parameter to image is eliminated, to drop Influence of the low distortion parameter to operation navigation procedure, improves the safety of surgical navigational.
Detailed description of the invention
Fig. 1 is the flow chart of one embodiment of endoscope distortion correction method provided by the invention;
Fig. 2 is that the endoscope is determined in the step S1 of endoscope distortion correction method shown in FIG. 1 provided by the invention The visual field profile Ω of mirror tube0And endoscope mark position p0Flow chart;
Fig. 3 is the process of an embodiment of the step S3 of endoscope distortion correction method shown in FIG. 1 provided by the invention Figure;
Fig. 4 is the stream of another embodiment of the step S3 of endoscope distortion correction method shown in FIG. 1 provided by the invention Cheng Tu;
Fig. 5 is the structural schematic diagram of an embodiment of endoscope provided by the invention;
Fig. 6 is the schematic diagram of one embodiment of endoscope profile provided by the invention;
Fig. 7 is the schematic diagram of another embodiment of endoscope profile provided by the invention;
Fig. 8 is the structure chart of an embodiment of operation navigation device provided by the invention;
Fig. 9 is the structure chart of one embodiment of processing module of operation navigation device shown in Fig. 8 provided by the invention;
Figure 10 is the structure of one embodiment of the second determining module of operation navigation device shown in Fig. 8 provided by the invention Figure;
Figure 11 is the structure of another embodiment of the second determining module of operation navigation device shown in Fig. 8 provided by the invention Figure;
Figure 12 is the structure of one embodiment of third determining module of operation navigation device shown in Fig. 8 provided by the invention Figure;
Figure 13 is the structure chart of an embodiment of electronic equipment provided by the invention.
Specific embodiment
For a clearer understanding of the technical characteristics, objects and effects of the present invention, this hair of Detailed description of the invention is now compareed Bright specific embodiment.
Referring to Fig. 1, Fig. 1 is the flow chart of one embodiment of endoscope distortion correction method provided by the invention, shown in FIG. 1 Endoscope distortion correction method can be applied to operation navigation device, as shown in Figure 1, endoscope distortion correction method includes following Step:
S1, in the case where endoscope mirror tube and camera are in initial position, obtain the inner parameter matrix K of camera0And Distortion parameter, and determine the visual field profile Ω of the endoscope mirror tube described under the initial position0Center w0And endoscope mark Position p0
Referring to Fig. 5, Fig. 5 is the structural schematic diagram of an embodiment of endoscope provided by the invention.Endoscope 500 includes Endoscope mirror tube 501, camera 502 and camera lens 503, wherein endoscope mirror tube 501 can be rotated around rotary shaft, thus band Index glass head 503 is rotated, and the fixation of camera 502 does not rotate, and the camera 502 may include the Charged Couple for acquiring image Element (Charge-coupled Device, CCD) target surface.In the use process of endoscope 500, endoscope mirror tube 501 can be with It rotates, camera lens is caused to rotate with camera, is i.e. camera lens 503 and the CCD target surface of acquisition image rotates, in camera lens 503 edge is provided with mark, which can be convenient the rotation position for judging endoscope for positioning, and the mark can be with For semicircle or wedge angle, it may be recessed inwardly or protrude outward.
In embodiments of the present invention, the inner parameter matrix K for obtaining camera0And the step of distortion parameter, may include Following steps: keeping endoscope mirror tube and the camera position for acquiring image to fix, and records the position where the mark on camera lens It sets and angle, as initial position.Endoscope is demarcated using Zhang Zhengyou calibration method, i.e., by endoscope and tessellated relative position Fixed, then switching endoscope, shoots multiple gridiron pattern pictures in different angle, detects X-comers automatically, be based on chessboard Lattice angle point calculates inner parameter matrix K0And distortion parameter, wherein inner parameter matrixcxAnd cyTable Show that principle point location, f indicate endoscope lens focal length fcWith CCD camera focal length fhProduct.Endoscope inner parameter K0, can be used for Distortion correction in endoscope real time rotation, distortion parameter include radial distortion parameter k1k2k3k4k5k6And tangential distortion parameter p1p2, the matrix K0With radial distortion parameter k1k2k3k4k5k6, tangential distortion parameter p1p2It can use open source computer view Feel that library (Open Source Computer Vision Library, openCV) library function is calculated, the reality of this library function Now it is based on Zhang Zhengyou camera calibration method.It should be noted that being also based on other standardizations, such as it can also be Tsai method.
In the present embodiment, it can be based on reflection transformation and RANSAC algorithm, determined in the initial position Under the endoscope mirror tube visual field profile Ω0Center w0And endoscope mark position p0.For example, can refering to Fig. 6, Fig. 6 is the schematic diagram of one embodiment of endoscope profile provided by the invention, and the endoscope under initial position is determined in Fig. 6 The visual field profile Ω of pipe0Center w0And endoscope mark position p0.
Optionally, referring to Fig. 2, Fig. 2 is the step S1 of endoscope distortion correction method shown in FIG. 1 provided by the invention The flow chart of the visual field profile Ω 0 and endoscope mark position p0 of the middle determination endoscope mirror tube;In step S1 Determine the center w of the visual field profile Ω 0 of the endoscope mirror tube described under the initial position0And endoscope mark position p0 It can be with step following steps:
S11, in the case where endoscope mirror tube and camera are in initial position, pass through the camera obtain picture frame.
For example, it can be endoscope 500 shown in fig. 5, be in initial bit in endoscope mirror tube 501 and camera 502 In the case where setting, picture frame is obtained by the camera 502.
S12, initialization elliptical image is obtained on described image frame.
In the present embodiment, the size for initializing elliptical image can be the customized arbitrary value of user with no restrictions.
S13, the initialization elliptical image is mapped as using the short axle of the initialization elliptical image as the circle of radius Image.
S14, the circular image is converted into the first image under polar coordinate system, by a line picture every in the first image The maximum pixel of gray-value variation maps back described image frame in vegetarian refreshments.
S15, the pixel mapped back in described image frame is fitted by RANSAC algorithm RANSAC, Obtain elliptic contour.
S16, using elliptic contour as the initialization elliptical image, re-execute n times step S13 to step S15, obtain The visual field profile Ω of the endoscope mirror tube0, and determine the visual field profile Ω0Center w0
In the present embodiment, the N is positive integer, for example, N can positive integer between 5-10.
S17, the visual field profile Ω by the endoscope mirror tube0It is mapped as the visual field profile Ω 0 with the endoscope mirror tube Short axle be radius target circular image.
S18, the target circular image is transformed into the second image under polar coordinate system, by polar diameter in second image Maximum point is mapped to the corresponding target point of described image frame, using the target point position as the endoscope mark institute In position p0
In this way, visual field profile Ω can be accurately calculated0And endoscope mark position p0, improve calculated result Accuracy.Only need the position indicated on tracking endoscope, so that it may which the rotation angle for calculating endoscope does not need external equipment survey Measure rotation angle.
S2, in the case where endoscope mirror tube and camera are in current location, determine described under current location endoscope The visual field profile Ω of mirror tubeiCenter wiAnd endoscope mark position pi
In the present embodiment, it can be based on reflection transformation and RANSAC algorithm, determine the institute under current location State the visual field profile Ω of endoscope mirror tubeiCenter wiAnd endoscope mark position pi.For example, referring to figure 6, the visual field profile Ω of endoscope mirror tube under current location is determined in Fig. 6iCenter wiAnd endoscope mark position pi.Specifically, visual field profile Ω can be determined by the step similar to step S11-S18iCenter wiAnd endoscope mark Will position pi.Specifically, determining visual field profile ΩiCenter wiAnd endoscope mark position pi, may include following Step:
S21, in the case where endoscope mirror tube and camera are in current location, pass through the camera obtain the first image Frame;
S22, the first initialization elliptical image is arbitrarily obtained on the first image frame;
S23, the first initialization elliptical image is mapped as with the short axle of the first initialization elliptical image being half First circular image of diameter;
S24, first circular image is converted into the third image under polar coordinate system, it will be each in the third image The maximum pixel of gray-value variation maps back the first image frame in row pixel;
S25, the pixel mapped back in the first image frame is fitted by RANSAC algorithm, is obtained To the first elliptic contour;
S26, elliptical image is initialized using the first elliptic contour as described first, re-executes n times step S23 to step S25 obtains the visual field profile Ω i of the endoscope mirror tube, and determines the visual field profile ΩiCenter wi, the N is positive whole Number;
S27, the visual field profile Ω by the endoscope mirror tubeiIt is mapped as the visual field profile Ω 0 with the endoscope mirror tube Short axle be radius first object circular image;
S28, the first object circular image is transformed into the 4th image under polar coordinate system, it will be in the 4th image The maximum point of polar diameter is mapped to the corresponding first object point of the first image frame, using the first object point position as Endoscope mark position pi.
S3, according to visual field profile Ω0Center w0And visual field profile ΩiCenter wi, endoscope mark position p0And Endoscope mark position pi, determine that the endoscope mirror tube is rotated from the initial position to the current location Angle.
It in the present embodiment, can be by visual field profile Ω0Center w0And visual field profile ΩiCenter wiLine is carried out, is obtained To third line segment, by endoscope mark position p0And endoscope mark position piLine is carried out, the 4th line is obtained Section, is determined as rotation center for the intersection point of the third perpendicular bisector of third line segment and the 4th perpendicular bisector of the 4th line segment, Rotation angle is determined based on rotation center and mark position.
Referring to Fig. 3, the reality that Fig. 3 is the step S3 of endoscope distortion correction method shown in FIG. 1 provided by the invention The flow chart of example is applied, step S3 may comprise steps of:
S31, by visual field profile Ω0Center w0, visual field profile ΩiCenter wiLine perpendicular bisector, peeped with interior Mirror mark position p0And endoscope mark position piLine perpendicular bisector intersection point as rotation in The heart;
S32, according to the rotation center, endoscope mark position p0 and endoscope mark position pi, Determine the angle rotated from the initial position to the current location.
Referring to Fig. 6, in Fig. 6, visual field profile Ω is connected0Center w0, visual field profile ΩiCenter wi, obtain Line segment w0wi, connect endoscope mark position p0And endoscope mark position pi, obtain line segment p0pi, by line segment w0wiAnd line segment p0piPerpendicular bisector intersection point as rotation center qi;According to the rotation center qiAnd endoscope mark institute In position p0And endoscope mark position pi, determine the folder rotated from the initial position to the current location Angle αi
Referring to Fig. 4, Fig. 4 is the another of the step S3 of endoscope distortion correction method shown in FIG. 1 provided by the invention The flow chart of embodiment, step S3 may comprise steps of:
S33, in the case where endoscope mirror tube and camera are in transitional intermediate positions, determine under transitional intermediate positions institute State the visual field profile Ω of endoscope mirror tubehCenter wh, the transitional intermediate positions are described in the rotation endoscope mirror tube makes The relative position of endoscope and camera is adjusted from the initial position to any position during the current location;
S34, to the center wh of the center w0 of visual field profile Ω 0, center wi and visual field profile the Ω h of visual field profile Ω i In two centers carry out line, obtain the first line segment, by the center w0 of visual field profile Ω 0, visual field profile Ω i center wi, And an endpoint of the center on first line segment and first line segment does not carry out in the center wh of visual field profile Ω h Line obtains second line segment, vertical with the second of the second line segment to divide equally by the first perpendicular bisector of first line segment The intersection point of line is as rotation center;
S35, according to the rotation center, endoscope mark position p0 and endoscope mark position pi, Determine the angle rotated from the initial position to the current location.
In the present embodiment, the visual field profile Ω of determination endoscope mirror tube under transitional intermediate positionshIn Heart whThe step of it is similar to step S11-S16, to avoid repeating, details are not described herein.
It for example, can be the schematic diagram of another embodiment of endoscope profile provided by the invention refering to Fig. 7, Fig. 7.? In Fig. 7, visual field profile Ω is connected0Center w0, visual field profile ΩhCenter wh, obtain line segment w0wh, connect visual field profile Ωh Center wh, visual field profile ΩiCenter wi, obtain line segment whwi, by line segment w0whAnd line segment whwiPerpendicular bisector intersection point As rotation center qi;According to the rotation center qiAnd endoscope mark position p0And the endoscope mark institute is in place Set pi, determine the angle α rotated from the initial position to the current locationi
S4, spin matrix R is determined based on the angle, according to the spin matrix R and the inner parameter matrix K0Really The inner parameter matrix K of the camera under settled front positioni
In the present embodiment, the spin matrix determined based on the angle, specifically, step S4 may include following step It is rapid:
S41, spin matrix R is calculated according to formula (1):Its In, R is spin matrix, and ∝ is rotation angle, qxAnd qyFor rotary shaft subpoint coordinate.
S42, inner parameter matrix K is calculated according to formula (2)i, Ki=RK0;Wherein, wherein R is spin matrix, KiIt is interior Portion parameter matrix Ki, K0For inner parameter matrix K0
In this way, only rotating angle according to the inner parameter of initial position and endoscope, so that it may calculate in any position and peep Mirror inner parameter can overcome endoscope rotation bring perturbed field variation according to the endoscope inner parameter on any position.
S5, it is based on the inner parameter matrix KiThe distortion parameter is corrected.
In the present embodiment, distortion parameter includes radial distortion parameter k1k2k3k4k5k6, tangential distortion parameter p1p2.It utilizes The distortion in real time correction of endoscopic images may be implemented in endoscopic camera inner parameter.Calculation formula (3) are as follows: x=Ki*Fk1, k2, k3, k4, k5, k6, p1, p2(X).X is the point coordinate in world coordinate system, and x is the point coordinate under pixel coordinate system, and Ki will World coordinate system is transformed under pixel coordinate system,Image is subjected to distortion in real time correction.
In this way, correct geometry fluoroscopy images can be presented with the distortion effects of real time correction endoscope, meet real-time Property require, and it is low to computing resource configuration requirement, it is easy to spread;In addition, the endoscope distortion that the embodiment of the present invention improves is rectified Correction method can be applied to any type of endoscopic apparatus, do not need any foreign intervention can be automatically performed radial distortion rectify Just, do not increase operating difficulty, not will receive the external interference blocked, do not change the operating habit of doctor, there is higher be applicable in Property and practicability.
The endoscope distortion correction method provided in the embodiment of the present invention, can be based on the rotation angle and camera of endoscope Inner parameter matrix the distortion parameter of image is corrected, influence of the distortion parameter to image is eliminated, to reduce distortion Influence of the parameter to operation navigation procedure, improves the safety of surgical navigational.
The present invention further provides a kind of operation navigation devices.Referring to Fig. 8, Fig. 8 is that surgical navigational provided by the invention is set The structure chart of a standby embodiment, as shown in figure 8, operation navigation device 800 include processing module 801, the first determining module 802, Second determining module 803, third determining module 804 and rectification module 805;Processing module 801 and the first determining module 802 connect It connecing, the first determining module 802 is connect with the second determining module 803, and the second determining module 803 is connect with third determining module 804, Third determining module 804 is connect with rectification module 805, in which:
Processing module 801, for obtaining the inside of camera in the case where endoscope mirror tube and camera are in initial position Parameter matrix K0And distortion parameter, and determine the visual field profile Ω of the endoscope mirror tube described under the initial position0Center w0 And endoscope mark position p0
First determining module 802, for determining current in the case where endoscope mirror tube and camera are in current location The visual field profile Ω of the endoscope mirror tube under positioniCenter wiAnd endoscope mark position pi
Second determining module 803, for according to visual field profile Ω0Center w0And visual field profile ΩiCenter wi, interior peep Mirror mark position p0And endoscope mark position pi, determine the endoscope mirror tube from the initial position to The angle that the current location is rotated;
Third determining module 804, for determining spin matrix R based on the angle, according to the spin matrix R and described Inner parameter matrix K0Determine the inner parameter matrix K of the camera under current locationi
Rectification module 805, for being based on the inner parameter matrix KiThe distortion parameter is corrected.
In the present embodiment, referring to Fig. 5, endoscope 500 shown in fig. 5 includes endoscope mirror tube 501, camera 502 and camera lens 503, wherein endoscope mirror tube 501 can be rotated around rotary shaft, so that camera lens 503 is driven to be rotated, The fixation of camera 502 does not rotate, and the camera 502 may include the charge coupled cell (Charge- for acquiring image Coupled Device, CCD) target surface.In the use process of endoscope 500, endoscope mirror tube 501 can be rotated, and be led Camera lens is caused to rotate with camera, i.e. camera lens 503 and the CCD target surface of acquisition image rotates, and is arranged at the edge of camera lens 503 There is mark, which can be convenient the rotation position for judging endoscope, the mark can be semicircle or point for positioning Angle protrudes outward after may being recessed inwardly.
In embodiments of the present invention, the processing module 801 is also used in holding endoscope mirror tube and for acquiring image Camera position it is fixed in the case where, the position where the mark on camera lens and angle are recorded, as initial position;Using just Friendly standardization demarcates endoscope, i.e., fixes endoscope and tessellated relative position, then switching endoscope, in different angle Multiple gridiron pattern pictures are shot, detect X-comers automatically, calculate inner parameter matrix K 0 and distortion based on X-comers Parameter, wherein inner parameter matrixcxAnd cyIndicate that principle point location, f indicate endoscope lens focal length fcWith CCD camera focal length fhProduct.Endoscope inner parameter K0, for the distortion correction in endoscope real time rotation, distortion parameter Including radial distortion parameter k1k2k3k4k5k6And tangential distortion parameter p1p2, the matrix K0And radial distortion parameter k1k2k3k4k5k6, tangential distortion parameter p1p2It can use open source computer vision library (Open Source Computer Vision Library, openCV) library function is calculated, and the realization of this library function is based on Zhang Zhengyou camera calibration method.It needs It is noted that being also based on other standardizations, such as it can also be Tsai method.
In the present embodiment, it can be based on reflection transformation and RANSAC algorithm, determined in the initial position Under the endoscope mirror tube visual field profile Ω0Center w0And endoscope mark position p0.For example, can refering to Fig. 6, Fig. 6 is the schematic diagram of one embodiment of endoscope profile provided by the invention, and the endoscope under initial position is determined in Fig. 6 The visual field profile Ω of pipe0Center w0And endoscope mark position p0
Optionally, referring to Fig. 9, the processing module 801 includes:
First acquisition submodule 8011, for passing through institute in the case where endoscope mirror tube and camera are in initial position It states camera and obtains picture frame;
Second acquisition submodule 8012, for obtaining initialization elliptical image on described image frame;
First mapping submodule 8013, for being mapped as the initialization elliptical image with the initialization elliptical image Short axle be radius circular image;
First transform subblock 8014, for the circular image to be converted to the first image under polar coordinate system, by institute State in the first image that the maximum pixel of gray-value variation maps back described image frame in every a line pixel;
It is fitted submodule 8015, for passing through RANSAC algorithm to the pixel mapped back in described image frame It is fitted, obtains elliptic contour;
Submodule 8016 is repeated, for controlling first mapping using elliptic contour as the initialization elliptical image Submodule, transform subblock and the fitting submodule successively re-execute n times movement, obtain the visual field of the endoscope mirror tube Profile Ω0, and determine the visual field profile Ω0Center w0, the N is positive integer;
Second mapping submodule 8017, for by the visual field profile Ω of the endoscope mirror tube0It is mapped as interior peeping with described The short axle of the visual field profile Ω 0 of mirror mirror tube is the target circular image of radius;
Second transform subblock 8018, for the target circular image to be transformed into the second image under polar coordinate system, The maximum point of polar diameter in second image is mapped to the corresponding target point of described image frame, by the target point position As endoscope mark position p0
In the present embodiment, endoscope can be endoscope 500 shown in fig. 5, in endoscope mirror tube 501 and camera 502 In the case where initial position, picture frame is obtained by the camera 502.In the present embodiment, elliptical image is initialized Size can be the customized arbitrary value of user with no restrictions.In the present embodiment, the N is positive integer, for example, N can be Positive integer between 5-10.
In this way, visual field profile Ω can be accurately calculated0And endoscope mark position p0, improve calculated result Accuracy.Only need the position indicated on tracking endoscope, so that it may which the rotation angle for calculating endoscope does not need external equipment survey Measure rotation angle.
In the present embodiment, it can be based on reflection transformation and RANSAC algorithm, determine the institute under current location State the visual field profile Ω of endoscope mirror tubeiCenter wiAnd endoscope mark position pi.For example, referring to figure 6, the visual field profile Ω of endoscope mirror tube under current location is determined in Fig. 6iCenter wiAnd endoscope mark position pi.Specifically, visual field profile Ω can be determined by the step similar to step S11-S18iCenter wiAnd endoscope mark Will position pi
Specifically, first determining module 802, is also used to the case where endoscope mirror tube and camera are in current location Under, the first picture frame is obtained by the camera;The first initialization elliptical image is arbitrarily obtained on the first image frame;It will The first initialization elliptical image is mapped as using the short axle of the first initialization elliptical image as the first circular diagram of radius Picture;First circular image is converted into the third image under polar coordinate system, by a line pixel every in the third image The middle maximum pixel of gray-value variation maps back the first image frame;By RANSAC algorithm to mapping back The pixel stated in the first picture frame is fitted, and obtains the first elliptic contour;Using the first elliptic contour as at the beginning of described first Beginningization elliptical image re-executes n times step S23 to step S25, obtains the visual field profile Ω of the endoscope mirror tubei, and really The fixed visual field profile ΩiCenter wi, the N is positive integer;By the visual field profile Ω of the endoscope mirror tubeiBe mapped as with The short axle of the visual field profile Ω 0 of the endoscope mirror tube is the first object circular image of radius;The first object is round Image is transformed into the 4th image under polar coordinate system, and the maximum point of polar diameter in the 4th image is mapped to the first image The corresponding first object point of frame, using the first object point position as endoscope mark position pi
In the present embodiment, second determining module 803 can be by visual field profile Ω0Center w0And visual field profile Ωi Center wiLine is carried out, third line segment is obtained, by endoscope mark position p0And endoscope mark position pi Line is carried out, the 4th line segment is obtained, by the 4th perpendicular bisector of the third perpendicular bisector of third line segment and the 4th line segment Intersection point is determined as rotation center, determines rotation angle based on rotation center and mark position.
It is optional, refering to fig. 10, second determining module 803 includes:
First processing submodule 8031, is used for visual field profile Ω0Center w0, visual field profile ΩiCenter wiLine Perpendicular bisector, with endoscope mark position p0And endoscope mark position piLine vertically divide equally The intersection point of line is as rotation center;
First determine submodule 8032, for according to the rotation center, endoscope mark position p0 and it is described in Sight glass mark position pi determines the angle rotated from the initial position to the current location.
Referring to Fig. 6, in Fig. 6, visual field profile Ω is connected0Center w0, visual field profile ΩiCenter wi, obtain Line segment w0wi, connect endoscope mark position p0And endoscope mark position pi, obtain line segment p0pi, by line segment w0wiAnd line segment p0piPerpendicular bisector intersection point as rotation center qi;According to the rotation center qiAnd endoscope mark institute In position p0And endoscope mark position pi, determine the folder rotated from the initial position to the current location Angle αi
It is optional, refering to fig. 11, second determining module 803 includes:
Second processing submodule 8033 is used in the case where endoscope mirror tube and camera are in transitional intermediate positions, really It is scheduled on the visual field profile Ω of the endoscope mirror tube under transitional intermediate positionshCenter wh, the transitional intermediate positions are rotation institute Stating endoscope mirror tube adjusts the relative position of the endoscope and camera to the current location mistake from the initial position Any position in journey;
Second determine submodule 8034, for center w0, visual field profile Ω i to visual field profile Ω 0 center wi and Two centers in the center wh of visual field profile Ω h carry out line, obtain the first line segment, by the center w0 of visual field profile Ω 0, view The not center on first line segment and described first in the center wh of center wi and visual field profile the Ω h of profile Ω i One endpoint of line segment carries out line, second line segment is obtained, by the first perpendicular bisector of first line segment, with described second The intersection point of second perpendicular bisector of line segment is as rotation center;
Third determines submodule 8035, according to the rotation center, endoscope mark position p0 and the endoscope Indicate position pi, determines the angle rotated from the initial position to the current location.
In the present embodiment, the visual field profile Ω of determination endoscope mirror tube under transitional intermediate positionshIn Heart whThe step of it is similar to step S11-S16, to avoid repeating, details are not described herein.
It for example, can be the schematic diagram of another embodiment of endoscope profile provided by the invention refering to Fig. 7, Fig. 7.? In Fig. 7, visual field profile Ω is connected0Center w0, visual field profile ΩhCenter wh, obtain line segment w0wh, connect visual field profile Ωh Center wh, visual field profile ΩiCenter wi, obtain line segment whwi, by line segment w0whAnd line segment whwiPerpendicular bisector intersection point As rotation center qi;According to the rotation center qiAnd endoscope mark position p0And the endoscope mark institute is in place Set pi, determine the angle α rotated from the initial position to the current locationi
Optionally, refering to fig. 12, the third determining module 804 includes:
First computational submodule 8041, for calculating spin matrix R according to formula (1):
Wherein, R is spin matrix, and α is rotation angle, qxAnd qyFor the coordinate of rotary shaft subpoint;
Second computational submodule 8042, for calculating inner parameter matrix K i:K according to formula (2)i=RK0
Wherein, R is spin matrix, KiFor inner parameter matrix Ki, K0For inner parameter matrix K0
In this way, only rotating angle according to the inner parameter of initial position and endoscope, so that it may calculate in any position and peep Mirror inner parameter can overcome endoscope rotation bring perturbed field variation according to the endoscope inner parameter on any position.
In the present embodiment, distortion parameter includes radial distortion parameter k1k2k3k4k5k6, tangential distortion parameter p1p2.It utilizes The distortion in real time correction of endoscopic images may be implemented in endoscopic camera inner parameter.Calculation formula (3) are as follows: x=Ki*Fk1, k2, k3, k4, k5, k6, p1, p2(X).X is the point coordinate in world coordinate system, and x is the point coordinate under pixel coordinate system, KiBy generation Boundary's coordinate system is transformed under pixel coordinate system,Image is subjected to distortion in real time correction.It is described Rectification module 805 can be based on formula (3): x=Ki*Fk1, k2, k3, k4, k5, k6, p1, p2(X) it is calculated, image is carried out Distortion in real time correction.
In this way, correct geometry fluoroscopy images can be presented with the distortion effects of real time correction endoscope, meet real-time Property require, and it is low to computing resource configuration requirement, it is easy to spread;In addition, the endoscope distortion that the embodiment of the present invention improves is rectified Correction method can be applied to any type of endoscopic apparatus, do not need any foreign intervention can be automatically performed radial distortion rectify Just, do not increase operating difficulty, not will receive the external interference blocked, do not change the operating habit of doctor, there is higher be applicable in Property and practicability.
The operation navigation device provided in the embodiment of the present invention, can be based on the rotation angle of endoscope and the inside of camera Parameter matrix corrects the distortion parameter of image, influence of the distortion parameter to image is eliminated, to reduce distortion parameter pair The influence of surgical navigational process improves the safety of surgical navigational.
The present invention further provides a kind of electronic equipment.It is that electronics provided in an embodiment of the present invention is set referring to Figure 13, Figure 13 Standby structure chart, as shown in figure 13, electronic equipment 1300 include: processor 1301, bus interface and transceiver 1302, in which:
Processor 1301, for obtaining the inside of camera in the case where endoscope mirror tube and camera are in initial position Parameter matrix K0And distortion parameter, and determine the visual field profile Ω of the endoscope mirror tube described under the initial position0Center w0 And endoscope mark position p0;In the case where endoscope mirror tube and camera are in current location, determine in current location Under the endoscope mirror tube visual field profile ΩiCenter wiAnd endoscope mark position pi;According to visual field profile Ω0Center w0And visual field profile ΩiCenter wi, endoscope mark position p0And endoscope mark position pi, determine the angle that the endoscope mirror tube is rotated from the initial position to the current location;It is true based on the angle Spin matrix R is determined, according to the spin matrix R and the inner parameter matrix K0Determine the inside of the camera under current location Parameter matrix Ki;Based on the inner parameter matrix KiThe distortion parameter is corrected.
Optionally, processor 1301 are also used to pass through institute in the case where endoscope mirror tube and camera are in initial position It states camera and obtains picture frame;Initialization elliptical image is obtained on described image frame;The initialization elliptical image is mapped as Using the short axle of the initialization elliptical image as the circular image of radius;The circular image is converted to under polar coordinate system The maximum pixel of gray-value variation in a line pixel every in the first image is mapped back described image frame by one image; The pixel mapped back in described image frame is fitted by RANSAC algorithm, obtains elliptic contour;It will be ellipse Circle contour re-executes n times step S13 to step S15 as the initialization elliptical image, obtains the endoscope mirror tube Visual field profile Ω0, and determine the visual field profile Ω0Center w0, the N is positive integer;By the visual field of the endoscope mirror tube Profile Ω0It is mapped as the visual field profile Ω with the endoscope mirror tube0Short axle be radius target circular image;By the mesh Mark circular image is transformed into the second image under polar coordinate system, and the maximum point of polar diameter in second image is mapped to the figure As the corresponding target point of frame, using the target point position as endoscope mark position p0
Optionally, processor 1301 are also used to visual field profile Ω0Center w0, visual field profile ΩiCenter wiCompany The perpendicular bisector of line, with endoscope mark position p0And endoscope mark position piLine it is vertical flat The intersection point of separated time is as rotation center;According to the rotation center, endoscope mark position p0 and the endoscope mark Position pi determines the angle rotated from the initial position to the current location.
Optionally, processor 1301 are also used in the case where endoscope mirror tube and camera are in transitional intermediate positions, really It is scheduled on the visual field profile Ω of the endoscope mirror tube under transitional intermediate positionshCenter wh, the transitional intermediate positions are rotation institute Stating endoscope mirror tube adjusts the relative position of the endoscope and camera to the current location mistake from the initial position Any position in journey;To visual field profile Ω0Center w0, visual field profile ΩiCenter wiAnd visual field profile ΩhCenter whIn two centers carry out line, the first line segment is obtained, by visual field profile Ω0Center w0, visual field profile ΩiCenter wi、 And visual field profile ΩhCenter whIn an endpoint of the not center on first line segment and first line segment carry out Line obtains second line segment, vertical with the second of the second line segment to divide equally by the first perpendicular bisector of first line segment The intersection point of line is as rotation center;According to the rotation center, endoscope mark position p0 and the endoscope mark institute In position pi, the angle rotated from the initial position to the current location is determined.
Optionally, processor 1301 are also used to calculate spin matrix R according to formula (1):
Wherein, R is spin matrix, and α is rotation angle, qxAnd qyFor the coordinate of rotary shaft subpoint;It is counted according to formula (2) Calculate inner parameter matrix Ki: Ki=RK0;Wherein, R is spin matrix, KiFor inner parameter matrix Ki, K0For inner parameter matrix K0
In embodiments of the present invention, client 1300 further include: memory 1303.In Figure 13, bus architecture be can wrap The bus and bridge of any number of interconnection are included, the one or more processors and memory 1303 specifically represented by processor 1301 The various circuits of the memory of representative link together.Bus architecture can also will such as peripheral equipment, voltage-stablizer and power tube Various other circuits of reason circuit or the like link together, and these are all it is known in the art, therefore, herein no longer to it It is described further.Bus interface provides interface.Transceiver 1302 can be multiple element, that is, include transmitter and reception Machine provides the unit for communicating over a transmission medium with various other devices.Processor 1301 be responsible for management bus architecture and Common processing, memory 1303 can store the used data when executing operation of processor 1301.
The embodiment of the present invention also provides a kind of computer readable storage medium, and meter is stored on computer readable storage medium Calculation machine program, the computer program realize each mistake of the embodiment of above-mentioned endoscope distortion correction method when being executed by processor Journey, and identical technical effect can be reached, to avoid repeating, which is not described herein again.Wherein, the computer-readable storage medium Matter, such as read-only memory (Read-Only Memory, abbreviation ROM), random access memory (Random Access Memory, abbreviation RAM), magnetic or disk etc..
The above is only a preferred embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills Art field, is included within the scope of the present invention.

Claims (12)

1. a kind of endoscope distortion correction method characterized by comprising
S1, in the case where endoscope mirror tube and camera are in initial position, obtain the inner parameter matrix K of camera0And distortion ginseng Number, and determine the visual field profile Ω of the endoscope mirror tube described under the initial position0Center w0And endoscope mark institute is in place Set p0
S2, in the case where endoscope mirror tube and camera are in current location, determine described under current location endoscope mirror tube Visual field profile ΩiCenter wiAnd endoscope mark position pi
S3, according to visual field profile Ω0Center w0And visual field profile ΩiCenter wi, endoscope mark position p0And it is described Endoscope mark position pi, determine the folder that the endoscope mirror tube is rotated from the initial position to the current location Angle;
S4, spin matrix R is determined based on the angle, according to the spin matrix R and the inner parameter matrix K0It determines current The inner parameter matrix K of the camera under positioni
S5, it is based on the inner parameter matrix KiThe distortion parameter is corrected.
2. endoscope distortion correction method as described in claim 1, which is characterized in that the determination is under the initial position The visual field profile Ω of the endoscope mirror tube0Center w0And endoscope mark position p0The step of include:
S11, in the case where endoscope mirror tube and camera are in initial position, pass through the camera obtain picture frame;
S12, initialization elliptical image is obtained on described image frame;
S13, the initialization elliptical image is mapped as using the short axle of the initialization elliptical image as the circular image of radius;
S14, the circular image is converted into the first image under polar coordinate system, by a line pixel every in the first image The middle maximum pixel of gray-value variation maps back described image frame;
S15, the pixel mapped back in described image frame is fitted by RANSAC algorithm, obtains elliptic wheel It is wide;
S16, using elliptic contour as the initialization elliptical image, re-execute n times step S13 to step S15, obtain described The visual field profile Ω of endoscope mirror tube0, and determine the visual field profile Ω0Center w0, the N is positive integer;
S17, the visual field profile Ω by the endoscope mirror tube0It is mapped as the visual field profile Ω with the endoscope mirror tube0Short axle For the target circular image of radius;
S18, the target circular image is transformed into the second image under polar coordinate system, polar diameter in second image is maximum Point be mapped to the corresponding target point of described image frame, the target point position is in place as endoscope mark institute Set p0
3. endoscope distortion correction method as claimed in claim 2, which is characterized in that the S3, according to visual field profile Ω0's Center w0And visual field profile ΩiCenter wi, endoscope mark position p0And endoscope mark position pi, determine The angle that the endoscope mirror tube is rotated from the initial position to the current location, comprising:
S31, by visual field profile Ω0Center w0, visual field profile ΩiCenter wiLine perpendicular bisector, with endoscope mark Will position p0And endoscope mark position piLine perpendicular bisector intersection point as rotation center;
S32, according to the rotation center, endoscope mark position p0 and endoscope mark position pi, determine The angle rotated from the initial position to the current location.
4. endoscope distortion correction method as claimed in claim 2, which is characterized in that the S3, according to visual field profile Ω0's Center w0And visual field profile ΩiCenter wi, endoscope mark position p0And endoscope mark position pi, determine The angle that the endoscope mirror tube is rotated from the initial position to the current location, comprising:
S33, in the case where endoscope mirror tube and camera are in transitional intermediate positions, determine under transitional intermediate positions it is described in The visual field profile Ω of sight glass mirror tubehCenter wh, the transitional intermediate positions are to rotate the endoscope mirror tube to peep in described The relative position of mirror and camera is adjusted from the initial position to any position during the current location;
S34, to visual field profile Ω0Center w0, visual field profile ΩiCenter wiAnd visual field profile ΩhCenter whIn two A center carries out line, the first line segment is obtained, by visual field profile Ω0Center w0, visual field profile ΩiCenter wiAnd visual field Profile ΩhCenter whIn an endpoint of the not center on first line segment and first line segment carry out line, obtain Second line segment, the intersection point by the first perpendicular bisector of first line segment, with the second perpendicular bisector of the second line segment As rotation center;
S35, according to the rotation center, endoscope mark position p0 and endoscope mark position pi, determine The angle rotated from the initial position to the current location.
5. such as the described in any item endoscope distortion correction methods of Claims 1-4, which is characterized in that the S4, based on described Angle determines spin matrix R, according to the spin matrix R and the inner parameter matrix K0Determine the camera under current location Inner parameter matrix Ki, comprising:
S41, spin matrix R is calculated according to formula (1):
Wherein, R is spin matrix, and α is rotation angle, qxAnd qyFor the coordinate of rotary shaft subpoint;
S42, inner parameter matrix K is calculated according to formula (2)i: Ki=RK0
Wherein, R is spin matrix, KiFor inner parameter matrix Ki, K0For inner parameter matrix K0
6. a kind of operation navigation device characterized by comprising
Processing module, for obtaining the inner parameter square of camera in the case where endoscope mirror tube and camera are in initial position Battle array K0And distortion parameter, and determine the visual field profile Ω of the endoscope mirror tube described under the initial position0Center w0And it interior peeps Mirror mark position p0
First determining module, for determining under current location in the case where endoscope mirror tube and camera are in current location The visual field profile Ω of the endoscope mirror tubeiCenter wiAnd endoscope mark position pi
Second determining module, for according to visual field profile Ω0Center w0And visual field profile ΩiCenter wi, endoscope mark institute In position p0And endoscope mark position pi, determine the endoscope mirror tube from the initial position to described current The angle that position is rotated;
Third determining module, for determining spin matrix R based on the angle, according to the spin matrix R and the internal ginseng Matrix number K0Determine the inner parameter matrix K of the camera under current locationi
Rectification module, for being based on the inner parameter matrix KiThe distortion parameter is corrected.
7. operation navigation device as claimed in claim 6, which is characterized in that the processing module includes:
First acquisition submodule, for being obtained by the camera in the case where endoscope mirror tube and camera are in initial position Take picture frame;
Second acquisition submodule, for obtaining initialization elliptical image on described image frame;
First mapping submodule, for by it is described initialization elliptical image be mapped as with it is described initialization elliptical image short axle be The circular image of radius;
First transform subblock, for the circular image to be converted to the first image under polar coordinate system, by first figure The maximum pixel of gray-value variation maps back described image frame in every a line pixel as in;
It is fitted submodule, for intending by RANSAC algorithm the pixel mapped back in described image frame It closes, obtains elliptic contour;
Submodule is repeated, for first mapping submodule being controlled, being turned using elliptic contour as the initialization elliptical image It changes submodule and the fitting submodule successively re-executes n times movement, obtain the visual field profile Ω of the endoscope mirror tube0, And determine the visual field profile Ω0Center w0, the N is positive integer;
Second mapping submodule, for by the visual field profile Ω of the endoscope mirror tube0It is mapped as with the view of the endoscope mirror tube Field profile Ω0Short axle be radius target circular image;
Second transform subblock, for the target circular image to be transformed into the second image under polar coordinate system, by described The maximum point of polar diameter is mapped to the corresponding target point of described image frame in two images, using the target point position as described in Endoscope mark position p0
8. operation navigation device as claimed in claim 7, which is characterized in that second determining module includes:
First processing submodule, is used for visual field profile Ω0Center w0, visual field profile ΩiCenter wiLine it is vertical flat Separated time, with endoscope mark position p0And endoscope mark position piLine perpendicular bisector intersection point As rotation center;
First determines submodule, for according to the rotation center, endoscope mark position p0 and the endoscope mark Position pi determines the angle rotated from the initial position to the current location.
9. operation navigation device as claimed in claim 7, which is characterized in that second determining module includes:
Second processing submodule, for determining in centre in the case where endoscope mirror tube and camera are in transitional intermediate positions The visual field profile Ω of the endoscope mirror tube under crossover positionhCenter wh, the transitional intermediate positions are to rotate the endoscope Mirror tube makes the relative position of the endoscope and camera adjust appointing to the current location from the initial position One position;
Second determines submodule, for visual field profile Ω0Center w0, visual field profile ΩiCenter wiAnd visual field profile ΩhCenter whIn two centers carry out line, the first line segment is obtained, by visual field profile Ω0Center w0, visual field profile Ωi Center wiAnd visual field profile ΩhCenter whIn one of the not center on first line segment and first line segment Endpoint carry out line, obtain second line segment, by the first perpendicular bisector of first line segment, with the second line segment second The intersection point of perpendicular bisector is as rotation center;
Third determines submodule, according to where the rotation center, endoscope mark position p0 and the endoscope mark Position pi determines the angle rotated from the initial position to the current location.
10. such as the described in any item operation navigation devices of claim 6 to 9, which is characterized in that the third determining module packet It includes:
First computational submodule, for calculating spin matrix R according to formula (1):
Wherein, R is spin matrix, and α is rotation angle, qxAnd qyFor the coordinate of rotary shaft subpoint;
Second computational submodule, for calculating inner parameter matrix K according to formula (2)i: Ki=RK0;Wherein, R is spin matrix, KiFor inner parameter matrix Ki, K0For inner parameter matrix K0
11. a kind of electronic equipment, which is characterized in that including processor, memory and be stored on the memory and can be in institute The computer program run on processor is stated, such as claim 1 to 5 is realized when the computer program is executed by the processor Any one of described in endoscope distortion correction method the step of.
12. a kind of computer readable storage medium, which is characterized in that be stored with computer on the computer readable storage medium Program realizes that the endoscope distortion as described in any one of claims 1 to 5 is rectified when the computer program is executed by processor The step of correction method.
CN201810590186.9A 2018-06-08 2018-06-08 Endoscope distortion correction method and operation navigation device Pending CN108938086A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810590186.9A CN108938086A (en) 2018-06-08 2018-06-08 Endoscope distortion correction method and operation navigation device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810590186.9A CN108938086A (en) 2018-06-08 2018-06-08 Endoscope distortion correction method and operation navigation device

Publications (1)

Publication Number Publication Date
CN108938086A true CN108938086A (en) 2018-12-07

Family

ID=64488183

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810590186.9A Pending CN108938086A (en) 2018-06-08 2018-06-08 Endoscope distortion correction method and operation navigation device

Country Status (1)

Country Link
CN (1) CN108938086A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109620409A (en) * 2019-01-14 2019-04-16 艾瑞迈迪科技石家庄有限公司 A kind of external tothe endoscope parameter real-time optimization system and method
US20220392110A1 (en) * 2019-10-07 2022-12-08 S&N Orion Prime, S.A. Systems And Methods For Characterization Of An Endoscope And Automatic Calibration Of An Endoscopic Camera System

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103827917A (en) * 2011-07-25 2014-05-28 科英布拉大学 Method and apparatus for automatic camera calibration using one or more images of a checkerboard pattern

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103827917A (en) * 2011-07-25 2014-05-28 科英布拉大学 Method and apparatus for automatic camera calibration using one or more images of a checkerboard pattern

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109620409A (en) * 2019-01-14 2019-04-16 艾瑞迈迪科技石家庄有限公司 A kind of external tothe endoscope parameter real-time optimization system and method
US20220392110A1 (en) * 2019-10-07 2022-12-08 S&N Orion Prime, S.A. Systems And Methods For Characterization Of An Endoscope And Automatic Calibration Of An Endoscopic Camera System

Similar Documents

Publication Publication Date Title
US11100636B2 (en) Systems, devices, and methods for tracking and compensating for patient motion during a medical imaging scan
US11737828B2 (en) System and method for medical device placement
US11123144B2 (en) Registration of frames of reference
US20240090950A1 (en) System and method using augmented reality with shape alignment for medical device placement
US20010035871A1 (en) System and method for generating an image
US20220383588A1 (en) Systems And Methods For Changing The Direction Of View During Video Guided Clinical Procedures Using Real-Time Image Processing
WO2019174953A1 (en) Ultrasound imaging dataset acquisition for neural network training and associated devices, systems, and methods
CN108969099B (en) Correction method, surgical navigation system, electronic device and storage medium
US20210290315A1 (en) System method and computer program product, for computer aided surgery
US20190180466A1 (en) System and method for component positioning by registering a 3d patient model to an intra-operative image
CN111508068B (en) Three-dimensional reconstruction method and system applied to binocular endoscopic image
CN108938086A (en) Endoscope distortion correction method and operation navigation device
Herrera et al. Shape-from-Polarization in laparoscopy
US11344180B2 (en) System, apparatus, and method for calibrating oblique-viewing rigid endoscope
CN108113629B (en) Hard tube endoscope rotation angle measuring method and device
JP6493877B2 (en) Reference point evaluation apparatus, method and program, and alignment apparatus, method and program
CN106618450B (en) A kind of method of three mesh stereo endoscope self-calibration
CN108095675A (en) Rigid pipe endoscope rotation axis axle center measuring method and device
JP6392190B2 (en) Image registration device, method of operating image registration device, and program
Kaiser et al. Improvement of manual 2D/3D registration by decoupling the visual influence of the six degrees of freedom
CN110403698B (en) Instrument intervention device and system
CN109620409A (en) A kind of external tothe endoscope parameter real-time optimization system and method
Liao et al. Integral videography overlay navigation system using mutual information-based registration
CN116849832A (en) Intracavity dynamic panoramic imaging method, device, equipment and medium
TW202223915A (en) Method and system for register operating space

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20181207

Assignee: Ari Mai Di technology Shijiazhuang Co., Ltd.

Assignor: Ari Mai Di medical technology (Beijing) Co., Ltd.

Contract record no.: 2019440020009

Denomination of invention: Endoscope distortion correction method and surgical navigation device

License type: Common License

Record date: 20190314

EE01 Entry into force of recordation of patent licensing contract
RJ01 Rejection of invention patent application after publication

Application publication date: 20181207

RJ01 Rejection of invention patent application after publication