![]() |
DeepSight SDK
3.0.0
DeepSight SDK - crowd face analysis
|
DeepSight SDK engine class. More...
Public Member Functions | |
| DeepSight (const ds::Settings &settings) | |
| ds::DeepSight constructor. More... | |
| ~DeepSight () noexcept | |
| ds::DeepSight destructor. | |
| DeepSight (DeepSight &&ds) noexcept | |
| ds::DeepSight move constructor. More... | |
| DeepSight & | operator= (DeepSight &&ds) noexcept |
| ds::DeepSight move assignment operator. More... | |
| void | authenticate () |
| Authenticates the SDK. More... | |
| void | setSettings (const ds::Settings &settings) |
| Set new settings to be used at runtime. More... | |
| ds::Settings | getSettings () const |
| Returns a copy of the settings object in use. More... | |
| std::vector< ds::Person > | analyze (const cv::Mat &image) |
| Analyzes an image, tracks and returns the detected faces. More... | |
| std::vector< ds::Person > | analyzeSingleImage (const cv::Mat &image) |
| Analyzes an image and returns the detected faces without tracking. More... | |
| std::vector< ds::Body > | analyzeBodies (const cv::Mat &image) |
| Analyzes an image, tracks and returns the detected bodies. More... | |
| std::vector< cv::Rect > | getTrackedBoxes () |
| Returns the bounding boxes tracked by the internal DeepSight tracker. More... | |
| int | getLicenseTimeLeft () const |
| int | getCountOfFaces () const |
| Returns the number of counted faces. More... | |
| int | getCountOfBodies () const |
| Returns the number of tracked bodies. More... | |
| void | resetTracker (bool resetCount) |
| Resets the state of the internal face tracker. More... | |
| void | resetBodyTracker (bool resetCount) |
| Resets the state of the internal body tracker. More... | |
DeepSight SDK engine class.
The ds::DeepSight class is the engine of the SDK. By instantiating a ds::DeepSight object the SDK engine is set up and is ready for processing images. The ds::DeepSight class is controlled by the ds::Settings class which holds the external configuration parameters. The main purpose of the ds::DeepSight class is to accept an image and to return a list of ds::Person objects detected in it.
| ds::DeepSight::DeepSight | ( | const ds::Settings & | settings | ) |
ds::DeepSight constructor.
| settings | A ds::Settings instance containing the configuration to be used by the DeepSight SDK engine. |
Main ds::DeepSight constructor. May throw std::runtime_error exceptions if the neuralNetworksPath specified in the settings does not contain the required networks.
Example usage:
|
noexcept |
ds::DeepSight move constructor.
A ds::DeepSight object cannot be copied, but it can be moved. The move constructor allows for this.
Example usage:
| std::vector< ds::Person > ds::DeepSight::analyze | ( | const cv::Mat & | image | ) |
Analyzes an image, tracks and returns the detected faces.
| image | A cv::Mat 3-dimensional array representing a BGR image. Must be non empty. |
This function performs the main SDK task of detecting faces in the input image and performing face analysis on each of them. If the SDK is not already authenticated, the ds::DeepSight::analyze function throws an std::runtime_error exception. Faces detected during the ds::DeepSight::analyze call are tracked in consecutive calls and interpolated such that the ID of each ds::Person is matched among the frames. This allows for assigning the same ID to the same face and smoothing age and gender for more stable estimations.
Example usage:
| std::vector< ds::Body > ds::DeepSight::analyzeBodies | ( | const cv::Mat & | image | ) |
Analyzes an image, tracks and returns the detected bodies.
| image | A cv::Mat 3-dimensional array representing a BGR image. Must be non-empty. |
This function performs body detection, tracking and counting. The bodies detected in the current frame are returned. If the SDK is not already authenticated, the ds::DeepSight::analyzeBodies function throws an std::runtime_error exception. Bodies detected during the ds::DeepSight::analyzeBodies call are tracked in consecutive calls and interpolated such that the ID of each ds::Body is matched among the frames. This allows for assigning the same ID to the same body and keeping track of detection duration.
Example usage:
| std::vector< ds::Person > ds::DeepSight::analyzeSingleImage | ( | const cv::Mat & | image | ) |
Analyzes an image and returns the detected faces without tracking.
| image | A cv::Mat 3-dimensional array representing a BGR image. Must be non empty. |
This function is similar to ds::DeepSight::analyze with the exception that the faces detected in the input image are not tracked and therefore not interpolated with previously analyzed frames.
Example usage:
| void ds::DeepSight::authenticate | ( | ) |
Authenticates the SDK.
Authenticate the DeepSight SDK against Raydiant's licensing servers to allow for its usage. Throws an std::runtime_error if the authentication fails. Before authenticating make sure the ds::Settings::licenseKey (and ds::Settings::lifetimeAuthFile in case of a lifetime release authentication) is properly set.
Example usage:
| int ds::DeepSight::getCountOfBodies | ( | ) | const |
Returns the number of tracked bodies.
If ds::DeepSight::analyzeBodies is used, the SDK internally keeps track of detected bodies and returns the count through this function.
| int ds::DeepSight::getCountOfFaces | ( | ) | const |
Returns the number of counted faces.
Returns the number of faces counted by the tracker. Each ds::Person returned by ds::DeepSight::analyze with the same ID is counted once.
| int ds::DeepSight::getLicenseTimeLeft | ( | ) | const |
| ds::Settings & ds::DeepSight::getSettings | ( | ) | const |
Returns a copy of the settings object in use.
Example usage:
| std::vector< cv::Rect > ds::DeepSight::getTrackedBoxes | ( | ) |
Returns the bounding boxes tracked by the internal DeepSight tracker.
When using the ds::DeepSight::analyze() function, each face detected in the frame is passed to an internal tracker. The tracker then interpolates the current face position with the one in the previous frames. Due to occlusion, sometimes a face cannot be found during the detection stage, however the tracker might still be able to find its location given the information collected in the previous frames. This function returns the position of the faces internally tracked, which in some cases differs from the ones detected during the ds::DeepSight::analyze(). This function is particularly usefull when blurring faces, since the detector might fail finding a face when occlusion occurs while the tracker is able to keep track of the face position.
|
noexcept |
ds::DeepSight move assignment operator.
A ds::DeepSight object cannot be copied, but it can be moved. The move assignment operator allows for this.
Example usage:
| void ds::DeepSight::resetBodyTracker | ( | bool | resetCount | ) |
Resets the state of the internal body tracker.
| resetCount | If true, resets the tracker's body-counter to 0. |
Resets the state of the internal tracker and (optionally) the number of tracked bodies.
| void ds::DeepSight::resetTracker | ( | bool | resetCount | ) |
Resets the state of the internal face tracker.
| resetCount | If true, resets the tracker's person-counter to 0. |
Resets the state of the internal tracker and (optionally) the number of tracked faces.
| void ds::DeepSight::setSettings | ( | const ds::Settings & | settings | ) |
Set new settings to be used at runtime.
| settings | A ds::Settings instance containing the new configuration to be used by the DeepSight SDK engine. |
Example usage: