예제 #1
0
    def Init_camera(self):
        try:
            # Create a camera instance (see pypogs.camera.Camera)
            self.cam = pypogs.Camera(model='ptgrey',
                                     identity='18285284',
                                     name='CoarseCam')

            # COARSE/STAR
            self.cam.exposure_time = 10  # 450
            self.cam.gain = 0
            self.cam.frame_rate = 4
            self.cam.binning = 2
            # cam.plate_scale = 20.3
            self.cam.plate_scale = 40.6
            self.cam.start()
            #img = cam.get_latest_image()

            # Create a TrackingThread instance
            self.tt = pypogs.TrackingThread(camera=self.cam,
                                            name='CoarseTrackThread')

            self.tt.goal_x_y = [0, 0]  # goal is center of image
            self.tt.spot_tracker.max_search_radius = 2000
            self.tt.spot_tracker.min_search_radius = 200
            self.tt.spot_tracker.crop = (256, 256)
            self.tt.spot_tracker.spot_min_sum = 500
            self.tt.spot_tracker.bg_subtract_mode = 'local_median'
            self.tt.spot_tracker.sigma_mode = 'local_median_abs'
            self.tt.spot_tracker.fails_to_drop = 10
            self.tt.spot_tracker.smoothing_parameter = 8
            self.tt.spot_tracker.rmse_smoothing_parameter = 8
            self.tt.feedforward_threshold = 10
            self.tt.img_save_frequency = 1
            self.tt.spot_tracker.image_th = 20000

            # Set up tracking parameters (see SpotTracker in this module for details)
            self.tt.spot_tracker.position_max_sd = 100
            self.tt.spot_tracker.position_min_sd = 20
            self.tt.spot_tracker.position_sigma = 5
            # (Optional) set up a directory for image saving at .5 Hz
            self.tt.image_folder = Path('./tracking_images')
            self.tt.img_save_frequency = 1
            print("Camera and tracking thread works")
        except BaseException:
            print("Camera and tracking error")
예제 #2
0
import pypogs
import time
import matplotlib.pyplot as plt

# Create instance and set parameters (will auto initialise)
try:
    cam = pypogs.Camera(model='phfocus', identity='AutoIP', name='CoarseCam')
    time.sleep(1)
    cam.frame_rate = 20
    print('frame rate:', cam.frame_rate)  # hz
    # # Start acquisition
    notemap = cam._phfocus_ia.remote_device.node_map
    print(notemap.ExposureTime.value)

    cam.start()
    time.sleep(3)

    print('Height before', notemap.Height.value)

    cam.size_readout = (640, 512)
    print('Height after', notemap.Height.value)
    cam.start()
    time.sleep(3)

    # time.sleep(3)
    # cam.start()
    # cam.frame_rate = 10
    # print('frame rate:', cam.frame_rate)  # hz
    #
    # try:
    #     while True:
예제 #3
0
import pypogs
import time

# Create instance and set parameters (will auto initialise)
cam = pypogs.Camera(model='ptgrey', identity='18285254', name='CoarseCam')
cam.gain = 0  # decibel
cam.exposure_time = 100  # milliseconds
cam.frame_rate_auto = True
# Start acquisition
cam.start()
# Wait for a while
time.sleep(2)
# Read the latest image
img = cam.get_latest_image()
# Stop the acquisition
cam.stop()
# Release the hardware
cam.deinitialize()