コード例 #1
0
ファイル: test_optical.py プロジェクト: hstarmans/hexastorm
 def test_laserspot(self):
     '''tests laser spot detection
     '''
     dct = {
         'laserspot1.jpg': np.array([26, 36]),
         'laserspot2.jpg': np.array([27, 41])
     }
     for k, v in dct.items():
         img = cv.imread(str(Path(TESTIMG_DIR, k)))
         np.testing.assert_array_equal(
             feature.spotsize(img)['axes'].round(0), v)
コード例 #2
0
ファイル: test_optical.py プロジェクト: hstarmans/hexastorm
 def grabspot(self, laserpower=80):
     '''turn on laser
     User can first preview image. After pressing escape,
     a final image is taken.
     '''
     # NOTE: all ND filters and a single channel is used
     self.host.laser_current = laserpower
     self.cam.set_exposure(1499)
     yield from self.host.enable_comp(laser1=True)
     print("Calibrate the camera with live view \
            and press escape to confirm spot in vision")
     self.cam.live_view(scale=0.6)
     img = self.takepicture()
     print(feature.spotsize(img))
     yield from self.host.enable_comp(laser1=False)
コード例 #3
0
ファイル: optical.py プロジェクト: aa88kk/hexastorm
    def grabspot(self, laserpower=80):
        '''turn on laser

        User can first preview image. After pressing escape,
        a final image is taken.
        '''
        self.om.laser_power = laserpower  #NOTE: at the moment all ND filters and a single channel is used
        self.cam.set_exposure(1499)
        self.om.test_laser()
        print(
            "Calibrate the camera with live view an press escape to confirm spot in vision"
        )
        self.cam.live_view(scale=0.6)
        img = self.takepicture()
        print(feature.spotsize(img))
        self.om.stop()