Set Properties for GigE Acquisition
Property Display
One of the main advantages of using the gigecam
object for image
acquisition, instead of the gige
adaptor with the
videoinput
object, is the advanced property features of GigE Vision® Compliant hardware.
When you create the gigecam
object, the basic properties are
displayed, as shown here.
g = gigecam
g = Display Summary for gigecam: DeviceModelName: 'MV1-D1312-80-G2-12' SerialNumber: '022600017445' IPAddress: '169.254.192.165' PixelFormat: 'Mono8' AvailablePixelFormats: {'Mono8' 'Mono10Packed' 'Mono12Packed' 'Mono10' 'Mono12'} Height: 1082 Width: 1312 Timeout: 10 Show Beginner, Expert, Guru properties. Show Commands.
When you click Beginner, the Beginner level camera properties are displayed.
The list of available properties is specific to your camera. The display of properties is broken into categories based on GenICam categories as specified by camera manufacturers. For example, in the display shown here, you can see a set of device control properties, and a set of acquisition control properties. There are other categories not shown in this graphic, such as analog control, convolver, and image format control.
The GigE Vision category standard also provides levels of expertise for the available
categories. When you create the gigecam
object, you see a small set of
commonly used properties with links to the expanded property list based on expertise. To see
the additional properties, click Beginner, Expert,
or Guru.
Set GigE Properties
You can set properties two different ways — as additional arguments when you
create the object using the gigecam
function, or anytime after you create
the object using the syntax shown in this section.
Set a Property When Creating the Object
When you use the gigecam
function with no arguments, it creates the
object and connects to the single GigE Vision Compliant camera on your system, or to the first camera it finds listed in the
output of the gigecamlist
function if you have multiple cameras. If you
use an argument to create the object — either an IP address, index number, or serial number
— as described in Create the gigecam Object, that argument must be the first argument.
g = gigecam('169.254.242.122')
To set a property when creating the object, it must be specified as a name-value pair
after the IP address, index number, or serial number. The following command creates the
object using the camera on the IP address used as the first argument, then sets the
PixelFormat
property to Mono10
.
g = gigecam('169.254.242.122', 'PixelFormat', 'Mono10')
If you are creating the object with just one camera connected, you can use the index
number 1
as the first input argument, then a property-value pair.
g = gigecam(1, 'PixelFormat', 'Mono10')
You can set multiple properties in this way, and you can use pairs of either character vectors or numerics.
g = gigecam(1, 'ExposureTime', 20000, 'PixelFormat', 'Mono10')
Set a Property After Creating the Object
You can set or change properties any time after you create the object, using this
syntax, where g
is the object name.
g.ExposureTime = 20000
If you want to change the Timeout
from its default value of 10
seconds, to increase it to 20 seconds for example, use this syntax.
g.Timeout = 20
This way of setting properties also supports both character vectors and numerics.
g.LinLog_Mode = 'On';
Note
To get a list of options you can use on a function, press the Tab key after entering a function on the MATLAB® command line. The list expands, and you can scroll to choose a property or value. For information about using this advanced tab completion feature, see Using Tab Completion for Functions.
Use GigE Commands
You can use any of the GigE Vision camera commands that your camera supports.
The commands
function tells you what commands are available for your
camera to use. The output depends on the commands that are supported by your specific
hardware. To get the list, use the commands
function with the object
name, which is g
in this example.
commands(g)
Then use executeCommand
to execute any of the commands found by the
commands
function. The command name is passed as a character vector.
For example, set a calibration correction.
executeCommand(g, 'Correction_CalibrateGrey');
The camera is set to correct the grey calibration when you acquire images.
You may have a camera that has a command to perform auto focus. With a
gigecam
object named gcam
and a GigE command named
AutoFocus
.
executeCommand(gcam, 'AutoFocus');
You can also see the list of commands for your camera by clicking the Show
Commands link at the bottom of the properties list when you create the
gigecam
object.