예제 #1
0
    def capture(self):
        self.capturing = True
        image = None

        if self.mode == 'Texture':
            image = image_capture.capture_texture()

        if self.mode == 'Pattern':
            image = image_capture.capture_pattern()
            image = image_detection.detect_pattern(image)

        if self.mode == 'Laser':
            image = image_capture.capture_all_lasers()

        if self.mode == 'Gray':
            images = image_capture.capture_lasers()
            for i in xrange(2):
                images[i] = laser_segmentation.compute_line_segmentation(images[i])
            if images[0] is not None and images[1] is not None:
                image = images[0] + images[1]
                image = cv2.merge((image, image, image))
            else:
                image = None

        self.capturing = False
        return image
예제 #2
0
 def after_scan(self, response):
     ret, result = response
     if ret:
         self.gauge.SetValue(self.gauge.GetRange())
         dlg = wx.MessageDialog(
             self,
             _("Scanning has finished. If you want to save your "
               "point cloud go to \"File > Save model\""),
             _("Scanning finished!"), wx.OK | wx.ICON_INFORMATION)
         dlg.ShowModal()
         dlg.Destroy()
         self.scanning = False
         # Flush video
         image_capture.capture_texture()
         image_capture.capture_texture()
         image_capture.capture_texture()
         self.on_scan_finished()
     else:
         if isinstance(result, InputOutputError):
             self.scanning = False
             self.on_scan_finished()
             self.GetParent().toolbar.update_status(False)
             driver.disconnect()
             dlg = wx.MessageDialog(
                 self,
                 "Low exposure values can cause a timing issue at the USB stack level on "
                 "v4l2_ioctl function in VIDIOC_S_CTRL mode. This is a Logitech issue on Linux",
                 str(result), wx.OK | wx.ICON_ERROR)
             dlg.ShowModal()
             dlg.Destroy()
예제 #3
0
 def get_image(self):
     if self.scanning:
         image_capture.stream = False
         image = current_video.capture()
         image = point_cloud_roi.mask_image(image)
         return image
     else:
         image_capture.stream = True
         image = image_capture.capture_texture()
         image = point_cloud_roi.draw_cross(image)
         if self.scene_view._view_roi:
             image = point_cloud_roi.mask_image(image)
             image = point_cloud_roi.draw_roi(image)
         return image
예제 #4
0
    def on_stop_tool_clicked(self, event):
        paused = ciclop_scan._inactive
        ciclop_scan.pause()
        dlg = wx.MessageDialog(self,
                               _("Your current scanning will be stopped.\n"
                                 "Are you sure you want to stop?"),
                               _("Stop scanning"), wx.YES_NO | wx.ICON_QUESTION)
        result = dlg.ShowModal() == wx.ID_YES
        dlg.Destroy()

        if result:
            self.scanning = False
            ciclop_scan.stop()
            # Flush video
            image_capture.capture_texture()
            image_capture.capture_texture()
            image_capture.capture_texture()
            self.on_scan_finished()
        else:
            if not paused:
                ciclop_scan.resume()
예제 #5
0
 def get_image(self):
     return image_capture.capture_texture()