00001
00002
00003
00004
00005
00006
00007 #ifndef __CANNYEDGEDETECTOR_H__
00008 #define __CANNYEDGEDETECTOR_H__
00009
00010 extern "C" {
00011 #include "avcodec.h"
00012 }
00013 #include "EdgeDetector.h"
00014
00015 typedef struct VideoFrame_ VideoFrame;
00016 class NuppelVideoPlayer;
00017
00018 class CannyEdgeDetector : public EdgeDetector
00019 {
00020 public:
00021 CannyEdgeDetector(void);
00022 ~CannyEdgeDetector(void);
00023 int nuppelVideoPlayerInited(const NuppelVideoPlayer *nvp,
00024 int width, int height);
00025 virtual int setExcludeArea(int row, int col, int width, int height);
00026 virtual const AVPicture *detectEdges(const AVPicture *pgm, int pgmheight,
00027 int percentile);
00028
00029 private:
00030 int resetBuffers(int pgmwidth, int pgmheight);
00031
00032 double *mask;
00033 int mask_radius;
00034
00035 unsigned int *sgm, *sgmsorted;
00036 AVPicture s1, s2, convolved;
00037 int ewidth, eheight;
00038 AVPicture edges;
00039
00040 struct {
00041 int row, col, width, height;
00042 } exclude;
00043 };
00044
00045 #endif
00046
00047