Main Content

gigecam

Create gigecam object to acquire images from GigE Vision cameras

Add-On Required: This feature requires the Image Acquisition Toolbox Support Package for GigE Vision Hardware add-on.

Description

g = gigecam creates the gigecam object g and connects to the single GigE Vision® camera on your system. If you have multiple cameras and you use the gigecam function with no input argument, then it creates the object and connects it to the first camera it finds listed in the output of the gigecamlist function.

When the gigecam object is created, it connects to the camera and establishes exclusive access. You can then preview the data and acquire images using the snapshot function.

example

g = gigecam(IPAddress) creates a gigecam object g where IPAddress is a character vector or string scalar value that identifies a particular camera by its IP address and connects it to the camera with that address.

example

g = gigecam(devicenumber) creates a gigecam object g, where devicenumber is a numeric scalar value that identifies a particular camera by its index number, and connects it to that camera.

example

g = gigecam(serialnumber) creates a gigecam object g where serialnumber is a character vector or string scalar value that identifies a particular camera by its serial number.

example

Examples

collapse all

Use the gigecam function with no input arguments to connect to the single GigE Vision camera on your system. If you have multiple cameras and you use the gigecam function with no input argument, it creates the object and connects it to the first camera it finds listed in the output of the gigecamlist function.

Use the gigecamlist function to ensure that MATLAB® is discovering your camera.

gigecamlist
ans = 

	Model              Manufacturer           IPAddress       SerialNumber
  ____________________   ___________________   _______________    ______________

  'MV1-D1312-80-G2-12'   'Photonofocus AG'     '169.254.192.165'  '022600017445'

Create an object, g.

g = gigecam

It creates the object and connects it to the Photonofocus AG camera.

Use the gigecam function with the IP address or serial number of the camera as the input argument to create the object and connect it to the camera with that address or number.

Use the gigecamlist function to ensure that MATLAB is discovering your cameras.

gigecamlist
ans = 

	Model              Manufacturer           IPAddress       SerialNumber
  ____________________   ___________________   _______________    ______________

  'MV1-D1312-80-G2-12'   'Photonofocus AG'     '169.254.192.165'  '022600017445'
  'mvBlueCOUGER-X120aG'  'MATRIX VISION GmbH'  '169.254.242.122'  'GX000818'

Create an object, g, using the IP address of the camera. You can also create the object in this same way using the serial number. You use the same syntax, but use a serial number instead of the IP address, also as a character vector.

g = gigecam('169.254.242.122')
g = 

Display Summary for gigecam:

         DeviceModelName: 'mvBlueCOUGER-X120aG'
            SerialNumber: 'GX000818'
               IPAddress: '169.254.242.122'
             PixelFormat: 'Mono8'
   AvailablePixelFormats: {'Mono8' 'Mono12' 'Mono14' 'Mono16' 'Mono12Packed'
                          'BayerGR8' 'BayerGR10' 'BayerGR12' 'BayerGR16' 'BayerGR12Packed'
                          'YUV422Packed' 'YUV422_YUYVPacked' 'YUV444Packed'}
                  Height: 1082
                   Width: 1312

Show Beginner, Expert, Guru properties.
Show Commands.

It creates the object and connects it to the Matrix Vision camera with that IP address.

Use the gigecam function with an index as the input argument to create the object corresponding to that index and connect it to that camera. The index corresponds to the order of cameras in the table returned by gigecamlist when you have multiple cameras connected.

Use the gigecamlist function to ensure that MATLAB is discovering your cameras.

gigecamlist
ans = 

	Model              Manufacturer           IPAddress       SerialNumber
  ____________________   ___________________   _______________    ______________

  'MV1-D1312-80-G2-12'   'Photonofocus AG'     '169.254.192.165'  '022600017445'
  'mvBlueCOUGER-X120aG'  'MATRIX VISION GmbH'  '169.254.242.122'  'GX000818'

Create an object, g, using the index number.

g = gigecam(2)
g = 

Display Summary for gigecam:

         DeviceModelName: 'mvBlueCOUGER-X120aG'
            SerialNumber: 'GX000818'
               IPAddress: '169.254.242.122'
             PixelFormat: 'Mono8'
   AvailablePixelFormats: {'Mono8' 'Mono12' 'Mono14' 'Mono16' 'Mono12Packed'
                          'BayerGR8' 'BayerGR10' 'BayerGR12' 'BayerGR16' 'BayerGR12Packed'
                          'YUV422Packed' 'YUV422_YUYVPacked' 'YUV444Packed'}
                  Height: 1082
                   Width: 1312

Show Beginner, Expert, Guru properties.
Show Commands.

It creates the object and connects it to the Matrix Vision camera with that index number, in this case, the second one displayed by gigecamlist. If you only have one camera, you do not need to use the index.

Input Arguments

collapse all

IP address of your camera, specified as a character vector or string scalar. This argument creates a gigecam object g where IPAddress is a character vector value that identifies a particular camera by its IP address. When you use the gigecam function with the IP address of the camera as the input argument, it creates the object and connects it to the camera with that address. You can see the IP address for your camera in the list returned by the gigecamlist function.

Example: g = gigecam('169.254.192.165')

Data Types: char | string

Device number of your camera, specified as a numeric scalar. This number identifies a particular camera by its index order. It creates the object corresponding to that index and connects it to that camera. The index corresponds to the order of cameras in the table returned by gigecamlist when you have multiple cameras connected.

Example: g = gigecam(2)

Data Types: double

Serial number of your camera, specified as a character vector or string scalar. This argument creates a gigecam object g where serialnumber is a character vector value that identifies a particular camera by its serial number. When you use the gigecam function with the serial number of the camera as the input argument, it creates the object and connects it to the camera with that number. You can see the serial number for your camera in the list returned by the gigecamlist function.

Example: g = gigecam('022600017445')

Data Types: char | string

Tips

  • When the gigecam object is created, it connects to the camera and establishes exclusive access. You can then preview the data and acquire images using the snapshot function.

  • You cannot create more than one object connected to the same device, and trying to do that generates an error.

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.

Version History

Introduced in R2014b