-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
345 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#ifndef PALETTES_H | ||
#define PALETTES_H | ||
|
||
#include <stdint.h> | ||
|
||
extern const uint8_t colormap_rainbow[]; | ||
extern const uint8_t colormap_grayscale[]; | ||
extern const uint8_t colormap_ironblack[]; | ||
extern const uint8_t colormap_blackHot[]; | ||
extern const uint8_t colormap_arctic[]; | ||
extern const uint8_t colormap_blueRed[]; | ||
extern const uint8_t colormap_coldest[]; | ||
extern const uint8_t colormap_contrast[]; | ||
extern const uint8_t colormap_doubleRainbow[]; | ||
extern const uint8_t colormap_grayRed[]; | ||
extern const uint8_t colormap_glowBow[]; | ||
extern const uint8_t colormap_hottest[]; | ||
extern const uint8_t colormap_lava[]; | ||
extern const uint8_t colormap_medical[]; | ||
extern const uint8_t colormap_wheel2[]; | ||
extern const uint8_t colormap_whiteHot[]; | ||
|
||
#define PALETTES_COUNT 16 | ||
extern const uint8_t* palettes[PALETTES_COUNT]; | ||
|
||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#ifndef FLIR_TRACKER_H | ||
#define FLIR_TRACKER_H | ||
|
||
#include <opencv2/core/core.hpp> | ||
#include "Palettes.h" | ||
|
||
class FlirTracker | ||
{ | ||
public: | ||
typedef enum _track_res | ||
{ | ||
TRK_RES_ERROR = 0, | ||
TRK_RES_NONE = 1, | ||
TRK_RES_FOUND = 2 | ||
} TrackRes; | ||
|
||
typedef enum _track_mode | ||
{ | ||
TRK_AVOID=0, | ||
TRK_FOLLOW=1 | ||
} TrackMode; | ||
|
||
FlirTracker(TrackMode trkMode, uint16_t minThresh, uint16_t maxThresh); | ||
~FlirTracker(); | ||
|
||
void setNewThresh(uint16_t minThresh, uint16_t maxThresh); | ||
|
||
TrackRes setNewFrame( cv::Mat frame16, uint16_t min, uint16_t max ); | ||
cv::Mat getResFrameRGB(); | ||
|
||
static cv::Mat normalizeFrame( const cv::Mat& frame16, uint16_t min, uint16_t max ); | ||
|
||
void nextPalette(); | ||
|
||
protected: | ||
TrackRes doTrackStep(); | ||
|
||
private: | ||
TrackMode mTrkMode; | ||
|
||
uint16_t mMinThresh; | ||
uint16_t mMaxThresh; | ||
|
||
uint16_t mFrameMin; | ||
uint16_t mFrameMax; | ||
|
||
cv::Mat mFrame16; | ||
cv::Mat mRes16; | ||
cv::Mat mResRGB; | ||
cv::Mat mResMask; | ||
|
||
uint8_t mPaletteIdx; | ||
}; | ||
|
||
#endif |
Oops, something went wrong.