CN110141800B - Accelerator optical distance scale equipment, calibration method and optical distance scale generation method - Google Patents

Accelerator optical distance scale equipment, calibration method and optical distance scale generation method Download PDF

Info

Publication number
CN110141800B
CN110141800B CN201910391616.9A CN201910391616A CN110141800B CN 110141800 B CN110141800 B CN 110141800B CN 201910391616 A CN201910391616 A CN 201910391616A CN 110141800 B CN110141800 B CN 110141800B
Authority
CN
China
Prior art keywords
projector
optical distance
accelerator
corner
camera
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.)
Active
Application number
CN201910391616.9A
Other languages
Chinese (zh)
Other versions
CN110141800A (en
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.)
Suzhou Linatech Medical Science And Technology Co ltd
Original Assignee
Suzhou Linatech Medical Science And Technology 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 Suzhou Linatech Medical Science And Technology Co ltd filed Critical Suzhou Linatech Medical Science And Technology Co ltd
Priority to CN201910391616.9A priority Critical patent/CN110141800B/en
Publication of CN110141800A publication Critical patent/CN110141800A/en
Priority to PCT/CN2019/116980 priority patent/WO2020228274A1/en
Application granted granted Critical
Publication of CN110141800B publication Critical patent/CN110141800B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61NELECTROTHERAPY; MAGNETOTHERAPY; RADIATION THERAPY; ULTRASOUND THERAPY
    • A61N5/00Radiation therapy
    • A61N5/10X-ray therapy; Gamma-ray therapy; Particle-irradiation therapy
    • A61N5/1048Monitoring, verifying, controlling systems and methods
    • A61N5/1049Monitoring, verifying, controlling systems and methods for verifying the position of the patient with respect to the radiation beam
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61NELECTROTHERAPY; MAGNETOTHERAPY; RADIATION THERAPY; ULTRASOUND THERAPY
    • A61N5/00Radiation therapy
    • A61N5/10X-ray therapy; Gamma-ray therapy; Particle-irradiation therapy
    • A61N5/1048Monitoring, verifying, controlling systems and methods
    • A61N5/1049Monitoring, verifying, controlling systems and methods for verifying the position of the patient with respect to the radiation beam
    • A61N2005/1056Monitoring, verifying, controlling systems and methods for verifying the position of the patient with respect to the radiation beam by projecting a visible image of the treatment field

Landscapes

  • Health & Medical Sciences (AREA)
  • Engineering & Computer Science (AREA)
  • Biomedical Technology (AREA)
  • Pathology (AREA)
  • Nuclear Medicine, Radiotherapy & Molecular Imaging (AREA)
  • Radiology & Medical Imaging (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Animal Behavior & Ethology (AREA)
  • General Health & Medical Sciences (AREA)
  • Public Health (AREA)
  • Veterinary Medicine (AREA)
  • Length Measuring Devices By Optical Means (AREA)

Abstract

The invention provides an accelerator optical distance ruler device, a calibration method and an optical distance ruler generation method, and relates to the technical field of medical instruments. The accelerator optical distance ruler equipment can calibrate the camera and the projector by a structured light method to obtain calibration parameters; in addition, the acquired calibration parameters can be further utilized to generate the optical distance ruler pattern. The accelerator optical distance scale provided by the invention is convenient to install, the calibration precision of the calibration method is high, and the calibration process of the optical distance scale is simplified.

Description

Accelerator optical distance scale equipment, calibration method and optical distance scale generation method
Technical Field
The invention relates to the technical field of medical instruments, in particular to accelerator optical distance scale equipment, a calibration method and an optical distance scale generation method.
Background
The optical distance ruler device is a device for indicating distance by projecting a scale through visible light, and is widely applied to medical linear accelerators. The accelerator pitch scale device may project a graduated visible scale onto the patient indicating the distance of the patient's skin from the radiation source and indicating the isocenter position of the accelerator. The accelerator optical distance ruler device is an indispensable important part in the medical linear accelerator.
At present, most of linear accelerators are composed of a light source, an optical lens or an organic glass film and an optical path indicator, and the principle is that the light source irradiates the lens/film to display scales and the optical path indicator positioned on a nose is used for indicating the scales.
However, the existing optical distance ruler based on the glass film has many disadvantages, for example, the scale on the film is difficult to make, and the scale precision is not high; the installation is difficult, and the influence on the precision of the optical distance ruler is large when the installation position is not good; the calibration process is relatively complicated; later maintenance and repair of the optical distance ruler are difficult; and so on. These disadvantages limit further applications of this type of pitch ruler.
Disclosure of Invention
The present invention provides an accelerator optical distance scale apparatus, a calibration method, and an optical distance scale generating method, aiming at the above-mentioned deficiencies in the prior art, so as to solve the problems of low calibration accuracy of the optical distance scale on the accelerator and complex calibration process of the optical distance scale.
In order to achieve the above purpose, the embodiment of the present invention adopts the following technical solutions:
in a first aspect, an embodiment of the present invention provides an accelerator range bar apparatus, including: the projector and the camera are fixed on a shell of the accelerator, the projector is used for projecting a structured light mode sequence pattern and an optical distance ruler pattern, the structured light mode sequence pattern is used for calibrating the projector and the camera, the camera is used for collecting pictures of the structured light mode sequence pattern projected by the projector and the optical distance ruler calibration plate, the optical distance ruler calibration plate is arranged outside an emergent end of the accelerator, the center of the optical distance ruler calibration plate corresponds to an isocenter position of the accelerator, the optical distance ruler calibration plate is used for calibrating the projector and the camera and verifying the precision of the optical distance ruler, the optical distance indicator is arranged inside the emergent end of the accelerator, and light rays from the optical distance indicator are emitted from the emergent end in a direction parallel to the emergent direction of the accelerator and used for indicating the scale of the optical distance ruler;
the accelerator optical distance ruler equipment is calibrated by using the following calibration method, and the calibration method specifically comprises the following steps:
in step 401, at least three first pictures of the optical distance scale calibration plate are collected by a camera, and the optical distance scale calibration plate corresponding to each picture in the at least three first pictures is in different postures, that is, checkerboard pictures in at least three different postures are collected;
in step 402, for the posture of the optical distance scale calibration plate corresponding to each of the at least three first pictures, respectively, a second picture of the optical distance scale calibration plate projected with the structured light mode sequence pattern is acquired by a camera, and the structured light mode sequence pattern is projected by a projector, that is, a checkerboard picture projected with the structured light mode sequence pattern corresponding to the picture acquired in step 401 is acquired;
in step 403, the positions of the corners in the first picture are extracted by using a predetermined corner detection algorithm to obtain first picture corner position coordinates, the first picture corner position coordinates are obtained according to the extracted positions of the corners in the first picture relative to the preset actual corner position coordinates of the pattern on the optical distance scale calibration plate, and the first picture corner position coordinates are recorded as the first picture corner position coordinates
Figure GDA0002621389900000021
The preset actual angular point position coordinates of the patterns on the optical distance ruler calibration plate are predefined as
Figure GDA0002621389900000022
The corner coordinates correspond to checkerboard corner coordinates obtained by a predetermined corner detection algorithm;
in step 404, decoding is performed on the second pictures corresponding to the horizontal structure light and the vertical structure light respectively to obtain a horizontal codeword and a vertical codeword of the second picture;
in step 405, according to the horizontal code word and the vertical code word, determining the projection pattern corner position coordinates of the projector by using the homography matrix, wherein the projection pattern corner position coordinates correspond to the preset actual corner position coordinates, and the projection pattern corner position coordinates are recorded as the projection pattern corner position coordinates
Figure GDA0002621389900000031
In step 406, the position coordinates q of the corner point in the first picture are determinedcPresetting actual angular point position coordinates Q and projection pattern angular point position coordinates QpAnd determining calibration parameters of the camera and the projector by using a predetermined calibration algorithm, wherein the predetermined calibration algorithm is a Zhang Zhengyou calibration algorithm, and the calibration parameters comprise the focal length of the camera lensDistance McDistortion of camera lens DcFocal length M of the lens of the projectorpDistortion of projector lens DpAnd a geometrical transformation R between the camera and the projectorcpAnd Tcp
The calibration process of projector and camera uses Shi-Tomasi angular point detection algorithm, which calculates the gray scale change E (u, v) generated by image window translation [ u, v ]
Figure GDA0002621389900000032
Wherein M is an autocorrelation matrix defined as
Figure GDA0002621389900000033
In the formula, w (x, y) represents a window function;
Ixand TyRepresenting the derivatives of the image in the x and y directions;
two eigenvalues λ for M1And λ2The Shi-Tomasi algorithm considers that the detection of a corner depends on the minimum feature value, the corner determination function R is as follows, and when the value of R exceeds a threshold value, it is considered as a corner:
R=min(λ1,λ2);
the structured light coding uses a phase shift method, and the coding mode of the phase shift method is as follows:
In(x,y)=I′(x,y)+I″(x,y)cos[φ(x,y)-2π/n];
where I' (x, y) is the average intensity of the point in the image;
i "(x, y) is the intensity of the point modulation in the image;
In(x, y) is the final camera captured image, N ∈ 1, 2.. N is the phase shift mode index, N is the number of phase shift mode pictures;
phi (x, y) is the phase of the solution;
the phase shift method used is a 3-step phase shift method, i.e. N of the above formula is equal to 3;
at this time, the phase φ (x, y) can be calculated by the following equation:
Figure GDA0002621389900000041
respectively solving the code words corresponding to the width direction and the height direction of the projector through phi (x, y)/2 pi multiplied by W and phi (x, y)/2 pi multiplied by H, wherein: w represents the width of the projector and H represents the height of the projector;
the calculation of the projection coordinates corresponding to the checkerboard angular points needs to be solved by combining with a local homography matrix, the corresponding relation between the projector pixel points and the checkerboard angular points is found by solving the local homography matrix, for each checkerboard pattern, the local homography matrix is calculated by using the code words around the pattern, finally, the checkerboard angular points and the pixel points on the projector are corresponding by using the homography matrix, and the calculation of the homography matrix is realized by minimizing the following formula:
Figure GDA0002621389900000042
wherein, H ∈ R3×3Is a homography matrix;
qc=[x,y,1]Tobtaining pixel coordinates in the chessboard image by three steps in a calibration process;
u=[col,row,1]Tdecoding the obtained codeword;
Figure GDA0002621389900000043
then, the projector corresponding point can be obtained by multiplying the homography matrix by the pixel coordinates in the checkerboard image.
The accelerator optical range rod device provided by the embodiment of the invention is convenient to install, the projector and the camera only need to be fixed on the accelerator, and no specific requirement is required on the relative position relationship between the projector and the camera. The accelerator optical distance ruler device can calibrate the camera and the projector by a structured light method, and the calibration precision is high.
Optionally, a first predetermined number of checkerboard patterns distributed at equal intervals are respectively arranged on two sides of the axis of the optical distance measuring plate, and are used for determining the relative position relationship between the optical distance measuring plate and the projector and the camera.
Optionally, a second predetermined number of equally spaced line patterns are disposed on the axis of the scale plate for verifying whether the scale meets the accuracy requirement.
Alternatively, the optical path indicator is disposed on an inner wall of the exit end of the accelerator, and light from the optical path indicator is reflected by a mirror having a predetermined angle disposed at the exit end of the accelerator and then emitted from the exit end in a direction parallel to the exit direction of the accelerator.
Optionally, the light gauge calibration plate is hung below the front pointer of the accelerator.
By hanging the light distance scale calibration plate under the front pointer, the linear accelerator is usually provided with the front pointer, so that additional manufacturing is not needed, the equipment structure is simplified, and the cost is saved.
In a second aspect, an embodiment of the present invention provides a calibration method for an accelerator optical distance scale device, where the accelerator optical distance scale device includes a camera, a projector, and an optical distance scale calibration board, and the method includes:
acquiring at least three first pictures of an optical distance scale calibration plate through a camera, wherein the optical distance scale calibration plate corresponding to each picture in the at least three first pictures is in different postures;
aiming at the posture of an optical distance scale calibration plate corresponding to each picture in at least three first pictures, respectively acquiring a second picture of the optical distance scale calibration plate projected with a structured light mode sequence pattern through a camera, and projecting the structured light mode sequence pattern through a projector;
extracting the positions of the corner points in the first picture by using a predetermined corner point detection algorithm to obtain first picture corner point position coordinates, wherein the first picture corner point position coordinates are obtained according to preset actual corner point position coordinates of the positions of the corner points in the extracted first picture relative to the pattern on the optical distance scale calibration plate;
decoding second pictures corresponding to the transverse structural light and the longitudinal structural light respectively to obtain transverse code words and longitudinal code words of the second pictures;
determining the position coordinates of the corner points of the projection pattern of the projector by utilizing the homography matrix according to the transverse code words and the longitudinal code words, wherein the position coordinates of the corner points of the projection pattern correspond to the position coordinates of a preset actual corner point;
and determining calibration parameters of the camera and the projector according to the position coordinates of the corner points of the first picture, the preset actual corner point position coordinates and the position coordinates of the corner points of the projection pattern by using a preset calibration algorithm.
The calibration process provided by the embodiment of the invention is simple and convenient, the system can be calibrated only by matching the calibration plate (for example, a checkerboard) with the projector projection structure light mode sequence pattern, and the calibration precision is high.
Optionally, the determining, according to the horizontal codeword and the vertical codeword, position coordinates of corner points of a projection pattern of the projector by using the homography matrix includes:
calculating a local homography matrix according to the transverse code words and the longitudinal code words;
based on the local homography matrix, corresponding the corner points of the projection pattern of the projector to the actual corner points on the light distance ruler calibration plate;
and determining the position coordinates of the corner points of the corresponding projection pattern based on the preset actual corner point position coordinates.
Alternatively, both sides of the axis of the optical distance scale marking plate are respectively provided with a first predetermined number of checkerboard patterns distributed at equal intervals.
Optionally, the calibration parameters include a focal length of the camera lens, distortion of the camera lens, a focal length of the projector lens, distortion of the projector lens, and a geometric transformation between the camera and the projector.
In a third aspect, an embodiment of the present invention provides an optical distance ruler generating method, used in an accelerator optical distance ruler device for generating an optical distance ruler, where the accelerator optical distance ruler device includes a camera, a projector, and an optical distance ruler calibration board, and the method includes:
hanging the light distance scale calibration plate below a front pointer of the accelerator, so that the midpoint of the light distance scale calibration plate corresponds to the isocenter position of the accelerator;
acquiring a picture of the optical distance scale calibration plate through a camera, and extracting the position of an angular point in the picture by using a preset angular point detection algorithm to obtain a corresponding position coordinate;
determining a first transformation matrix of the camera relative to the optical distance scale calibration plate by using the position coordinates and the calibration parameters of the camera and the projector obtained by the calibration method according to the second aspect;
determining a second transformation matrix of the projector relative to the optical distance scale calibration plate according to the first transformation matrix;
determining coordinates of all scale points on the optical distance scale calibration plate based on preset coordinates of preset points on the optical distance scale calibration plate;
determining a position point corresponding to a scale point on the optical distance scale calibration plate in a projection image of the projector based on the calibration parameter of the projector and the second transformation matrix;
and generating an optical distance ruler pattern in the negative of the projector based on the corresponding position points.
The optical distance ruler generating method provided by the embodiment of the invention is convenient for later maintenance, if the positions of the camera and the projector are not changed and the focal length is not adjusted, the camera and the projector do not need to be calibrated again, and the optical distance ruler can be generated only by acquiring calibrated parameters which are calibrated in advance.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
FIG. 1 is a schematic diagram of an accelerator optical distance scale apparatus provided by an embodiment of the present invention;
fig. 2 is a schematic structural diagram of an optical distance measuring scale calibration plate provided by an embodiment of the invention;
FIGS. 3 and 4 are schematic diagrams illustrating a calibration method of an accelerator optical pitch ruler device according to an embodiment of the present invention;
fig. 5 is a schematic flow chart illustrating a method for generating an optical distance ruler according to an embodiment of the present invention;
fig. 6 shows a schematic diagram of an optical distance scale for projection generated by the optical distance scale generation method according to the present invention.
Reference numerals: 101-a projector; 102-a camera; 103-optical distance ruler calibration plate; 104-an optical path indicator; 105-a mirror; 106-front pointer.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The structured light measurement method is a method of acquiring three-dimensional coordinates of an object by projecting a series of optical fringes (i.e., a structured light pattern sequence pattern) onto the object and then collecting optical fringe information using a camera. At present, a structured light measuring system has high precision in stereo measurement and can completely meet the precision requirement of a ranging rod.
The embodiment of the invention provides a medical linear accelerator optical ranging rod device based on structured light, as shown in figure 1, the device mainly comprises: a projector 101, a camera 102, an optical distance scale calibration plate 103, and an optical path indicator 104, the projector 101 and the camera 102 are fixed in a box and mounted on the housing of the accelerator, the projector 101 is used for projecting a structured light pattern sequence pattern and a finally generated optical distance scale pattern, the structured light pattern sequence pattern is used for calibrating the projector 101 and the camera 102, the camera 102 is used for collecting pictures of the structured light pattern sequence pattern projected by the projector 101 and the optical distance scale calibration plate 103, the optical distance scale calibration plate 103 is arranged outside the exit end of the accelerator, the center of the optical distance scale calibration plate 103 corresponds to the isocenter position of the accelerator, the optical distance scale calibration plate 103 is used for calibrating the projector 101 and the camera 102 and verifying the precision of the generated optical distance scale, the optical path indicator 104 is arranged inside the exit end of the accelerator, light from the optical path indicator 104 is emitted from the exit end in a direction parallel to the exit direction of the optical distance accelerator, for indicating the scale of the optical distance rod.
The camera 102 may be a CCD (charge coupled device) camera. As shown in fig. 1, the optical path indicator 104 may be disposed on an inner wall of the exit end of the accelerator, so that the light from the optical path indicator 104 is reflected by a mirror 105 having a predetermined angle disposed at the exit end of the accelerator and then emitted from the exit end in a direction parallel to the exit direction of the accelerator. For example, when the exit direction of the optical path indicator 104 is perpendicular to the exit direction of the accelerator, the mirror 105 is disposed at an angle of 45 ° with respect to the exit direction of the optical path indicator 104, so that the light from the optical path indicator 104 is reflected by the mirror 105 and then is parallel to the exit direction of the accelerator. The optical distance scale calibration plate 103 may be hung below the front pointer 106 of the accelerator such that the center of the optical distance scale calibration plate 103 corresponds to the isocenter position of the accelerator.
The accelerator optical range rod device provided by the embodiment of the invention is convenient to install, the projector and the camera only need to be fixed on the accelerator, and no specific requirement is required on the relative position relationship between the projector and the camera. The accelerator optical distance ruler device can calibrate the camera and the projector by a structured light method, and the calibration precision is high. By hanging the light distance scale calibration plate under the front pointer, the linear accelerator is usually provided with the front pointer, so that additional manufacturing is not needed, the equipment structure is simplified, and the cost is saved.
Fig. 2 is a schematic structural diagram of an optical distance scale calibration board according to an embodiment of the present invention, and as shown in fig. 2, two sides of an axis of the optical distance scale calibration board 103 are respectively provided with a predetermined number (for example, 5) of checkerboard patterns distributed at equal intervals, and the checkerboard patterns are used for determining a relative positional relationship between the optical distance scale calibration board 103 and the projector 101 and the camera 102 during calibration. In addition, a predetermined number of line patterns of equal pitch distribution (for example, 2mm intervals) are provided on the axis of the optical distance scale calibration plate 103, and after the optical distance scale is generated, the line patterns can be used to verify whether the optical distance scale satisfies the accuracy requirement.
The embodiment of the invention also provides a calibration method of the accelerator optical distance scale device, which can be used for calibrating the camera and the projector in the accelerator optical distance scale device. The calibration method provided by the embodiment of the invention can be used for calibrating the camera and the projector in the accelerator range rod device provided by the embodiment of the invention.
The calibration method of the projector and the camera will be described below with reference to fig. 3 and 4 in conjunction with the accelerator scale device provided in the above-described embodiment of the present invention. It should be understood that the calibration pattern on the optical distance scale calibration plate 103 may be a checkerboard pattern, but is not limited thereto. For the sake of simplicity, a checkerboard pattern will be described as an example.
In step 401, at least three first pictures of the optical distance scale calibration board 103 are collected by the camera 102, where the optical distance scale calibration board 103 corresponding to each of the at least three first pictures is in a different posture, that is, checkerboard pictures in at least three different postures are collected, and usually, checkerboard pictures in 4 to 8 different postures are collected.
In step 402, for the gesture of the optical distance scale calibration board corresponding to each of the at least three first pictures, a second picture of the optical distance scale calibration board projected with the structured light mode sequence pattern is acquired by the camera, and the structured light mode sequence pattern is projected by the projector, that is, a checkerboard picture projected with the structured light mode sequence pattern corresponding to the picture acquired in step 401 is acquired.
In step 403, the positions of the corner points in the first picture are extracted by using a predetermined corner point detection algorithm to obtain first picture corner point position coordinates, the first picture corner point position coordinates are obtained according to the extracted positions of the corner points in the first picture relative to preset actual corner point position coordinates of the pattern on the optical distance scale calibration plate, the predetermined corner point detection algorithm may be, for example, a stone-Tomasi (Shi-Tomasi) corner point detection algorithm, and the first picture corner point position coordinates may be recorded as
Figure GDA0002621389900000101
The preset actual corner position coordinates of the pattern on the optical distance scale calibration plate can be predefined as
Figure GDA0002621389900000102
The corner coordinates correspond to tessellated corner coordinates obtained by a predetermined corner detection algorithm.
In step 404, decoding is performed on the second picture corresponding to the horizontal structure light and the vertical structure light, respectively, to obtain a horizontal codeword and a vertical codeword of the second picture.
In step 405, according to the horizontal code word and the vertical code word, determining the position coordinates of the corner points of the projection pattern of the projector by using the homography matrix, wherein the position coordinates of the corner points of the projection pattern correspond to the preset actual corner point position coordinates, and the position coordinates of the corner points of the projection pattern can be recorded as the position coordinates
Figure GDA0002621389900000103
The determination of the projection pattern angular point position coordinates of the projector using the homography matrix will be described in detail below.
In step 406, the position coordinates q of the corner point in the first picture are determinedcPresetting actual angular point position coordinates Q and projection pattern angular point position coordinates QpAnd determining calibration parameters of the camera and the projector using a predetermined calibration algorithm. The predetermined Calibration algorithm herein may be Zhang, Aflexible New Technique for Camera Calibration [ J ] for a detailed description of Zhang Z]IEEE Transactions on Pattern analysis and Machine understanding, 2000, 22 (11): 1330-McDistortion of camera lens DcFocal length M of the lens of the projectorpDistortion of projector lens DpAnd a geometrical transformation R between the camera and the projectorcpAnd Tcp
The Shi-Tomasi corner detection algorithm used in the calibration process of the projector and camera in FIGS. 3 and 4 is a modified algorithm of Harris (Harris) corner detection algorithm by calculating the gray scale change E (u, v) generated by the window shift [ u, v ] of the image
Figure GDA0002621389900000111
Wherein M is an autocorrelation matrix defined as
Figure GDA0002621389900000112
In which w (x, y) denotes a window function, IxAnd IyRepresenting the derivatives of the image in the x and y directions. Two eigenvalues λ for M1And λ2The Shi-Tomasi algorithm considers that the detection of a corner depends on the smallest characteristic value, the corner determination function R is as follows, and when the value of R exceeds a certain threshold, it is considered as a corner:
R=min(λ1,λ2)
the structured light encoding of fig. 3 uses a phase shift method, which is a relatively general calibration method among various encoding schemes, has extremely wide application, and provides higher and higher precision. The phase-shift method coding mode is as follows:
In(x,y)=I′(x,y)+I″(x,y)cos[φ(x,y)-2π/n]
i '(x, y) is the average intensity of the point in the image, I' (x, y) is the intensity of the modulation of the point in the image, In(x, y) is the final image captured by the camera, N ∈ 1, 2, N is the phase shift pattern index, N is the number of phase shift pattern pictures, and phi (x, y) is the phase to be solved the phase shift method used in the present invention is a 3-step phase shift method, i.e. the above formula has N equal to 3The formula is calculated to obtain:
Figure GDA0002621389900000113
finally, respectively solving the code words corresponding to the width direction and the height direction of the projector through phi (x, y)/2 pi multiplied by W and phi (x, y)/2 pi multiplied by H, wherein W represents the width of the projector and H represents the height of the projector.
The calculation of the projection coordinates corresponding to the corresponding checkerboard corner points in fig. 3 requires the solution in combination with the local homography matrix. The code word obtained from the structured light cannot be directly used for the correspondence of the projector pixel points to the checkerboard corner points. The invention finds this correspondence by solving the local homography matrix. For each checkerboard pattern, local homography matrixes are calculated by using code words around the pattern, and finally, the checkerboard corner points correspond to pixel points on the projector by using the homography matrixes. The homography matrix is calculated by minimizing the following equation:
Figure GDA0002621389900000121
wherein H ∈ R3×3Is a homography matrix; q. q.sc=[x,y,1]TObtaining pixel coordinates in the chessboard image by three steps in a calibration process; u ═ col, row, 1]TTo decode the obtained codeword.
Figure GDA0002621389900000122
Then, the projector corresponding point can be obtained by multiplying the homography matrix by the pixel coordinates in the checkerboard image.
In summary, the calibration process provided by the embodiment of the invention is simple and convenient, the system can be calibrated only by matching the calibration board (for example, checkerboard) with the projector projection structure light mode sequence pattern, and the calibration precision is high.
The embodiment of the invention also provides a method for generating the optical distance ruler, which is used for generating the optical distance ruler by the accelerator optical distance ruler equipment, wherein the accelerator optical distance ruler equipment comprises a camera, a projector and an optical distance ruler calibration plate. The optical distance ruler generating method can be applied to the accelerator optical distance ruler device provided by the previous embodiment of the invention to generate the optical distance ruler.
As shown in fig. 5, the optical distance scale generating method is as follows:
in step 501, a preparation operation is performed to hang the optical distance scale calibration plate below the front pointer of the accelerator such that the midpoint of the optical distance scale calibration plate corresponds to the isocenter of the accelerator.
In step 502, a picture of the optical distance scale calibration plate is captured by a camera, and positions of corner points in the picture are extracted by using a preset corner point detection algorithm to obtain corresponding position coordinates, and when the corner points are found, positions of the corner points in the picture can be extracted by using a Shi-Tomasi corner point detection algorithm.
In step 503, the calibration parameters M of the camera and the projector obtained by the position coordinates and the calibration method provided by the above embodiment of the present inventioncAnd DcDetermining a first transformation matrix R of the camera with respect to the scale platecAnd Tc. In practical applications, if calibration of the camera and the projector has been performed before, and the positions of the camera and the projector are not changed and the focal length is not adjusted, calibration parameters obtained in the previous calibration can be directly adopted without calibrating the camera and the projector again.
In step 504, a first transformation matrix R is usedcAnd TcDetermining a second transformation matrix R of the projector relative to the optical distance scale calibration platepAnd TpThe calculation formula is as follows:
Rp=Rcp·Rc,Tp=Rcp·Tc+Tcp
in step 505, the coordinates of all scale points on the optical distance scale calibration plate are determined based on preset coordinates of preset points on the optical distance scale calibration plate (for example, the coordinates of the center point of the optical distance scale calibration plate may be preset to (0, 0)).
In step 506, based on the projectionCalibration parameters (focal length M) of the instrumentpAnd distortion Dp) And a second transformation matrix, which determines the corresponding position point of the scale point on the optical distance scale calibration plate (the scale point determined in step 505) in the projector projection image.
In step 507, an optical distance scale pattern is generated in the negative of the projector based on the corresponding location points. The generated optical distance scale pattern, an example of which is shown in fig. 6, is used for projection. Alternatively, after the optical distance scale is projected, it can be observed for error with the line pattern on the axis of the optical distance scale calibration plate to determine whether it meets the accuracy requirements.
The optical distance ruler generating method provided by the embodiment of the invention is convenient for later maintenance, if the positions of the camera and the projector are not changed and the focal length is not adjusted, the camera and the projector do not need to be calibrated again, and the optical distance ruler can be generated only by acquiring calibrated parameters which are calibrated in advance.
The above embodiments are merely illustrative of the technical concept and features of the present invention, and the purpose thereof is to enable those skilled in the art to understand the content of the present invention and implement the present invention, and not to limit the scope of the present invention, and all equivalent changes or modifications made according to the spirit of the present invention should be covered in the scope of the present invention.

Claims (10)

1. An accelerator optical distance scale apparatus comprising: a projector, a camera, an optical distance scale calibration plate and an optical path indicator, wherein the projector and the camera are fixed on a shell of an accelerator, the projector is used for projecting a structural light mode sequence pattern and an optical distance scale pattern, the structural light mode sequence pattern is used for calibrating the projector and the camera, the camera is used for collecting pictures of the structural light mode sequence pattern and the optical distance scale calibration plate projected by the projector, the optical distance scale calibration plate is arranged outside an emergent end of the accelerator, the center of the optical distance scale calibration plate corresponds to the isocenter position of the accelerator, the optical distance scale calibration plate is used for calibrating the projector and the camera and verifying the precision of the optical distance scale, the optical path indicator is arranged inside the emergent end of the accelerator, and light rays from the optical path indicator are emitted from the emergent end along a direction parallel to the emergent direction of the accelerator, scales for indicating the optical distance scale;
the accelerator optical distance ruler equipment is calibrated by using the following calibration method, and specifically comprises the following steps:
in step 401, at least three first pictures of the optical distance scale calibration plate are collected by the camera, and the optical distance scale calibration plate corresponding to each picture in the at least three first pictures is in different postures, that is, checkerboard pictures in at least three different postures are collected;
in step 402, for the gesture of the optical distance scale calibration board corresponding to each of the at least three first pictures, respectively, a second picture of the optical distance scale calibration board projected with the structured light mode sequence pattern is collected by the camera, and the structured light mode sequence pattern is projected by the projector, that is, a checkerboard picture projected with the structured light mode sequence pattern corresponding to the picture collected in step 401 is collected;
in step 403, the positions of the corners in the first picture are extracted by using a predetermined corner detection algorithm to obtain first picture corner position coordinates, the first picture corner position coordinates are obtained according to the extracted positions of the corners in the first picture relative to the preset actual corner position coordinates of the pattern on the optical distance scale calibration plate, and the first picture corner position coordinates are recorded as the first picture corner position coordinates
Figure FDA0002621389890000011
The preset actual angular point position coordinates of the patterns on the optical distance ruler calibration plate are predefined as
Figure FDA0002621389890000021
The corner coordinates correspond to checkerboard corner coordinates obtained by a predetermined corner detection algorithm;
in step 404, decoding is performed on the second pictures corresponding to the horizontal structure light and the vertical structure light respectively to obtain a horizontal codeword and a vertical codeword of the second picture;
in step 405, according to the horizontal code word and the vertical code word, determining the projection pattern corner position coordinates of the projector by using the homography matrix, wherein the projection pattern corner position coordinates correspond to preset actual corner position coordinates, and the projection pattern corner position coordinates are recorded as
Figure FDA0002621389890000022
In step 406, the position coordinates q of the corner point in the first picture are determinedcPresetting actual angular point position coordinates Q and projection pattern angular point position coordinates QpAnd determining calibration parameters of the camera and the projector by using a predetermined calibration algorithm, wherein the predetermined calibration algorithm is a Zhang Zhengyou calibration algorithm, and the calibration parameters comprise a focal length M of a camera lenscDistortion of camera lens DcFocal length M of the lens of the projectorpDistortion of projector lens DpAnd a geometrical transformation R between the camera and the projectorcpAnd Tcp
The calibration process of the projector and the camera uses an algorithm of Shi-Tomasi angular point detection, which calculates gray level change E (u, v) generated by image window translation [ u, v ]
Figure FDA0002621389890000023
Wherein M is an autocorrelation matrix defined as
Figure FDA0002621389890000024
In the formula, w (x, y) represents a window function;
Ixand IyRepresenting the derivatives of the image in the x and y directions;
for two features of MValue of lambda1And λ2The Shi-Tomasi algorithm considers that the detection of a corner depends on the minimum feature value, the corner determination function R is as follows, and when the value of R exceeds a threshold value, it is considered as a corner:
R=min(λ1,λ2);
the structured light coding uses a phase shift method, and the coding mode of the phase shift method is as follows:
In(x,y)=I′(x,y)+I″(x,y)cos[φ(x,y)-2π/n];
where I' (x, y) is the average intensity of the point in the image;
i "(x, y) is the intensity of the point modulation in the image;
In(x, y) is the final camera captured image, N ∈ 1, 2.. N is the phase shift mode index, N is the number of phase shift mode pictures;
phi (x, y) is the phase of the solution;
the phase shift method used is a 3-step phase shift method, i.e. N of the above formula is equal to 3;
at this time, the phase φ (x, y) can be calculated by the following equation:
Figure FDA0002621389890000031
respectively solving the code words corresponding to the width direction and the height direction of the projector through phi (x, y)/2 pi multiplied by W and phi (x, y)/2 pi multiplied by H, wherein: w represents the width of the projector and H represents the height of the projector;
the calculation of the projection coordinates corresponding to the checkerboard angular points needs to be solved by combining with a local homography matrix, the corresponding relation between the projector pixel points and the checkerboard angular points is found by solving the local homography matrix, for each checkerboard pattern, the local homography matrix is calculated by using the code words around the pattern, finally, the checkerboard angular points and the pixel points on the projector are corresponding by using the homography matrix, and the calculation of the homography matrix is realized by minimizing the following formula:
Figure FDA0002621389890000032
wherein, H ∈ R3×3Is a homography matrix;
qc=[x,y,1]Tobtaining pixel coordinates in the chessboard image by three steps in a calibration process;
u=[col,row,1]Tdecoding the obtained codeword;
Figure FDA0002621389890000033
then, the projector corresponding point can be obtained by multiplying the homography matrix by the pixel coordinates in the checkerboard image.
2. The accelerator pitch ruler device of claim 1, wherein a first predetermined number of regularly spaced checkerboard patterns are provided on both sides of the axis of the pitch ruler calibration plate for determining the relative positional relationship of the pitch ruler calibration plate to the projector and the camera.
3. Accelerator track scale apparatus according to claim 1 or 2, wherein a second predetermined number of equally spaced line patterns are provided on the axis of the track scale calibration plate for verifying that the track scale meets the accuracy requirements.
4. The accelerator pitch scale apparatus according to claim 1, wherein the optical path indicator is provided on an inner wall of an exit end of the accelerator, and light from the optical path indicator is reflected by a mirror having a predetermined angle provided at the exit end of the accelerator and then emitted from the exit end in a direction parallel to an exit direction of the accelerator.
5. The accelerator lightgauge apparatus of any of claims 1, 2 or 4, wherein the lightgauge scaling plate is suspended below a front pointer of the accelerator.
6. A calibration method for an accelerator track scale device, the accelerator track scale device comprising a camera, a projector, and a track scale calibration plate, the method comprising:
acquiring at least three first pictures of the optical distance scale calibration plate through the camera, wherein the optical distance scale calibration plate corresponding to each picture in the at least three first pictures is in different postures;
acquiring second pictures of the optical distance scale calibration plate projected with a structured light mode sequence pattern by the camera according to the postures of the optical distance scale calibration plate corresponding to each picture in the at least three first pictures respectively, wherein the structured light mode sequence pattern is projected by the projector;
extracting the positions of the corner points in the first picture by using a predetermined corner point detection algorithm to obtain first picture corner point position coordinates, wherein the first picture corner point position coordinates are obtained according to the extracted positions of the corner points in the first picture relative to preset actual corner point position coordinates of the pattern on the optical distance scale calibration plate;
decoding second pictures corresponding to the transverse structural light and the longitudinal structural light respectively to obtain transverse code words and longitudinal code words of the second pictures;
determining projection pattern corner position coordinates of the projector by utilizing a homography matrix according to the transverse code words and the longitudinal code words, wherein the projection pattern corner position coordinates correspond to the preset actual corner position coordinates;
and determining calibration parameters of the camera and the projector according to the position coordinates of the corner points of the first picture, the preset actual corner point position coordinates and the position coordinates of the corner points of the projection pattern by using a preset calibration algorithm.
7. The method for calibrating an accelerator range rod apparatus according to claim 6, wherein the determining the projection pattern corner position coordinates of the projector according to the transverse code words and the longitudinal code words by using a homography matrix comprises:
calculating a local homography matrix according to the transverse code words and the longitudinal code words;
based on the local homography matrix, corresponding the projection pattern corner points of the projector to the actual corner points on the optical distance scale calibration plate;
and determining the position coordinates of the corner points of the corresponding projection pattern based on the preset actual corner point position coordinates.
8. The method of claim 6, wherein a first predetermined number of checkerboard patterns are provided on both sides of the axis of the scale plate.
9. The method of calibrating an accelerator pitch ruler device according to claim 6, wherein the calibration parameters comprise focal length of the camera lens, distortion of the camera lens, focal length of the projector lens, distortion of the projector lens, and geometric transformation between the camera and the projector.
10. An optical range finder generation method for an accelerator optical range finder device including a camera, a projector and an optical range finder plate to generate an optical range finder, the method comprising:
hanging the light distance scale calibration plate below a front pointer of an accelerator, so that the midpoint of the light distance scale calibration plate corresponds to the isocenter position of the accelerator;
acquiring a picture of the optical distance scale calibration plate through the camera, and extracting the positions of angular points in the picture by using a preset angular point detection algorithm to obtain corresponding position coordinate coordinates;
determining a first transformation matrix of the camera with respect to the optical distance scale calibration plate using the position coordinates and the calibration parameters of the camera and the projector obtained by the calibration method according to any one of claims 6 to 9;
determining a second transformation matrix of the projector relative to the optical distance scale calibration plate according to the first transformation matrix;
determining coordinates of all scale points on the optical distance scale calibration plate based on preset coordinates of preset points on the optical distance scale calibration plate;
determining a position point corresponding to a scale point on the optical distance scale calibration plate in a projection image of the projector based on the calibration parameter of the projector and the second transformation matrix;
generating an optical distance scale pattern in a negative of the projector based on the corresponding location points.
CN201910391616.9A 2019-05-10 2019-05-10 Accelerator optical distance scale equipment, calibration method and optical distance scale generation method Active CN110141800B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910391616.9A CN110141800B (en) 2019-05-10 2019-05-10 Accelerator optical distance scale equipment, calibration method and optical distance scale generation method
PCT/CN2019/116980 WO2020228274A1 (en) 2019-05-10 2019-11-11 Accelerator optical distance indicator apparatus, calibration method, and optical distance indicator generation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910391616.9A CN110141800B (en) 2019-05-10 2019-05-10 Accelerator optical distance scale equipment, calibration method and optical distance scale generation method

Publications (2)

Publication Number Publication Date
CN110141800A CN110141800A (en) 2019-08-20
CN110141800B true CN110141800B (en) 2020-10-16

Family

ID=67594209

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910391616.9A Active CN110141800B (en) 2019-05-10 2019-05-10 Accelerator optical distance scale equipment, calibration method and optical distance scale generation method

Country Status (2)

Country Link
CN (1) CN110141800B (en)
WO (1) WO2020228274A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110141800B (en) * 2019-05-10 2020-10-16 苏州雷泰医疗科技有限公司 Accelerator optical distance scale equipment, calibration method and optical distance scale generation method
CN111632279B (en) * 2020-05-23 2021-12-10 四川中测辐射科技有限公司 SSD (solid State disk) accurate adjustment method for three-dimensional beam analyzer by using multiple sensors

Family Cites Families (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6973202B2 (en) * 1998-10-23 2005-12-06 Varian Medical Systems Technologies, Inc. Single-camera tracking of an object
WO2006138643A2 (en) * 2005-06-16 2006-12-28 Nomos Corporation System, tracker, and program product to facilitate and verify proper target alignment for radiation delivery, and related methods
CN202403670U (en) * 2011-12-31 2012-08-29 成都利尼科医学技术发展有限公司 Optical distance rule of medical linear accelerator
CN102708566B (en) * 2012-05-08 2014-10-29 天津工业大学 Novel single-camera and single-projection light source synchronous calibrating method
US20170136261A1 (en) * 2013-12-11 2017-05-18 Karsten Hofmann System and method for determining the position of objects in a radiation room for radiation therapy
CN105268119B (en) * 2014-07-22 2019-06-18 苏州雷泰医疗科技有限公司 A kind of radiotherapy unit
CN104338245B (en) * 2014-11-11 2017-12-29 中国科学院近代物理研究所 A kind of parallel light field instruction device and method for simulating ion beam launched field
CN104657982A (en) * 2015-01-15 2015-05-27 华中科技大学 Calibration method for projector
CN104732539A (en) * 2015-03-27 2015-06-24 华中科技大学 Projector calibration method
US10674973B2 (en) * 2015-04-24 2020-06-09 Rush University Medical Center Radiation therapy system and methods of use thereof
US20170312547A1 (en) * 2016-04-29 2017-11-02 The Johns Hopkins University Method to reconstruct the 3d map of the radiation treatment isocenter of a medical accelerator
CN108225216B (en) * 2016-12-14 2021-03-12 中国科学院深圳先进技术研究院 Structured light system calibration method and device, structured light system and mobile device
CN106991702B (en) * 2017-03-03 2020-06-23 浙江华睿科技有限公司 Projector calibration method and device
CN108245788B (en) * 2017-12-27 2020-06-02 苏州雷泰医疗科技有限公司 Binocular distance measuring device and method and accelerator radiotherapy system comprising same
CN110141800B (en) * 2019-05-10 2020-10-16 苏州雷泰医疗科技有限公司 Accelerator optical distance scale equipment, calibration method and optical distance scale generation method

Also Published As

Publication number Publication date
WO2020228274A1 (en) 2020-11-19
CN110141800A (en) 2019-08-20

Similar Documents

Publication Publication Date Title
US8180101B2 (en) Calibration method for structure parameters of structured-light vision sensor
US9858684B2 (en) Image processing method and apparatus for calibrating depth of depth sensor
KR102236297B1 (en) Calibration device and method for calibrating a dental camera
KR101601331B1 (en) System and method for three-dimensional measurment of the shape of material object
CN101373135B (en) Method and apparatus for measuring three-dimensional curved surface based on instantaneous accidental light irradiation
Luo et al. A simple calibration procedure for structured light system
CN101308012A (en) Double monocular white light three-dimensional measuring systems calibration method
KR20060031685A (en) Image projector, inclination angle detection method, and projection image correction method
CN110141800B (en) Accelerator optical distance scale equipment, calibration method and optical distance scale generation method
CN107883874B (en) Calibration method of circular structured light
Yang et al. A novel projector ray-model for 3D measurement in fringe projection profilometry
CN116067283B (en) Deep cavity measurement method, device, equipment and medium
CN110398199A (en) A kind of track clearance detection method
Zhou et al. Constructing feature points for calibrating a structured light vision sensor by viewing a plane from unknown orientations
US11295478B2 (en) Stereo camera calibration method and image processing device for stereo camera
JP4837538B2 (en) End position measuring method and dimension measuring method
CN114170321A (en) Camera self-calibration method and system based on distance measurement
CN105434046A (en) Surgical navigator positioning method based on elimination of infrared filter refraction effect
CN117387523A (en) Three-dimensional measurement method and device based on structured light, electronic equipment and storage medium
CN108895979A (en) The structure optical depth acquisition methods of line drawing coding
US20200088508A1 (en) Three-dimensional information generating device and method capable of self-calibration
ITMI972667A1 (en) PROCEDURE FOR MEASURING THREE-DIMENSION PROFILES BY STRUCTURED LIGHT PROJECTION
JP4382430B2 (en) Head three-dimensional shape measurement system
CN116558445A (en) Phase decoding method of stripe projection and computer readable storage medium
CN113658267B (en) Geometric parameter calibration method for phase shift deflection operation considering surface shape of display equipment

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
GR01 Patent grant
GR01 Patent grant