Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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);

...

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)

...