Vision Library - Class List

Following is the description of classes presented in the Stream Library.

RingBuffer

Internal usage purpose only

Public Attributes

    <li><a href = "#RingBuffer@bufferSize">bufferSize</a></li>
    
    <li><a href = "#RingBuffer@writeIndex">writeIndex</a></li>
    
    <li><a href = "#RingBuffer@readIndex">readIndex</a></li>
    
    <li><a href = "#RingBuffer@bigMask">bigMask</a></li>
    
    <li><a href = "#RingBuffer@smallMask">smallMask</a></li>
    
    <li><a href = "#RingBuffer@start_frame">start_frame</a></li>
    
    <li><a href = "#RingBuffer@imagerSource">imagerSource</a></li>
    
    <li><a href = "#RingBuffer@starttime">starttime</a></li>
    
    <li><a href = "#RingBuffer@width">width</a></li>
    
    <li><a href = "#RingBuffer@height">height</a></li>
    
    <li><a href = "#RingBuffer@buffer">buffer</a></li>
    
    <li><a href = "#RingBuffer@isMotionData">isMotionData</a></li>
    

Public Member Data Documentation

Following is the detailed documentation of the public variables declared under the RingBuffer class.

bufferSize

int32_t   bufferSize;         ///< Number of bytes in FIFO. Power of 2.

writeIndex

int32_t   writeIndex;         ///< Index of next writable byte.

readIndex

int32_t   readIndex;          ///< Index of next readable byte. 

bigMask

int32_t   bigMask;            ///< Used for wrapping indices with extra bit to distinguish full/empty.

smallMask

int32_t   smallMask;          ///< Used for fitting indices to buffer.

start_frame

int32_t   start_frame;

imagerSource

std::string imagerSource;     ///< Used for setting the imager number.

starttime

timespec starttime;  ///< Used to indicate the time of the start frame.

width

int width;

height

int height;  

buffer

unsigned char *buffer;

isMotionData

bool isMotionData;

SensorVectorData

Euclidean vector Data for sensor input/output
Defines 3 Dimensional Euclidean vector data.
This is used for 3 axis data of accelerometer magnetometer gyroscope.

Private Attributes

    <li><a href = "#SensorVectorData@x">x</a></li>
    
    <li><a href = "#SensorVectorData@y">y</a></li>
    
    <li><a href = "#SensorVectorData@z">z</a></li>
    
    <li><a href = "#SensorVectorData@id">id</a></li>
    

Public Attributes

    <li><a href = "#SensorVectorData@absvalue">absvalue</a></li>
    
    <li><a href = "#SensorVectorData@capture_interval">capture_interval</a></li>
    
    <li><a href = "#SensorVectorData@UUID">UUID</a></li>
    

Public Methods

    <li><a href = "#SensorVectorData@set_x">set_x</a></li>
    
    <li><a href = "#SensorVectorData@set_y">set_y</a></li>
    
    <li><a href = "#SensorVectorData@set_z">set_z</a></li>
    
    <li><a href = "#SensorVectorData@set_id">set_id</a></li>
    
    <li><a href = "#SensorVectorData@get_x">get_x</a></li>
    
    <li><a href = "#SensorVectorData@get_y">get_y</a></li>
    
    <li><a href = "#SensorVectorData@get_z">get_z</a></li>
    
    <li><a href = "#SensorVectorData@get_id">get_id</a></li>
    
    <li><a href = "#SensorVectorData@IsEqual">IsEqual</a></li>
    

Private Member Data Documentation

Following is the detailed documentation of the private variables declared under the SensorVectorData class.

x

    float x;

y

    float y;

z

    float z;

id

    int id;

Public Member Data Documentation

Following is the detailed documentation of the public variables declared under the SensorVectorData class.

absvalue

    bool absvalue;

capture_interval

    int capture_interval; // in milliseconds

UUID

    std::string UUID;

Public Member Function Documentation

Following is the detailed documentation of the public methods declared under the SensorVectorData class.

set_x

void set_x(float x);

set_y

void set_y(float y);

set_z

void set_z(float z);

set_id

void set_id(int id);

get_x

float get_x();

get_y

float get_y();

get_z

float get_z();

get_id

int   get_id();

IsEqual

bool IsEqual( SensorVector & r);

DigitalData

DigitalData
Defines Digital Data.

Public Attributes

    <li><a href = "#DigitalData@data">data</a></li>
    
    <li><a href = "#DigitalData@name">name</a></li>
    
    <li><a href = "#DigitalData@id">id</a></li>
    
    <li><a href = "#DigitalData@capture_interval">capture_interval</a></li>
    
    <li><a href = "#DigitalData@UUID">UUID</a></li>
    

Public Member Data Documentation

Following is the detailed documentation of the public variables declared under the DigitalData class.

data

    unsigned char data; 

name

    std::string name;

id

    int id;

capture_interval

    int capture_interval; // in milliseconds

UUID

    std::string UUID;

SensorData

Public Attributes

    <li><a href = "#SensorData@id">id</a></li>
    
    <li><a href = "#SensorData@stype">stype</a></li>
    
    <li><a href = "#SensorData@digitalData">digitalData</a></li>
    
    <li><a href = "#SensorData@vectorData">vectorData</a></li>
    
    <li><a href = "#SensorData@capturedtime">capturedtime</a></li>
    

Public Member Data Documentation

Following is the detailed documentation of the public variables declared under the SensorData class.

id

    int id;               // id of the sensor

stype

    SensorType stype;     // type of the sensor

digitalData

    // digitalData and vectorData together forms a union
    DigitalData *digitalData; 

vectorData

    // digitalData and vectorData together forms a union
    SensorVectorData *vectorData;

capturedtime

    timespec capturedtime;

Vision

Public Attributes

    <li><a href = "#Vision@access">access</a></li>
    

Public Methods

    <li><a href = "#Vision@~Vision">~Vision</a></li>
    
    <li><a href = "#Vision@setAccess">setAccess</a></li>
    
    <li><a href = "#Vision@start">start</a></li>
    
    <li><a href = "#Vision@stop">stop</a></li>
    
    <li><a href = "#Vision@setSharedAudioBuffer">setSharedAudioBuffer</a></li>
    
    <li><a href = "#Vision@setSharedVideoBuffer">setSharedVideoBuffer</a></li>
    
    <li><a href = "#Vision@setSensorData">setSensorData</a></li>
    
    <li><a href = "#Vision@addDeepLearingFilePath">addDeepLearingFilePath</a></li>
    
    <li><a href = "#Vision@setThreshold">setThreshold</a></li>
    
    <li><a href = "#Vision@enableVideoAnalytic">enableVideoAnalytic</a></li>
    
    <li><a href = "#Vision@getVideoAnalyticStatus">getVideoAnalyticStatus</a></li>
    
    <li><a href = "#Vision@enableAudioAnalytic">enableAudioAnalytic</a></li>
    
    <li><a href = "#Vision@getAudioAnalyticStatus">getAudioAnalyticStatus</a></li>
    
    <li><a href = "#Vision@enableSensorModule">enableSensorModule</a></li>
    
    <li><a href = "#Vision@getSensorModuleStatus">getSensorModuleStatus</a></li>
    
    <li><a href = "#Vision@enableUnsupervisedLearning">enableUnsupervisedLearning</a></li>
    
    <li><a href = "#Vision@getUnsupervisedLearningStatus">getUnsupervisedLearningStatus</a></li>
    
    <li><a href = "#Vision@setVisionEventListener">setVisionEventListener</a></li>
    
    <li><a href = "#Vision@setEndpointAndUserID">setEndpointAndUserID</a></li>
    
    <li><a href = "#Vision@sendFrame">sendFrame</a></li>
    

Typedefs

    <li><a href = "#Vision@Ptr">Ptr</a></li>
    

Public Member Data Documentation

Following is the detailed documentation of the public variables declared under the Vision class.

access

com::anyconnect::access::Access::Ptr access;

Public Member Function Documentation

Following is the detailed documentation of the public methods declared under the Vision class.

~Vision

virtual ~Vision() {};

setAccess

class builder; Set Access object.

virtual void setAccess(com::anyconnect::access::Access::Ptr access) = 0;
MemberDatatypeDefinition
accesscom::anyconnect::access::Access::PtrAccess object.

start

Starting Vision library. Resources are allocated waiting in idle state for a request to come in or to send a request issued by the application.

virtual VisionRet start() = 0;

Return Value: VisionRet::OK on successful vision initialization, other values on failure.

stop

Stopping Vision library. Graceful shutdown of recording and any other cloud service running, gracefully stops media processing. Close active visions and free resources.

virtual VisionRet stop() = 0;

Return Value: VisionRet::OK on successful, other values on failure.

setSharedAudioBuffer

Set the shared audio buffer from which the audio data will be read. Stream library will provide the buffer pointer and it is need to be set.

virtual VisionRet setSharedAudioBuffer(RingBuffer &audioBuffer) = 0;
MemberDatatypeDefinition
audioBufferRingBuffer &the reference pointer of the shared audio buffer

Return Value: VisionRet::OK on successful, other values on failure.

setSharedVideoBuffer

Set the shared video buffer from which the video data will be read. Stream library will provide the buffer pointer and it is need to be set.

virtual VisionRet setSharedVideoBuffer(RingBuffer &videoBuffer) = 0;
MemberDatatypeDefinition
videoBufferRingBuffer &the reference pointer of the shared video buffer

Return Value: VisionRet::OK on successful, other values on failure.

setSensorData

Set the external sensor data of the given id if the vision library do not have access to the sensor.

virtual VisionRet setSensorData(int id, SensorData sensorData) = 0;
MemberDatatypeDefinition
idintthe id of the sensor
sensorDataSensorDatavalues of the analog and digital data of the sensor.

Return Value: VisionRet::OK on success, other values on failure.

addDeepLearingFilePath

Set the file path for the deep learning and vision usage. Vision library will store deep learning files on the provided path. By default it will be stored in the current binary directory.

virtual VisionRet addDeepLearingFilePath(std::string filePath) = 0;
MemberDatatypeDefinition
filePathstd::stringthe path of the deep learning model file and label file directory

Return Value: VisionRet::OK on success, other values on failure.

setThreshold

Set the threshold for the vision event (sensor, audio, video)

virtual VisionRet setThreshold(int id, MediaType media, double threshold) = 0;
MemberDatatypeDefinition
idintthe id of the model
mediaMediaTypeAudio, video or sensor.
thresholddoublevalues of the threshold in range of (0-100).

Return Value: VisionRet::OK on success, other values on failure.

enableVideoAnalytic

Enable or disable VideoAnalytic.

virtual VisionRet enableVideoAnalytic(bool enableVideoAnalytic) = 0;
MemberDatatypeDefinition
enableVideoAnalyticboolTRUE will enable VideoAnalytic. FALSE will disable it.

Return Value: VisionRet::OK on success, other values on failure.

getVideoAnalyticStatus

Get the status of VideoAnalytic.

virtual bool getVideoAnalyticStatus(void) = 0;

Return Value: "true" on enabled, false on disabled.

enableAudioAnalytic

Enable or disable AudioAnalytic.

virtual VisionRet enableAudioAnalytic(bool enableAudioAnalytic) = 0;
MemberDatatypeDefinition
enableAudioAnalyticbool"true" will enable Audio Analysis, "false" will disable it.

Return Value: VisionRet::OK on success, other values on failure.

getAudioAnalyticStatus

Get the status of VideoAnalytic.

virtual bool getAudioAnalyticStatus(void) = 0;

Return Value: "true" on enabled, false on disabled.

enableSensorModule

Enable or disable sensor module.

virtual VisionRet enableSensorModule(bool enableSensor) = 0;
MemberDatatypeDefinition
enableSensorboolTRUE will enable all the sensors and FALSE will disable it.

Return Value: VisionRet::OK on success, other values on failure.

getSensorModuleStatus

Get the status of sensor module.

virtual bool getSensorModuleStatus(void) = 0;

Return Value: "true" on enabled, false on disabled.

enableUnsupervisedLearning

Enable or disable UnsupervisedLearning.

virtual VisionRet enableUnsupervisedLearning(bool enableUnsupervisedLearning) = 0;
MemberDatatypeDefinition
enableUnsupervisedLearningbool"true" will enable sensor of Timer, "false" will disable it.

Return Value: VisionRet::OK on success, other values on failure.

getUnsupervisedLearningStatus

Get the status of UnsupervisedLearning.

virtual bool getUnsupervisedLearningStatus(void) = 0;

Return Value: "true" on enabled, false on disabled.

setVisionEventListener

Set the Vision event listener for sending it to cloud This event will invoked 2 times if any event detecte. First invoked, as soon as event found. And second time when event analysis is done, with result.

virtual VisionRet setVisionEventListener(VisionEventHandler handler) = 0;

Return Value: "true" on successful sending.

setEndpointAndUserID

Set the endpoint ID and owner user ID for mapping.

virtual void setEndpointAndUserID(uint64_t ownerID, uint64_t endpointID) = 0;

sendFrame

Send Frame to Vision Microservice

virtual void sendFrame(unsigned char *buf, int size, time_t timestamp=0) = 0;

Typedefs Documentation

Following is the detailed documentation of the typedefs declared under the Vision class.

Ptr

/// Shared pointer to a Vision class object for camera app usage.
typedef std::shared_ptr<Vision> Ptr;

Enum Class Documentation

Following is the description of the enum classes.

VisionRet

/// \brief Vision return states.
/// Defines Vision success and failure states.
enum class VisionRet {
    OK,                  ///< Successful invocation.
    NOT_STARTED,         ///< Vision library is not started.
    INVALID_PARAMETERS,  ///< Invalid parameters.
    FAIL,                ///< Generic failure.
};

MediaType

enum class MediaType {
    AUDIO,
    VIDEO,
    SENSOR
};

SensorType

enum class SensorType { 
    DIGITAL,      
    VECTOR_DATA,          
    MIXED
};

VisionEventType

enum class VisionEventType {
    EVENT,
    RECORD,
    DEVICE_STATUS
};

Global Typedefs Documentation

Following is the detailed documentation of the Typedefs which do not belong to any structur class

VisionEventHandler

typedef std::function<void(VisionEventType eventType, std::string eventSource, std::string eventMessage, time_t eventTime, unsigned char* data, int size)> VisionEventHandler;

Handler for Endpoint peer connection. apiStatus - OK on success, other values on failure.