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