#include #include using namespace cv; using namespace std; int applyMask(unsigned short* input, unsigned char* pmask, int Width, int Height, unsigned short* output); int getMaskRect(unsigned char* pmask, int Width, int Height, int& x, int& y, int& RectWidth, int& RectHeight); int cropImg(unsigned short* input, unsigned short* output, int Width, int Height, int x, int y, int RectWidth, int RectHeight); int applyInvertMask(unsigned short* input, unsigned char* pmask, int Width, int Height, unsigned short* output, int srcfillvalue = 65535); int getForegroundMask(unsigned short* input, unsigned char* pmask, int Width, int Height, unsigned char* output);