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.
int32_t bufferSize; ///< Number of bytes in FIFO. Power of 2.
int32_t writeIndex; ///< Index of next writable byte.
int32_t readIndex; ///< Index of next readable byte.
int32_t bigMask; ///< Used for wrapping indices with extra bit to distinguish full/empty.
int32_t smallMask; ///< Used for fitting indices to buffer.
int32_t start_frame;
std::string imagerSource; ///< Used for setting the imager number.
timespec starttime; ///< Used to indicate the time of the start frame.
int width;
int height;
unsigned char *buffer;
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.
float x;
float y;
float z;
int id;
Public Member Data Documentation
Following is the detailed documentation of the public variables declared under the SensorVectorData class.
bool absvalue;
int capture_interval; // in milliseconds
std::string UUID;
Public Member Function Documentation
Following is the detailed documentation of the public methods declared under the SensorVectorData class.
void set_x(float x);
void set_y(float y);
void set_z(float z);
void set_id(int id);
float get_x();
float get_y();
float get_z();
int get_id();
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.
unsigned char data;
std::string name;
int id;
int capture_interval; // in milliseconds
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.
int id; // id of the sensor
SensorType stype; // type of the sensor
// digitalData and vectorData together forms a union
DigitalData *digitalData;
// digitalData and vectorData together forms a union
SensorVectorData *vectorData;
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.
com::anyconnect::access::Access::Ptr access;
Public Member Function Documentation
Following is the detailed documentation of the public methods declared under the Vision class.
virtual ~Vision() {};
class builder; Set Access object.
virtual void setAccess(com::anyconnect::access::Access::Ptr access) = 0;
Member | Datatype | Definition |
---|---|---|
access | com::anyconnect::access::Access::Ptr | Access object. |
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.
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.
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;
Member | Datatype | Definition |
---|---|---|
audioBuffer | RingBuffer & | the reference pointer of the shared audio buffer |
Return Value: VisionRet::OK on successful, other values on failure.
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;
Member | Datatype | Definition |
---|---|---|
videoBuffer | RingBuffer & | the reference pointer of the shared video buffer |
Return Value: VisionRet::OK on successful, other values on failure.
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;
Member | Datatype | Definition |
---|---|---|
id | int | the id of the sensor |
sensorData | SensorData | values of the analog and digital data of the sensor. |
Return Value: VisionRet::OK on success, other values on failure.
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;
Member | Datatype | Definition |
---|---|---|
filePath | std::string | the path of the deep learning model file and label file directory |
Return Value: VisionRet::OK on success, other values on failure.
Set the threshold for the vision event (sensor, audio, video)
virtual VisionRet setThreshold(int id, MediaType media, double threshold) = 0;
Member | Datatype | Definition |
---|---|---|
id | int | the id of the model |
media | MediaType | Audio, video or sensor. |
threshold | double | values of the threshold in range of (0-100). |
Return Value: VisionRet::OK on success, other values on failure.
Enable or disable VideoAnalytic.
virtual VisionRet enableVideoAnalytic(bool enableVideoAnalytic) = 0;
Member | Datatype | Definition |
---|---|---|
enableVideoAnalytic | bool | TRUE will enable VideoAnalytic. FALSE will disable it. |
Return Value: VisionRet::OK on success, other values on failure.
Get the status of VideoAnalytic.
virtual bool getVideoAnalyticStatus(void) = 0;
Return Value: "true" on enabled, false on disabled.
Enable or disable AudioAnalytic.
virtual VisionRet enableAudioAnalytic(bool enableAudioAnalytic) = 0;
Member | Datatype | Definition |
---|---|---|
enableAudioAnalytic | bool | "true" will enable Audio Analysis, "false" will disable it. |
Return Value: VisionRet::OK on success, other values on failure.
Get the status of VideoAnalytic.
virtual bool getAudioAnalyticStatus(void) = 0;
Return Value: "true" on enabled, false on disabled.
Enable or disable sensor module.
virtual VisionRet enableSensorModule(bool enableSensor) = 0;
Member | Datatype | Definition |
---|---|---|
enableSensor | bool | TRUE will enable all the sensors and FALSE will disable it. |
Return Value: VisionRet::OK on success, other values on failure.
Get the status of sensor module.
virtual bool getSensorModuleStatus(void) = 0;
Return Value: "true" on enabled, false on disabled.
Enable or disable UnsupervisedLearning.
virtual VisionRet enableUnsupervisedLearning(bool enableUnsupervisedLearning) = 0;
Member | Datatype | Definition |
---|---|---|
enableUnsupervisedLearning | bool | "true" will enable sensor of Timer, "false" will disable it. |
Return Value: VisionRet::OK on success, other values on failure.
Get the status of UnsupervisedLearning.
virtual bool getUnsupervisedLearningStatus(void) = 0;
Return Value: "true" on enabled, false on disabled.
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.
Set the endpoint ID and owner user ID for mapping.
virtual void setEndpointAndUserID(uint64_t ownerID, uint64_t endpointID) = 0;
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.
/// 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.
/// \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.
};
enum class MediaType {
AUDIO,
VIDEO,
SENSOR
};
enum class SensorType {
DIGITAL,
VECTOR_DATA,
MIXED
};
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
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.
Updated over 2 years ago