Skip to main content

GetCamera

GetCamera [/DEF/Q /W=winName /Z ] keyword=value

The GetCamera operation provides information about cameras connected to your computer, their current settings, and the options they support.

Except for the availableCameras keyword, you must either include the /DEF flag or specify the name (e.g., Camera0) of the camera window of interest using the /W flag.

GetCamera was added in Igor Pro 7.00, and deprecated in Igor Pro 10.00.

Use MMI_GetCamera instead.

Flags

/DEFApplies the GetCamera operation to the computer's default camera. Note that the default camera does not have to be represented by an open viewfinder window but it must be connected to the computer.
/W=winNameSpecifies the camera window to target. Use the name of the camera window, e.g., camera0, not the name/description of the camera.
If the camera window is embedded in a graph the name would have the form e.g., graph0#CM0.
/QQuiet mode, do not print diagnostics to the history area of the command window.
/ZSuppress errors. Sets V_Flag to zero or to a non-zero error code.

Keywords

apertureReturns the current aperture setting or -1 if the aperture setting is not supported by the camera's driver.
The value is returned in the S_info output variable as a keyword/value pair: "aperture:<value>". Use NumberByKey to get the value.
availableCamerasReturns the description of each available camera in the semicolon-separated string S_cameraNames.
If you omit the /Q flag, the operation prints a list of available cameras to the history area of the command window.
The availableCameras keyword is different from all others in that it does not require that you specify a camera via /W or /DEF flags and it can't be used in combination with any other keyword.
colorFilterReturns the current color filter.
The value is returned in the S_info output variable as a keyword/value pair: "colorFilter:<value>". Use NumberByKey to get the value.
Supported filters include:
ValueFilter
0None
1Grayscale
2Negative
3Solarize
4Sepia
5Posterize
6Whiteboard
7Blackboard
8Aqua
1000Start of vendor-specific color filters
contrastReturns the contrast level in the range [-1,1].
Return -1 if contrast control is not supported by the camera's driver.
The value is returned in the S_info output variable as a keyword/value pair: "contrast:<value>". Use NumberByKey to get the value.
customFocusPointReturns the custom focus point as a pair of values (left,top) in the range [0,1] as fractions of the image measured from the top-left corner.
The value is returned in the S_info output variable as a keyword/value pair: "customFocusPoint:(<value>,<value>)". Use StringByKey to get the text after the colon and then sscanf to parse the result into numeric variables.
denoisingLevelReturns the denoising level in the range [-1,1].
Return s-1 if denoising level is not supported by the camera's driver.
The value is returned in the S_info output variable as a keyword/value pair: "denoisingLevel:<value>". Use NumberByKey to get the value.
descriptionReturns the description of the current camera.
The value is returned in the S_info output variable as a keyword/value pair: "Description:<value>". Use StringByKey to get the value.
deviceNameReturns the device name for the specified camera. This is usually a hex number.
The value is returned in the S_info output variable as a keyword/value pair: "DeviceName:<value>". Use StringByKey to get the value.
digitalZoomReturns the current digital zoom level.
The value is returned in the S_info output variable as a keyword/value pair: "digitalZoom:<value>". Use NumberByKey to get the value.
exposureCompensationReturns the current exposure compensation.
The value is returned in the S_info output variable as a keyword/value pair: "exposureCompensation:<value>". Use NumberByKey to get the value.
focusModeReturns the current focus mode.
The value is returned in the S_info output variable as a keyword/value pair: "focusMode:<value>". Use NumberByKey to get the value.
Supported focus modes are:
ValueFocus Mode
1Manual
2Hyperfocal
4Infinity
8Auto focus
16Continuous
32Macro
isColorFilterSupported=cf
Returns true or false for the specified color filter.
See the colorFilter keyword for supported color filter codes.
The value is returned in the S_info output variable as a keyword/value pair: "isColorFilterSupported:<value>" where <value> is true or false. Use StringByKey to get the value.
isFlashModeSupported=fm
Returns true or false for the specified flash mode.
The value is returned in the S_info output variable as a keyword/value pair: "isFlashModeSupported:<value>" where <value> is true or false. Use StringByKey to get the value.
Supported flash modes are:
ValueFlash Mode
1Auto
2Off
4On
8Redeye reduction
16Fill
32Torch
64Video light
128Front curtain
256Rear curtain
512Manual
isFlashReadyReturns the readiness state of the camera flash.
The value is returned in the S_info output variable as a keyword/value pair: "isFlashReady:<value>" where <value> is true or false. Use StringByKey to get the value.
isFocusModeSupported=fm
Returns true or false for the specified focus mode.
See the focusMode keyword for supported focus mode codes.
The value is returned in the S_info output variable as a keyword/value pair: "isFocusModeSupported:<value>" where <value> is true or false. Use StringByKey to get the value.
isFocusPointModeSupported=fpm
Returns true or false for the specified focus point mode.
The value is returned in the S_info output variable as a keyword/value pair: "isFocusPointModeSupported:<value>" where <value> is true or false. Use StringByKey to get the value.
Supported focus point modes are:
ValueFocus Point Mode
0Auto
1Center
2Face detection
3Custom point
isIPAvailableReturns the availability of the image processing. Image processing provides control over white balance, contrast, saturation, sharpening and denoising.
The value is returned in the S_info output variable as a keyword/value pair: "isIPAvailable:<value>" where <value> is true or false. Use StringByKey to get the value.
isMeteringModeSupported=mm
Returns true or false for the specified metering mode.
The value is returned in the S_info output variable as a keyword/value pair: "isMeteringModeSupported:<value>" where <value> is true or false. Use StringByKey to get the value.
Supported metering modes are:
ValueMetering Mode
1Matrix
2Average
3Spot
isWBModeSupported=wbm
Returns true or false for the specified white balance mode.
The value is returned in the S_info output variable as a keyword/value pair: "isWBModeSupported:<value>" where <value> is true or false. Use StringByKey to get the value.
See the whiteBalanceMode keyword for supported white balance modes.
manualWhiteBalanceReturns the current color temperature in degrees Kelvin.
The value is returned in the S_info output variable as a keyword/value pair: "manualWhiteBalance:<value>". Use NumberByKey to get the value.
maximumDigitalZoomReturns the maximum value of digital zoom.
The value is returned in the S_info output variable as a keyword/value pair: "maximumDigitalZoom:<value>". Use NumberByKey to get the value.
maximumOpticalZoomReturns the maximum value of optical zoom
The value is returned in the S_info output variable as a keyword/value pair: "maximumOpticalZoom:<value>". Use NumberByKey to get the value.
opticalZoomReturns the current optical zoom level.
The value is returned in the S_info output variable as a keyword/value pair: "opticalZoom:<value>". Use NumberByKey to get the value.
orientationReturns the angle of the camera sensor relative to its natural orientation in steps of 90 degrees.
The value is returned in the S_info output variable as a keyword/value pair: "orientation:<value>". Use NumberByKey to get the value.
positionReturns the position of the camera.
The value is returned in the S_info output variable as a keyword/value pair: "position:<value>" where <value> is true or false. Use StringByKey to get the value.
Supported positions are:
ValuePosition
0UnspecifiedPosition
1BackFace
2FrontFace
saturationReturns the saturation level in the range [-1,1].
Return -1 if saturation control is not supported by the driver.
The value is returned in the S_info output variable as a keyword/value pair: "saturation:<value>". Use NumberByKey to get the value.
sharpeningLevelReturns the sharpening level in the range [-1,1].
Returns -1 if the driver does not support sharperningLevel control
The value is returned in the S_info output variable as a keyword/value pair: "sharpeningLevel:<value>". Use NumberByKey to get the value.
spotMeteringPointReturns a pair of values (left,top) defining a spot metering point measured in fractions of the image from the top-left corner.
The value is returned in the S_info output variable as a keyword/value pair: "spotMeteringPoint:(<value>,<value>)". Use StringByKey to get the text after the colon and then sscanf to parse the result into numeric variables.
supportedAperturesReturns a comma-separated list of floating point numbers representing supported apertures. The list will be empty if the driver does not support changing apertures.
The value is returned in the S_info output variable as a keyword/value pair: "supportedApertures:<list>". Use StringByKey to get the list.
supportedISOSensitivities
Returns a comma-separated list of integers representing ISO values. The will be empty if the driver does not provide ISO sensitivities control.
The value is returned in the S_info output variable as a keyword/value pair: "supportedApertures:<list>". Use StringByKey to get the list.
supportedShutterSpeeds
Returns a comma-separated list of floating point numbers representing supprted shutter speeds (in seconds). The list will be empty if the driver does not provide shutter speed control.
The value is returned in the S_info output variable as a keyword/value pair: "supportedShutterSpeeds:<list>". Use StringByKey to get the list.
shutterSpeedReturns the current shutter speed in seconds.
Returns -1 if the driver does not support shutter speed control.
The value is returned in the S_info output variable as a keyword/value pair: "shutterSpeed:<value>". Use NumberByKey to get the value.
viewfinderPixelFormats
Returns a comma-separated list of floating numbers representing supprted viewfinder pixel formats.
The value is returned in the S_info output variable as a keyword/value pair: "viewfinderPixelFormats:<list>". Use StringByKey to get the list.
The following pixel format values are defined:
ValuePixel Format
1ARGB32
2ARGB32_Premultiplied
3RGB32
4RGB24
5RGB565
6RGB555
7ARGB8565_Premultiplied
8BGRA32
9BGRA32_Premultiplied
10BGR32
11BGR24
12BGR565
13BGR555
14BGRA5658_Premultiplied
15AYUV444
16Format_AYUV444_Premultiplied
17YUV444
18YUV420P
19YV12
20UYVY
viewfinderFrameRateRanges
Returns comma-separated list of floating point pairs of form "(minFrameRate,maxFrameRate)".
The list is returned in the S_info output variable. It is not a keyword/value pair. Use StringByKey to get the list.
See ModifyCamera with the keyword setFrameRate for further information.
viewfinderResolutionsReturns comma-separated list of number pairs of form "(width,height)".
The value is returned in the S_info output variable as a keyword/value pair: "viewfinderResolutions:<list>". Use StringByKey to get the list.
whiteBalanceModeReturns the current white balance mode.
The value is returned in the S_info output variable as a keyword/value pair: "whiteBalanceMode:<value>". Use NumberByKey to get the value.
Supported white balance modes are:
ValueWhite Balance Mode
0Auto
1Manual
2Sunlight
3Cloudy
4Shade
5Tungsten
6Fluorescent
7Flash
8Sunset
1000Start of vendor-specific white balance modes

Details

The GetCamera operation includes a broad range of options that may not be supported in practice by either the operating system or the camera driver. Some results are undefined when the driver does not support the corresponding feature.

Except for the availableCameras keyword, you must either include the /DEF flag or specify the name (e.g., Camera0) of the camera window of interest using the /W flag.

Output Variables

The availableCameras keyword returns a semicolon-separated list for camera descriptions in S_cameraNames.

All other keywords return their results in S_info as a string list with keyword:value pairs separated by semicolons. When the result for any keyword consists of multiple possible values they are separated by commas.

Output Variables

GetCamera sets the following output variables:

V_flag0 if the operation succeeded or a non-zero error code.
S_cameraNamesSet by the availableCameras keyword only to a semicolon-separated list of camera descriptions.
S_infoSet by all keywords except availableCameras to a keyword:value pair terminated by a semicolon. When the result for any keyword consists of multiple possible values they are separated by commas.

See Also

ModifyCamera, NewCamera, MMI - Overview