Package: endocal
endocal is a cross-platform, compact GUI application for the optical distortion calibration of fluid-immersed
endoscopes. It uses theOpenCVcamera calibration module.endocal was developed by Dzhoshkun I. Shakir as part of theGIFT-Surg projectat theTranslational Imaging Groupin theCentre for Medical Image ComputingatUniversity College London (UCL).FeaturesLightweight, compact GUI application for optical distortion calibration of endoscopesCommand-line application for generatingASCII DXF filesfor use in calibration target fabrication (translatedfrom Matlab scripts developed by Daniil I. Nikitichev)The detailed changelog is available onGitHub.System requirementsPythonpipOpenCV(installed withPythonsupport)For live calibration: a video sourcesupported by OpenCV(see esp. the OpenCV tutorials related
to video IO)PyYAMLNumPySo far endocal has been tested on the following operating systems:Ubuntu 16.04.3 LTS 64-bitUbuntu 14.04.3 LTS 64-bitelementary OS Freya 0.3.2 64-bitmacOS Sierra 10.12.6OS X El Capitan 10.11.3Windows 10 Professional 64-bitInstallationInstalling endocalpip install endocalTesting your installationLaunch the test application by runningendocal-test.This screenshotshows you what to expect on launching the application.To perform an optical distortion calibration, follow the instructions shown in red on top of the application window.While acquiring calibration data, detected calibration pattern blobs will be emphasized with a virtual overlay as
inthis acquisition-mode screenshot.All data for each calibration will be saved in a human-readably time-stamped, uniquely-named folder within a root
folder namedtmp-sample_002created within the folder where the application was launched.
For instancetmp-sample_002/2018-02-08-11-03-19-AHDHOfor a calibration run on 8 February 2018 at 11:03 am.
The saved data includes:AYAMLfile namedcalibration.ymlwith the computed calibration parametersFrames used for calibration saved as indexed image files, e.g.frame_009.jpgAfter performing a calibration, the application will automatically show the undistorted images in real time to the
right of the application window as inthis undistortion-mode screenshot.Uninstalling endocalpip uninstall endocalUsageCalibrationendocal--helpshows details of what input parameters are expected. Some examples are provided below:Offline calibration by using all frames saved as indexed image files in a/data/offlinefolder:endocal--pattern-specs31131--output-folder./calibration-results--input/data/offline/frame_%03d.jpgLive calibration using a real-time video stream from an endoscope provided by a frame-grabber (assuming the
frame-grabber ismountedas/dev/video0):endocal--input0--pattern-specs31131--output-folder./calibration-resultsUsing a700 x 700sub-frame of the whole endoscopic video frame (whose full size is e.g.1920 x 1080):endocal--input0--pattern-specs31131--output-folder./calibration-results--roi620200700700ASCII DXF file generationdxf--helpshows details of what input parameters are expected.For instance to generate an asymmetric grid of circles each with a diameter of1 mmto be etched by a laser
cutter with a beam width of45 μm(microns):dxf--laser-beam-width45--diameter1--output-fileoutput.dxfHere the grid is saved to fileoutput.dxfand the corresponding (ellipse) legend tooutput-legend.dxf(legend
filename always inferred from main DXF filename).TroubleshootingPlease check outthese hintsin case you encounter any issues with endocal.Licensing and copyrightCopyright (c) 2016,University College London. endocal is available as free open-source software under a
BSD 3-Clause Licence.AcknowledgementsThis work was supported through an Innovative Engineering for Health award by theWellcome Trust[WT101957], theEngineering and Physical Sciences Research Council (EPSRC)[NS/A000027/1] and aNational Institute for Health ResearchBiomedical Research CentreUCLH/UCL High Impact Initiative.