diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dbbece6..c30dd9b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,13 +9,21 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] - python-ver: [3.7, 3.8] + python-ver: [3.7] experimental: [false] include: + - python-ver: 3.8 + os: ubuntu-latest + experimental: false + - python-ver: 3.8 + os: windows-latest + experimental: true + - python-ver: 3.8 + os: macos-latest + experimental: false - python-ver: 3.9 os: ubuntu-latest experimental: true - - python-ver: 3.9 os: windows-latest experimental: true @@ -23,6 +31,7 @@ jobs: os: macos-latest experimental: true + runs-on: ${{ matrix.os }} continue-on-error: ${{ matrix.experimental }} timeout-minutes: 10 diff --git a/config/.gitignore b/config/.gitignore new file mode 100644 index 0000000..dee68d3 --- /dev/null +++ b/config/.gitignore @@ -0,0 +1,17 @@ +# Pycharm +/.idea + +# Generated files +.tox +.coverage +*.pyc +.pytest_cache/ + +# PyInstaller +build/ +dist/ +model2camera.spec + +# Mac Finder: +.DS_Store + diff --git a/config/video_chessboard_conf.json b/config/video_chessboard_conf.json new file mode 100644 index 0000000..8dcc541 --- /dev/null +++ b/config/video_chessboard_conf.json @@ -0,0 +1,8 @@ +{ + "method": "chessboard", + "corners": [14, 10], + "square size in mm": 6, + "minimum number of views": 5, + "keypress delay in ms": 1000, + "sample frequency" : 1 +} \ No newline at end of file diff --git a/requirements-dev.txt b/requirements-dev.txt index 89ae570..bd569b5 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -8,7 +8,7 @@ coverage mock pyfakefs parameterized -pylint +pylint<2.14 sphinx sphinx_rtd_theme pyinstaller diff --git a/requirements.txt b/requirements.txt index 36e13c3..74487b9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,9 +4,10 @@ # doc/requirements.rst six>=1.10 numpy>=1.11 -opencv-contrib-python-headless>=4.1.1.26 -PySide2<5.15.0 +opencv-contrib-python-headless>=4.1.1.26,<4.6 scikit-surgerycore>=0.1.7 -scikit-surgeryimage>=0.2.0 -scikit-surgeryvtk>=0.19.1 -scikit-surgeryarucotracker>=0.0.4 +scikit-surgeryimage>=0.10.1 +scikit-surgeryvtk>=1.0.6 +scikit-surgeryarucotracker>=0.2.7 +scikit-surgerycalibration>=0.2.1 +PySide2>=5.12.0 diff --git a/setup.py b/setup.py index 93fe5cc..9eab992 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ name='scikit-surgeryutils', version=versioneer.get_version(), cmdclass=versioneer.get_cmdclass(), - description='scikit-surgeryutils - Tests/demos utilities, based around opencv-contrib and PySide2', + description='scikit-surgeryutils - Tests/demos utilities, based around opencv-contrib-python-headless and PySide2', long_description=long_description, long_description_content_type='text/x-rst', url='https://github.com/SciKit-Surgery/scikit-surgeryutils', @@ -56,10 +56,10 @@ 'opencv-contrib-python-headless>=4.1.1.26', 'PySide2<5.15.0', 'scikit-surgerycore>=0.1.7', - 'scikit-surgeryimage>=0.2.0', - 'scikit-surgeryvtk>=0.19.1', - 'scikit-surgeryarucotracker>=0.0.4' - + 'scikit-surgeryimage>=0.10.1', + 'scikit-surgeryvtk>=1.0.6', + 'scikit-surgeryarucotracker>=0.2.7', + 'scikit-surgerycalibration>=0.2.1' ], entry_points={ @@ -71,6 +71,8 @@ 'sksurgeryreslice=sksurgeryutils.ui.sksurgeryreslice_command_line:main', 'sksurgerytextoverlay=sksurgeryutils.ui.sksurgerytextoverlay_command_line:main', 'sksurgerytransformpolydata=sksurgeryutils.ui.sksurgeryrendermodelslikecamera_command_line:main', + 'sksurgeryvideocalibration=sksurgeryutils.ui.sksurgeryvideocalibration_command_line:main', + 'sksurgeryvideocalibrationchecker=sksurgeryutils.ui.sksurgeryvideocalibrationchecker_command_line:main', ], }, ) diff --git a/sksurgeryutils/common_overlay_apps.py b/sksurgeryutils/common_overlay_apps.py index c7e5694..88c68d0 100644 --- a/sksurgeryutils/common_overlay_apps.py +++ b/sksurgeryutils/common_overlay_apps.py @@ -1,44 +1,70 @@ -"""Common use cases for vtk_overlay_window""" +# coding=utf-8 + +""" Common use cases for vtk_overlay_window """ #pylint: disable=no-member, no-name-in-module, protected-access -# coding=utf-8 + import datetime import logging import cv2 +from PySide2.QtWidgets import QWidget, QHBoxLayout from PySide2.QtCore import QTimer from sksurgeryimage.acquire.video_source import TimestampedVideoSource from sksurgeryimage.acquire.video_writer import TimestampedVideoWriter - from sksurgeryvtk.widgets.vtk_overlay_window import VTKOverlayWindow from sksurgeryvtk.models.vtk_surface_model_directory_loader \ import VTKSurfaceModelDirectoryLoader -class OverlayBaseApp(): + +class OverlayBaseWidget(QWidget): """ Base class for applications that use vtk_overlay_window. The update() method should be implemented in the child class. :param video_source: OpenCV compatible video source (int or filename) + :param dims: size of video feed """ def __init__(self, video_source, dims=None): + super().__init__() + + self.layout = QHBoxLayout(self) + self.layout.setContentsMargins(0, 0, 0, 0) + self.layout.setSpacing(0) + self.vtk_overlay_window = VTKOverlayWindow() + self.layout.addWidget(self.vtk_overlay_window) + self.video_source = TimestampedVideoSource(video_source, dims) + + self.timer = QTimer() + self.timer.timeout.connect(self.update_view) + self.update_rate = 30 self.img = None - self.timer = None self.save_frame = None def start(self): - """Show the overlay widget and - set a timer running""" - self.vtk_overlay_window.show() - - self.timer = QTimer() - self.timer.timeout.connect(self.update) + """ + Starts the timer, which repeatedly triggers the update_view() method. + """ self.timer.start(1000.0 / self.update_rate) + def stop(self): + """ + Stops the timer. + """ + self.timer.stop() + + def terminate(self): + """ + Make sure that the VTK Interactor terminates nicely, otherwise + it can throw some error messages, depending on the usage. + """ + self.vtk_overlay_window._RenderWindow.Finalize() + self.vtk_overlay_window.TerminateApp() + def add_vtk_models_from_dir(self, directory): """ Add VTK models to the foreground. @@ -47,34 +73,28 @@ def add_vtk_models_from_dir(self, directory): model_loader = VTKSurfaceModelDirectoryLoader(directory) self.vtk_overlay_window.add_vtk_models(model_loader.models) - def update(self): + def update_view(self): """ Update the scene background and/or foreground. Should be implemented by sub class """ raise NotImplementedError('Should have implemented this method.') - def stop(self): - """ - Make sure that the VTK Interactor terminates nicely, otherwise - it can throw some error messages, depending on the usage. - """ - self.vtk_overlay_window._RenderWindow.Finalize() - self.vtk_overlay_window.TerminateApp() -class OverlayOnVideoFeed(OverlayBaseApp): +class OverlayOnVideoFeed(OverlayBaseWidget): """ Uses the acquired video feed as the background image, with no additional processing. """ - - def update(self): - """ Get the next frame of input and display it. """ + def update_view(self): + """ + Get the next frame of input and display it. + """ _, self.img = self.video_source.read() self.vtk_overlay_window.set_video_image(self.img) - self.vtk_overlay_window._RenderWindow.Render() + self.vtk_overlay_window.Render() -class OverlayOnVideoFeedCropRecord(OverlayBaseApp): +class OverlayOnVideoFeedCropRecord(OverlayBaseWidget): """ Add cropping of the incoming video feed, and the ability to record the vtk_overlay_window. @@ -89,14 +109,15 @@ def __init__(self, video_source, output_filename=None, dims=None): self.output_filename = output_filename self.video_writer = None - def update(self): - """ Get the next frame of input, crop and/or - write to file (if either enabled). """ + def update_view(self): + """ + Get the next frame of input, crop and/or + write to file (if either enabled). + """ _, self.img = self.video_source.read() self.vtk_overlay_window.set_video_image(self.img) - - self.vtk_overlay_window._RenderWindow.Render() + self.vtk_overlay_window.Render() if self.save_frame: output_frame = self.get_output_frame() @@ -144,46 +165,3 @@ def on_record_stop(self): self.save_frame = False self.video_writer.close() logging.debug("Recording stopped.") - - -class DuplicateOverlayWindow(OverlayOnVideoFeedCropRecord): - """ - Set the background of vtk_overlay_window to duplicate - that of another vtk_overlay_window. - - Example usage: - video_source = 0 - source_window = OverlayOnVideoFeedCropRecord(video_source) - - duplicate_window = DuplicateOverlayWindow() - duplicate_window.set_source_window(source_window) - - """ - def __init__(self): - - #pylint: disable=super-init-not-called - self.vtk_overlay_window = VTKOverlayWindow() - self.update_rate = 30 - self.img = None - self.timer = None - self.source_window = None - - def set_source_window(self, source_window): - """ Set the source window. - :param source_window: The window that contains the image to copy. """ - self.source_window = source_window - - def update(self): - """ Update the frame with a new background image.""" - - self.img = self.source_window.vtk_overlay_window.input - self.vtk_overlay_window.set_video_image(self.img) - - self.vtk_overlay_window._RenderWindow.Render() - - def on_record_start(self): - """ Don't want to call the base class version, so override.""" - - - def on_record_stop(self): - """ Don't want to call the base class version, so override.""" diff --git a/sksurgeryutils/ui/sksurgeryreslice_demo.py b/sksurgeryutils/ui/sksurgeryreslice_demo.py index 8ca9d09..193c48c 100644 --- a/sksurgeryutils/ui/sksurgeryreslice_demo.py +++ b/sksurgeryutils/ui/sksurgeryreslice_demo.py @@ -5,6 +5,7 @@ from sksurgeryarucotracker.arucotracker import ArUcoTracker + def run_demo(tracked, dicom_dir): """ Demo """ diff --git a/sksurgeryutils/ui/sksurgerytextoverlay_demo.py b/sksurgeryutils/ui/sksurgerytextoverlay_demo.py index de102d1..904c71f 100644 --- a/sksurgeryutils/ui/sksurgerytextoverlay_demo.py +++ b/sksurgeryutils/ui/sksurgerytextoverlay_demo.py @@ -12,7 +12,9 @@ logging.basicConfig(level=logging.INFO) LOGGER = logging.getLogger(__name__) -#pylint:disable=line-too-long, invalid-name, unused-argument + + +# pylint:disable=line-too-long, invalid-name, unused-argument class TextOverlayDemo(common_overlay_apps.OverlayOnVideoFeed): """ Demo app, to show text overlay""" def __init__(self, video_source): @@ -50,6 +52,7 @@ def mouse_click_callback(self, obj, ev): vtk_text.set_parent_window(self.vtk_overlay_window) self.vtk_overlay_window.add_vtk_actor(vtk_text.text_actor, 2) + def run_demo(): """ Run demo """ app = QApplication([]) diff --git a/sksurgeryutils/ui/sksurgerytransformpolydata_demo.py b/sksurgeryutils/ui/sksurgerytransformpolydata_demo.py index 9cfdf05..90f325d 100644 --- a/sksurgeryutils/ui/sksurgerytransformpolydata_demo.py +++ b/sksurgeryutils/ui/sksurgerytransformpolydata_demo.py @@ -9,7 +9,8 @@ import sksurgeryvtk.utils.matrix_utils as mu import sksurgeryvtk.models.vtk_surface_model as sm -#pylint:disable=no-member +# pylint:disable=no-member + def run_demo(input_file, output_file, diff --git a/sksurgeryutils/ui/sksurgeryvideocalibration_app.py b/sksurgeryutils/ui/sksurgeryvideocalibration_app.py new file mode 100644 index 0000000..22ed7ae --- /dev/null +++ b/sksurgeryutils/ui/sksurgeryvideocalibration_app.py @@ -0,0 +1,409 @@ +# coding=utf-8 + +""" Functions to run video calibration, in a VTKOverlayWindow (i.e. Qt). """ + +import os +import sys +from datetime import datetime +import cv2 +from PySide2 import QtWidgets +from PySide2.QtWidgets import QWidget, QHBoxLayout, QApplication +from PySide2.QtCore import QTimer +from sksurgeryvtk.widgets.vtk_overlay_window import VTKOverlayWindow +import sksurgeryimage.calibration.chessboard_point_detector as cpd +import sksurgerycalibration.video.video_calibration_driver_mono as mc +import sksurgeryutils.utils.opencv_video_capture_utils as vcu + +# pylint: disable=protected-access,unused-argument,unused-variable + + +class BaseDriver: + """ + Base class for both CalibrationDriver and CalibrationCheckerDriver. + Separate from Qt stuff, so it can be used in interactive mode or not. + """ + def __init__(self, + configuration, + source): + """ + Constructor must throw if anything at all wrong. + + :raises ValueError, RuntimeError. + """ + if configuration is None: + raise ValueError( + "You must provide a configuration file. " + "(see config/video_chessboard_conf.json for example).") + + # Throws RuntimeError if anything wrong. + source = vcu.validate_camera_source(source) + + # For now just doing chessboards. + # The underlying framework works for several point detectors, + # but each would have their own parameters etc. + method = configuration.get("method", "chessboard") + if method != "chessboard": + raise ValueError("Only chessboard calibration" + " is currently supported") + + # The video source either defaults to whatever size OpenCV + # gives, or you can specify the size in the config file. + window_size = configuration.get("window size", None) + self.cap = vcu.open_video_source(source, window_size) + + # These are the key parameters for the chessboard. + size = configuration.get("square size in mm", 3) + corners = configuration.get("corners", [14, 10]) + self.corners = (corners[0], corners[1]) + + # .. and hence we can now create a chessboard point detector. + self.detector = cpd.ChessboardPointDetector(corners, size) + + self.frame_ok = False + self.frame = None + + self.key_pressed = None + + def set_key_pressed(self, key_pressed): + """ + Set's member variable key_pressed. + """ + self.key_pressed = key_pressed + + def get_key_pressed(self): + """ + Get's member variable key_pressed. + """ + return self.key_pressed + + def shutdown(self): + """ + Try to do any cleanup properly. Releases video source. + """ + self.cap.release() + + def grab_frame(self): + """ + Captures image. + + :return: frame_ok, frame + :rtype: bool, numpy.ndarray + """ + self.frame_ok, self.frame = self.cap.read() + + if not self.frame_ok: + print("Reached end of video source or read failure.") + + return self.frame_ok, self.frame + + def process_frame(self): + """ + Derived classes must implement this. + """ + raise NotImplementedError("Derived classes must implement " + "process_frame()") + + +class CalibrationDriver(BaseDriver): + """ + Main calibration logic in a separate class, so it can be + used either in interactive mode, or not. + """ + def __init__(self, + configuration, + source, + output_dir=None, + file_prefix=None + ): + """ + Constructor must throw if anything at all wrong. + """ + super().__init__(configuration=configuration, + source=source) + + # These two are optional, so can be None. + self.output_dir = output_dir + self.file_prefix = file_prefix + + if self.file_prefix is not None and self.output_dir is None: + self.output_dir = os.getcwd() + + # Parameters specific to calibration. + self.calibrator = mc.MonoVideoCalibrationDriver(self.detector, + self.corners[0] * + self.corners[1]) + + self.min_num_views = configuration.get("minimum number of views", 5) + + print("Minimum number of views to calibrate:" + str(self.min_num_views)) + + def process_frame(self): + """ + Extracts the points from the image, and if we have enough frames, + will automatically recalibrate. + + :return: number_points, annotated + :rtype: int, numpy.ndarray + """ + annotated = None + number_points = self.calibrator.grab_data(self.frame) + + if number_points > 0: + img_pts = self.calibrator.video_data.image_points_arrays[-1] + annotated = cv2.drawChessboardCorners(self.frame, + self.corners, + img_pts, + number_points) + number_of_views = self.calibrator.get_number_of_views() + print("Number of frames = " + str(number_of_views)) + + if number_of_views >= self.min_num_views: + + proj_err, params = self.calibrator.calibrate() + print("Reprojection (2D) error is:" + str(proj_err)) + print("Intrinsics are:") + print(params.camera_matrix) + print("Distortion matrix is:") + print(params.dist_coeffs) + + if self.output_dir is not None: + + if not os.path.isdir(self.output_dir): + os.makedirs(self.output_dir) + + self.calibrator.save_data(self.output_dir, + self.file_prefix) + self.calibrator.save_params(self.output_dir, + self.file_prefix) + else: + print("Failed to detect points") + + return number_points, annotated + + +class BaseCalibrationWidget(QWidget): + """ + Base class Widget to provide calibration methods in interactive mode. + """ + def __init__(self, configuration, driver): + """ + Constructor must throw if any issues. + + :param configuration: Dictionary of configuration data. + :param driver: class derived from BaseDriver + """ + super().__init__() + + if configuration is None: + raise ValueError("Configuration data is None") + + if driver is None: + raise ValueError("Driver is None") + + self.driver = driver + + self.layout = QHBoxLayout(self) + self.layout.setContentsMargins(0, 0, 0, 0) + self.layout.setSpacing(0) + + self.vtk_overlay_window = VTKOverlayWindow() + self.layout.addWidget(self.vtk_overlay_window) + + self.keypress_delay_in_milliseconds \ + = configuration.get("keypress delay in ms", 1000) + + self.vtk_overlay_window.AddObserver("KeyPressEvent", + self.on_key_press_event) + + self.timer = QTimer() + self.timer.timeout.connect(self.update_view) + + self.update_rate = 30 + self.annotation_time = None + self.show_annotation = False + + def start(self): + """ + Starts the timer, which repeatedly triggers the update_view() method. + """ + self.timer.start(int(1000.0 / self.update_rate)) + + def stop(self): + """ + Stops the timer. + """ + self.timer.stop() + + def finalize(self): + """ + Make sure that the VTK Interactor terminates nicely, otherwise + it can throw some error messages, depending on the usage. + """ + self.vtk_overlay_window._RenderWindow.Finalize() + + def on_exit_selected(self): + """ + Opportunity to do any clear up, before exiting app. + + Stops timer, shutsdown camera feed, and asks VTK to kill window/app. + """ + self.stop() + self.driver.shutdown() + self.finalize() + QApplication.quit() + + def update_view(self): + """ + Called by QTimer, to do the main UI window update. + """ + frame_ok, frame = self.driver.grab_frame() + + if not frame_ok: + print("Failed to read frame") + return + + time_now = datetime.now() + + if self.annotation_time is not None: + time_diff = time_now - self.annotation_time + seconds = time_diff.total_seconds() + if seconds > self.keypress_delay_in_milliseconds / 1000.0: + self.show_annotation = False + + if not self.show_annotation: + self.vtk_overlay_window.set_video_image(frame) + + if self.driver.get_key_pressed() is not None: + + number_of_points, annotated_image = self.driver.process_frame() + self.driver.set_key_pressed(None) + + if number_of_points < 1: + print("Failed to detect points") + return + + self.vtk_overlay_window.set_video_image(annotated_image) + self.vtk_overlay_window.Render() + self.repaint() + + self.annotation_time = datetime.now() + self.show_annotation = True + + else: + self.vtk_overlay_window.Render() + self.repaint() + + +class CalibrationWidget(BaseCalibrationWidget): + """ + Widget to provide calibration logic in interactive mode. + """ + def __init__(self, + configuration, + driver): + """ + Widget class to provide GUI event handling for the Calibration process. + """ + super().__init__(configuration, driver) + + print("Press 'q' to quit and 'c' to capture an image.") + + def on_key_press_event(self, obj, event): + """ + Called when a key is pressed, if 'q', exit, if 'c' capture image. + """ + if self.vtk_overlay_window.GetKeySym() == 'q': + print("Detected 'q' key press, exiting.") + self.on_exit_selected() + elif self.vtk_overlay_window.GetKeySym() == 'c': + print("Detected 'c' key press, capturing data.") + self.driver.set_key_pressed('c') + + +class CalibrationManager: + """ + For non-interactive mode, reads from an OpenCV VideoCapture, and + samples every few frames, as determined by "sample frequency" in config. + """ + def __init__(self, + configuration, + driver + ): + """ + General manager class that will repeatedly call driver.grab_frame() + and then trigger driver.extract_points() every few frames. + + :param configuration: Dictionary of configuration parameters. + :param driver: Class derived from BaseDriver. + """ + if driver is None: + raise ValueError("Driver is None") + if configuration is None: + raise ValueError("Configuration is None") + + self.driver = driver + + self.sample_frequency = configuration.get("sample frequency", 1) + + def run(self): + """ + Process frames from the video source, until no frames. + """ + frames_sampled = 0 + + while True: + + frame_ok, _ = self.driver.grab_frame() + + if not frame_ok: + print("Reached end of video source or read failure.") + break + + frames_sampled += 1 + + if frames_sampled % self.sample_frequency == 0: + + number_of_points, _ = self.driver.process_frame() + + if number_of_points < 1: + print("Failed to detect points") + + +def run_video_calibration(configuration, + source, + output_dir=None, + file_prefix=None, + noninteractive=None + ): + """ + Performs Video Calibration using OpenCV + source and scikit-surgerycalibration. + + It's a demo app, so currently, only chessboards are supported. + + :param configuration: dictionary of configuration data. + :param source: OpenCV video source, either webcam number or file name. + :param output_dir: optional directory name to dump calibrations to. + :param file_prefix: optional file name prefix when saving. + :param noninteractive: If True we run without GUI. + """ + driver = CalibrationDriver(configuration, + source, + output_dir, + file_prefix) + + if noninteractive: + + manager = CalibrationManager(configuration=configuration, + driver=driver) + manager.run() + + else: + + app = QtWidgets.QApplication([]) + + widget = CalibrationWidget(configuration=configuration, + driver=driver) + widget.show() + widget.start() + sys.exit(app.exec_()) diff --git a/sksurgeryutils/ui/sksurgeryvideocalibration_command_line.py b/sksurgeryutils/ui/sksurgeryvideocalibration_command_line.py new file mode 100644 index 0000000..c870d7e --- /dev/null +++ b/sksurgeryutils/ui/sksurgeryvideocalibration_command_line.py @@ -0,0 +1,62 @@ +# coding=utf-8 + +""" CLI for sksurgeryvideocalibration app. """ +import argparse +from sksurgerycore.configuration.configuration_manager import \ + ConfigurationManager +from sksurgeryutils import __version__ +from sksurgeryutils.ui.sksurgeryvideocalibration_app import \ + run_video_calibration + + +def main(args=None): + """ Entry point for sksurgeryvideocalibration. """ + + parser = argparse.ArgumentParser(description='sksurgeryvideocalibration') + + parser.add_argument("-c", "--config", + required=True, + type=str, + help="Configuration file containing the parameters " + "(see config/video_chessboard_conf.json " + "for example).") + + parser.add_argument("-s", "--source", + required=False, + type=str, + default="0", + help="OpenCV source. (USB camera number, or filename).") + + parser.add_argument("-o", "--output", + required=False, + type=str, + help="Optional directory to save to.") + + parser.add_argument("-p", "--prefix", + required=False, + type=str, + help="Optional filename prefix to save to.") + + parser.add_argument("-ni", "--noninteractive", + required=False, + action='store_true', + help="If specified, runs noninteractive mode.") + + version_string = __version__ + friendly_version_string = version_string if version_string else 'unknown' + parser.add_argument( + "-v", "--version", + action='version', + version='sksurgeryvideocalibration version ' + friendly_version_string) + + args = parser.parse_args(args) + + configurer = ConfigurationManager(args.config) + configuration = configurer.get_copy() + + run_video_calibration(configuration, + args.source, + args.output, + args.prefix, + args.noninteractive + ) diff --git a/sksurgeryutils/ui/sksurgeryvideocalibrationchecker_app.py b/sksurgeryutils/ui/sksurgeryvideocalibrationchecker_app.py new file mode 100644 index 0000000..e2d084a --- /dev/null +++ b/sksurgeryutils/ui/sksurgeryvideocalibrationchecker_app.py @@ -0,0 +1,194 @@ +# coding=utf-8 + +""" Functions to assess calibration accuracy, in a VTKOverlayWindow. """ + +import os +import sys +import numpy as np +import cv2 +from PySide2 import QtWidgets +from sksurgerycalibration.video.video_calibration_params import \ + MonoCalibrationParams +import sksurgeryutils.ui.sksurgeryvideocalibration_app as vca + +# pylint: disable=unused-argument + + +class CalibrationCheckerDriver(vca.BaseDriver): + """ + Main app logic to check the accuracy of a calibration. + """ + def __init__(self, + configuration, + source, + calibration_dir=None, + file_prefix=None + ): + """ + Constructor must throw if anything at all wrong. + """ + super().__init__(configuration=configuration, + source=source) + + if calibration_dir is None: + raise ValueError("Calibration dir must not be None") + if not isinstance(calibration_dir, str): + raise ValueError("Calibration dir should be a string") + if len(calibration_dir) == 0: + raise ValueError("Calibration dir is an empty string") + if not os.path.isdir(calibration_dir): + raise ValueError("Calibration dir is not a dir") + + # Parameters specific to calibration checking, as base class + # has all the stuff for video capture etc. + existing_calibration = MonoCalibrationParams() + existing_calibration.load_data(calibration_dir, + file_prefix, + halt_on_ioerror=False) + self.intrinsics = existing_calibration.camera_matrix + self.distortion = existing_calibration.dist_coeffs + + self.captured_positions = np.zeros((0, 3)) + + print("Loaded calibration from:" + str(calibration_dir)) + + def process_frame(self): + """ + Main logic for what to extract and what to measure. + + :return: number_points, annotated + :rtype: int, numpy.ndarray + """ + number_points = 0 + annotated = None + + undistorted = cv2.undistort(self.frame, + self.intrinsics, self.distortion) + + _, object_points, image_points = \ + self.detector.get_points(undistorted) + + if image_points.shape[0] > 0: + + number_points = self.corners[0] * self.corners[1] + + annotated = cv2.drawChessboardCorners(undistorted, + self.corners, + image_points, + number_points) + + pnp_ok, _, tvec = cv2.solvePnP(object_points, + image_points, + self.intrinsics, + None) + + if pnp_ok: + + self.captured_positions = np.append(self.captured_positions, + np.transpose(tvec), + axis=0) + + if self.captured_positions.shape[0] > 1: + + if self.key_pressed == 't': + print("Translation: " + + str(self.captured_positions[-1][0] + - self.captured_positions[-2][0]) + " " + + str(self.captured_positions[-1][1] + - self.captured_positions[-2][1]) + " " + + str(self.captured_positions[-1][2] + - self.captured_positions[-2][2]) + " ") + + if self.key_pressed == 'm': + print("Mean:" + + str(np.mean(self.captured_positions, axis=0))) + print("StdDev:" + + str(np.std(self.captured_positions, axis=0))) + + if self.key_pressed == 'c': + print("Pose" + str(tvec[0][0]) + " " + + str(tvec[1][0]) + " " + + str(tvec[2][0])) + else: + print("Failed to solve PnP.") + else: + print("Failed to detect points.") + + return number_points, annotated + + +class CalibrationCheckerWidget(vca.BaseCalibrationWidget): + """ + Widget to provide calibration checking logic in interactive mode. + """ + def __init__(self, + configuration, + driver): + """ + Widget class to provide GUI event handling for the Checking process. + """ + super().__init__(configuration, driver) + + print("Press 'q' to quit.") + print("Press 'c' to capture an image.") + print("Press 't' to measure translation.") + print("Press 'm' to measure the mean/std-dev of a fixed position.") + + def on_key_press_event(self, obj, event): + """ + Called when a key is pressed. + """ + if self.vtk_overlay_window.GetKeySym() == 'q': + print("Detected 'q' key press, exiting.") + self.on_exit_selected() + elif self.vtk_overlay_window.GetKeySym() == 'c': + print("Detected 'c' key press, capturing data.") + self.driver.set_key_pressed('c') + elif self.vtk_overlay_window.GetKeySym() == 't': + print("Detected 't' key press, measuring translation.") + self.driver.set_key_pressed('t') + elif self.vtk_overlay_window.GetKeySym() == 'm': + print("Detected 'm' key press, measuring mean/std-dev.") + self.driver.set_key_pressed('m') + + +def run_video_calibration_checker(configuration, + source, + calib_dir, + file_prefix, + noninteractive + ): + """ + Checks how accurate an OpenCV calibration is. Essentially, + you move a chessboard by a known amount, e.g. 5mm, and + we use PnP to work out how far the camera has moved relative + to the chessboard. + + It's a demo app, so currently, only chessboards are supported. + + :param configuration: dictionary of configuration data. + :param source: OpenCV video source, either webcam number or file name. + :param calib_dir: Directory containing a calibration. + :param file_prefix: optional file name prefix when loading. + :param noninteractive: If True we run without GUI. + """ + driver = CalibrationCheckerDriver(configuration, + source, + calib_dir, + file_prefix + ) + if noninteractive: + + manager = vca.CalibrationManager(configuration=configuration, + driver=driver) + manager.run() + + else: + + app = QtWidgets.QApplication([]) + + widget = CalibrationCheckerWidget(configuration=configuration, + driver=driver) + widget.show() + widget.start() + sys.exit(app.exec_()) diff --git a/sksurgeryutils/ui/sksurgeryvideocalibrationchecker_command_line.py b/sksurgeryutils/ui/sksurgeryvideocalibrationchecker_command_line.py new file mode 100644 index 0000000..b9c22dd --- /dev/null +++ b/sksurgeryutils/ui/sksurgeryvideocalibrationchecker_command_line.py @@ -0,0 +1,64 @@ +# coding=utf-8 + +""" CLI for sksurgeryvideocalibrationchecker app. """ +import argparse +from sksurgerycore.configuration.configuration_manager import \ + ConfigurationManager +from sksurgeryutils import __version__ +from sksurgeryutils.ui.sksurgeryvideocalibrationchecker_app import \ + run_video_calibration_checker + + +def main(args=None): + """ Entry point for sksurgeryvideocalibrationchecker. """ + + parser = argparse.ArgumentParser( + description='sksurgeryvideocalibrationchecker') + + parser.add_argument("-c", "--config", + required=True, + type=str, + help="Configuration file containing the parameters " + "(see config/video_chessboard_conf.json " + "for example).") + + parser.add_argument("-s", "--source", + required=False, + type=str, + default="0", + help="OpenCV source. (USB camera number, or filename).") + + parser.add_argument("-d", "--calib_dir", + required=True, + type=str, + help="Directory containing calibration data.") + + parser.add_argument("-p", "--prefix", + required=False, + type=str, + help="Prefix for calibration data.") + + parser.add_argument("-ni", "--noninteractive", + required=False, + action='store_true', + help="If specified, runs noninteractive mode.") + + version_string = __version__ + friendly_version_string = version_string if version_string else 'unknown' + parser.add_argument( + "--version", + action='version', + version='scikit-sksurgeryvideocalibrationchecker version ' + + friendly_version_string) + + args = parser.parse_args(args) + + configurer = ConfigurationManager(args.config) + configuration = configurer.get_copy() + + run_video_calibration_checker(configuration, + args.source, + args.calib_dir, + args.prefix, + args.noninteractive + ) diff --git a/sksurgeryutils/utils/opencv_video_capture_utils.py b/sksurgeryutils/utils/opencv_video_capture_utils.py new file mode 100644 index 0000000..ef0b165 --- /dev/null +++ b/sksurgeryutils/utils/opencv_video_capture_utils.py @@ -0,0 +1,66 @@ +# coding=utf-8 + +""" Small utilities to do with opening an OpenCV video camera. """ + +import os +import cv2 + + +def validate_camera_source(source): + """ + Checks the source parameters is not None, is either + an int or a string, and if it's a string, then it should be a filename, + or if it's an int, it should be non-negative. + + :raises: RuntimeError on all errors. + """ + if source is None: + raise RuntimeError("OpenCV source is None. " + "Should be a device number or filename.") + + if not isinstance(source, str) and not isinstance(source, int): + raise RuntimeError("OpenCV source is neither str nor int.") + + result = source + + if isinstance(source, str): + + if source.isdigit(): + source_as_int = int(source) + if source_as_int < 0: + raise RuntimeError("OpenCV source is an int, but negative.") + + result = source_as_int + else: + if not os.path.isfile(source): + raise RuntimeError("OpenCV source is a string, but not a file.") + + return result + + +def open_video_source(source, window_size=None): + """ + Function to open the source, and if provided, set window size. + + :param source: OpenCV video source specifier (file, or int). + :param window_size: 2-tuple, (width, height) + :return cv2.VideoCapture that is open (ready). + :raises RuntimeError: if the source fails to open. + """ + cap = cv2.VideoCapture(source) + if not cap.isOpened(): + raise RuntimeError("Failed to open camera " + "from source:" + str(source)) + + if window_size is not None: + cap.set(cv2.CAP_PROP_FRAME_WIDTH, window_size[0]) + cap.set(cv2.CAP_PROP_FRAME_HEIGHT, window_size[1]) + print("Video feed set to (" + + str(window_size[0]) + " x " + str(window_size[1]) + ")") + else: + width = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH)) + height = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT)) + print("Video feed defaults to (" + + str(width) + " x " + str(height) + ")") + + return cap diff --git a/sksurgeryvideocalibration.py b/sksurgeryvideocalibration.py new file mode 100644 index 0000000..6a32e74 --- /dev/null +++ b/sksurgeryvideocalibration.py @@ -0,0 +1,8 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- +import sys + +from sksurgeryutils.ui.sksurgeryvideocalibration_command_line import main + +if __name__ == "__main__": + sys.exit(main(sys.argv[1:])) diff --git a/sksurgeryvideocalibrationchecker.py b/sksurgeryvideocalibrationchecker.py new file mode 100644 index 0000000..5fefdc4 --- /dev/null +++ b/sksurgeryvideocalibrationchecker.py @@ -0,0 +1,8 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- +import sys + +from sksurgeryutils.ui.sksurgeryvideocalibrationchecker_command_line import main + +if __name__ == "__main__": + sys.exit(main(sys.argv[1:])) diff --git a/tests/data/laparoscope_calibration/cbh-viking/calib.left.distortion.txt b/tests/data/laparoscope_calibration/cbh-viking/calib.left.distortion.txt new file mode 100755 index 0000000..5d33916 --- /dev/null +++ b/tests/data/laparoscope_calibration/cbh-viking/calib.left.distortion.txt @@ -0,0 +1 @@ +-0.291690 -0.001882 0.007161 -0.000171 0.374519 \ No newline at end of file diff --git a/tests/data/laparoscope_calibration/cbh-viking/calib.left.intrinsics.txt b/tests/data/laparoscope_calibration/cbh-viking/calib.left.intrinsics.txt new file mode 100755 index 0000000..f47de1e --- /dev/null +++ b/tests/data/laparoscope_calibration/cbh-viking/calib.left.intrinsics.txt @@ -0,0 +1,3 @@ +1766.276290 0.000000 915.665775 +0.000000 1769.623383 458.985368 +0.000000 0.000000 1.000000 \ No newline at end of file diff --git a/tests/data/laparoscope_calibration/cbh-viking/calib.right.distortion.txt b/tests/data/laparoscope_calibration/cbh-viking/calib.right.distortion.txt new file mode 100755 index 0000000..2b6657f --- /dev/null +++ b/tests/data/laparoscope_calibration/cbh-viking/calib.right.distortion.txt @@ -0,0 +1 @@ +-0.291115 0.226945 -0.000367 0.013965 -0.121846 \ No newline at end of file diff --git a/tests/data/laparoscope_calibration/cbh-viking/calib.right.intrinsics.txt b/tests/data/laparoscope_calibration/cbh-viking/calib.right.intrinsics.txt new file mode 100755 index 0000000..e47abdb --- /dev/null +++ b/tests/data/laparoscope_calibration/cbh-viking/calib.right.intrinsics.txt @@ -0,0 +1,3 @@ +1792.669020 0.000000 1113.645820 +0.000000 1792.169495 478.497416 +0.000000 0.000000 1.000000 \ No newline at end of file diff --git a/tests/data/laparoscope_calibration/cbh-viking/config-cbh-dots.json b/tests/data/laparoscope_calibration/cbh-viking/config-cbh-dots.json new file mode 100644 index 0000000..2987bf4 --- /dev/null +++ b/tests/data/laparoscope_calibration/cbh-viking/config-cbh-dots.json @@ -0,0 +1,52 @@ +{ + "tracker": { + "tracker type": "unit test", + "use quaternions": false, + "tracked objects": { + "marker": "config/8700339.rom", + "laparoscope": "config/8700449.rom", + "pointer": "config/8700340.rom" + } + }, + "calibration": { + "general": { + "load previous calibration file": true, + "left intrinsics": "", + "left distortion": "", + "right intrinsics": "", + "right distortion": "", + "l2r": "", + "features": "dots", + "frames required": 5, + "smooth images": false, + "iterative": false, + "maximum reprojection error": 20, + "maximum reconstruction error": 5, + "display good or bad": true, + "required to pass": false + }, + "charuco": { + "minimum points per frame": 50, + "squares": [19, 26], + "square sizes": [5, 4], + "chessboard squares": [9, 14], + "chessboard square size": 3, + "filter markers": false, + "error if no chessboard": true, + "error if no charuco": false + }, + "dots": { + "intrinsic params": "tests/data/calibration/cbh-viking/calib.left.intrinsics.txt", + "distortion coeffs": "tests/data/calibration/cbh-viking/calib.left.distortion.txt", + "minimum points per frame": 36, + "dots": [14, 16], + "separation in mm": 4, + "fiducial indexes": [69, 74, 149, 154], + "reference image size in pixels": [1200, 1360], + "pixels per mm": 80 + } + }, + "recording": { + "output dir": "output/" + } +} \ No newline at end of file diff --git a/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_08_32/left_image.png b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_08_32/left_image.png new file mode 100755 index 0000000..928ada6 Binary files /dev/null and b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_08_32/left_image.png differ diff --git a/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_08_32/right_image.png b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_08_32/right_image.png new file mode 100755 index 0000000..fc62e8e Binary files /dev/null and b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_08_32/right_image.png differ diff --git a/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_08_32/tracking_data.txt b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_08_32/tracking_data.txt new file mode 100755 index 0000000..7253347 --- /dev/null +++ b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_08_32/tracking_data.txt @@ -0,0 +1,4 @@ +-0.982398 -0.164113 -0.089220 72.810715 +-0.008690 0.517266 -0.855780 -263.958832 +0.186595 -0.839942 -0.509588 -1396.689209 +0.000000 0.000000 0.000000 1.000000 diff --git a/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_09_35/left_image.png b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_09_35/left_image.png new file mode 100755 index 0000000..595821a Binary files /dev/null and b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_09_35/left_image.png differ diff --git a/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_09_35/right_image.png b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_09_35/right_image.png new file mode 100755 index 0000000..90dc420 Binary files /dev/null and b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_09_35/right_image.png differ diff --git a/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_09_35/tracking_data.txt b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_09_35/tracking_data.txt new file mode 100755 index 0000000..e0a6823 --- /dev/null +++ b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_09_35/tracking_data.txt @@ -0,0 +1,4 @@ +-0.982717 -0.162246 -0.089131 72.787117 +-0.007737 0.517065 -0.855911 -263.931549 +0.184955 -0.840428 -0.509384 -1396.719971 +0.000000 0.000000 0.000000 1.000000 diff --git a/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_10_22/left_image.png b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_10_22/left_image.png new file mode 100755 index 0000000..19283d6 Binary files /dev/null and b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_10_22/left_image.png differ diff --git a/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_10_22/right_image.png b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_10_22/right_image.png new file mode 100755 index 0000000..684b189 Binary files /dev/null and b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_10_22/right_image.png differ diff --git a/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_10_22/tracking_data.txt b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_10_22/tracking_data.txt new file mode 100755 index 0000000..ec75519 --- /dev/null +++ b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_10_22/tracking_data.txt @@ -0,0 +1,4 @@ +-0.982798 -0.161738 -0.089161 72.783470 +-0.007532 0.517470 -0.855668 -263.936035 +0.184533 -0.840277 -0.509786 -1396.716064 +0.000000 0.000000 0.000000 1.000000 diff --git a/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_10_45/left_image.png b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_10_45/left_image.png new file mode 100755 index 0000000..f1607ef Binary files /dev/null and b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_10_45/left_image.png differ diff --git a/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_10_45/right_image.png b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_10_45/right_image.png new file mode 100755 index 0000000..490886b Binary files /dev/null and b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_10_45/right_image.png differ diff --git a/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_10_45/tracking_data.txt b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_10_45/tracking_data.txt new file mode 100755 index 0000000..77ce890 --- /dev/null +++ b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_10_45/tracking_data.txt @@ -0,0 +1,4 @@ +-0.982774 -0.161856 -0.089202 72.792496 +-0.007553 0.517448 -0.855681 -263.932983 +0.184655 -0.840268 -0.509757 -1396.728027 +0.000000 0.000000 0.000000 1.000000 diff --git a/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_11_22/left_image.png b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_11_22/left_image.png new file mode 100755 index 0000000..3e3bf45 Binary files /dev/null and b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_11_22/left_image.png differ diff --git a/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_11_22/right_image.png b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_11_22/right_image.png new file mode 100755 index 0000000..1f35410 Binary files /dev/null and b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_11_22/right_image.png differ diff --git a/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_11_22/tracking_data.txt b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_11_22/tracking_data.txt new file mode 100755 index 0000000..0f5014c --- /dev/null +++ b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_11_22/tracking_data.txt @@ -0,0 +1,4 @@ +nan nan nan nan +nan nan nan nan +nan nan nan nan +nan nan nan nan diff --git a/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_11_56/left_image.png b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_11_56/left_image.png new file mode 100755 index 0000000..91fbb5e Binary files /dev/null and b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_11_56/left_image.png differ diff --git a/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_11_56/right_image.png b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_11_56/right_image.png new file mode 100755 index 0000000..c877310 Binary files /dev/null and b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_11_56/right_image.png differ diff --git a/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_11_56/tracking_data.txt b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_11_56/tracking_data.txt new file mode 100755 index 0000000..17f8e8a --- /dev/null +++ b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_11_56/tracking_data.txt @@ -0,0 +1,4 @@ +-0.982902 -0.161179 -0.089024 72.783546 +-0.007396 0.517651 -0.855560 -263.924164 +0.183982 -0.840273 -0.509992 -1396.731201 +0.000000 0.000000 0.000000 1.000000 diff --git a/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_12_04/left_image.png b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_12_04/left_image.png new file mode 100755 index 0000000..aa77fff Binary files /dev/null and b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_12_04/left_image.png differ diff --git a/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_12_04/right_image.png b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_12_04/right_image.png new file mode 100755 index 0000000..c113175 Binary files /dev/null and b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_12_04/right_image.png differ diff --git a/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_12_04/tracking_data.txt b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_12_04/tracking_data.txt new file mode 100755 index 0000000..b9b4797 --- /dev/null +++ b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_12_04/tracking_data.txt @@ -0,0 +1,4 @@ +-0.982862 -0.161351 -0.089152 72.793602 +-0.007386 0.517705 -0.855527 -263.921356 +0.184194 -0.840207 -0.510024 -1396.717651 +0.000000 0.000000 0.000000 1.000000 diff --git a/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_12_24/left_image.png b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_12_24/left_image.png new file mode 100755 index 0000000..633feee Binary files /dev/null and b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_12_24/left_image.png differ diff --git a/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_12_24/right_image.png b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_12_24/right_image.png new file mode 100755 index 0000000..ef8adbd Binary files /dev/null and b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_12_24/right_image.png differ diff --git a/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_12_24/tracking_data.txt b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_12_24/tracking_data.txt new file mode 100755 index 0000000..29daf82 --- /dev/null +++ b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_12_24/tracking_data.txt @@ -0,0 +1,4 @@ +-0.982902 -0.161175 -0.089025 72.777924 +-0.007394 0.517654 -0.855558 -263.921570 +0.183979 -0.840272 -0.509995 -1396.695679 +0.000000 0.000000 0.000000 1.000000 diff --git a/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_12_44/left_image.png b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_12_44/left_image.png new file mode 100755 index 0000000..f6352aa Binary files /dev/null and b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_12_44/left_image.png differ diff --git a/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_12_44/right_image.png b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_12_44/right_image.png new file mode 100755 index 0000000..be6f952 Binary files /dev/null and b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_12_44/right_image.png differ diff --git a/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_12_44/tracking_data.txt b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_12_44/tracking_data.txt new file mode 100755 index 0000000..3787ccb --- /dev/null +++ b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_12_44/tracking_data.txt @@ -0,0 +1,4 @@ +-0.982908 -0.161018 -0.089251 72.785416 +-0.007027 0.517258 -0.855801 -263.899078 +0.183965 -0.840546 -0.509548 -1396.661499 +0.000000 0.000000 0.000000 1.000000 diff --git a/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_13_18/left_image.png b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_13_18/left_image.png new file mode 100755 index 0000000..1c5a70e Binary files /dev/null and b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_13_18/left_image.png differ diff --git a/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_13_18/right_image.png b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_13_18/right_image.png new file mode 100755 index 0000000..489e920 Binary files /dev/null and b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_13_18/right_image.png differ diff --git a/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_13_18/tracking_data.txt b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_13_18/tracking_data.txt new file mode 100755 index 0000000..2663706 --- /dev/null +++ b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_13_18/tracking_data.txt @@ -0,0 +1,4 @@ +-0.974732 -0.205281 -0.088079 72.982742 +-0.031747 0.517605 -0.855030 -264.551239 +0.221111 -0.830629 -0.511043 -1395.835815 +0.000000 0.000000 0.000000 1.000000 diff --git a/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_13_46/left_image.png b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_13_46/left_image.png new file mode 100755 index 0000000..0fe5968 Binary files /dev/null and b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_13_46/left_image.png differ diff --git a/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_13_46/right_image.png b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_13_46/right_image.png new file mode 100755 index 0000000..888c18a Binary files /dev/null and b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_13_46/right_image.png differ diff --git a/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_13_46/tracking_data.txt b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_13_46/tracking_data.txt new file mode 100755 index 0000000..4349e97 --- /dev/null +++ b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_13_46/tracking_data.txt @@ -0,0 +1,4 @@ +-0.976352 -0.197388 -0.088175 72.941139 +-0.027534 0.518080 -0.854889 -264.480377 +0.214426 -0.832245 -0.511263 -1395.980469 +0.000000 0.000000 0.000000 1.000000 diff --git a/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_14_26/left_image.png b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_14_26/left_image.png new file mode 100755 index 0000000..6f3b1db Binary files /dev/null and b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_14_26/left_image.png differ diff --git a/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_14_26/right_image.png b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_14_26/right_image.png new file mode 100755 index 0000000..5235735 Binary files /dev/null and b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_14_26/right_image.png differ diff --git a/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_14_26/tracking_data.txt b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_14_26/tracking_data.txt new file mode 100755 index 0000000..0a449cc --- /dev/null +++ b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_14_26/tracking_data.txt @@ -0,0 +1,4 @@ +-0.976963 -0.194236 -0.088409 72.939697 +-0.025577 0.517852 -0.855088 -264.430023 +0.211872 -0.833127 -0.510891 -1396.021362 +0.000000 0.000000 0.000000 1.000000 diff --git a/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_14_58/left_image.png b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_14_58/left_image.png new file mode 100755 index 0000000..46c9dc4 Binary files /dev/null and b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_14_58/left_image.png differ diff --git a/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_14_58/right_image.png b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_14_58/right_image.png new file mode 100755 index 0000000..2900a2b Binary files /dev/null and b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_14_58/right_image.png differ diff --git a/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_14_58/tracking_data.txt b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_14_58/tracking_data.txt new file mode 100755 index 0000000..e3884f9 --- /dev/null +++ b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_14_58/tracking_data.txt @@ -0,0 +1,4 @@ +-0.977317 -0.192506 -0.088278 72.926239 +-0.024757 0.517827 -0.855127 -264.402130 +0.210330 -0.833545 -0.510847 -1396.077759 +0.000000 0.000000 0.000000 1.000000 diff --git a/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_16_59/left_image.png b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_16_59/left_image.png new file mode 100755 index 0000000..54184c1 Binary files /dev/null and b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_16_59/left_image.png differ diff --git a/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_16_59/right_image.png b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_16_59/right_image.png new file mode 100755 index 0000000..638e31c Binary files /dev/null and b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_16_59/right_image.png differ diff --git a/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_16_59/tracking_data.txt b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_16_59/tracking_data.txt new file mode 100755 index 0000000..3e355fc --- /dev/null +++ b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_16_59/tracking_data.txt @@ -0,0 +1,4 @@ +-0.978301 -0.188249 -0.086541 74.033569 +-0.024157 0.518483 -0.854746 -265.486938 +0.205775 -0.834109 -0.511780 -1396.832520 +0.000000 0.000000 0.000000 1.000000 diff --git a/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_17_36/left_image.png b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_17_36/left_image.png new file mode 100755 index 0000000..c132d64 Binary files /dev/null and b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_17_36/left_image.png differ diff --git a/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_17_36/right_image.png b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_17_36/right_image.png new file mode 100755 index 0000000..4644713 Binary files /dev/null and b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_17_36/right_image.png differ diff --git a/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_17_36/tracking_data.txt b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_17_36/tracking_data.txt new file mode 100755 index 0000000..c35112c --- /dev/null +++ b/tests/data/laparoscope_calibration/cbh-viking/snapshots-metal-1/14_17_36/tracking_data.txt @@ -0,0 +1,4 @@ +-0.979023 -0.184886 -0.085623 74.031738 +-0.023645 0.520491 -0.853539 -265.775879 +0.202373 -0.833610 -0.513945 -1396.724243 +0.000000 0.000000 0.000000 1.000000 diff --git a/tests/data/laparoscope_calibration/chessboard_14_10_3.txt b/tests/data/laparoscope_calibration/chessboard_14_10_3.txt new file mode 100644 index 0000000..daa97d5 --- /dev/null +++ b/tests/data/laparoscope_calibration/chessboard_14_10_3.txt @@ -0,0 +1,140 @@ +0 0 0 +3 0 0 +6 0 0 +9 0 0 +12 0 0 +15 0 0 +18 0 0 +21 0 0 +24 0 0 +27 0 0 +30 0 0 +33 0 0 +36 0 0 +39 0 0 +0 3 0 +3 3 0 +6 3 0 +9 3 0 +12 3 0 +15 3 0 +18 3 0 +21 3 0 +24 3 0 +27 3 0 +30 3 0 +33 3 0 +36 3 0 +39 3 0 +0 6 0 +3 6 0 +6 6 0 +9 6 0 +12 6 0 +15 6 0 +18 6 0 +21 6 0 +24 6 0 +27 6 0 +30 6 0 +33 6 0 +36 6 0 +39 6 0 +0 9 0 +3 9 0 +6 9 0 +9 9 0 +12 9 0 +15 9 0 +18 9 0 +21 9 0 +24 9 0 +27 9 0 +30 9 0 +33 9 0 +36 9 0 +39 9 0 +0 12 0 +3 12 0 +6 12 0 +9 12 0 +12 12 0 +15 12 0 +18 12 0 +21 12 0 +24 12 0 +27 12 0 +30 12 0 +33 12 0 +36 12 0 +39 12 0 +0 15 0 +3 15 0 +6 15 0 +9 15 0 +12 15 0 +15 15 0 +18 15 0 +21 15 0 +24 15 0 +27 15 0 +30 15 0 +33 15 0 +36 15 0 +39 15 0 +0 18 0 +3 18 0 +6 18 0 +9 18 0 +12 18 0 +15 18 0 +18 18 0 +21 18 0 +24 18 0 +27 18 0 +30 18 0 +33 18 0 +36 18 0 +39 18 0 +0 21 0 +3 21 0 +6 21 0 +9 21 0 +12 21 0 +15 21 0 +18 21 0 +21 21 0 +24 21 0 +27 21 0 +30 21 0 +33 21 0 +36 21 0 +39 21 0 +0 24 0 +3 24 0 +6 24 0 +9 24 0 +12 24 0 +15 24 0 +18 24 0 +21 24 0 +24 24 0 +27 24 0 +30 24 0 +33 24 0 +36 24 0 +39 24 0 +0 27 0 +3 27 0 +6 27 0 +9 27 0 +12 27 0 +15 27 0 +18 27 0 +21 27 0 +24 27 0 +27 27 0 +30 27 0 +33 27 0 +36 27 0 +39 27 0 diff --git a/tests/data/laparoscope_calibration/left/left-1095.png b/tests/data/laparoscope_calibration/left/left-1095.png new file mode 100755 index 0000000..359d131 Binary files /dev/null and b/tests/data/laparoscope_calibration/left/left-1095.png differ diff --git a/tests/data/laparoscope_calibration/left/left-1095.png.points.txt b/tests/data/laparoscope_calibration/left/left-1095.png.points.txt new file mode 100644 index 0000000..111f778 --- /dev/null +++ b/tests/data/laparoscope_calibration/left/left-1095.png.points.txt @@ -0,0 +1,140 @@ +1098.3 267.087 +1144.36 265.08 +1190.76 262.848 +1237.74 261.431 +1284.35 259.5 +1331.78 258.308 +1379.43 256.383 +1427.1 255.583 +1474.61 254.372 +1522.45 253.343 +1571.04 252.401 +1619.24 251.156 +1667.41 249.957 +1716.28 249.669 +1094.69 306.275 +1141.6 303.377 +1188.53 301.83 +1235.99 299.672 +1283.58 298.475 +1331.31 296.675 +1379.31 295.711 +1427.57 294.631 +1475.91 294.212 +1524.61 293.175 +1573.76 292.36 +1621.82 290.809 +1671.01 289.996 +1719.32 289.383 +1091.76 345.032 +1139.22 343.444 +1186.69 341.309 +1234.42 340.359 +1282.58 338.259 +1331.08 337.468 +1379.53 336.104 +1428.94 335.499 +1477.6 334.715 +1526.76 334.324 +1576.06 333.336 +1625.51 332.071 +1674.71 330.937 +1724.34 330.87 +1088.27 386.404 +1136.3 384.111 +1184.44 382.869 +1232.23 381.24 +1280.86 380.392 +1330.38 378.639 +1379.76 378.215 +1429.1 377.372 +1478.72 377.479 +1528.74 376.587 +1578.24 376.053 +1628.48 374.417 +1678.4 373.585 +1728.39 372.522 +1084.05 427.179 +1132.3 426.753 +1181.04 424.806 +1229.88 424.259 +1279.18 422.491 +1329.25 421.817 +1379.2 420.533 +1429.4 420.792 +1479.11 420.177 +1529.93 420.282 +1579.73 419.125 +1631.29 417.832 +1681.72 416.377 +1732.41 416.361 +1080.9 470.423 +1129.62 468.625 +1178.75 468.292 +1227.95 466.952 +1278.41 466.621 +1328.5 465.174 +1379.6 464.811 +1429.64 464.311 +1480.54 464.467 +1531.49 463.926 +1582.8 463.048 +1633.98 461.997 +1685.93 461.028 +1735.96 460.61 +1077.66 513.242 +1127.26 512.939 +1176.3 511.766 +1226.6 511.568 +1277.51 510.99 +1328.64 509.799 +1378.78 508.786 +1430.07 508.683 +1481.92 508.429 +1533.69 508.547 +1585.17 508.005 +1637.53 507.143 +1688.84 506.412 +1740.37 506.168 +1073.3 558.441 +1123.29 557.154 +1173.62 557.185 +1224.19 556.908 +1276.17 556.865 +1327.51 555.548 +1378.43 555.039 +1430.23 554.38 +1482.57 554.698 +1534.73 554.591 +1587.23 554.379 +1639.61 553.411 +1691.63 553.218 +1743.82 553.069 +1069.36 603.654 +1120.04 603.791 +1170.68 603.463 +1222.12 603.59 +1274.02 603.158 +1325.69 602.676 +1377.96 602.088 +1430.56 601.748 +1482.94 601.646 +1535.59 602.198 +1588.51 601.622 +1642.4 601.548 +1694.59 601.26 +1747.49 601.217 +1065.28 651.595 +1116.06 651.298 +1167.75 651.586 +1219.71 651.742 +1272.22 651.913 +1324.28 651.487 +1377.3 651.326 +1429.85 650.751 +1483.52 650.911 +1536.26 650.613 +1590.09 650.777 +1643.8 650.461 +1697.29 650.587 +1750.98 650.183 diff --git a/tests/data/laparoscope_calibration/left/left-1338.png b/tests/data/laparoscope_calibration/left/left-1338.png new file mode 100755 index 0000000..d12a703 Binary files /dev/null and b/tests/data/laparoscope_calibration/left/left-1338.png differ diff --git a/tests/data/laparoscope_calibration/left/left-1338.png.points.txt b/tests/data/laparoscope_calibration/left/left-1338.png.points.txt new file mode 100644 index 0000000..0fcceab --- /dev/null +++ b/tests/data/laparoscope_calibration/left/left-1338.png.points.txt @@ -0,0 +1,140 @@ +816.541 412.263 +874.835 410.118 +934.098 406.424 +993.719 405.176 +1054.01 401.789 +1115.06 400.369 +1176.9 397.191 +1238.73 396.358 +1300.83 394.297 +1363.44 392.883 +1426.42 390.947 +1489.65 389.315 +1552.66 387.614 +1615.69 386.84 +809.39 464.227 +868.618 460.172 +928.549 458.764 +989.227 455.43 +1050.57 454.115 +1112.48 451.177 +1175.12 450.272 +1237.98 448.297 +1301.69 447.5 +1364.88 445.676 +1429.34 444.772 +1492.58 442.344 +1557.04 441.177 +1620.37 440.004 +802.612 515.499 +862.851 514.351 +923.547 511.119 +985.012 510.015 +1047.33 507.22 +1110.44 506.499 +1173.56 503.96 +1238.61 503.54 +1302.22 502.106 +1367.03 501.62 +1431.91 499.682 +1496.91 497.92 +1561.7 496.02 +1626.53 495.601 +795.362 571.223 +856.189 568.357 +917.713 567.612 +979.921 565.059 +1043.27 564.041 +1107.38 562.067 +1172.05 561.77 +1237.06 560.076 +1302.53 560.153 +1368.54 558.833 +1434.01 557.712 +1500.23 555.465 +1566.41 554.014 +1631.73 552.378 +787.242 626.817 +848.286 626.12 +911.132 623.417 +974.472 623.233 +1038.5 621.37 +1103.77 620.969 +1169.54 619.313 +1235.84 619.602 +1301.81 618.512 +1369.25 618.585 +1435.64 617.093 +1503.11 614.804 +1570.26 612.627 +1636.6 612.042 +779.884 684.558 +842.092 683.085 +905.454 682.886 +969.489 682.154 +1035.17 681.729 +1100.97 680.05 +1168.24 679.982 +1234.85 679.061 +1302.7 679.422 +1369.94 678.651 +1438.29 677.505 +1506.47 675.553 +1574.97 674.035 +1641.27 672.843 +772.823 743.05 +836.265 743.088 +899.899 742.488 +965.264 742.672 +1031.67 742.311 +1099 741.586 +1165.66 740.751 +1233.64 740.549 +1302.75 740.317 +1371.88 740.303 +1440.62 739.402 +1510.2 738.068 +1578.9 736.706 +1647.21 735.771 +764.522 804.303 +828.827 804.075 +893.914 804.696 +960.051 805.136 +1027.8 805.45 +1095.4 804.381 +1163.34 804.303 +1232.24 803.828 +1302.53 804.179 +1372.19 804.197 +1442.54 803.582 +1512.62 802.311 +1581.82 801.598 +1651.56 800.734 +756.524 866.781 +821.732 867.8 +887.733 868.311 +955.089 869.235 +1022.88 869.507 +1091.54 869.877 +1161.12 869.88 +1230.86 869.759 +1301.47 869.969 +1372.27 870.427 +1443.44 869.998 +1515.31 869.346 +1585.23 868.505 +1655.85 867.991 +748.237 932.185 +814.551 933.278 +881.596 934.433 +949.397 936.018 +1018.43 937.319 +1087.33 937.47 +1157.89 938.183 +1228.48 938.271 +1300.52 938.657 +1371.96 938.308 +1444.13 938.426 +1516.61 937.819 +1587.9 937.44 +1660.29 936.563 diff --git a/tests/data/laparoscope_calibration/left/left-1884.png b/tests/data/laparoscope_calibration/left/left-1884.png new file mode 100755 index 0000000..cd486b4 Binary files /dev/null and b/tests/data/laparoscope_calibration/left/left-1884.png differ diff --git a/tests/data/laparoscope_calibration/left/left-1884.png.points.txt b/tests/data/laparoscope_calibration/left/left-1884.png.points.txt new file mode 100644 index 0000000..25db005 --- /dev/null +++ b/tests/data/laparoscope_calibration/left/left-1884.png.points.txt @@ -0,0 +1,140 @@ +424.837 289.602 +472.931 277.999 +521.862 265.858 +571.355 254.437 +620.674 242.94 +671.925 231.322 +723.014 219.18 +774.818 208.753 +826.604 197.156 +878.929 186.409 +932.148 174.721 +985.48 163.535 +1038.91 152.278 +1092.58 142.53 +423.882 332.293 +472.488 320.044 +521.932 308.672 +571.868 296.656 +622.629 285.167 +673.653 273.276 +725.87 262.398 +778.003 251.053 +831.366 240.277 +884.304 228.659 +938.466 218.113 +991.549 205.867 +1046.41 195.309 +1100.78 184.465 +423.207 376.092 +472.687 364.216 +522.426 352.151 +573.206 341.003 +624.269 328.949 +676.621 317.996 +728.963 306.195 +782.823 295.352 +835.99 283.988 +890.529 273.606 +944.856 261.811 +999.402 250.542 +1054.29 238.735 +1109.78 228.388 +422.46 421.323 +471.763 409.31 +523.06 398.114 +573.55 386.404 +625.979 375.06 +678.951 362.915 +732.39 352.411 +786.43 340.768 +840.897 330.974 +895.909 318.978 +950.928 308.525 +1006.7 295.688 +1062.72 284.939 +1118.44 273.162 +420.473 467.872 +471.246 456.7 +522.61 444.79 +574.685 433.965 +627.261 422.052 +681.276 410.926 +735.406 398.845 +790.488 389.016 +845.104 377.107 +901.53 367.351 +956.976 354.906 +1013.84 343.451 +1070.33 330.427 +1127.22 320.507 +420.417 515.413 +471.505 504.073 +523.478 493.199 +576.147 481.971 +630.212 470.856 +684.094 458.963 +739.561 447.897 +794.475 436.763 +850.995 426.306 +907.411 414.648 +964.363 403.648 +1021.41 391.044 +1079.59 379.816 +1136.17 368.027 +420.203 563.774 +472.585 553.144 +524.708 541.942 +578.616 531.272 +633.175 520.129 +688.229 508.425 +743.075 496.7 +799.384 486.003 +856.69 474.355 +914.53 464.556 +971.657 452.284 +1030.53 440.934 +1088.18 428.371 +1146.48 417.922 +419.719 614.474 +472.499 603.284 +526.198 592.683 +580.244 582.306 +635.902 571.283 +691.452 559.15 +747.275 548.454 +803.966 536.542 +862.288 526.052 +920.594 514.615 +979.36 503.741 +1038.41 491.472 +1096.97 480.447 +1155.94 468.845 +419.722 665.892 +473.367 655.651 +527.55 644.89 +582.952 634.33 +638.607 623.324 +694.654 612.477 +751.616 600.673 +809.329 589.693 +867.678 578.092 +927.03 567.935 +986.28 555.983 +1046.79 544.803 +1105.57 533.104 +1166.2 521.947 +420.174 719.989 +474.015 709.565 +529.41 698.902 +585.125 688.986 +641.743 678.43 +698.405 667.167 +756.077 656.139 +814.191 644.49 +873.826 633.758 +933.001 622.022 +993.87 611.092 +1054.58 599.276 +1115.18 588.514 +1176.35 576.72 diff --git a/tests/data/laparoscope_calibration/left/left-2520.png b/tests/data/laparoscope_calibration/left/left-2520.png new file mode 100755 index 0000000..85df9ec Binary files /dev/null and b/tests/data/laparoscope_calibration/left/left-2520.png differ diff --git a/tests/data/laparoscope_calibration/left/left-2520.png.points.txt b/tests/data/laparoscope_calibration/left/left-2520.png.points.txt new file mode 100644 index 0000000..fe2c519 --- /dev/null +++ b/tests/data/laparoscope_calibration/left/left-2520.png.points.txt @@ -0,0 +1,140 @@ +788.149 472.307 +819.207 475.101 +850.588 476.819 +882.242 480.495 +914.03 482.503 +945.864 485.67 +978.115 487.803 +1010.11 491.33 +1042.5 493.61 +1074.71 496.985 +1107.69 499.564 +1140.65 502.742 +1173.65 505.154 +1206.51 509.001 +781.996 500.376 +813.437 502.325 +844.853 505.588 +876.89 507.461 +908.712 510.945 +940.661 512.707 +973.033 516.51 +1005.69 518.771 +1038.25 522.667 +1070.88 524.797 +1104.18 528.519 +1136.64 530.881 +1170.15 534.379 +1203.06 537.13 +776.085 528.214 +807.785 531.263 +839.541 533.292 +871.703 536.74 +903.841 538.846 +936.032 542.25 +968.445 544.757 +1001.38 548.596 +1034.14 551.07 +1067.12 555.001 +1100.41 557.337 +1133.51 560.686 +1166.8 563.113 +1200.35 566.96 +769.719 557.375 +801.707 559.432 +833.641 563.072 +865.73 565.341 +898.087 568.862 +930.725 570.985 +963.505 574.823 +996.622 577.425 +1029.44 581.58 +1062.91 584.262 +1096.1 587.9 +1129.93 590.12 +1163.11 593.714 +1197.18 596.301 +762.982 585.925 +794.964 589.384 +827.211 591.764 +859.701 595.28 +892.367 597.614 +925.459 601.211 +958.524 603.902 +991.56 608.063 +1024.73 610.915 +1058.35 615.041 +1091.68 617.354 +1125.8 620.87 +1159.74 623.26 +1193.38 626.976 +757.083 615.767 +789.233 618.34 +821.465 621.907 +854.265 624.531 +887.016 628.386 +920.373 630.835 +953.601 634.75 +986.681 637.827 +1020.55 641.945 +1054.1 644.491 +1087.97 648.253 +1121.91 650.741 +1156.74 654.282 +1190.08 657.272 +751.072 645.163 +783.79 648.67 +815.949 651.271 +848.867 655.354 +882.061 658.263 +915.635 661.923 +948.733 664.685 +982.169 668.237 +1016.34 671.455 +1050.3 675.393 +1084.39 678.548 +1118.75 682.06 +1153.1 684.849 +1186.95 688.595 +744.293 675.569 +777.064 678.498 +810.007 682.326 +842.851 685.533 +876.704 689.66 +910.377 692.167 +943.576 695.698 +977.13 698.68 +1011.47 702.982 +1045.82 706.25 +1080.22 710.083 +1115.06 713.222 +1149.01 716.609 +1183.52 720.041 +737.753 706.021 +770.734 709.976 +803.9 712.953 +837.567 716.983 +871.023 720.079 +904.812 723.945 +938.514 726.814 +972.645 730.578 +1006.66 734.008 +1040.99 738.324 +1075.63 741.48 +1110.7 745.418 +1145.14 748.464 +1179.96 752.413 +730.9 738.169 +764.487 741.136 +797.801 745.316 +831.524 748.931 +865.231 752.877 +898.786 755.931 +933.224 759.74 +967.347 762.866 +1001.85 766.824 +1036.49 770.231 +1071.33 774.17 +1106.39 777.498 +1141.19 781.47 +1176.27 784.703 diff --git a/tests/data/laparoscope_calibration/left/left-3083.png b/tests/data/laparoscope_calibration/left/left-3083.png new file mode 100755 index 0000000..76c5289 Binary files /dev/null and b/tests/data/laparoscope_calibration/left/left-3083.png differ diff --git a/tests/data/laparoscope_calibration/left/left-3083.png.points.txt b/tests/data/laparoscope_calibration/left/left-3083.png.points.txt new file mode 100644 index 0000000..0f1293e --- /dev/null +++ b/tests/data/laparoscope_calibration/left/left-3083.png.points.txt @@ -0,0 +1,140 @@ +878.499 702.513 +900.374 703.401 +922.848 703.931 +944.712 705.416 +966.877 706.106 +989.091 707.227 +1011.65 707.727 +1033.8 708.96 +1055.56 709.436 +1078.13 710.701 +1100.41 711.531 +1122.66 712.534 +1145.27 713.228 +1167.54 714.437 +876.74 723.069 +898.845 723.809 +921.202 724.705 +943.581 725.634 +965.515 726.687 +987.791 727.286 +1010.13 728.5 +1032.33 729.226 +1054.79 730.646 +1077.26 731.394 +1099.78 732.429 +1121.68 733.154 +1144.74 734.196 +1166.82 734.738 +875.175 743.759 +897.867 744.689 +919.671 745.43 +942.18 746.618 +964.525 747.433 +986.875 748.475 +1009.22 749.088 +1031.59 750.33 +1053.86 751.201 +1076.52 752.388 +1098.88 753.101 +1121.6 754.32 +1143.81 754.517 +1166.71 756.155 +873.523 764.718 +895.985 765.762 +918.229 766.916 +940.442 767.623 +962.854 768.721 +985.502 769.469 +1007.81 770.516 +1030.63 771.564 +1052.94 772.906 +1075.59 773.781 +1097.97 774.798 +1120.86 775.486 +1143.58 776.398 +1166.2 776.931 +871.319 785.882 +894.018 786.887 +916.463 787.674 +938.629 788.688 +961.444 789.536 +984.034 790.939 +1006.78 792.095 +1029.33 792.968 +1051.68 794.108 +1074.42 795.451 +1096.95 795.908 +1119.84 797.024 +1142.89 797.23 +1165.68 798.531 +869.768 807.087 +892.07 808.058 +914.63 809.259 +937.605 810.443 +960.319 811.33 +982.693 812.116 +1005.59 813.381 +1027.99 814.319 +1051.01 815.57 +1073.69 816.438 +1096.34 817.44 +1119.56 818.255 +1142.52 819.233 +1164.67 819.541 +868.083 828.245 +890.922 829.533 +913.502 830.154 +936.208 831.661 +959.296 833.121 +981.899 833.803 +1004.32 834.484 +1027.35 835.748 +1050.09 836.739 +1072.97 838.059 +1095.76 838.626 +1119.07 839.557 +1141.68 840.481 +1164.58 841.428 +866.494 850.035 +889.155 850.861 +911.802 851.931 +934.684 853.269 +957.845 854.601 +980.384 855.176 +1003.27 856.349 +1025.85 857.083 +1049.06 858.531 +1071.91 859.644 +1095.09 860.617 +1118.06 860.898 +1141.13 862.303 +1164 863.242 +864.486 871.938 +887.237 873.148 +910.129 873.935 +933.255 875.201 +956.152 876.407 +979.39 877.474 +1002.03 878.141 +1024.8 879.167 +1047.85 880.21 +1070.94 881.612 +1094.02 882.393 +1117.62 883.513 +1140.02 883.979 +1163.16 885.101 +862.783 894.269 +885.594 894.909 +908.733 896.3 +931.634 897.579 +954.836 898.535 +977.502 899.582 +1000.83 900.713 +1023.8 901.677 +1046.81 902.734 +1069.76 903.419 +1093.3 904.737 +1116.28 905.665 +1139.77 906.771 +1162.53 907.328 diff --git a/tests/data/laparoscope_calibration/left/left-3335.png b/tests/data/laparoscope_calibration/left/left-3335.png new file mode 100755 index 0000000..9aaf3ea Binary files /dev/null and b/tests/data/laparoscope_calibration/left/left-3335.png differ diff --git a/tests/data/laparoscope_calibration/left/left-3335.png.points.txt b/tests/data/laparoscope_calibration/left/left-3335.png.points.txt new file mode 100644 index 0000000..639a212 --- /dev/null +++ b/tests/data/laparoscope_calibration/left/left-3335.png.points.txt @@ -0,0 +1,140 @@ +1087.28 304.776 +1108.61 306.512 +1130.43 307.151 +1152.04 309.01 +1173.7 309.767 +1195.11 311.666 +1216.91 312.359 +1237.94 313.787 +1259.16 314.797 +1280.14 316.45 +1301.38 317.331 +1322.46 319.441 +1343.81 320.435 +1364.33 322.417 +1085.94 325.859 +1107.65 327.24 +1129.17 328.948 +1150.91 329.538 +1171.8 331.713 +1193.72 332.368 +1214.56 334.177 +1235.97 334.654 +1257.05 336.187 +1277.98 337.234 +1299.32 338.802 +1320.3 340.204 +1341.39 341.629 +1362.28 342.854 +1084.4 347.581 +1106.17 348.984 +1127.7 349.629 +1149.2 351.426 +1170.45 352.41 +1191.85 353.858 +1213.26 354.837 +1234.31 356.677 +1255.34 357.334 +1276.16 358.663 +1297.45 359.78 +1318.33 361.583 +1339.19 362.414 +1360.09 364.326 +1082.81 369.189 +1104.46 369.731 +1126.26 371.556 +1147.17 372.495 +1168.62 373.983 +1190.18 374.642 +1211.12 376.566 +1232.12 377.466 +1252.95 379.08 +1273.98 379.393 +1295.24 381.175 +1316.16 382.237 +1337.18 383.806 +1357.77 385.29 +1081.3 390.455 +1102.46 392.211 +1124.23 392.582 +1145.37 394.072 +1166.93 394.754 +1187.87 396.314 +1209.47 397.363 +1230.3 398.636 +1251.1 399.503 +1272.26 401.134 +1293.14 401.861 +1313.96 403.374 +1335.27 404.019 +1355.63 405.632 +1079.75 411.472 +1101.49 411.919 +1122.32 413.834 +1143.83 414.54 +1165.15 416.228 +1186.51 416.857 +1207.53 418.404 +1228.31 419.589 +1249.36 420.741 +1270.01 421.09 +1291.15 422.601 +1311.71 423.541 +1332.9 425.569 +1353.51 426.202 +1078.7 431.769 +1099.99 433.142 +1121.12 433.777 +1142.28 435.745 +1163.87 436.307 +1184.91 438.134 +1205.63 438.795 +1226.52 440.019 +1247.71 440.706 +1268.58 441.733 +1289.25 442.814 +1310.39 444.156 +1330.74 445.535 +1351.24 446.862 +1076.93 453.122 +1097.96 453.489 +1119.1 455.089 +1140.46 455.656 +1161.66 457.471 +1183.2 457.723 +1203.78 459.312 +1224.76 459.963 +1245.46 461.508 +1266.41 462.082 +1287.49 463.406 +1307.95 464.233 +1328.68 466.002 +1348.89 466.951 +1075.28 473.123 +1096.69 474.346 +1117.82 475.328 +1138.85 476.766 +1159.84 477.24 +1181.18 478.601 +1201.68 479.244 +1222.84 481.11 +1243.8 481.615 +1264.32 483.103 +1285.24 483.496 +1305.82 485.363 +1326.01 485.807 +1346.61 487.32 +1073.69 493.934 +1094.89 494.513 +1116.27 496.042 +1137.11 496.691 +1158.3 497.775 +1179.25 498.95 +1200.16 500.492 +1220.76 501.363 +1241.77 502.445 +1262.08 502.91 +1283.05 504.424 +1303.56 505.358 +1324.03 506.725 +1344.33 507.499 diff --git a/tests/data/laparoscope_calibration/left/left-3685.png b/tests/data/laparoscope_calibration/left/left-3685.png new file mode 100755 index 0000000..6e623b1 Binary files /dev/null and b/tests/data/laparoscope_calibration/left/left-3685.png differ diff --git a/tests/data/laparoscope_calibration/left/left-3685.png.points.txt b/tests/data/laparoscope_calibration/left/left-3685.png.points.txt new file mode 100644 index 0000000..bb34101 --- /dev/null +++ b/tests/data/laparoscope_calibration/left/left-3685.png.points.txt @@ -0,0 +1,140 @@ +322.425 396.461 +343.403 393.575 +364.706 390.404 +385.907 387.695 +406.892 384.533 +428.348 381.714 +449.626 378.457 +470.744 375.592 +491.853 372.417 +513.655 369.591 +534.819 366.247 +556.388 363.786 +578.289 360.724 +599.639 358.537 +326.128 417.277 +347.222 414.314 +368.436 411.424 +389.484 408.2 +410.628 405.498 +431.887 402.355 +452.783 399.53 +474.215 396.256 +495.392 393.371 +516.717 390.353 +538.375 387.728 +559.242 384.567 +581.157 382.233 +602.573 378.995 +330.012 437.917 +351.314 434.92 +372.347 432.007 +393.142 428.869 +414.435 426.242 +435.434 423.348 +456.55 420.32 +477.83 417.376 +498.728 413.94 +520.464 411.273 +541.568 407.996 +562.974 405.928 +584.327 402.478 +605.69 400.319 +334.188 458.783 +354.731 455.72 +375.92 452.752 +396.672 450.069 +417.722 447.069 +438.894 444.128 +460.061 441.386 +480.905 437.8 +502.207 435.321 +523.438 431.896 +544.712 429.423 +566.218 426.351 +587.438 423.835 +608.792 420.576 +337.396 479.37 +358.47 476.544 +379.385 473.487 +400.178 470.574 +421.042 467.718 +442.215 465.005 +463.126 461.659 +484.502 458.802 +505.259 455.64 +526.744 452.947 +547.812 449.888 +569.14 447.333 +590.46 444.068 +611.771 441.534 +341.529 499.526 +362.146 496.436 +383.004 493.837 +404.003 490.996 +425.023 488.133 +445.698 484.919 +466.948 482.667 +487.855 479.275 +508.784 476.309 +530.083 473.153 +551.561 470.22 +572.504 467.432 +594.111 464.84 +614.673 461.604 +345.543 519.498 +366.382 516.559 +386.942 513.722 +407.738 510.969 +428.831 508.029 +449.754 505.492 +470.438 502.302 +491.606 499.307 +512.427 496.046 +533.729 493.265 +554.69 490.267 +576.211 487.571 +596.717 484.602 +618.078 482.288 +349.344 539.474 +370.003 536.421 +390.716 533.515 +411.45 530.802 +432.623 528.142 +453.165 525.035 +474.074 522.28 +494.585 519.186 +516.023 516.424 +536.815 513.222 +558.103 510.679 +579.234 507.513 +600.13 505.024 +620.995 502.258 +353.01 559.274 +373.604 556.453 +394.5 553.399 +415.302 550.563 +435.805 547.698 +456.646 544.936 +478.483 543.298 +498.338 539.413 +518.938 535.956 +540.204 533.457 +560.895 530.523 +582.473 527.767 +603.041 524.854 +624.381 522.383 +357.249 579.258 +377.547 576.286 +398.22 573.435 +419.096 570.654 +439.877 567.814 +460.207 564.981 +481.252 562.045 +501.685 559.319 +522.538 556.616 +543.372 553.451 +564.341 551.121 +585.367 547.671 +606.448 545.045 +627.206 542.325 diff --git a/tests/data/laparoscope_calibration/left/left-4848.png b/tests/data/laparoscope_calibration/left/left-4848.png new file mode 100755 index 0000000..4f3f826 Binary files /dev/null and b/tests/data/laparoscope_calibration/left/left-4848.png differ diff --git a/tests/data/laparoscope_calibration/left/left-4848.png.points.txt b/tests/data/laparoscope_calibration/left/left-4848.png.points.txt new file mode 100644 index 0000000..05666fd --- /dev/null +++ b/tests/data/laparoscope_calibration/left/left-4848.png.points.txt @@ -0,0 +1,140 @@ +778.252 311.335 +823.216 322.441 +865.807 332.445 +907.691 343.434 +946.901 353.077 +985.756 362.917 +1022.33 371.445 +1058.06 381.361 +1091.76 390.17 +1125.29 399.406 +1157.54 407.575 +1189.44 415.729 +1219.73 423.493 +1248.47 431.746 +781.667 365.503 +826.361 374.115 +869.847 384.742 +911 393.531 +951.388 403.127 +989.619 411.397 +1027.13 420.807 +1062.2 428.611 +1096.82 437.374 +1129.87 445.371 +1162.58 453.438 +1194.01 460.599 +1224.63 467.956 +1253.7 475.318 +784.584 418.854 +830.468 428.568 +873.413 436.783 +915.622 445.623 +955.414 453.642 +994.752 462.294 +1031.3 469.625 +1067.72 477.842 +1101.31 485.147 +1134.86 492.656 +1167.02 499.468 +1199.36 506.359 +1229.66 512.421 +1259.02 519.535 +788.349 475.403 +833.592 482.951 +877.469 491.678 +918.773 498.388 +959.692 506.45 +998.785 512.996 +1036.42 520.483 +1071.69 527.434 +1106.01 534.823 +1139.2 541.125 +1171.98 547.052 +1204.4 552.776 +1234.94 558.648 +1264.18 564.053 +790.688 531.638 +836.596 538.964 +880.381 545.181 +922.831 552.866 +963.12 558.547 +1002.94 565.218 +1040.43 571.405 +1076.24 577.756 +1110 583.402 +1143.75 589.751 +1176.09 594.805 +1208.98 599.848 +1239.96 604.18 +1269.03 609.593 +794.379 588.591 +839.615 594.187 +884.129 600.711 +926.109 606.569 +968.138 612.756 +1006.75 617.7 +1045.34 623.461 +1080.49 628.701 +1114.99 633.747 +1148.04 638.389 +1181.27 642.651 +1213.25 646.733 +1245.25 650.698 +1273.78 654.851 +797.764 645.878 +844.003 651.477 +887.434 656.084 +930.366 661.465 +971.563 666.196 +1011.71 670.73 +1048.95 674.647 +1085.2 679.096 +1119.75 682.905 +1153.26 687.24 +1185.85 690.895 +1219.14 694.303 +1249.85 697.671 +1278.94 701.118 +800.446 704.681 +846.548 708.048 +890.827 712.783 +933.408 716.669 +975.545 720.947 +1014.96 723.794 +1052.66 727.145 +1089.17 730.158 +1124.34 733.522 +1157.49 736.635 +1190.75 739.396 +1223.32 742.368 +1253.96 744.628 +1283.55 747.604 +803.251 763.975 +849.805 767.179 +893.995 769.945 +937.124 772.838 +978.19 775.422 +1018.19 777.957 +1056.63 780.087 +1093.89 782.452 +1128.66 784.764 +1162.28 786.996 +1195.3 788.806 +1227.73 790.617 +1258.33 792.564 +1287.74 794.476 +806.025 824.827 +852.474 826.498 +897.272 828.475 +940.154 830.372 +981.598 832.296 +1021.54 833.453 +1060.66 834.563 +1097.37 835.915 +1133.31 837.256 +1166.82 838.235 +1199.94 839.202 +1231.98 839.998 +1262.45 841.003 +1292.26 841.832 diff --git a/tests/data/laparoscope_calibration/left/left-798.png b/tests/data/laparoscope_calibration/left/left-798.png new file mode 100755 index 0000000..758c3af Binary files /dev/null and b/tests/data/laparoscope_calibration/left/left-798.png differ diff --git a/tests/data/laparoscope_calibration/left/left-798.png.points.txt b/tests/data/laparoscope_calibration/left/left-798.png.points.txt new file mode 100644 index 0000000..1c9d4d4 --- /dev/null +++ b/tests/data/laparoscope_calibration/left/left-798.png.points.txt @@ -0,0 +1,140 @@ +496.288 368.65 +541.551 368.63 +586.568 368.596 +632.093 369.568 +676.719 369.744 +722.439 370.529 +767.602 370.237 +812.528 372.02 +857.246 372.16 +902.25 373.733 +947.206 374.046 +991.996 375.369 +1036.49 375.733 +1080.84 377.783 +493.457 409.061 +538.893 408.928 +584.543 409.491 +630.256 409.39 +675.818 409.953 +721.107 409.625 +767.012 411.331 +812.385 411.277 +858.059 413.197 +902.951 413.064 +948.886 414.871 +993.146 414.619 +1038.64 416.269 +1082.76 416.645 +490.722 450.205 +536.932 450.506 +582.805 450.276 +629.006 451.008 +674.875 450.927 +721.269 451.721 +766.694 451.762 +813.248 453.095 +858.468 453.51 +904.407 455.332 +949.905 455.159 +995.665 456.227 +1040.5 456.246 +1085.72 457.967 +487.944 492.899 +534.326 492.513 +580.882 493.275 +626.78 493.13 +673.526 493.748 +720.227 493.554 +766.818 494.762 +812.821 495.178 +859.129 496.628 +905.186 496.867 +951.326 498.123 +997.147 497.711 +1042.95 498.827 +1088.09 498.622 +484.742 536.5 +531.39 536.2 +578.364 535.896 +625.273 536.795 +671.708 536.373 +719.282 537.326 +765.867 537.112 +812.89 538.754 +858.913 538.926 +905.905 540.561 +951.724 539.94 +998.734 540.853 +1044.82 540.22 +1090.24 541.506 +482.314 579.324 +529.316 579.304 +576.665 579.973 +623.651 580.225 +671.377 580.826 +718.546 580.509 +766.499 581.323 +812.635 581.668 +860.077 583.299 +906.662 582.88 +953.932 583.685 +1000.36 583.262 +1047.65 583.877 +1092.7 583.903 +479.972 623.403 +527.995 623.713 +574.799 623.617 +622.892 624.639 +670.763 624.877 +719.099 624.983 +765.75 624.811 +813.35 625.823 +860.876 625.525 +908.573 626.891 +955.566 626.84 +1003.27 627.344 +1049.72 627.105 +1095.66 627.768 +477.072 668.793 +525.107 668.513 +573.282 669.007 +621.247 669.507 +670.134 670.321 +717.983 669.626 +765.978 670.212 +813.407 669.926 +861.945 671.031 +909.32 671.124 +957.253 671.681 +1004.56 671.393 +1051.37 671.877 +1097.96 671.895 +474.576 714.525 +523.23 714.881 +571.48 715.115 +620.444 715.625 +668.688 715.584 +717.472 716.117 +765.592 715.718 +814.332 715.87 +861.945 716.228 +910.206 717.178 +958.092 716.797 +1006.46 717.291 +1053.15 716.808 +1100.56 717.414 +472.287 761.887 +520.926 762.01 +569.952 762.461 +618.849 762.721 +667.986 763.479 +716.594 763.241 +765.718 763.587 +814.001 763.146 +863.034 763.604 +911.071 763.26 +959.727 763.601 +1007.68 763.028 +1055.29 763.517 +1102.84 763.321 diff --git a/tests/data/laparoscope_calibration/left/left.ogv b/tests/data/laparoscope_calibration/left/left.ogv new file mode 100644 index 0000000..1ab3719 Binary files /dev/null and b/tests/data/laparoscope_calibration/left/left.ogv differ diff --git a/tests/data/laparoscope_calibration/right/right-1095.png b/tests/data/laparoscope_calibration/right/right-1095.png new file mode 100755 index 0000000..cb34189 Binary files /dev/null and b/tests/data/laparoscope_calibration/right/right-1095.png differ diff --git a/tests/data/laparoscope_calibration/right/right-1095.png.points.txt b/tests/data/laparoscope_calibration/right/right-1095.png.points.txt new file mode 100644 index 0000000..fd96d9d --- /dev/null +++ b/tests/data/laparoscope_calibration/right/right-1095.png.points.txt @@ -0,0 +1,140 @@ +1184.22 243.019 +1230.44 240.129 +1277 237.449 +1324.25 235.181 +1371.44 233.073 +1419.44 230.622 +1467.71 228.289 +1515.99 226.713 +1564.56 224.634 +1613.68 223.021 +1663.36 221.231 +1712.68 218.8 +1762.49 216.768 +1812.75 215.292 +1179.99 282.306 +1226.77 279.361 +1273.9 277.271 +1321.67 274.838 +1369.51 272.589 +1417.71 270.237 +1466.61 268.602 +1515.65 266.959 +1564.91 265.641 +1614.59 263.909 +1664.8 262.13 +1714.32 260.02 +1764.91 258.532 +1814.98 256.62 +1176.12 322.358 +1223.41 320.205 +1271.09 317.777 +1319.14 315.729 +1367.67 313.578 +1416.67 311.935 +1465.72 309.886 +1515.85 308.626 +1565.47 307.45 +1615.52 306.323 +1666.04 304.446 +1717.07 302.208 +1767.06 300.37 +1819.22 299.295 +1171.68 363.709 +1219.34 361.594 +1267.49 360.234 +1315.67 357.949 +1365.01 356.356 +1414.74 354.302 +1464.75 353.142 +1514.88 351.807 +1565.46 351.084 +1616.49 349.735 +1667.23 348.213 +1718.78 346.16 +1770.06 344.178 +1821.36 342.711 +1166.14 406.454 +1214.56 404.808 +1263.4 402.885 +1312.58 401.467 +1362.23 399.62 +1412.14 398.928 +1463.29 396.808 +1513.88 396.118 +1564.9 395.115 +1616.51 394.502 +1667.81 392.838 +1720.36 390.536 +1772.36 388.389 +1824.58 387.021 +1162.13 449.227 +1210.68 447.694 +1260.04 446.611 +1309.59 445.579 +1360.2 444.284 +1410.86 442.667 +1462.43 441.671 +1513.18 440.775 +1565.19 440.431 +1616.93 439.298 +1669.44 437.754 +1722.17 436.108 +1775.2 434.24 +1826.76 432.976 +1157.79 492.912 +1207.3 492.226 +1256.5 491.448 +1307.1 490.399 +1358.12 489.634 +1409.74 488.142 +1460.81 486.951 +1512.63 486.051 +1565.44 485.296 +1618.21 484.961 +1671.12 483.928 +1724.65 482.137 +1776.92 480.618 +1830.48 479.542 +1152.68 538.466 +1202.37 537.338 +1252.92 536.868 +1303.72 536.586 +1355.74 536.149 +1407.5 534.53 +1459.3 533.468 +1511.6 532.7 +1565.11 532.284 +1618.14 532.041 +1671.72 530.974 +1725.24 529.545 +1779 528.566 +1832.88 528.04 +1147.6 584.707 +1198.26 584.37 +1248.84 583.929 +1300.63 583.596 +1352.58 583.063 +1404.83 582.572 +1457.63 581.685 +1510.85 580.783 +1564.14 580.375 +1617.79 580.36 +1671.77 579.379 +1726.98 578.456 +1780.48 577.553 +1835.75 577.043 +1142.64 632.667 +1193.44 632.536 +1245.33 632.405 +1297 632.568 +1349.74 632.529 +1402.09 632.004 +1455.66 631.585 +1509.08 631.094 +1563.36 630.494 +1617.26 629.588 +1672.75 629.366 +1726.94 628.267 +1782.73 628.091 +1837.35 627.552 diff --git a/tests/data/laparoscope_calibration/right/right-1338.png b/tests/data/laparoscope_calibration/right/right-1338.png new file mode 100755 index 0000000..f97db8e Binary files /dev/null and b/tests/data/laparoscope_calibration/right/right-1338.png differ diff --git a/tests/data/laparoscope_calibration/right/right-1338.png.points.txt b/tests/data/laparoscope_calibration/right/right-1338.png.points.txt new file mode 100644 index 0000000..210b3f9 --- /dev/null +++ b/tests/data/laparoscope_calibration/right/right-1338.png.points.txt @@ -0,0 +1,140 @@ +881.501 393.885 +938.857 390.494 +996.91 387.247 +1056.57 384.361 +1115.92 381.569 +1177.49 379.145 +1239.19 375.99 +1301.68 374.058 +1364.42 371.794 +1427.95 369.381 +1492.1 366.826 +1556.44 364.023 +1621.17 361.643 +1685.85 359.878 +873.242 444.585 +931.13 441.814 +989.609 439.33 +1050.26 436.428 +1111.18 434.067 +1173.22 431.293 +1235.87 429.675 +1299.37 427.632 +1363.43 425.878 +1427.72 423.633 +1493.36 421.68 +1557.78 418.695 +1623.73 416.593 +1689.21 414.975 +864.893 497.75 +923.977 495.079 +983.522 492.898 +1043.76 491.58 +1106.12 488.729 +1169.73 486.72 +1232.69 484.832 +1297.97 483.396 +1362.38 481.83 +1428.2 480.456 +1493.97 478.046 +1560.5 475.48 +1626.44 473.026 +1693.23 471.532 +856.742 552.299 +915.545 550.508 +976.618 549.045 +1037.35 547.275 +1100.54 545.468 +1164.64 543.892 +1229.6 542.564 +1294.59 541.018 +1360.77 540.513 +1427.67 538.985 +1494.34 537.28 +1561.88 534.479 +1629.61 532.102 +1696.44 529.869 +846.268 609.183 +906.591 607.611 +967.982 606.227 +1030.52 605.489 +1094.07 604.153 +1159.27 602.896 +1225.05 601.362 +1291.57 601.079 +1357.99 599.878 +1426.58 599.406 +1493.88 597.88 +1562.99 594.866 +1631.4 592.219 +1700.15 590.908 +837.465 666.361 +898.551 665.536 +960.938 664.901 +1023.96 664.93 +1089.09 664.121 +1154.64 663.045 +1222 662.496 +1288.61 661.775 +1356.9 661.764 +1425.34 660.811 +1494.61 659.127 +1564.25 656.844 +1634.55 654.752 +1702.38 653.039 +828.656 725.426 +890.994 725.247 +953.528 725.137 +1018.25 725.3 +1083.96 725.533 +1150.96 724.625 +1217.52 724.117 +1285.76 723.698 +1355.4 723.296 +1425.41 723.348 +1495.08 722.083 +1566.23 720.36 +1635.83 718.147 +1706.64 716.951 +819.06 786.041 +881.918 786.359 +946.282 787.095 +1011.09 788.083 +1078.59 788.479 +1145.92 787.92 +1213.5 787.752 +1282.55 787.833 +1353.27 787.991 +1423.64 787.986 +1495.27 787.26 +1566.58 785.525 +1637.45 784.555 +1709.05 783.278 +809.53 848.54 +873.415 849.77 +938.355 851.028 +1004.82 852.054 +1071.95 852.821 +1140.11 853.492 +1209.41 853.859 +1279.28 853.989 +1350.19 854.276 +1421.77 854.796 +1493.63 854.044 +1567.23 853.493 +1638.51 852.254 +1711.73 851.672 +800.09 913.008 +864.35 915.25 +930.496 916.734 +997.346 919.078 +1065.66 920.6 +1134.14 921.449 +1204.45 922.382 +1275 922.908 +1347.44 923.357 +1419.46 923.231 +1493.49 923.381 +1566.23 922.399 +1639.89 922.344 +1714.13 921.515 diff --git a/tests/data/laparoscope_calibration/right/right-1884.png b/tests/data/laparoscope_calibration/right/right-1884.png new file mode 100755 index 0000000..9a120c6 Binary files /dev/null and b/tests/data/laparoscope_calibration/right/right-1884.png differ diff --git a/tests/data/laparoscope_calibration/right/right-1884.png.points.txt b/tests/data/laparoscope_calibration/right/right-1884.png.points.txt new file mode 100644 index 0000000..48c0473 --- /dev/null +++ b/tests/data/laparoscope_calibration/right/right-1884.png.points.txt @@ -0,0 +1,140 @@ +503.829 269.425 +551.55 257.418 +599.154 245.57 +647.999 233.47 +697.238 222.453 +746.535 210.765 +797.34 198.753 +848.714 186.781 +899.988 175.407 +952.284 163.707 +1005.71 151.689 +1058.64 139.024 +1112.35 127.424 +1166.58 115.81 +502.155 311.776 +550.495 300.217 +598.542 288.527 +647.602 276.623 +697.471 264.872 +748.358 253.335 +798.987 241.66 +851.349 230.746 +903.684 219.388 +956.735 206.787 +1010.37 195.073 +1063.82 182.807 +1118.46 170.72 +1173.08 159.048 +500.43 355.701 +549.357 343.784 +598.579 332.726 +648.191 320.72 +699.36 309.548 +749.867 296.7 +801.944 286.749 +853.97 275.295 +908.154 264.344 +961.595 252.593 +1015.79 239.966 +1070.45 228.007 +1125.35 215.364 +1180.99 203.965 +498.78 401.046 +547.779 389.674 +597.564 378.086 +647.616 366.88 +698.884 354.626 +750.752 343.478 +803.146 332.547 +856.51 320.97 +911.372 310.426 +966.028 298.827 +1020.73 286.664 +1076.1 274.203 +1131.95 262.161 +1188.49 249.577 +495.865 448.008 +545.589 436.598 +596.083 425.634 +647.034 413.912 +698.945 402.822 +751.887 390.955 +805.518 379.929 +859.762 368.221 +914.551 358.118 +969.911 347.301 +1025.12 334.303 +1081.8 322.017 +1138.84 308.907 +1195.97 297.805 +495.206 494.869 +545.312 484.515 +596.082 473.196 +647.925 462.583 +700.719 450.999 +753.75 439.987 +808.976 428.015 +863.085 417.491 +918.684 406.641 +974.371 394.927 +1031.53 383.443 +1088.23 370.324 +1146.74 358.267 +1204.11 346.478 +493.737 543.546 +544.593 533.001 +596.079 522.192 +648.786 511.929 +702.137 500.547 +756.879 489.003 +810.616 477.637 +865.976 466.608 +923.383 455.344 +980.306 444.613 +1037.36 432.688 +1096.57 420.463 +1154.34 408.254 +1212.81 396.618 +491.837 594.034 +543.93 583.182 +596.164 572.882 +649.404 562.799 +704.452 551.756 +758.324 540.13 +813.875 529.048 +869.583 517.866 +927.635 507.352 +985.082 496.054 +1043.98 484.279 +1102.59 472.13 +1161.64 460.138 +1221.19 448.499 +491.074 645.578 +543.338 635.45 +596.449 625.585 +650.238 614.962 +705.485 604.219 +760.473 593.251 +816.977 582.039 +874.304 570.499 +931.033 559.465 +990.315 549.281 +1049.36 537.749 +1109.99 525.76 +1169.13 514.193 +1230.17 502.171 +490.244 698.912 +542.935 689.114 +597.387 678.987 +651.625 669.573 +707.734 658.771 +762.599 648.251 +820.209 637.387 +877.329 626.37 +936.966 614.673 +995.065 603.996 +1055.87 593.103 +1116.34 581.05 +1177.5 569.386 +1238.86 557.917 diff --git a/tests/data/laparoscope_calibration/right/right-2520.png b/tests/data/laparoscope_calibration/right/right-2520.png new file mode 100755 index 0000000..19da726 Binary files /dev/null and b/tests/data/laparoscope_calibration/right/right-2520.png differ diff --git a/tests/data/laparoscope_calibration/right/right-2520.png.points.txt b/tests/data/laparoscope_calibration/right/right-2520.png.points.txt new file mode 100644 index 0000000..9f50fae --- /dev/null +++ b/tests/data/laparoscope_calibration/right/right-2520.png.points.txt @@ -0,0 +1,140 @@ +895.659 450.75 +926.808 453.672 +958.014 455.538 +989.663 458.617 +1020.86 460.808 +1053 463.611 +1085.17 465.86 +1117.38 469.312 +1149.66 471.688 +1182.36 474.76 +1215.43 477.706 +1248.52 480.245 +1281.56 482.94 +1314.58 486.472 +889.698 478.74 +920.574 481.047 +952.205 484.204 +983.822 486.357 +1015.35 489.488 +1047.62 491.853 +1079.76 494.969 +1112.4 497.698 +1145.07 501.048 +1177.83 503.594 +1211.23 506.649 +1244.05 509.07 +1277.62 512.282 +1310.86 515.167 +883.06 507.15 +914.808 509.73 +946.008 512.204 +977.89 515.421 +1010.09 517.834 +1042.46 520.921 +1074.71 523.768 +1107.74 527.034 +1140.6 530.061 +1173.78 533.437 +1207.07 535.982 +1240.36 539.059 +1273.62 541.679 +1307.22 545.169 +876.875 535.95 +908.001 538.694 +940.206 541.821 +971.654 544.297 +1004.1 547.661 +1036.62 550.268 +1069.48 553.762 +1102.34 556.552 +1135.49 560.412 +1169.08 563.484 +1202.43 566.445 +1235.97 569.182 +1269.73 572.328 +1303.55 574.956 +869.442 565.311 +896.303 571.501 +933.202 571.227 +965.704 574.336 +997.785 576.919 +1030.67 580.571 +1063.93 583.563 +1096.83 587.208 +1130.13 590.365 +1163.86 594.167 +1197.26 596.835 +1231.64 599.676 +1265.74 602.305 +1299.65 605.778 +863.304 594.498 +894.849 597.653 +927.073 601.065 +959.333 604.046 +992.252 607.805 +1025.42 610.661 +1058.6 614.164 +1091.52 617.631 +1125.29 621.37 +1159.07 624.452 +1193.23 627.639 +1227.38 630.325 +1261.91 633.643 +1295.65 636.654 +856.727 624.572 +889.263 627.695 +921.152 631.132 +953.768 634.502 +986.619 637.869 +1020.04 641.466 +1053.03 644.417 +1086.55 648.064 +1120.82 651.308 +1154.85 655.088 +1189.08 658.389 +1223.68 661.678 +1257.76 664.57 +1291.96 668.148 +850.046 654.754 +882.051 658.194 +914.667 661.641 +947.353 665.176 +980.952 669.183 +1014.54 672.24 +1047.5 675.647 +1081.14 678.691 +1115.45 682.872 +1149.8 686.342 +1184.33 689.977 +1219.16 693.026 +1253.39 696.508 +1288.03 700.067 +842.875 685.395 +875.388 689.413 +908.283 692.694 +941.727 696.567 +974.965 699.887 +1008.51 703.585 +1042.02 706.931 +1075.91 710.647 +1110.14 714.239 +1144.61 718.4 +1179.28 721.688 +1214.75 725.333 +1248.85 728.639 +1284 732.523 +836.047 717.201 +868.598 720.759 +902.259 724.673 +935.007 728.569 +969.086 732.489 +1002.18 735.998 +1036.55 739.694 +1070.44 743.214 +1104.89 747.076 +1139.45 750.56 +1174.58 754.475 +1209.56 757.825 +1244.49 761.746 +1279.78 765.138 diff --git a/tests/data/laparoscope_calibration/right/right-3083.png b/tests/data/laparoscope_calibration/right/right-3083.png new file mode 100755 index 0000000..bc6927b Binary files /dev/null and b/tests/data/laparoscope_calibration/right/right-3083.png differ diff --git a/tests/data/laparoscope_calibration/right/right-3083.png.points.txt b/tests/data/laparoscope_calibration/right/right-3083.png.points.txt new file mode 100644 index 0000000..4c20e7e --- /dev/null +++ b/tests/data/laparoscope_calibration/right/right-3083.png.points.txt @@ -0,0 +1,140 @@ +1001.62 681.083 +1023.41 682.26 +1045.55 682.773 +1067.92 683.906 +1089.88 685.295 +1112.13 685.789 +1134.62 686.492 +1156.72 687.535 +1178.82 688.426 +1201.29 689.425 +1223.89 690.564 +1246.21 691.229 +1268.76 691.823 +1291.36 693.155 +999.537 701.892 +1021.44 702.515 +1043.75 703.667 +1065.86 704.404 +1088.48 705.5 +1110.54 706.725 +1133.02 707.391 +1155.3 708.41 +1177.69 709.565 +1199.89 710.305 +1222.8 711.43 +1244.97 712.043 +1268.11 712.906 +1290.4 713.733 +997.643 722.524 +1020.03 723.449 +1042.13 724.287 +1064.34 725.451 +1086.74 726.496 +1109.51 727.163 +1131.51 728.116 +1154.37 729.483 +1176.6 730.476 +1199.54 731.061 +1221.85 732.333 +1244.51 733.454 +1267.07 733.717 +1290.04 735.145 +995.702 743.546 +1017.98 744.596 +1040.33 745.867 +1062.62 746.805 +1084.87 747.962 +1107.69 748.954 +1130.52 749.503 +1152.71 750.399 +1175.56 751.552 +1198.06 752.695 +1220.66 754.029 +1243.76 754.839 +1266.39 755.511 +1289.18 756.387 +993.481 764.748 +1015.73 765.992 +1038.16 766.952 +1060.78 768.17 +1083.38 768.93 +1105.86 770.175 +1128.52 771.004 +1151.42 772.286 +1173.97 773.256 +1196.89 774.814 +1219.55 775.326 +1242.84 776.047 +1265.54 776.683 +1288.46 777.729 +991.519 786.043 +1014.07 786.961 +1036.55 788.181 +1058.87 789.341 +1082.05 790.346 +1104.44 791.402 +1127.45 792.793 +1149.85 793.983 +1172.95 795.199 +1195.89 795.936 +1218.91 796.637 +1241.9 797.377 +1264.88 798.581 +1287.45 798.965 +989.903 807.213 +1012.34 808.261 +1034.63 809.389 +1057.45 810.903 +1080.38 811.898 +1103.38 813.355 +1125.75 813.635 +1148.91 814.929 +1172.12 816.12 +1195.1 817.317 +1218.04 818.376 +1241.23 819.262 +1264.16 820.107 +1286.91 821.203 +987.808 828.742 +1010.34 829.951 +1033.09 830.979 +1055.85 832.421 +1078.75 833.899 +1101.88 834.746 +1124.65 835.625 +1147.43 836.937 +1170.85 837.83 +1193.79 839.204 +1217.01 840.312 +1240.17 840.813 +1263.15 841.638 +1286.28 842.773 +985.381 850.929 +1008.19 852.143 +1031.35 853.03 +1054.11 854.41 +1077.35 855.542 +1100.1 856.704 +1123.24 857.589 +1146 858.844 +1169.5 860.032 +1192.57 861.197 +1215.74 862.166 +1239.22 863.153 +1261.77 863.651 +1285.16 865.168 +983.387 873.202 +1006.11 873.969 +1029.69 875.23 +1052.29 876.655 +1075.39 878.263 +1098.44 879.101 +1121.56 880.096 +1144.68 880.924 +1167.99 882.619 +1190.87 883.122 +1214.74 884.525 +1238.01 885.24 +1260.96 886.505 +1284.48 887.052 diff --git a/tests/data/laparoscope_calibration/right/right-3335.png b/tests/data/laparoscope_calibration/right/right-3335.png new file mode 100755 index 0000000..73f6018 Binary files /dev/null and b/tests/data/laparoscope_calibration/right/right-3335.png differ diff --git a/tests/data/laparoscope_calibration/right/right-3335.png.points.txt b/tests/data/laparoscope_calibration/right/right-3335.png.points.txt new file mode 100644 index 0000000..4754a99 --- /dev/null +++ b/tests/data/laparoscope_calibration/right/right-3335.png.points.txt @@ -0,0 +1,140 @@ +1211.83 278.944 +1233.8 280.122 +1255.55 280.911 +1277.43 282.514 +1299.26 283.5 +1320.86 284.523 +1342.67 285.369 +1364.19 286.629 +1385.77 287.475 +1407.12 288.95 +1428.85 289.72 +1449.87 291.626 +1471.53 292.624 +1492.8 294.118 +1210.07 301.118 +1232.44 302.153 +1254.27 303.271 +1275.76 303.676 +1297.53 305.23 +1319.15 305.715 +1340.91 307.139 +1362.08 308.078 +1383.54 309.782 +1405.22 310.473 +1426.64 311.733 +1448 312.828 +1469.4 314.287 +1490.7 315.31 +1209.11 322.122 +1230.99 323.504 +1252.73 324.395 +1274.22 325.87 +1296.02 326.119 +1317.73 328.056 +1339.17 328.854 +1360.53 330.336 +1381.92 330.882 +1403.35 332.109 +1424.75 333.098 +1445.93 334.363 +1467.38 335.498 +1488.26 337.113 +1207.5 344.244 +1229.51 345.436 +1251.35 346.611 +1272.27 347.448 +1294.3 348.548 +1315.92 349.468 +1337.08 350.858 +1358.73 351.44 +1379.99 352.854 +1401.44 353.612 +1422.52 355.191 +1443.97 356.052 +1465.2 357.228 +1486.39 357.98 +1205.83 365.892 +1227.73 366.959 +1249.2 367.832 +1270.73 369.184 +1292.25 370.184 +1314.04 371.161 +1335.14 372 +1356.74 373.149 +1377.59 373.902 +1399.2 375.083 +1420.13 376.076 +1441.64 377.306 +1463.23 378.141 +1483.79 379.477 +1204.7 386.721 +1226.07 387.988 +1247.81 389.315 +1269.24 390.35 +1290.81 391.562 +1312.47 392.541 +1333.65 393.75 +1355.14 394.491 +1376.21 395.212 +1397.04 395.994 +1418.62 397.291 +1439.91 398.181 +1460.96 399.398 +1481.62 400.694 +1203.42 407.944 +1225.01 409.187 +1246.03 409.675 +1267.55 411.586 +1289.5 412.261 +1311.12 413.328 +1331.61 414.193 +1353.22 415.01 +1374.58 416.075 +1395.49 416.911 +1416.51 417.424 +1438.03 419.234 +1458.85 419.865 +1479.56 421.312 +1201.9 429.203 +1223.5 430.039 +1244.69 431.073 +1266.19 431.915 +1287.69 433.347 +1309 433.911 +1330.11 435.135 +1350.89 435.701 +1372.62 436.683 +1393.57 437.708 +1414.61 438.773 +1435.77 439.436 +1456.75 440.847 +1477.32 441.776 +1200.32 450.12 +1221.79 451.037 +1243.29 451.849 +1264.53 452.946 +1285.77 453.669 +1307.55 454.687 +1328.01 455.503 +1349.4 456.988 +1370.37 457.519 +1391.48 458.529 +1412.31 459.167 +1433.81 460.279 +1454.14 461.323 +1475.05 462.449 +1198.78 470.588 +1220.23 471.672 +1241.77 472.615 +1262.66 473.972 +1284.21 474.537 +1305.28 475.324 +1326.5 476.696 +1347.34 477.507 +1368.5 478.489 +1389.3 479.072 +1410.37 480.231 +1431.19 480.789 +1451.64 482.108 +1472.62 482.797 diff --git a/tests/data/laparoscope_calibration/right/right-3685.png b/tests/data/laparoscope_calibration/right/right-3685.png new file mode 100755 index 0000000..77ca5cb Binary files /dev/null and b/tests/data/laparoscope_calibration/right/right-3685.png differ diff --git a/tests/data/laparoscope_calibration/right/right-3685.png.points.txt b/tests/data/laparoscope_calibration/right/right-3685.png.points.txt new file mode 100644 index 0000000..ca95f89 --- /dev/null +++ b/tests/data/laparoscope_calibration/right/right-3685.png.points.txt @@ -0,0 +1,140 @@ +447.203 372.064 +467.996 369.271 +489.007 366.311 +510.321 363.433 +531.916 361.16 +552.277 358.097 +574.162 354.836 +594.565 351.941 +616.43 348.99 +637.346 346.08 +659.616 343.295 +680.25 340.147 +702.83 337.598 +723.455 335.031 +450.983 392.895 +472.365 390.179 +492.945 387.171 +514.367 384.466 +534.622 381.537 +556.753 378.952 +577.097 375.583 +598.933 372.92 +619.541 369.76 +641.714 367.212 +662.806 363.715 +684.29 361.584 +705.636 358.814 +726.99 355.75 +454.998 413.664 +475.674 410.614 +496.865 408.131 +518.208 405.215 +539.232 402.562 +560.213 399.522 +581.951 397.071 +602.289 393.692 +623.707 390.883 +644.857 387.899 +666.48 384.919 +687.319 382.27 +709.249 379.781 +729.697 377.215 +459.06 434.553 +479.98 431.851 +501.111 428.901 +521.925 426.507 +542.407 423.275 +563.957 420.489 +584.295 417.538 +606.099 414.788 +626.781 411.648 +648.119 408.659 +669.396 405.684 +691.059 403.432 +711.757 400.324 +733.34 397.679 +462.878 455.397 +483.79 452.211 +504.67 449.752 +525.219 446.82 +546.4 444.286 +567.309 441.266 +588.501 438.614 +609.124 435.507 +630.341 432.658 +651.283 429.633 +672.584 427.082 +693.719 424.235 +714.946 420.833 +736.053 418.717 +466.722 475.364 +487.718 472.612 +508.416 470.073 +529.667 467.647 +550.298 464.45 +571.117 461.728 +592.069 458.872 +612.776 456.007 +633.969 453.28 +654.771 450.056 +676.511 447.071 +697.812 444.351 +718.361 441.888 +739.392 438.773 +471.131 495.633 +491.976 492.54 +512.438 490.114 +532.951 487.473 +554.223 484.777 +574.987 481.818 +595.881 479.001 +616.365 475.995 +637.701 472.952 +659.255 469.968 +679.367 466.893 +700.788 464.726 +721.883 461.859 +742.383 459.962 +475.387 515.13 +495.906 512.862 +516.232 510.169 +536.705 507.316 +557.707 504.828 +578.796 501.825 +599.097 499.069 +620.112 496.387 +641.132 492.94 +661.8 490.427 +683.044 487.785 +704.256 484.955 +725.406 481.918 +745.579 479.367 +478.944 535.517 +499.574 532.587 +520.383 530.211 +540.739 527.145 +561.43 524.307 +581.933 521.687 +602.383 518.917 +623.413 516.328 +644.631 513.461 +665.184 510.616 +686.335 507.758 +707.292 504.753 +728.163 502.395 +749.034 500.108 +483.017 555.384 +503.195 552.51 +524.119 549.829 +544.571 547.083 +565.317 544.584 +585.76 541.85 +606.892 538.812 +626.859 536.384 +648.071 533.454 +668.145 530.57 +689.964 527.864 +710.479 525.12 +731.289 522.35 +752.124 519.664 diff --git a/tests/data/laparoscope_calibration/right/right-4848.png b/tests/data/laparoscope_calibration/right/right-4848.png new file mode 100755 index 0000000..a80b496 Binary files /dev/null and b/tests/data/laparoscope_calibration/right/right-4848.png differ diff --git a/tests/data/laparoscope_calibration/right/right-4848.png.points.txt b/tests/data/laparoscope_calibration/right/right-4848.png.points.txt new file mode 100644 index 0000000..74014b3 --- /dev/null +++ b/tests/data/laparoscope_calibration/right/right-4848.png.points.txt @@ -0,0 +1,140 @@ +848.64 293.048 +893.044 302.681 +938.014 312.579 +981.221 322.731 +1021.32 331.78 +1062.36 341.505 +1100.64 350.605 +1137.44 359.578 +1173.07 368.313 +1208.34 377.178 +1242.02 385.492 +1275.29 393.055 +1307.23 401.127 +1337.76 409.057 +849.673 345.851 +895.851 354.581 +940.902 365.285 +983.794 373.757 +1025.41 382.681 +1065.53 391.321 +1104.41 399.677 +1141.78 408.307 +1177.47 416.078 +1212.22 423.869 +1246.86 431.654 +1279.66 438.893 +1311.95 445.965 +1342.35 453.232 +853.263 400.907 +899.275 409.167 +944.088 417.876 +987.195 426.358 +1028.29 433.841 +1069.58 442.74 +1108.31 449.581 +1146.49 457.033 +1181.62 464.678 +1216.7 471.918 +1250.63 478.668 +1284.49 485.022 +1316.55 491.303 +1347.43 497.85 +855.358 456.364 +901.056 463.355 +947.12 472.406 +989.592 479.252 +1032.61 487.218 +1073.28 493.624 +1112.57 500.76 +1149.86 507.805 +1185.76 514.643 +1220.69 521.212 +1254.83 526.749 +1289 532.329 +1321.39 537.82 +1352 543.31 +856.835 512.766 +904.672 520.046 +949.134 526.327 +993.314 533.984 +1035.16 539.789 +1076.63 546.398 +1116.2 552.685 +1153.38 558.696 +1189.29 564.143 +1224.49 570.11 +1258.42 575.318 +1293.06 580.023 +1325.58 584.094 +1356.18 589.224 +860.117 569.896 +906.761 576.362 +952.56 582.391 +996.316 587.832 +1039.77 594.267 +1079.82 599.429 +1120.29 604.764 +1157.32 609.909 +1193.62 614.844 +1228.62 619.234 +1262.98 623.294 +1297.24 627.478 +1330.44 631.31 +1360.71 635.416 +862.811 627.788 +910.421 632.972 +955.628 637.835 +999.712 643.361 +1042.9 647.853 +1084.41 652.521 +1123.8 656.619 +1161.33 660.488 +1197.98 664.238 +1233.1 668.168 +1267.58 671.681 +1301.85 675.263 +1334.53 678.541 +1365 681.653 +865.027 686.291 +912.191 690.532 +958.425 694.234 +1002.2 698.621 +1046.15 702.819 +1087.48 705.873 +1127.14 709.064 +1165.03 712.174 +1201.86 715.41 +1236.82 718.587 +1271.56 721.19 +1305.86 723.828 +1338.18 725.895 +1369.41 728.815 +866.525 745.79 +915.027 749.158 +960.943 751.894 +1005.5 754.708 +1048.14 757.722 +1090 760.271 +1130.31 762.49 +1169.15 764.431 +1205.75 766.773 +1240.92 769.196 +1275.71 770.869 +1309.71 772.455 +1342.31 774.763 +1373.33 776.285 +868.844 806.421 +917.138 808.494 +963.473 810.53 +1008.05 812.612 +1051 814.364 +1092.82 815.836 +1133.57 817.239 +1172.25 818.38 +1209.75 819.593 +1245.1 820.431 +1280.02 821.442 +1313.66 822.144 +1345.62 823.181 +1377.18 823.704 diff --git a/tests/data/laparoscope_calibration/right/right-798.png b/tests/data/laparoscope_calibration/right/right-798.png new file mode 100755 index 0000000..fceca30 Binary files /dev/null and b/tests/data/laparoscope_calibration/right/right-798.png differ diff --git a/tests/data/laparoscope_calibration/right/right-798.png.points.txt b/tests/data/laparoscope_calibration/right/right-798.png.points.txt new file mode 100644 index 0000000..dfaa168 --- /dev/null +++ b/tests/data/laparoscope_calibration/right/right-798.png.points.txt @@ -0,0 +1,140 @@ +585.319 348.147 +630.148 347.419 +675.653 348.573 +720.328 348.513 +765.319 349.649 +809.888 349.79 +855.478 350.097 +900.251 350.984 +944.881 351.116 +990.195 352.364 +1035.21 352.571 +1080.82 353.014 +1125.54 353.79 +1170.16 354.954 +581.88 388.001 +627.489 388.685 +671.924 389.009 +718.556 389.617 +763.105 389.332 +808.573 389.483 +853.99 390.67 +899.366 390.979 +945.154 392.402 +990.399 392.598 +1036.37 393.17 +1080.78 393.242 +1126.71 394.37 +1171.7 394.721 +578.636 429.788 +624.577 429.543 +670.012 429.835 +715.985 430.378 +762.043 430.895 +808.106 430.648 +853.21 431.602 +899.46 432.654 +944.952 433.358 +990.815 434.503 +1036.43 434.478 +1082.6 435.194 +1128.29 435.1 +1173.82 436.275 +575.833 471.715 +621.031 472.319 +667.451 472.662 +713.442 473.437 +760.514 472.814 +805.681 473.568 +853.139 474.466 +898.344 474.88 +944.995 476.272 +990.75 476.73 +1037.11 477.674 +1083.41 477.48 +1129.86 477.63 +1175.45 477.741 +571.204 515.423 +618.278 515.46 +664.294 515.703 +711.105 516.241 +757.366 516.733 +804.667 516.949 +851.155 517.42 +898.186 518.465 +943.592 518.766 +990.826 520.672 +1037.09 520.221 +1084.43 520.533 +1131.1 519.809 +1177.09 520.918 +568.396 558.495 +615.698 559.409 +661.982 559.579 +708.751 560.287 +756.038 560.668 +802.992 561.008 +851.148 561.385 +896.902 562.074 +944.559 563.529 +991.388 563.447 +1038.96 563.651 +1085.62 563.702 +1133.06 564.08 +1179.06 564.021 +565.541 602.534 +612.883 603.125 +659.57 603.535 +707.6 604.25 +754.876 604.963 +803.221 605.079 +850.136 605.56 +897.168 606.058 +944.856 606.355 +992.591 607.274 +1039.78 607.696 +1087.65 607.839 +1134.4 607.935 +1181.25 607.965 +561.841 647.744 +609.75 648.062 +657.517 648.628 +704.912 649.532 +753.851 650.176 +801.485 650.342 +849.152 650.398 +896.414 650.566 +945.11 651.618 +992.503 652.05 +1040.75 652.53 +1088.59 652.673 +1135.58 652.796 +1182.85 652.98 +559.17 693.675 +607.228 693.971 +655.442 694.883 +703.627 695.44 +751.874 695.727 +799.967 696.31 +848.216 696.303 +896.705 696.655 +944.611 697.007 +993.132 697.731 +1040.97 697.913 +1089.64 698.165 +1136.87 698.303 +1184.52 698.45 +556.114 740.23 +604.279 740.963 +653.126 741.609 +701.517 742.568 +750.558 743.289 +798.541 743.478 +847.82 743.748 +895.881 744.121 +944.787 744.422 +993.123 744.527 +1041.87 744.756 +1090.23 744.563 +1138.18 744.644 +1186.33 744.655 diff --git a/tests/test_common_overlay_apps.py b/tests/test_common_overlay_apps.py index 488d5da..bd8af99 100644 --- a/tests/test_common_overlay_apps.py +++ b/tests/test_common_overlay_apps.py @@ -7,6 +7,7 @@ import numpy as np import sksurgeryutils.common_overlay_apps as coa + def test_OverlayOnVideoFeedCropRecord_from_file(setup_qt, tmpdir): in_github_ci = os.environ.get('CI') @@ -25,11 +26,11 @@ def test_OverlayOnVideoFeedCropRecord_from_file(setup_qt, tmpdir): # the window is showing something, before we start # recording. overlay_app.start() - overlay_app.update() + overlay_app.update_view() overlay_app.on_record_start() for i in range(50): - overlay_app.update() + overlay_app.update_view() overlay_app.on_record_stop() overlay_app.stop() @@ -47,6 +48,7 @@ def test_OverlayOnVideoFeedCropRecord_from_file(setup_qt, tmpdir): output_video.release() + def test_OverlayOnVideoFeedCropRecord_from_webcam(setup_qt): """ Test will only run if there is a camera avilable. @@ -69,18 +71,19 @@ def test_OverlayOnVideoFeedCropRecord_from_webcam(setup_qt): # the window is showing something, before we start # recording. overlay_app.start() - overlay_app.update() + overlay_app.update_view() overlay_app.on_record_start() for i in range(50): - overlay_app.update() + overlay_app.update_view() overlay_app.on_record_stop() overlay_app.stop() -def test_OverlayBaseAppRaisesNotImplementedError(setup_qt): - class ErrorApp(coa.OverlayBaseApp): +def test_OverlayBaseWidgetRaisesNotImplementedError(setup_qt): + + class ErrorApp(coa.OverlayBaseWidget): def something(self): pass @@ -89,39 +92,12 @@ def something(self): input_file = 'tests/data/100x50_100_frames.avi' overlay_app = ErrorApp(input_file) - overlay_app.update() + overlay_app.update_view() def test_OverlayOnVideoFeedCropRecord_set_roi(setup_qt): input_file = 'tests/data/100x50_100_frames.avi' overlay_app = coa.OverlayOnVideoFeedCropRecord(input_file) - overlay_app.update() # Get a frame so that we can crop it + overlay_app.update_view() # Get a frame so that we can crop it with pytest.raises(RuntimeError): overlay_app.set_roi() - -def test_DuplicateOverlayWindow(setup_qt): - - input_file = 'tests/data/100x50_100_frames.avi' - overlay_app = coa.OverlayOnVideoFeed(input_file) - - duplicate = coa.DuplicateOverlayWindow() - duplicate.set_source_window(overlay_app) - - overlay_app.update() - duplicate.update() - - np.testing.assert_array_equal(overlay_app.img, duplicate.vtk_overlay_window.input) - -def test_DuplicateOverlayWindowWithCrop(setup_qt): - input_file = 'tests/data/100x50_100_frames.avi' - overlay_app = coa.OverlayOnVideoFeedCropRecord(input_file) - - duplicate = coa.DuplicateOverlayWindow() - duplicate.set_source_window(overlay_app) - - overlay_app.update() - duplicate.update() - - np.testing.assert_array_equal(overlay_app.img, duplicate.vtk_overlay_window.input) - - diff --git a/tests/ui/test_video_calibration.py b/tests/ui/test_video_calibration.py new file mode 100644 index 0000000..813c8fe --- /dev/null +++ b/tests/ui/test_video_calibration.py @@ -0,0 +1,27 @@ +"""Tests for command line application """ +import pytest +from sksurgeryutils.ui.sksurgeryvideocalibration_command_line import main + + +def test_cl_no_config(): + """ + Run command line app with no config file. The parser should + raise SystemExit due to missing required argument. + """ + with pytest.raises(SystemExit) as pytest_wrapped_e: + main([]) + + #I'm not sure how useful the next 2 asserts are. We already know it's + #a SystemExit, if the code value specific to the parser? + assert pytest_wrapped_e.type == SystemExit + assert pytest_wrapped_e.value.code == 2 + + +def test_cl_with_config(): + """ + Run command line app with config. + """ + main(['-c', 'config/video_chessboard_conf.json', + '-s', 'tests/data/laparoscope_calibration/left/left.ogv', + '-ni' + ]) diff --git a/tests/ui/test_video_calibration_app.py b/tests/ui/test_video_calibration_app.py new file mode 100644 index 0000000..e0fe3c7 --- /dev/null +++ b/tests/ui/test_video_calibration_app.py @@ -0,0 +1,99 @@ +"""Tests for command line application """ +import copy +import os +import pytest +from sksurgeryutils.ui.sksurgeryvideocalibration_app import run_video_calibration + +config = { + "method": "chessboard", + "corners": [14, 10], + "square size in mm": 6, + "minimum number of views": 5, + "keypress delay": 0, + "sample frequency" : 2 +} + + +def _clean_up(prefix): + """Helper to clean up calibration results""" + for i in range(5): + os.remove(prefix + ".extrinsics." + str(i) + ".txt") + os.remove(prefix + ".ids." + str(i) + ".txt") + os.remove(prefix + ".image_points." + str(i) + ".txt") + os.remove(prefix + ".object_points." + str(i) + ".txt") + os.remove(prefix + ".images." + str(i) + ".png") + os.remove(prefix + ".distortion.txt") + os.remove(prefix + ".handeye.txt") + os.remove(prefix + ".intrinsics.txt") + os.remove(prefix + ".pattern2marker.txt") + + +def test_with_save_prefix(): + """ + Run command line app with a file_prefix. + """ + run_video_calibration(config, + source='tests/data/laparoscope_calibration/left/left.ogv', + file_prefix="testjunk", + noninteractive=True + ) + _clean_up("testjunk") + + +def test_with_save_directory(): + """ + Run command line app with a save directory. + """ + run_video_calibration(config, + source='tests/data/laparoscope_calibration/left/left.ogv', + output_dir="testjunk", + noninteractive=True + ) + _clean_up("testjunk/calib") + os.rmdir("testjunk") + + +def test_with_invalid_method(): + """ + Should throw a value error if method is not supported. + """ + duff_config = copy.deepcopy(config) + duff_config['method'] = 'not chessboard' + with pytest.raises(ValueError): + run_video_calibration(duff_config, + source='tests/data/laparoscope_calibration/left/left.ogv', + noninteractive=True + ) + + +def test_with_invalid_capture(): + """ + Should throw a runtime error if we can't open video capture. + """ + with pytest.raises(RuntimeError): + run_video_calibration(config, + source='invalid source', + noninteractive=True + ) + + +def test_with_blank_source(): + """ + Should throw a runtime error if we can't open video capture. + """ + with pytest.raises(RuntimeError): + run_video_calibration(config, + source=None + ) + + +def test_with_custom_window_size(): + """ + We should be able to set the window size in config. + """ + ok_config = copy.deepcopy(config) + ok_config['window size'] = [640, 480] + run_video_calibration(ok_config, + source='tests/data/laparoscope_calibration/left/left.ogv', + noninteractive=True + ) diff --git a/tests/ui/test_video_calibration_checker.py b/tests/ui/test_video_calibration_checker.py new file mode 100644 index 0000000..39b6086 --- /dev/null +++ b/tests/ui/test_video_calibration_checker.py @@ -0,0 +1,29 @@ +"""Tests for command line application """ +import pytest +from sksurgeryutils.ui.sksurgeryvideocalibrationchecker_command_line import main + + +def test_cl_no_config(): + """ + Run command line app with no config file. The parser should + raise SystemExit due to missing required argument. + """ + with pytest.raises(SystemExit) as pytest_wrapped_e: + main([]) + + #I'm not sure how useful the next 2 asserts are. We already know it's + #a SystemExit, if the code value specific to the parser? + assert pytest_wrapped_e.type == SystemExit + assert pytest_wrapped_e.value.code == 2 + + +def test_cl_with_config(): + """ + Run command line app with config. + """ + main(['-c', 'config/video_chessboard_conf.json', + '-s', 'tests/data/laparoscope_calibration/left/left.ogv', + '-ni', + '-d', 'tests/data/laparoscope_calibration/cbh-viking/', + '-p', 'calib.left'] + ) diff --git a/tests/ui/test_video_calibration_checker_app.py b/tests/ui/test_video_calibration_checker_app.py new file mode 100644 index 0000000..6c09aa7 --- /dev/null +++ b/tests/ui/test_video_calibration_checker_app.py @@ -0,0 +1,66 @@ +"""Tests for command line application """ +import copy +import pytest +from sksurgeryutils.ui.sksurgeryvideocalibrationchecker_app import \ + run_video_calibration_checker + +config = { + "method": "chessboard", + "corners": [14, 10], + "square size in mm": 6, + "minimum number of views": 5, + "keypress delay": 0, + "sample frequency": 2 +} + + +def test_with_no_config(): + """ + It shouldn't run with no configuration file. + """ + with pytest.raises(ValueError): + run_video_calibration_checker(None, + source='tests/data/laparoscope_calibration/left/left.ogv', + calib_dir='tests/data/laparoscope_calibration/cbh-viking', + file_prefix="calib.right", + noninteractive=True + ) + + +def test_with_prefix(): + """ + Run command line app with an existing calibration. + """ + run_video_calibration_checker(config, + source='tests/data/laparoscope_calibration/left/left.ogv', + calib_dir='tests/data/laparoscope_calibration/cbh-viking', + file_prefix="calib.right", + noninteractive=True + ) + + +def test_with_invalid_capture(): + """ + Should throw a runtime error if we can't open video capture. + """ + with pytest.raises(RuntimeError): + run_video_calibration_checker(config, + source='bad source', + calib_dir='tests/data/laparoscope_calibration/cbh-viking', + file_prefix="calib.right", + noninteractive=True + ) + + +def test_with_custom_window_size(): + """ + We should be able to set the window size in config. + """ + ok_config = copy.deepcopy(config) + ok_config['window size'] = [640, 480] + run_video_calibration_checker(ok_config, + source='tests/data/laparoscope_calibration/left/left.ogv', + calib_dir='tests/data/laparoscope_calibration/cbh-viking', + file_prefix="calib.right", + noninteractive=True + )