Ciclop开源3D扫描仪软件---Horus源码分析之src\horus\engine\calibration\calibration.py

来源:互联网 发布:小米note网络制式修改 编辑:程序博客网 时间:2024/05/20 08:42
/****************************************************************************/
 *
 *                  (c)    光明工作室  2017-2037  COPYRIGHT
 *
 *   光明工作室团队成员大部分来自全国著名985、211工程院校。具有丰富的工程实践经验,
 *本工作室热忱欢迎大家的光临。工作室长期承接嵌入式开发、PCB设计、算法仿真等软硬件设计。
 *
 *
 *1)基于C8051、AVR、MSP430单片机开发。
 *2)基于STM32F103、STM32F407等ARM处理器开发。(IIC、SPI、485、WIFI等相关设计)
 *3)基于C6678、DM388等DSP处理器开发。(视频、网络、通信协议相关设计)
 *4)基于QT、C#软件开发。
 *5)基于OPENCV、OPENGL图像处理算法开发。(基于LINUX、WINDOWS、MATLAB等)
 *6)无人机飞控、地面站程序开发。(大疆、PIX、 qgroundcontrol、missionplanner、MAVLINK)
 *7) ROS机器人操作系统下相关开发。
 *8)LINUX、UCOSII、VXWORKS操作系统开发。
 *
 *
 *                                                 联系方式:
 *                                                 QQ:2468851091 call:18163325140
 *                                                 Email:2468851091@qq.com
 *

/ ****************************************************************************/ 

# -*- coding: utf-8 -*-# This file is part of the Horus Project__author__ = 'Jes煤s Arroyo Torrens <jesus.arroyo@bq.com>'__copyright__ = 'Copyright (C) 2014-2016 Mundo Reader S.L.'__license__ = 'GNU General Public License v2 http://www.gnu.org/licenses/gpl2.html'import platformimport threadingfrom horus.engine.driver.driver import Driverfrom horus.engine.calibration.pattern import Patternfrom horus.engine.calibration.calibration_data import CalibrationDatafrom horus.engine.algorithms.image_capture import ImageCapturefrom horus.engine.algorithms.image_detection import ImageDetectionfrom horus.engine.algorithms.laser_segmentation import LaserSegmentationfrom horus.engine.algorithms.point_cloud_generation import PointCloudGenerationsystem = platform.system()"""    Calibrations:        - Autocheck Algorithm        - Camera Intrinsics Calibration        - Laser Triangulation Calibration        - Platform Extrinsics Calibration"""class CalibrationCancel(Exception):    def __init__(self):        Exception.__init__(self, "CalibrationCancel")class Calibration(object):    """Generic class for threading calibration"""    def __init__(self):        self.driver = Driver()        self.pattern = Pattern()        self.calibration_data = CalibrationData()        self.image_capture = ImageCapture()        self.image_detection = ImageDetection()        self.laser_segmentation = LaserSegmentation()        self.point_cloud_generation = PointCloudGeneration()        # TODO: Callbacks to Observer pattern        self._before_callback = None        self._progress_callback = None        self._after_callback = None        self._is_calibrating = False    def set_callbacks(self, before, progress, after):        self._before_callback = before        self._progress_callback = progress        self._after_callback = after    def start(self):        if not self._is_calibrating:            if self._before_callback is not None:                self._before_callback()            if self._progress_callback is not None:                self._progress_callback(0)            self._is_calibrating = True            threading.Thread(target=self._start).start()    def _start(self):        pass    def cancel(self):        self._is_calibrating = False




阅读全文
0 0