...
To use ApBase COM, create an object of type apbaseCom.ApBase. The details will depend on the tool or language you are using. The following example is in Matlab.
Here is a minimal procedure to open a demo kit camera, initialize the ON Semiconductor device, grab an image and convert it to RGB.
% open ApBase and Camera, and initialize via "Demo Initialization" preset
apbase = actxserver('apbaseCom.ApBase');
camera = apbase.Create(0);
camera.LoadIniPreset('', '');
% Throw-away the first frame after initialization
raw = camera.GrabFrame;
% grab a frame, convert to RGB
raw = camera.GrabFrame;
rgb = camera.ColorPipe(raw);
Note: The call to LoadIniPreset() with blank parameters is only applicable in situations where the default initialization is sufficient. For demo kits with multiple possible configurations, such as ISP + sensor combinations or different connection options, you will need to specify the particular initialization preset for the configuration.
Note: The rgb image is one long line; this is for performance reasons.
In Matlab you will need to reshape it for display
apbaseCom.ApBase Methods and Properties
...
Get the next image from the camera.
Use LastError for the error code.
Note: after initialization via "LoadIniPreset('', '')", do a call to GrabFrame() to throw-away the first frame due to possibility it will be a partial frame - first-waffle kind of thing.
Frames after that will be full frames.
VARIANT ColorPipe(VARIANT inImage, ULONG *outWidth, ULONG *outHeight, ULONG *outBitDepth)
...