MythTV master
CannyEdgeDetector.h
Go to the documentation of this file.
1/*
2 * CannyEdgeDetector
3 *
4 * Implement the Canny edge detection algorithm.
5 */
6
7#ifndef CANNYEDGEDETECTOR_H
8#define CANNYEDGEDETECTOR_H
9
10extern "C" {
11#include "libavcodec/avcodec.h" /* AVFrame */
12}
13#include "EdgeDetector.h"
14
15class MythPlayer;
16
18{
19public:
21 ~CannyEdgeDetector(void) override;
22 CannyEdgeDetector(const CannyEdgeDetector &) = delete; // not copyable
23 CannyEdgeDetector &operator=(const CannyEdgeDetector &) = delete; // not copyable
24 int MythPlayerInited(const MythPlayer *player, int width, int height);
25 int setExcludeArea(int row, int col, int width, int height) override; // EdgeDetector
26 const AVFrame *detectEdges(const AVFrame *pgm, int pgmheight,
27 int percentile) override; // EdgeDetector
28
29private:
30 int resetBuffers(int newwidth, int newheight);
31
32 double *m_mask {nullptr}; /* pre-computed Gaussian mask */
33 int m_maskRadius {2}; /* radius of mask */
34
35 unsigned int *m_sgm {nullptr}; /* squared-gradient magnitude */
36 unsigned int *m_sgmSorted {nullptr}; /* squared-gradient magnitude */
37 AVFrame m_s1 {}; /* smoothed grayscale frame */
38 AVFrame m_s2 {}; /* smoothed grayscale frame */
39 AVFrame m_convolved {}; /* smoothed grayscale frame */
40 int m_ewidth {-1}; /* dimensions */
41 int m_eheight {-1}; /* dimensions */
42 AVFrame m_edges {}; /* detected edges */
43
44 struct {
47};
48
49#endif /* !CANNYEDGEDETECTOR_H */
50
51/* vim: set expandtab tabstop=4 shiftwidth=4: */
AVFrame AVFrame
unsigned int * m_sgm
int setExcludeArea(int row, int col, int width, int height) override
int MythPlayerInited(const MythPlayer *player, int width, int height)
const AVFrame * detectEdges(const AVFrame *pgm, int pgmheight, int percentile) override
CannyEdgeDetector(const CannyEdgeDetector &)=delete
unsigned int * m_sgmSorted
int resetBuffers(int newwidth, int newheight)
struct CannyEdgeDetector::@72 m_exclude
~CannyEdgeDetector(void) override
CannyEdgeDetector & operator=(const CannyEdgeDetector &)=delete