Home

EasyCamCalib User Manual - ArthroNav

image

Contents

1. KTe Hg 7 Where H is the plane to image homography and I is the radial distortion function of equation 1 K is the matrix of intrinsic parameters of the camera generally given by af sf Cr ES O atf 8 0 0 1 10 a Homography Image01 a Image02 Image03 Image04 Image05 Image06 Image07 Image08 Image09 Image01 a Image02 Image03 Image04 Image05 Image06 Image07 Image08 Image09 E Load Calibration Start Figure 5 Homography Checker window Where a is the aspect ratio s is the skew factor a factor of the angles between the axes of the image f is the focal distance and cz cy is the principal point where the z axis intersects the image plane 7 2 Homography Checker Another method to verify the calibration parameters this time the extrinsics also is the Homography test figure 3 item 27 In this test we will compute the homography between two images using the method proposed in 3 This method uses information from the calibration extrinsics parameters to compute the homographic relation between two calibration planes Because of this only calibration images can be used for the homography test In figure 5 you can see the Homography Checker GUI You sart by loading the calibration file and then select two images from the two list boxes After you hit the start button the original images will be presented to you as well as an estimation of Image generated by the homogr
2. fit the undistorted image to the size of the conic boundary in order to correct the meaningful zone of the arthroscopic image only as described in 2 The image is then corrected using equation 2 where g represents the undistorted image point and q the correspondent distorted point q KyFe 1 K59 2 _ Calibration File a gitignore CalibData_temp mat E Arthro00000 tiff Ar IK Correctimage Image File Arthro0000 L tiff Arthro00002 tiff Arthro00003 tiff Arthro00004 tiff Arthro00005 tiff Arthro00006 tiff Arthro00007 tiff Arthro00008 tiff Arthro00009 tiff Arthro00010 tiff Arthro00011 tiff 2 tiff_ Options Arthroscopic Point Grey Width 7007 Height 700 Start Figure 4 Radial Distortion Correction window an sn Cy Ky 0 an Cy 0 0 1 with n ar AI Fscale 0 Crs K 0 Fscale Cys 4 0 0 1 5 f le MAX bamin bYmax tnt scale 7 Sxa Syd fecale x Sxq Crs gt C eonic Cys 2 fscale x Sya 2 CYconic 6 To fit the useful zone of the arthroscopic image fscate is based on the conic boundaries and the desired undistorted image size bx by are the coordinates of the conic boundary in undistorted world coordinates and Sxa and Syg are the desired size of the undistorted image e If you specify the image as being from a Point Grey camera the image distortion will be corrected using equation 7 q
3. EasyCamCalib User Manual Rui Melo ISR Coimbra 28 March 2010 Contents 1 What is EasyCamCalib 2 How can you calibrate from a single image 3 Good calibration images means better calibrations 4 Lets start with the actual calibration A GUI windows Mi ck ee a ORE ee ee Se Boke 4 2 Calibration Mode amp song da ES db ee ee a 43 Matlab Mode psi li irreale Lai ee 5 All you need to know about the options and buttons 5 1 Manual Selection LL 5 2 Define Origins su vs Db pie eee E 5 3 Calibration Refinement 2L 0 a 5 4 Auto Change Grid Origin o ie aa a eee 6 Where are my calibration parameters 7 Howto check calibration consistency and accuracy 7 1 Radial Distortion Correction LL 7 2 Homography Checker LL o o O NN NI NI ot O A Go Known Issues no software is perfect Troubleshooting References12 1 What is EasyCamCalib The main purpose of EasyCamCalib is to calibrate a camera with radial dis tortion from a single image The application aims to automatically calibrate a camera from an image or a set of images requiring as input the calibration images and some calibration options The final goal of this application is to automatically calibrate an endoscope with a single image taken by a surgeon on the surgery room but the software can be used in any lens as long as it has radial distortion 1 The algorithms herein developed are able to fully calibrate a camera intrinsic and extrinsic para
4. ImageRGB RGB image ImageGrey Greyscale image Info Some additional information about the calibration image including the grid size Hand2Opto if any OptoTracker information is available this 4x4 matrix holds the transformation from the Hand camera to the Optotracker Boundary if the image is arthroscopic this field holds all the boundary infor mation conic parameters boundary points etc PosImageAuto Automatic corners detected in image coordinates PosPlaneAuto Automatic corners detected in plane coordinates InitCalib Initial calibration using only the automatic corners Inside this structure besides the intrinsic extrinsic and distortion parameter you can also find the re projection error information PosImage Corners detected in image coordinates after joining automatic cor ners and new generated corners PosPlane Corners detected in plane coordinates after joining automatic corners and new generated corners FinalCalib Final calibration using all the corners automatic corners new generated points Inside this structure besides the intrinsic extrinsic and dis tortion parameter you can find the re projection error information OptimCalib Optimal calibration after using a non linear optimizer over Fi nalCalib Inside this structure besides the intrinsic extrinsic and distortion pa rameter you can also find the reprojection error informatio
5. a first calibra tion is computed to provide an initialization to the following algorithms This calibration will be referred as the Initial Calibration e New Points Generation After the first calibration initialization more points are generated in order to improve the results These points are generated in the image plane and are then refined to fit the squares of the calibration grid Note that for lenses with strong radial distortion the generated points near the boundary of the image tend to be less accurate In this case you might need to use the manual selection tool to remove undesired points e Final Calibration With the new generated points the calibration pa rameters are recomputed providing what we will call from now on the Final Calibration Figure 1 Examples of bad calibration images On the left we can see an image in a fronto parallel configuration On the right we can see a too oblique calibration image Both these images fail to calibrate e Calibration Refinement The calibration parameters are refined using a non linear optimization over the re projection error 3 Good calibration images means better calibra tions The algorithms are tuned for certain types of images only One of the few limitations of the software comes from the automatic corner detection used to initialize the calibration If the calibration image does not fulfill all the following requirements there is a good chance that the calibration
6. alibrating just select some images from the list pointed by 1 set the grid size in 10 and hit start button 9 After the calibration is done the software automatically enters in Matlab Mode so you can visualize the results and apply any desired option The software is then separated in two distinct _ Selectio modes 4 2 Calibration Mode This is the default mode when you run EasyCamCalib m In this mode you have access to the file browser in order to locate and add the calibration images to the calibration list In this mode you can also select the desired options that will be applied along with the calibration When you hit start the images from the calibration list are calibrated loosing any existing data 4 3 Matlab Mode This mode is automatically selected when you successfully finish a calibration It simply loads a previously saved mat file and allows you to better see the calibration results In this mode when you hit the start button the calibration images are not re calibrated only the options are applied As you click in the images names in the calibration list you can see the calibration results as well as the actual images with additional information re projection errors reprojected points corners coordinates etc Remember that at any point you can save the calibration data using the save menu 5 All you need to know about the options and buttons 5 1 Manual Selection When you hit the Manual Select
7. aphy To better see the result a fourth image is presented this one containing the subtraction of Image2 with Image generated by homography A good homography estimation results in a near black subtraction image Note that the subtraction does not take into account that the Image2 generated by homography is rendered using bi linear interpolation 8 Known Issues no software is perfect The major drawback of this software resides in the automatic corner detection and counting for the first calibration As the application targets a wide range of cameras and lens with different distortions this task grew difficult in many ways The software must be able to handle illumination variations resolution changes different sizes of the squares in the image different amount and effects of distortion backgrounds other than the calibration grid different shapes of the grid squares as the perspective distortion changes etc As you can verify after using the software this issue can reduce the usability of the software and therefore this is a major development priority 11 9 Troubleshooting e My matlab and actually my whole computer stopped respond ing while i was calibrating an image Something got wrong in the automatic corner detection so that the algo rithm is generating a zillion points There is not much to do in this case The image is not good enough for EasyCamCalib None of my images are good for calibration even if the
8. b from the matlab prompt The GUI of figure 3 should appear Here is a brief overview of all the components Navigation Manual Selection button Browser list box All the calibration im ages are chosen from this list box buttons You can one by one and lets you select bad de tected points manually Refer to section 5 1 for more details add remove an image into from the cal 8 Define Origins button This button ibration list this is also possible with a opens each image in the calibration list double click in the image of the list in and lets you manually select an origin question add an entire directory and and x direction for all calibration images clear the whole calibration list the z axis is always considered normal to the calibration grid plane and pointing Calibration list All the images you want towards the camera Refer to section 5 2 to calibrate are listed here for more details Current directory path You can navigate Si Sfar acon part calibrating the re through absolute paths inserted here ages of the calibration list if you are in i Calibration Mode or apply the options described in item 11 to the current cali 5 Preview window As you click in the bration if you are in Matlab Mode browse list box or the calibration list box a small preview off the image is presented 10 Calibration options You must input the here Mode button This button switches the application mode bet
9. boundary has to be computed or not Status bar Main visualization window All visual re sults are presented here Mean re projection error of all the cali brated images This value is simply the mean of all the re projection error of each image visualization Re projection error switcher Mean reprojection errors of the cali brated images The value in bold repre sents the mean re projection error of the current selected image After the calibration is over switch to the calibration parameters you want to dis play Refer to section 2 to know what does each calibration mean 18 19 20 21 22 23 24 25 26 27 Angle of the camera relatively to the cali bration plane and distance from the plane origin to the optical center of the camera Displayed calibration parameters Display the coordinates and reference frame of the current calibration image Disp ner ay the automatically detected cor Display the meaningful region boundary if you are using arthroscopic images Display the initial calibration reprojected point Display the final calibration reprojected points Display the optimal calibration repro jected points Save menu At any time after a calibra tion or a mat file loading you can save the calibration structure Calibration verification menu Here you can find the routines to verify the consis tency and accuracy of the calibration To start c
10. her changes It is very important that you keep a constant reference frame across all calibration images This reference frame will be used to compute the extrinsics transformation from the plane to the calibration grid 5 3 Calibration Refinement When you activate this option the intrinsic extrinsic parameters and the dis tortion parameter are refined through a non linear optimizer The refinement minimizes the overall re projection error so you should get better calibration results This takes into account all the images 5 4 Auto Change Grid Origin When you activate this option and the calibration grid as a distinct mark col ored mark as the one present in figure 2 the program will try to automatically set a common reference frame across all the images To be able to use this feature the calibration images must fulfill three requirements e The calibration grid must have two diagonally consecutive white squares painted with different colors e The colors of the marks should be very distinctive in the HSV color space The colors tested usually present both high Value and Saturation and a different value of Hue One good example is using strong green and strong red as marks colors e The marks should be nearby the center of the image if the image has high distortion 6 Where are my calibration parameters All the calibration data is stored in a MATLAB structure that is composed by the following fields e ImageData
11. ion button a new figure containing the image and the detected new generated points is presented to you so that you can manually choose points to remove from the calibration image Such points can be misplaced or out of order corners in this case you have to check the corner coordinates Here are the keys allowed when you manually select points e Left Click select the point for removal The point gets surrounded by a yellow square e Right Click unselect the point for removal The point gets surrounded by a black square e Middle Click define a box with two middle clicks that select points for removal e p show hide point coordinates e space get to the next image e q finish the manual selection here The modifications you have done so far are kept the rest of the images stays untouched After the manual selection if you have removed some points the calibration parameters are recomputed However you have to apply the calibration options again Calibration Refinement by example if you want the optimal calibration to be updated 5 2 Define Origins When you hit the Define Origins button a new figure pops up and you are able to select the origin and direction of the reference frame of the calibration plane for each image You define the origin with the Left Mouse click and the x direction with the Right Mouse button After you are done with one image press space to get to the next image or press q to exit without furt
12. meters plus a distortion parameter with a single image of a planar grid Despite the fact that the software is able to compute reliable results with one image better results can de achieved with multiple images 2 How can you calibrate from a single image In 1 the authors are able to calibrate a camera with lens distortion using a single image of a planar chessboard pattern The radial distortion is modeled using the first order division model and the method provides a closed form estimation of the intrinsic parameters and distortion coefficient The fact that the distortion follows a known model provides additional geometric cues for achieving calibration from a single image The calibration is performed in the following steps e Boundary Detection in the case of an arthroscopic image The bound ary between the meaningful region of the arthroscopic image and the back ground is defined This information is later used to restrict the corner detection e Automatic Corner Detection The image is searched for plausible corners and these are counted in order to obtain a calibration grid and the correspondent coordinates in the grid plane This detection is based in the entropy of the angles and uses geometric metrics to validate and count the corners Therefore the automatic corner detection can be sensitive to illumination conditions and view angle as referred in section 3 e Initial Calibration With the automatic corners detected
13. n Inside InitCalib FinalCalib and OptimCalib you can find all the relevant calibration information The calibration parameters aspect ratio skew focal distance and center of projection are easily identified The transformation T gives you the transform between the calibration plane and the camera Besides the parameters defined before you can find a distortion parameter and a parameter 7 ard as well as the intrinsics matrix K computed as usual in the literature and a matrix K used in other applications To check the calibration results refer to section 7 7 Howto check calibration consistency and ac curacy The calibration parameters computed with EasyCamCalib can be verified in several ways Two methods were implemented to verify the calibration param eters intrinsics and extrinsics and the distortion parameter 7 1 Radial Distortion Correction Item 27 of figure 3 allows you to Correct Radial Distortion using a simple GUI The distortion model used is represented in equation 1 p deTelu gt Quy 2u2 u3 vu3 4 u 43 1 With this GUI you are able to verify if the distortion parameter as well as the intrinsics parameters were correctly estimated To correct an image select a calibration file from the first list box and an image from the second list box and hit the start button You can also specify if the image is arthroscopic or not e If you specify the image as being arthroscopic the program will
14. ween Matlab Mode and Calibration Mode as explained in sections 4 2 and 4 3 This button opens each image in the calibration list grid size in millimeters as well as any op tion you desire The Auto Change Grid Origin automatically changes the refer ence frame of all calibration images using a color detection algorithm the calibra tion images must have a mark in the grid similar to the one presented in figure 1 left The Calibration Refinement opti mizes the current calibration using a non Save Calibration Verification AutoCalibGUI Image01 Image02 Image03 Image04 Image05 Image06 Image0Z Image Image ES Dal 1ome CommonArea AutoCalib Calibration Results Show ReProjection Error Calibration Options Eta 2107 87 init 2 4094 3 12484 3 09611 8 30859 Grid Size 7 65 10 Aspect Ratio 1 00002 2 0733 G H 9 28799 F Auto Change Grid Origin Skew 0 00013409 Optim 2 89548 Calibration Refinement Define o Center 632 8 486 0 Rende bration i Focal Distance 1082 89 3 Hand Qsi 0 263926 Es x a Mean RAS Egor ANA OBO Atirose O G Start Auto omer Deer QD Bars 11 12 13 14 15 16 17 Figure 3 Main EasyCamCalib window linear optimization over the re projection error Refer to section 5 3 for more de tails Image source Define here whether the image was taken with an arthroscopic lens or a normal lens This option de fines if the
15. will fail due to bad detected corners e The angle between the optical axis and the normal to the calibration plane should be approximately between 15 and 75 This is you must avoid fronto parallel configurations angle 0 in order to have a good decou pling between and the focal distance and you must avoid too oblique views to avoid bad autocorner detections Figures 1 and 2 illustrate some good and bad calibration images examples e The number of squares present in the image must be enough to calibrate from a single view The image should contain at least 16 corners Note than an excessive number of corners does not mean a better calibration image You have to establish a trade off between the number quality of the squares e The Calibration grid must be in the central part of the image An optimal situation is when all the image is filled with the calibration grid If you cannot take calibration images in this conditions try to put the calibra tion grid over a non textured material like a black fabric to avoid bad autocorner detections This is not the minimum number of corners to calibrate an image from a single view This minimum number of points is just a safety measure to avoid bad images to even get in the calibration list Figure 2 Examples of good calibration images 4 Lets start with the actual calibration 4 1 GUI window To start EasyCamCalib cd to the downloaded folder and call EasyCamCali
16. y fulfill all the necessary requirements It is possible that you are getting out of memory errors from matlab Since the application uses try catch routines so that it does not interrupt the calibration flow you are not able to see this as matlab error If you really think you are getting this problem contact the authors Another possible cause can be that you forgot to check the image source option correctly If you are using a normal lens and you are trying to calibrate assuming an arthroscopic image the application will try to fit a conic to the meaningful zone boundary when there is no such thing References 1 J Barreto J Roquette P Sturm and F Fonseca Automatic camera calibration applied to medical endoscopy in Proceedings of the 20th British Machine Vision Conference London UK 2009 Online Available http perception inrialpes fr Publications 2009 BRSF09 R Melo Interfaces and visualization in clinical endoscopy Master s thesis Faculdade de Ci ncias e Tecnologia da Universidade de Coimbra Portugal June 2009 3 Y Ma S Soatto J Kosecka and S S Sastry An Invitation to 8 D Vision 4 From Images to Geometric Models Springer Verlag 2003 J P Barreto A unifying geometric representation for central projection systems Comput Vis Image Underst vol 103 no 3 pp 208 217 2006 Online Available http www isr uc pt jpbar 12

Download Pdf Manuals

image

Related Search

Related Contents

  Aspects SWF213SCT Installation Guide  Eglo 91489A Installation Guide  Olivetti B8834  Samsung SMX-C200RP คู่มือการใช้งาน    Samsung PS43E490B1W دليل المستخدم  税込102円    Sony DSC-T99S  

Copyright © All rights reserved.
Failed to retrieve file