#pragma once #include "TrackEngineTypes.h" #include namespace tsdk { /** * @brief BestShot observer interface */ struct TRACK_ENGINE_API IBatchBestShotObserver { /** * @brief Ready portrait notification for streams * @param streamIDs ids of the streams. * @param data callback data. see 'BestShotCallbackData' for details * Do not delete it under no circumstances. * @note pure virtual method */ virtual void bestShot(const fsdk::Span &streamIDs, const fsdk::Span &data) = 0; /** * @brief End of the tracks notification for streams * @param streamIDs ids of the streams. * @param data callback data. see 'TrackEndCallbackData' for details * @note pure virtual method * @note See 'TrackEndCallbackData' struct comments for more information about logic of this callback */ virtual void trackEnd(const fsdk::Span &streamIDs, const fsdk::Span &data) = 0; /** * @brief status of the track update notification for streams. * @param streamIDs ids of the streams. * @param data callback data. see 'TrackStatusUpdateCallbackData' for details * @note pure virtual method */ virtual void trackStatusUpdate(const fsdk::Span &streamIDs, const fsdk::Span &data) = 0; /** * @brief ReIdentification of the old non-active tracks notification for streams. * The callback serves to connect two matched tracks: first one is from the current tracks and second one is from the old non-active tracks. * See human tracking algorithm section in docs for details. * @param streamIDs ids of the streams. * @param data callback data. see 'TrackReIdentificateCallbackData' for details * @note the callback's called only for human tracking in the current version of the Track Engine * @note after 'trackReIdentificate' 'trackEnd' may be called for the current track id to indicate, that this id doesn't exist anymore */ virtual void trackReIdentificate(const fsdk::Span &streamIDs, const fsdk::Span &data) = 0; virtual ~IBatchBestShotObserver() = default; }; /** @brief Ready track observer interface */ struct TRACK_ENGINE_API IBatchVisualObserver { /** * @brief Ready track notification * @param streamIDs ids of the streams. * @param data callback data. see 'VisualCallbackData' for details * Do not remove it under no circumstances. * @note pure virtual method */ virtual void visual(const fsdk::Span &streamIDs, const fsdk::Span &data) = 0; virtual ~IBatchVisualObserver() = default; }; /** @brief Debug information observer interface */ struct TRACK_ENGINE_API IBatchDebugObserver { /** * @brief Debug callback for the foreground subtractor * @param streamIDs ids of the streams. * @param data callback data. see 'DebugForegroundSubtractionCallbackData' for details */ virtual void debugForegroundSubtraction(const fsdk::Span &streamIDs, const fsdk::Span &data) = 0; /** * @brief Debug callback for the detection * @param streamIDs ids of the streams. * @param data callback data. see 'DebugDetectionCallbackData' for details */ virtual void debugDetection(const fsdk::Span &streamIDs, const fsdk::Span &data) = 0; virtual ~IBatchDebugObserver() = default; }; /** * @brief BestShot observer interface */ struct IBestShotObserver { /** * @brief Ready portrait notification * @param ReadyFace portrait, @see ReadyFace * @param data any additional frame data from source. Absolutely the same data you pass into pushFrame(). * Do not remove it under no circumstances. * @note pure virtual method */ TRACK_ENGINE_API virtual void bestShot(const tsdk::DetectionDescr& descr, const tsdk::AdditionalFrameData* data) = 0; /** * @brief End of the track notification. * @param trackId id of the track which was finished. * @note pure virtual method */ TRACK_ENGINE_API virtual void trackEnd(const tsdk::TrackId& trackId) = 0; /** * @brief status of the track update notification. * @param trackId id of the track with status updated. * @param status track status. */ TRACK_ENGINE_API virtual void trackStatusUpdate(tsdk::FrameId frameId, tsdk::TrackId trackId, tsdk::TrackStatus status) { }; /** * @brief ReIdentification of the old non-active tracks notification for streams. * The callback serves to connect two matched tracks: first one is from the current tracks and second one is from the old non-active tracks. * See human tracking algorithm section in docs for details. * @param frameId id of frame * @param trackId id of track, that was matched to one of the old non-active tracks * @param reidTrackId id of the non-active track, that successfully mathed to track with id = 'trackId' * @note the callback's called only for human tracking in the current version of the Track Engine * @note after 'trackReIdentificate' 'trackEnd' may be called for the current track id to indicate, that this id doesn't exist anymore */ TRACK_ENGINE_API virtual void trackReIdentificate(tsdk::FrameId frameId, tsdk::TrackId trackId, tsdk::TrackId reidTrackId) { } TRACK_ENGINE_API virtual ~IBestShotObserver() = default; }; /** * @brief Ready track observer interface */ struct IVisualObserver { /** * @brief Ready track notification * @param frameId id of the frame * @param fsdk::image this is either original image (if 'pushFrame' used) or RGB image got from custom frame convert (is 'pushCustomFrame' used) * @param tsdk::TrackInfo* pointer to array of track information * @param int nTrack size of array of track * @param data any additional frame data from source. Absolutely the same data you pass into pushFrame(). * Do not remove it under no circumstances. * @note pure virtual method */ TRACK_ENGINE_API virtual void visual( const tsdk::FrameId &frameId, const fsdk::Image &image, const tsdk::TrackInfo * trackInfo, const int nTrack, const tsdk::AdditionalFrameData* data) = 0; TRACK_ENGINE_API virtual ~IVisualObserver() = default; }; /** * @brief Debug information observer interface */ struct IDebugObserver { /** * @brief Debug callback for the foreground subtractor * @param frameId id of the frame * @param firstMask first mask of the frg subtractor * @param secondMask second mask of the frg subtractor * @param regions detected regions * @param nRegions count of the regions */ TRACK_ENGINE_API virtual void debugForegroundSubtraction( const tsdk::FrameId& frameId, const fsdk::Image& firstMask, const fsdk::Image& secondMask, fsdk::Rect * regions, int nRegions ) { }; /** * @brief Debug callback for the detection * @param descr debug information about detection. */ TRACK_ENGINE_API virtual void debugDetection( const tsdk::DetectionDebugInfo& descr) { }; TRACK_ENGINE_API virtual ~IDebugObserver() = default; }; /** @brief Best shot predicate * @note Logic for checking if current shot could be the best shot candidate */ struct TRACK_ENGINE_API IBestShotPredicate { /** * @brief Check if current shot is the best shot candidate * @param descr detection descriptor, @see tsdk::DetectionDescr * @param data any additional frame data from source. Absolutely the same data you pass into pushFrame(). * Do not remove it under no circumstances. * @return true if current shot could be the best shot candidate, false otherwise * @note pure virtual method */ virtual bool checkBestShot(const tsdk::DetectionDescr& descr, const tsdk::AdditionalFrameData *data) = 0; virtual ~IBestShotPredicate() = default; }; /** @brief Visual predicate * @note Logic for checking if original or converted RGB image is needed in visual callback data (useful, when client uses 'pushCustomFrame') */ struct TRACK_ENGINE_API IVisualPredicate { virtual bool needRGBImage(const tsdk::FrameId frameId, const tsdk::AdditionalFrameData*) = 0; virtual ~IVisualPredicate() = default; }; }