Class VisionClient

A gRPC-web client for a Vision service.

Implements

  • Vision

Constructors

Properties

callOptions: CallOptions = ...
name: string

The name of the resource.

Methods

  • Returns the requested image, classifications, detections, and 3d point cloud objects in the next image given a camera.

    Parameters

    • cameraName: string

      The name of the camera to use for classification, detection, and segmentation.

    • __namedParameters: CaptureAllOptions
    • extra: {} = {}
    • callOptions: CallOptions = ...

    Returns Promise<
        {
            classifications: visionApi.Classification[];
            detections: visionApi.Detection[];
            extra: undefined
            | Struct;
            image: undefined | Image;
            objectPointClouds: commonApi.PointCloudObject[];
        },
    >

    • The requested image, classifications, detections, and 3d point cloud objects.
    const vision = new VIAM.VisionClient(machine, 'my_vision');
    const captureAll = await vision.captureAllFromCamera('my_camera', {
    returnImage: true,
    returnClassifications: true,
    returnDetections: true,
    returnObjectPointClouds: true,
    });

    For more information, see Vision API.

  • Send/Receive arbitrary commands to the resource.

    Parameters

    • command: Struct

      The command to execute.

    • callOptions: CallOptions = ...

    Returns Promise<JsonValue>

    const result = await resource.doCommand({
    name: 'myCommand',
    args: { key: 'value' },
    });
  • Get a list of classifications in the given image.

    Parameters

    • image: Uint8Array

      The image from which to get classifications.

    • width: number

      The width of the image.

    • height: number

      The height of the image.

    • mimeType: MimeType

      The MimeType of the image.

    • count: number

      The number of Classifications requested.

    • extra: {} = {}
    • callOptions: CallOptions = ...

    Returns Promise<visionApi.Classification[]>

    • The list of Classifications.
    const camera = new VIAM.CameraClient(machine, 'my_camera');
    const vision = new VIAM.VisionClient(machine, 'my_vision');

    const mimeType = 'image/jpeg';
    const image = await camera.getImage(mimeType);
    const classifications = await vision.getClassifications(
    image,
    600,
    600,
    mimeType,
    10
    );

    For more information, see Vision API.

  • Get a list of classifications in the next image given a camera.

    Parameters

    • cameraName: string

      The name of the camera to use for classification.

    • count: number

      The number of Classifications requested.

    • extra: {} = {}
    • callOptions: CallOptions = ...

    Returns Promise<visionApi.Classification[]>

    • The list of Classifications.
    const vision = new VIAM.VisionClient(machine, 'my_vision');
    const classifications = await vision.getClassificationsFromCamera(
    'my_camera',
    10
    );

    For more information, see Vision API.

  • Get a list of detections in the given image.

    Parameters

    • image: Uint8Array

      The image from which to get detections.

    • width: number

      The width of the image.

    • height: number

      The height of the image.

    • mimeType: MimeType

      The MimeType of the image.

    • extra: {} = {}
    • callOptions: CallOptions = ...

    Returns Promise<visionApi.Detection[]>

    • The list of Detections.
    const camera = new VIAM.CameraClient(machine, 'my_camera');
    const vision = new VIAM.VisionClient(machine, 'my_vision');

    const mimeType = 'image/jpeg';
    const image = await camera.getImage(mimeType);
    const detections = await vision.getDetections(
    image,
    600,
    600,
    mimeType
    );

    For more information, see Vision API.

  • Get a list of detections in the next image given a camera.

    Parameters

    • cameraName: string

      The name of the camera to use for detection.

    • extra: {} = {}
    • callOptions: CallOptions = ...

    Returns Promise<visionApi.Detection[]>

    • The list of Detections.
    const vision = new VIAM.VisionClient(machine, 'my_vision');
    const detections = await vision.getDetectionsFromCamera('my_camera');

    For more information, see Vision API.

  • Returns a list of the 3D point cloud objects and associated metadata in the latest picture obtained from the specified 3D camera.

    Parameters

    • cameraName: string

      The name of the camera.

    • extra: {} = {}
    • callOptions: CallOptions = ...

    Returns Promise<commonApi.PointCloudObject[]>

    • The list of PointCloudObjects
    const vision = new VIAM.VisionClient(machine, 'my_vision');
    const pointCloudObjects =
    await vision.getObjectPointClouds('my_camera');

    For more information, see Vision API.

  • Returns an object describing the properties of the vision service, namely booleans indicating whether classifications, detections, and 3d segmentation are supported.

    Parameters

    • extra: {} = {}
    • callOptions: CallOptions = ...

    Returns Promise<
        {
            classificationsSupported: boolean;
            detectionsSupported: boolean;
            objectPointCloudsSupported: boolean;
        },
    >

    • The properties of the vision service
    const vision = new VIAM.VisionClient(machine, 'my_vision');
    const properties = await vision.getProperties();

    For more information, see Vision API.

MMNEPVFCICPMFPCPTTAAATR