DFX Extraction library v4.14.5
enabling applications to perform DFX blood flow analysis
Frame.h
1 /*
2  * Copyright (c) 2016-2019, Nuralogix Corp.
3  * All Rights reserved
4  *
5  * THIS SOFTWARE IS LICENSED BY AND IS THE CONFIDENTIAL AND
6  * PROPRIETARY PROPERTY OF NURALOGIX CORP. IT IS
7  * PROTECTED UNDER THE COPYRIGHT LAWS OF THE USA, CANADA
8  * AND OTHER FOREIGN COUNTRIES. THIS SOFTWARE OR ANY
9  * PART THEREOF, SHALL NOT, WITHOUT THE PRIOR WRITTEN CONSENT
10  * OF NURALOGIX CORP, BE USED, COPIED, DISCLOSED,
11  * DECOMPILED, DISASSEMBLED, MODIFIED OR OTHERWISE TRANSFERRED
12  * EXCEPT IN ACCORDANCE WITH THE TERMS AND CONDITIONS OF A
13  * NURALOGIX CORP SOFTWARE LICENSE AGREEMENT.
14  */
15 #pragma once
16 #ifndef LIBDFX_FRAME_H
17 #define LIBDFX_FRAME_H
18 
19 #include "dfx/Face.h"
20 #include "dfx/VideoFrame.h"
21 
22 #include <memory>
23 #include <string>
24 
25 namespace dfx {
37 class Frame {
38  public:
42  virtual ~Frame() {
43  // Empty but necessary for vtable
44  }
45 
52  virtual VideoFrame getVideoFrame() const = 0;
53 
63  virtual bool addFace(std::shared_ptr<dfx::Face> face) = 0;
64 
80  virtual std::vector<float> getQualityMetrics(float iso, float exposure) = 0;
81 
87  virtual std::vector<float> getOpticalQualityMetrics() = 0;
88 
100  virtual int getStarRating(std::string& feedback) = 0;
101 
110  virtual int getOpticalQualityRating(std::string& feedback) = 0;
111 
122  virtual bool addMarker(const std::string &label) = 0;
123 
129  virtual std::vector<std::string> getMarkers() const = 0;
130 
145  virtual std::vector<std::string> getDesiredFaceAttributes() const = 0;
146 
162  virtual std::vector<std::string> getDesiredDeviceAttributes() const = 0;
163 
170  virtual double getDeviceAttribute(const std::string& key) const = 0;
171 
183  virtual void setDeviceAttribute(const std::string& key, double value) = 0;
184 
193  virtual std::vector<std::string> getFaceIdentifiers() const = 0;
194 
204  virtual std::vector<std::string> getRegionNames(const std::string &faceID) const = 0;
205 
214  virtual std::vector<cv::Point> getRegionPolygon(const std::string &faceID, const std::string &regionName) const = 0;
215 
225  virtual int32_t getRegionIntProperty(const std::string& faceID, const std::string& regionName, const std::string& property) const = 0;
226 
235  virtual cv::Mat getRegionHistogram(const std::string &faceID, const std::string &regionName) const = 0;
236 };
237 } // namespace dfx
238 
239 #endif // LIBDFX_FRAME_H
dfx::Frame::getFaceIdentifiers
virtual std::vector< std::string > getFaceIdentifiers() const =0
obtain the known face identifiers within this frame.
dfx::Frame::getRegionHistogram
virtual cv::Mat getRegionHistogram(const std::string &faceID, const std::string &regionName) const =0
obtain the histogram for a region of interest.
dfx::Frame::getStarRating
virtual int getStarRating(std::string &feedback)=0
Provide the 5-star rating value for the current frame, available after a call to getQualityMetrics.
dfx::Frame::getOpticalQualityRating
virtual int getOpticalQualityRating(std::string &feedback)=0
Provide the 5-star rating value for the current frame, available after a call to getOpticalQualityMet...
dfx::Frame::addFace
virtual bool addFace(std::shared_ptr< dfx::Face > face)=0
Add a face and associated data to the frame.
dfx::Frame::getRegionIntProperty
virtual int32_t getRegionIntProperty(const std::string &faceID, const std::string &regionName, const std::string &property) const =0
Regions can have numeric properties attached to them.
dfx::Frame
Frame is a wrapper which links a VideoFrame with one or more Face objects and additional state needed...
Definition: Frame.h:37
dfx::Frame::getVideoFrame
virtual VideoFrame getVideoFrame() const =0
Convenience method to retrieve the VideoFrame associated with this Frame instance.
dfx::Frame::setDeviceAttribute
virtual void setDeviceAttribute(const std::string &key, double value)=0
add a device attribute
dfx::Frame::getMarkers
virtual std::vector< std::string > getMarkers() const =0
Returns the marker/labels in a video frame.
dfx::Frame::getOpticalQualityMetrics
virtual std::vector< float > getOpticalQualityMetrics()=0
Calculates the optical quality metrics for the current frame.
dfx::VideoFrame
Represents the internal structure for how image frames are passed to the DFX Engine since there is li...
Definition: VideoFrame.h:35
dfx::Frame::~Frame
virtual ~Frame()
Frame destructor.
Definition: Frame.h:42
dfx::Frame::getRegionPolygon
virtual std::vector< cv::Point > getRegionPolygon(const std::string &faceID, const std::string &regionName) const =0
obtain the polygon for the region of interest.
dfx::Frame::getRegionNames
virtual std::vector< std::string > getRegionNames(const std::string &faceID) const =0
obtains the names of regions which are defined for the face within this frame.
dfx::Frame::addMarker
virtual bool addMarker(const std::string &label)=0
Adds a marker/label to a video frame.
dfx::Frame::getDeviceAttribute
virtual double getDeviceAttribute(const std::string &key) const =0
Returns the value of a device attribute if it exists or zero.
dfx
Definition: ChunkData.h:21
dfx::Frame::getDesiredDeviceAttributes
virtual std::vector< std::string > getDesiredDeviceAttributes() const =0
Returns a list of desired device attributes for this frame.
dfx::Frame::getQualityMetrics
virtual std::vector< float > getQualityMetrics(float iso, float exposure)=0
Calculates the quality metrics for the current frame.
dfx::Frame::getDesiredFaceAttributes
virtual std::vector< std::string > getDesiredFaceAttributes() const =0
Returns a list of desired face attributes for this frame.