Specifications

sharpVISION™ Camera
sharpVISION SDK Reference
10
2.3. Enumerate/Open a camera
To get the list of available cameras, call SvEnumCameras. Use the cameraId field of the
camera list in your call to SvOpenCamera. Here is a simple example of opening the first
available camera:
SV_ENUMITEM svList[10];
unsigned long nListLen = sizeof(szList)/sizeof(SV_ENUMITEM);
SvLoadDriver();
// nListLen is the length of your SV_ENUMITEM array
SvEnumCameras( &svList[0], &nListLen );
// nListLen is now the number of cameras available. It may be
// larger than your SV_ENUMITEM array length!
if (( nListLen > 0 ) && ( svList[0].isOpen == FALSE ))
{
SV_HANDLE hCamera;
// Open the first camera in the list.
SvOpenCamera( svList[0].cameraId, &hCamera );
// Do something...
...
// Close the camera.
SvCloseCamera( hCamera );
}
// Unload the driver
SvUnloadDriver();
The camera list contains a unique ID which identifies each particular camera. Many
developers use the unique ID to recall previous settings, or associate a meaningful name
string with a camera.