Exemplo n.º 1
0
def Standard_Settings(cam, dev, verbose):
    '''
        Write standard settings to the camera. This is typically items that will
        never change (such as single frame mode, use full frame, no Auto-exposure, etc.)

        Note that the DefectCorrectStaticEnable option uses an internal look-up table of
        factory-measured bad pixels and interpolates across them. We want this off!

    '''

    # [fWid,fHgt] = cam.get_sensor_size()   # Full frame size

    fWid, fHgt = 1600, 1100  # Full frame size
    cam.set_binning(1, 1)  # Pixel binning 1x1
    cam.set_region(0, 0, fWid, fHgt)  # Use full frame

    frameRate = 1.0  # Frame rate (Hz). I don't think that this has any effect (for single frames)
    cam.set_frame_rate(frameRate)  # Frame rate (Hz)

    dev.set_string_feature_value('PixelFormat', 'Mono16')

    cam.set_boolean('GammaEnable', False)  # No gamma correction!
    cam.set_exposure_time_auto(
        Aravis.auto_from_string('Off'))  # Auto-exposure off
    cam.set_gain_auto(Aravis.auto_from_string('Off'))  # Also auto-gain
    cam.set_acquisition_mode(
        (Aravis.acquisition_mode_from_string('SingleFrame')
         ))  # Set to single frames

    cam.set_boolean('ReverseX', False)  # Use these to flip left-right
    cam.set_boolean('ReverseY', False)  #   and up-down

    cam.set_string('AdcBitDepth',
                   'Bit12')  # 12-bit ADC - only option for this camera
    cam.set_string(
        'DeviceTemperatureSelector',
        'Sensor')  # Which temperature sensor - only option for this camera

    cam.set_boolean('DefectCorrectStaticEnable',
                    False)  # Turn off auto-correction of (known) bad pixels

    cam.set_boolean('BlackLevelClampingEnable',
                    False)  # CHECK - seems to correct low signal clamping

    if verbose:
        print("Set RoI to Full Frame ", fWid, " x ", fHgt)
        print("Set binning to 1 x 1")
        print("Auto-exposure off, Single frame mode")
        print("No X or Y-flips of frame")
        print("ADC depth 12 bits")
        print("auto-correction of bad pixels off")
        print("BlackLevelClampingEnable off")
Exemplo n.º 2
0
'''

#--- Set conversion mode, gain, exposure time here:

GCM = "HCG"  # Gain Conversion Mode ("HCG" or "LCG")
GainSetting = 5.0  # Gain setting 0-48
ExpTime = 0.07  # Exposure time (Seconds: 18E-6 to 30)

cam.set_string('GainConversion', GCM)  # Set gain conversion mode
cam.set_gain(GainSetting)  #   and Gain Setting
cam.set_exposure_time(ExpTime * 1.0E6)  # Exposure time (uSec)

#---

cam.set_acquisition_mode((Aravis.acquisition_mode_from_string('SingleFrame')
                          ))  # Set to single frames

cam.set_boolean('ReverseX', False)  # Use these to flip left-right
cam.set_boolean('ReverseY', False)  #   and up-down

# cam.set_string('ImageCompressionMode','Off')           # Definitely don't want this (WRITE-PROTECTED?)
cam.set_string('AdcBitDepth', 'Bit12')  # Only option for this camera
cam.set_string('DeviceTemperatureSelector',
               'Sensor')  # Only option for this camera

cam.set_boolean('DefectCorrectStaticEnable',
                False)  # Turn off auto-correction of (known) bad pixels

dev = cam.get_device()  # Allows access to "deeper" features