Visualization 2 - Lab Course
 All Classes Functions Enumerations Enumerator
junctiondetector.h
1 #ifndef JUNCTIONDETECTOR_H
2 #define JUNCTIONDETECTOR_H
3 
4 #include <QtGui>
5 #include <vector>
6 #include <cmath>
7 
8 extern "C" {
9  #include "emd.h"
10 }
11 
12 #define MAX_RECURSIVE_STEPS 1
13 #define MIN_EIGENVALUE_VALUE 0.1f
14 
15 using namespace std;
16 
24 {
25 public:
26 
36  static void detectJunctions(const QImage &image,
37  const QImage &cannyEdgeImage,
38  const QImage &gradientImage,
39  QImage &junctionImage,
40  QImage &outputJunctionImage);
41 
50  static void detectXJunctions(
51  QImage &image,
52  QImage &junctionImage,
53  QImage &outputXJunctionImage,
54  std::vector<std::vector<float>> &luminances);
55 
60  struct ColorSignature {
61  float N;
62  QVector3D pixel;
63  };
64 
65 
66 private:
67  static void calculateColorsignature(
68  const vector<QVector3D> &imagePixels,
69  signature_t &signature);
70 
71  static void recursiveSplit(
72  const vector<QVector3D> &imagePixels,
73  const QMatrix3x3 &R, const QVector3D &m,
74  vector<ColorSignature> &colorSignatures);
75 
76  static QMatrix3x3 multiplyVectors(
77  const QVector3D *vec,
78  const QVector3D *vecT);
79 
80  static void calcCubicEquation(
81  const QMatrix3x3 &A,
82  float root[3]);
83 
84  static void eigenvectorSolver(
85  const QMatrix3x3 &A,
86  float evalue[3],
87  QVector3D res[3]);
88 
89  static int computeRank(QMatrix3x3 M);
90 
91  static void getComplement1 (
92  const QVector3D &U,
93  const QVector3D &V,
94  QVector3D &W);
95 
96  static void getComplement2 (
97  QVector3D U,
98  QVector3D &V,
99  QVector3D &W);
100 
101  static bool colorSignatureSortFunction(
102  const ColorSignature &sig1,
103  const ColorSignature &sig2);
104 
105  static void growRegion(
106  const int &seedX, const int &seedY,
107  QImage &image,
108  const QColor &initialColor,
109  QImage &neighbours);
110 
111  static float colorDiff(
112  const QColor &color1,
113  const QColor &color2);
114 
115  static unsigned int recursiveDepth;
116  static const QVector2D normalizedVector;
117 };
118 
119 #endif