You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
84 lines
2.0 KiB
84 lines
2.0 KiB
/***************************************************************************************
|
|
*
|
|
* detect.h is part of SimpleSkyCam.
|
|
*
|
|
*****************************************************************************************/
|
|
|
|
|
|
#ifndef _DETECT_H_
|
|
#define _DETECT_H_
|
|
|
|
#include "gui.h"
|
|
#include "config.h"
|
|
#include "video.h"
|
|
#include "videoframe.h"
|
|
|
|
|
|
struct {
|
|
VideoFrame *image; // detected image
|
|
int posx; // position of the detected object
|
|
int posy; // position of the detected object
|
|
} typedef DetectOutput;
|
|
|
|
|
|
|
|
class Detect {
|
|
private:
|
|
int running;
|
|
VideoFrame inFrame; // input frame
|
|
VideoFrame oldFrame; // oldinput frame
|
|
int inFrameNew; // new input frame;
|
|
VideoFrame image; // output image
|
|
VideoFrame imagegtk; // output image -- send to gtk
|
|
GMutex muteximage;
|
|
GMutex mutexin;
|
|
GMutex mutex; // general mutex for changing settings
|
|
GThread *thread;
|
|
|
|
float *maxx;
|
|
float *maxy;
|
|
int posmaxx;
|
|
int posmaxy;
|
|
float *detmatrix;
|
|
|
|
int objectW; // object Image Size Width
|
|
int objectH; // object Image Size Height
|
|
int minBright; // min brightness
|
|
|
|
int inputtype; // input detection type to use
|
|
|
|
void InputDetect (int *posx, int *posy);
|
|
void InputDetectCrossC (int *posx, int *posy);
|
|
void SetInputSize (int nw, int nh);
|
|
|
|
public:
|
|
Detect();
|
|
~Detect();
|
|
|
|
int NewFrame(VideoFrame *newframe);
|
|
|
|
//
|
|
// Thread Releated Functions (maybe soon private?)
|
|
int TryLockInMutex() { return g_mutex_trylock(&mutexin); };
|
|
void LockInMutex() { g_mutex_lock(&mutexin);};
|
|
void UnLockInMutex() { g_mutex_unlock(&mutexin);};
|
|
|
|
int TryLockImageMutex() { return g_mutex_trylock(&muteximage); };
|
|
void LockImageMutex() { g_mutex_lock(&muteximage);};
|
|
void UnLockImageMutex() { g_mutex_unlock(&muteximage);};
|
|
|
|
void LockMutex() { g_mutex_lock(&mutex);};
|
|
void UnLockMutex() { g_mutex_unlock(&mutex);};
|
|
|
|
//
|
|
// Object functions
|
|
void SetObjectSize (int neww, int newh);
|
|
void SetMinBrightness (int value);
|
|
void SetInputType(int intype);
|
|
void GetObjectPos (int *x, int *y);
|
|
|
|
void Thread();
|
|
};
|
|
|
|
#endif
|