示例#1
0
    def __init__(self,
                 parent,
                 buttonPrevCallback=None,
                 buttonNextCallback=None):
        WizardPage.__init__(self,
                            parent,
                            title=_("Calibration"),
                            buttonPrevCallback=buttonPrevCallback,
                            buttonNextCallback=buttonNextCallback)

        self.driver = Driver.Instance()
        self.cameraIntrinsics = calibration.CameraIntrinsics.Instance()
        self.laserTriangulation = calibration.LaserTriangulation.Instance()
        self.platformExtrinsics = calibration.PlatformExtrinsics.Instance()
        self.phase = 'none'

        self.patternLabel = wx.StaticText(
            self.panel,
            label=
            _("Put the pattern on the platform as shown in the picture and press \"Calibrate\""
              ))
        self.patternLabel.Wrap(400)
        self.imageView = ImageView(self.panel)
        self.imageView.setImage(
            wx.Image(resources.getPathForImage("pattern-position-right.jpg")))
        self.calibrateButton = wx.Button(self.panel, label=_("Calibrate"))
        self.cancelButton = wx.Button(self.panel, label=_("Cancel"))
        self.gauge = wx.Gauge(self.panel, range=100, size=(-1, 30))
        self.resultLabel = wx.StaticText(self.panel, size=(-1, 30))

        self.cancelButton.Disable()
        self.resultLabel.Hide()
        self.skipButton.Enable()
        self.nextButton.Disable()

        #-- Layout
        vbox = wx.BoxSizer(wx.VERTICAL)
        vbox.Add(self.patternLabel, 0, wx.ALL | wx.CENTER, 5)
        vbox.Add(self.imageView, 1, wx.ALL | wx.EXPAND, 5)
        vbox.Add(self.resultLabel, 0, wx.ALL | wx.CENTER, 5)
        vbox.Add(self.gauge, 0, wx.ALL | wx.EXPAND, 5)
        hbox = wx.BoxSizer(wx.HORIZONTAL)
        hbox.Add(self.cancelButton, 1, wx.ALL | wx.EXPAND, 5)
        hbox.Add(self.calibrateButton, 1, wx.ALL | wx.EXPAND, 5)
        vbox.Add(hbox, 0, wx.ALL | wx.EXPAND, 2)
        self.panel.SetSizer(vbox)

        self.Layout()

        self.calibrateButton.Bind(wx.EVT_BUTTON,
                                  self.onCalibrationButtonClicked)
        self.cancelButton.Bind(wx.EVT_BUTTON, self.onCancelButtonClicked)
        self.Bind(wx.EVT_SHOW, self.onShow)

        self.videoView.setMilliseconds(20)
        self.videoView.setCallback(self.getFrame)
示例#2
0
    def __init__(self, parent, buttonPrevCallback=None, buttonNextCallback=None):
        WizardPage.__init__(self, parent,
                            title=_("Connection"),
                            buttonPrevCallback=buttonPrevCallback,
                            buttonNextCallback=buttonNextCallback)

        self.parent = parent
        self.driver = Driver.Instance()
        self.cameraIntrinsics = calibration.CameraIntrinsics.Instance()
        self.autoCheck = calibration.SimpleLaserTriangulation.Instance()

        self.connectButton = wx.Button(self.panel, label=_("Connect"))
        self.settingsButton = wx.Button(self.panel, label=_("Edit settings"))


        self.patternLabel = wx.StaticText(self.panel, label=_("Put the pattern on the platform as shown in the picture and press \"Auto check\""))
        self.patternLabel.Wrap(400)
        self.imageView = ImageView(self.panel)
        self.imageView.setImage(wx.Image(resources.getPathForImage("pattern-position-right.jpg")))
        self.autoCheckButton = wx.Button(self.panel, label=_("Auto check"))
        self.gauge = wx.Gauge(self.panel, range=100, size=(-1, 30))
        self.resultLabel = wx.StaticText(self.panel, size=(-1, 30))

        self.connectButton.Enable()
        self.settingsButton.Enable()
        self.patternLabel.Disable()
        self.imageView.Disable()
        self.autoCheckButton.Disable()
        self.skipButton.Disable()
        self.nextButton.Disable()
        self.resultLabel.Hide()
        self.enableNext = False

        vbox = wx.BoxSizer(wx.VERTICAL)
        hbox = wx.BoxSizer(wx.HORIZONTAL)
        hbox.Add(self.connectButton, 1, wx.ALL|wx.EXPAND, 5)
        hbox.Add(self.settingsButton, 1, wx.ALL|wx.EXPAND, 5)
        vbox.Add(hbox, 0, wx.ALL|wx.EXPAND, 2)
        vbox.Add(self.patternLabel, 0, wx.ALL|wx.CENTER, 5)
        vbox.Add(self.imageView, 1, wx.ALL|wx.EXPAND, 5)
        vbox.Add(self.resultLabel, 0, wx.ALL|wx.CENTER, 5)
        vbox.Add(self.gauge, 0, wx.ALL|wx.EXPAND, 5)
        vbox.Add(self.autoCheckButton, 0, wx.ALL|wx.EXPAND, 5)
        self.panel.SetSizer(vbox)

        self.Layout()

        self.connectButton.Bind(wx.EVT_BUTTON, self.onConnectButtonClicked)
        self.settingsButton.Bind(wx.EVT_BUTTON, self.onSettingsButtonClicked)
        self.autoCheckButton.Bind(wx.EVT_BUTTON, self.onAutoCheckButtonClicked)
        self.Bind(wx.EVT_SHOW, self.onShow)

        self.videoView.setMilliseconds(50)
        self.videoView.setCallback(self.getDetectChessboardFrame)
        self.updateStatus(self.driver.isConnected)
示例#3
0
    def __init__(self, parent, buttonPrevCallback=None, buttonNextCallback=None):
        WizardPage.__init__(self, parent,
                            title=_("Connection"),
                            buttonPrevCallback=buttonPrevCallback,
                            buttonNextCallback=buttonNextCallback)

        self.parent = parent
        self.driver = Driver.Instance()
        self.cameraIntrinsics = calibration.CameraIntrinsics.Instance()
        self.autoCheck = calibration.SimpleLaserTriangulation.Instance()

        self.connectButton = wx.Button(self.panel, label=_("Connect"))
        self.settingsButton = wx.Button(self.panel, label=_("Edit settings"))


        self.patternLabel = wx.StaticText(self.panel, label=_("Put the pattern on the platform as shown in the picture and press \"Auto check\""))
        self.patternLabel.Wrap(400)
        self.imageView = ImageView(self.panel)
        self.imageView.setImage(wx.Image(resources.getPathForImage("pattern-position-right.jpg")))
        self.autoCheckButton = wx.Button(self.panel, label=_("Auto check"))
        self.gauge = wx.Gauge(self.panel, range=100, size=(-1, 30))
        self.resultLabel = wx.StaticText(self.panel, size=(-1, 30))

        self.connectButton.Enable()
        self.settingsButton.Enable()
        self.patternLabel.Disable()
        self.imageView.Disable()
        self.autoCheckButton.Disable()
        self.skipButton.Disable()
        self.nextButton.Disable()
        self.resultLabel.Hide()
        self.enableNext = False

        vbox = wx.BoxSizer(wx.VERTICAL)
        hbox = wx.BoxSizer(wx.HORIZONTAL)
        hbox.Add(self.connectButton, 1, wx.ALL|wx.EXPAND, 5)
        hbox.Add(self.settingsButton, 1, wx.ALL|wx.EXPAND, 5)
        vbox.Add(hbox, 0, wx.ALL|wx.EXPAND, 2)
        vbox.Add(self.patternLabel, 0, wx.ALL|wx.CENTER, 5)
        vbox.Add(self.imageView, 1, wx.ALL|wx.EXPAND, 5)
        vbox.Add(self.resultLabel, 0, wx.ALL|wx.CENTER, 5)
        vbox.Add(self.gauge, 0, wx.ALL|wx.EXPAND, 5)
        vbox.Add(self.autoCheckButton, 0, wx.ALL|wx.EXPAND, 5)
        self.panel.SetSizer(vbox)

        self.Layout()

        self.connectButton.Bind(wx.EVT_BUTTON, self.onConnectButtonClicked)
        self.settingsButton.Bind(wx.EVT_BUTTON, self.onSettingsButtonClicked)
        self.autoCheckButton.Bind(wx.EVT_BUTTON, self.onAutoCheckButtonClicked)
        self.Bind(wx.EVT_SHOW, self.onShow)

        self.videoView.setMilliseconds(50)
        self.videoView.setCallback(self.getDetectChessboardFrame)
        self.updateStatus(self.driver.isConnected)
示例#4
0
	def __init__(self, parent, buttonPrevCallback=None, buttonNextCallback=None):
		WizardPage.__init__(self, parent,
							title=_("Connection"),
							buttonPrevCallback=buttonPrevCallback,
							buttonNextCallback=buttonNextCallback)

		self.parent = parent
		self.driver = Driver.Instance()
		self.cameraIntrinsics = calibration.CameraIntrinsics.Instance()
		self.autoCheck = calibration.SimpleLaserTriangulation.Instance()

		self.connectButton = wx.Button(self.panel, label=_("Connect"))
		luminosity=profile.getProfileSettingObject('luminosity').getType()
		self.luminosityComboBox = wx.ComboBox(self.panel, wx.ID_ANY,
											  value=profile.getProfileSetting('luminosity'),
											  choices=[_(luminosity[0]), _(luminosity[1]), _(luminosity[2])],
											  style=wx.CB_READONLY)
		self.patternLabel = wx.StaticText(self.panel, label=_("Put the pattern on the platform and press \"Auto check\""))
		self.imageView = ImageView(self.panel)
		self.imageView.setImage(wx.Image(resources.getPathForImage("pattern-position-right.jpg")))
		self.autoCheckButton = wx.Button(self.panel, label=_("Auto check"))
		self.gauge = wx.Gauge(self.panel, range=100, size=(-1, 30))
		self.resultLabel = wx.StaticText(self.panel, size=(-1, 30))

		self.connectButton.Enable()
		self.patternLabel.Disable()
		self.imageView.Disable()
		self.autoCheckButton.Disable()
		self.skipButton.Disable()
		self.nextButton.Disable()
		self.resultLabel.Hide()
		self.enableNext = False

		vbox = wx.BoxSizer(wx.VERTICAL)
		hbox = wx.BoxSizer(wx.HORIZONTAL)
		hbox.Add(self.connectButton, 1, wx.ALL|wx.EXPAND, 5)
		hbox.Add(self.luminosityComboBox, 0, wx.ALL|wx.EXPAND, 5)
		vbox.Add(hbox, 0, wx.ALL|wx.EXPAND, 2)
		vbox.Add(self.patternLabel, 0, wx.ALL|wx.CENTER, 5)
		vbox.Add(self.imageView, 1, wx.ALL|wx.EXPAND, 5)
		vbox.Add(self.resultLabel, 0, wx.ALL|wx.CENTER, 5)
		vbox.Add(self.gauge, 0, wx.ALL|wx.EXPAND, 5)
		vbox.Add(self.autoCheckButton, 0, wx.ALL|wx.EXPAND, 5)
		self.panel.SetSizer(vbox)

		self.Layout()

		self.connectButton.Bind(wx.EVT_BUTTON, self.onConnectButtonClicked)
		self.luminosityComboBox.Bind(wx.EVT_COMBOBOX, self.onLuminosityComboBoxChanged)
		self.autoCheckButton.Bind(wx.EVT_BUTTON, self.onAutoCheckButtonClicked)
		self.Bind(wx.EVT_SHOW, self.onShow)

		self.videoView.setMilliseconds(50)
		self.videoView.setCallback(self.getDetectChessboardFrame)
		self.updateStatus(self.driver.isConnected)
示例#5
0
	def __init__(self, parent, buttonPrevCallback=None, buttonNextCallback=None):
		WizardPage.__init__(self, parent,
							title=_("Calibration"),
							buttonPrevCallback=buttonPrevCallback,
							buttonNextCallback=buttonNextCallback)

		self.driver = Driver.Instance()
		self.cameraIntrinsics = calibration.CameraIntrinsics.Instance()
		self.laserTriangulation = calibration.LaserTriangulation.Instance()
		self.platformExtrinsics = calibration.PlatformExtrinsics.Instance()
		self.phase = 'none'

		self.patternLabel = wx.StaticText(self.panel, label=_("Put the pattern on the platform as shown in the picture and press \"Calibrate\""))
		self.patternLabel.Wrap(400)
		self.imageView = ImageView(self.panel)
		self.imageView.setImage(wx.Image(resources.getPathForImage("pattern-position-right.jpg")))
		self.calibrateButton = wx.Button(self.panel, label=_("Calibrate"))
		self.cancelButton = wx.Button(self.panel, label=_("Cancel"))
		self.gauge = wx.Gauge(self.panel, range=100, size=(-1, 30))
		self.resultLabel = wx.StaticText(self.panel, size=(-1, 30))

		self.cancelButton.Disable()
		self.resultLabel.Hide()
		self.skipButton.Enable()
		self.nextButton.Disable()

		#-- Layout
		vbox = wx.BoxSizer(wx.VERTICAL)
		vbox.Add(self.patternLabel, 0, wx.ALL|wx.CENTER, 5)
		vbox.Add(self.imageView, 1, wx.ALL|wx.EXPAND, 5)
		vbox.Add(self.resultLabel, 0, wx.ALL|wx.CENTER, 5)
		vbox.Add(self.gauge, 0, wx.ALL|wx.EXPAND, 5)
		hbox = wx.BoxSizer(wx.HORIZONTAL)
		hbox.Add(self.cancelButton, 1, wx.ALL|wx.EXPAND, 5)
		hbox.Add(self.calibrateButton, 1, wx.ALL|wx.EXPAND, 5)
		vbox.Add(hbox, 0, wx.ALL|wx.EXPAND, 2)
		self.panel.SetSizer(vbox)

		self.Layout()

		self.calibrateButton.Bind(wx.EVT_BUTTON, self.onCalibrationButtonClicked)
		self.cancelButton.Bind(wx.EVT_BUTTON, self.onCancelButtonClicked)
		self.Bind(wx.EVT_SHOW, self.onShow)

		self.videoView.setMilliseconds(20)
		self.videoView.setCallback(self.getFrame)
示例#6
0
    def __init__(self,
                 parent,
                 buttonPrevCallback=None,
                 buttonNextCallback=None):
        WizardPage.__init__(self,
                            parent,
                            title=_("Scanning"),
                            buttonPrevCallback=buttonPrevCallback,
                            buttonNextCallback=buttonNextCallback)

        self.driver = Driver.Instance()
        self.pcg = PointCloudGenerator.Instance()

        value = abs(float(profile.getProfileSetting('step_degrees_scanning')))
        if value > 1.35:
            value = _("Low")
        elif value > 0.625:
            value = _("Medium")
        else:
            value = _("High")
        self.resolutionLabel = wx.StaticText(self.panel, label=_("Resolution"))
        self.resolutionComboBox = wx.ComboBox(
            self.panel,
            wx.ID_ANY,
            value=value,
            choices=[_("High"), _("Medium"), _("Low")],
            style=wx.CB_READONLY)

        self.laserLabel = wx.StaticText(self.panel, label=_("Laser"))
        use_laser = profile.getProfileSettingObject('use_laser').getType()
        self.laserComboBox = wx.ComboBox(
            self.panel,
            wx.ID_ANY,
            value=profile.getProfileSetting('use_laser'),
            choices=[_(use_laser[0]),
                     _(use_laser[1]),
                     _(use_laser[2])],
            style=wx.CB_READONLY)

        self.scanTypeLabel = wx.StaticText(self.panel, label=_("Scan Type"))
        scan_type = profile.getProfileSettingObject('scan_type').getType()
        self.scanTypeComboBox = wx.ComboBox(
            self.panel,
            wx.ID_ANY,
            value=profile.getProfileSetting('scan_type'),
            choices=[_(scan_type[0]), _(scan_type[1])],
            style=wx.CB_READONLY)

        self.skipButton.Hide()

        #-- Layout
        vbox = wx.BoxSizer(wx.VERTICAL)
        hbox = wx.BoxSizer(wx.HORIZONTAL)
        hbox.Add(self.resolutionLabel, 0, wx.ALL ^ wx.BOTTOM | wx.EXPAND, 18)
        hbox.Add(self.resolutionComboBox, 1, wx.ALL ^ wx.BOTTOM | wx.EXPAND,
                 12)
        vbox.Add(hbox, 0, wx.ALL | wx.EXPAND, 5)
        hbox = wx.BoxSizer(wx.HORIZONTAL)
        hbox.Add(self.laserLabel, 0, wx.ALL ^ wx.BOTTOM | wx.EXPAND, 18)
        hbox.Add(self.laserComboBox, 1, wx.ALL ^ wx.BOTTOM | wx.EXPAND, 12)
        vbox.Add(hbox, 0, wx.ALL | wx.EXPAND, 5)
        hbox = wx.BoxSizer(wx.HORIZONTAL)
        hbox.Add(self.scanTypeLabel, 0, wx.ALL ^ wx.BOTTOM | wx.EXPAND, 18)
        hbox.Add(self.scanTypeComboBox, 1, wx.ALL ^ wx.BOTTOM | wx.EXPAND, 12)
        vbox.Add(hbox, 0, wx.ALL | wx.EXPAND, 5)
        self.panel.SetSizer(vbox)
        self.Layout()

        self.resolutionComboBox.Bind(wx.EVT_COMBOBOX,
                                     self.onResolutionComboBoxChanged)
        self.laserComboBox.Bind(wx.EVT_COMBOBOX, self.onLaserComboBoxChanged)
        self.scanTypeComboBox.Bind(wx.EVT_COMBOBOX,
                                   self.onScanTypeComboBoxChanged)
        self.Bind(wx.EVT_SHOW, self.onShow)

        self.videoView.setMilliseconds(20)
        self.videoView.setCallback(self.getFrame)
示例#7
0
	def __init__(self, parent, buttonPrevCallback=None, buttonNextCallback=None):
		WizardPage.__init__(self, parent,
							title=_("Scanning"),
							buttonPrevCallback=buttonPrevCallback,
							buttonNextCallback=buttonNextCallback)

		self.driver = Driver.Instance()
		self.pcg = PointCloudGenerator.Instance()

		value = abs(float(profile.getProfileSetting('step_degrees_scanning')))
		if value > 1.35:
			value = _("Low")
		elif value > 0.625:
			value = _("Medium")
		else:
			value = _("High")
		self.resolutionLabel = wx.StaticText(self.panel, label=_("Resolution"))
		self.resolutionComboBox = wx.ComboBox(self.panel, wx.ID_ANY,
												value=value,
												choices=[_("High"), _("Medium"), _("Low")],
												style=wx.CB_READONLY)

		_choices = []
		choices = profile.getProfileSettingObject('use_laser').getType()
		for i in choices:
			_choices.append(_(i))
		self.laserDict = dict(zip(_choices, choices))
		self.laserLabel = wx.StaticText(self.panel, label=_("Laser"))
		useLaser = profile.getProfileSettingObject('use_laser').getType()
		self.laserComboBox = wx.ComboBox(self.panel, wx.ID_ANY,
										value=_(profile.getProfileSetting('use_laser')),
										choices=_choices,
										style=wx.CB_READONLY)

		_choices = []
		choices = profile.getProfileSettingObject('scan_type').getType()
		for i in choices:
			_choices.append(_(i))
		self.scanTypeDict = dict(zip(_choices, choices))
		self.scanTypeLabel = wx.StaticText(self.panel, label=_('Scan'))
		scanType = profile.getProfileSettingObject('scan_type').getType()
		self.scanTypeComboBox = wx.ComboBox(self.panel, wx.ID_ANY,
											value=_(profile.getProfileSetting('scan_type')),
											choices=_choices,
											style=wx.CB_READONLY)

		self.skipButton.Hide()

		#-- Layout
		vbox = wx.BoxSizer(wx.VERTICAL)
		hbox = wx.BoxSizer(wx.HORIZONTAL)
		hbox.Add(self.resolutionLabel, 0, wx.ALL^wx.BOTTOM|wx.EXPAND, 18)
		hbox.Add(self.resolutionComboBox, 1, wx.ALL^wx.BOTTOM|wx.EXPAND, 12)
		vbox.Add(hbox, 0, wx.ALL|wx.EXPAND, 5)
		hbox = wx.BoxSizer(wx.HORIZONTAL)
		hbox.Add(self.laserLabel, 0, wx.ALL^wx.BOTTOM|wx.EXPAND, 18)
		hbox.Add(self.laserComboBox, 1, wx.ALL^wx.BOTTOM|wx.EXPAND, 12)
		vbox.Add(hbox, 0, wx.ALL|wx.EXPAND, 5)
		hbox = wx.BoxSizer(wx.HORIZONTAL)
		hbox.Add(self.scanTypeLabel, 0, wx.ALL^wx.BOTTOM|wx.EXPAND, 18)
		hbox.Add(self.scanTypeComboBox, 1, wx.ALL^wx.BOTTOM|wx.EXPAND, 12)
		vbox.Add(hbox, 0, wx.ALL|wx.EXPAND, 5)
		self.panel.SetSizer(vbox)
		self.Layout()

		self.resolutionComboBox.Bind(wx.EVT_COMBOBOX, self.onResolutionComboBoxChanged)
		self.laserComboBox.Bind(wx.EVT_COMBOBOX, self.onLaserComboBoxChanged)
		self.scanTypeComboBox.Bind(wx.EVT_COMBOBOX, self.onScanTypeComboBoxChanged)
		self.Bind(wx.EVT_SHOW, self.onShow)

		self.videoView.setMilliseconds(20)
		self.videoView.setCallback(self.getFrame)