VAT  3.0
Video Analysis Tool
SegmentationTool.h
1 #ifndef SEGMENTATIONTOOL_H
2 #define SEGMENTATIONTOOL_H
3 
4 #include "opencvCompatibilityVersion.h"
5 #ifdef __OPENCV3__
6  #include <opencv/cv.hpp>
7 #else
8  #include <opencv/cv.h>
9 #endif
10 
11 #include <map>
12 #include <string>
13 #include <QImage>
14 #include <QDir>
15 #include <opencv/highgui.h>
16 #include <QColor>
17 
22 public:
23 
24  enum BG_FG_ErodeDilate
25  {
26  erode,
27  dilate,
28  none
29  };
30 
31  QImage MatToQImage(const cv::Mat& mat);
32 
33  static void chromaticSegmentationMat(cv::Mat &currentImage,cv::Mat &result, int minGrade,int maxGrade, int minSaturation, int maxLight);
34 
35 
36 
37  static void chromaticSegmentation(QImage * currentImage,QImage *result, QImage *result_c, QImage *maskImage,bool m_mask,int minGrade,int maxGrade, int minSaturation, int maxLight);
38  void chromaticSegmentation(QImage * currentImage, QImage *result, QImage *result_c, QImage *maskImage, bool m_mask, std::vector<std::vector<int> > rangesFG, std::vector<std::vector<int> > rangesBG, int BGED, int BGSS, int FGED, int FGSS);
39 
40  /* Pasa de qImage a Mat, devuelve imagen de 3 canales de 8 bits. */
41  /* Utiliza memoria compartida */
42  static cv::Mat qImage2Mat(const QImage& qimage);
43 
44  /*Pasa de Mat a QImage*/
45  static QImage Mat2QImage(cv::Mat &mat);
46 
47 
48  /*
49  * Code for thinning a binary image using Zhang-Suen algorithm.
50  */
51  /*Perform one thinning iteration*/
52  void thinningIteration(cv::Mat& im, int iter);
53 
54  /*Function for thinning the given binary image*/
55  void thinning(cv::Mat& im);
56 
57  /*Compute and show histogram of gray scale image*/
58  int grayHistogram(cv::Mat &image);
59 
60 };
61 
62 
63 #endif // SEGMENTATIONTOOL_H
void thinningIteration(cv::Mat &im, int iter)
Definition: SegmentationTool.cpp:543
The SegmentationTool class is used to generate Chromatic Segmentation.
Definition: SegmentationTool.h:21
QImage MatToQImage(const cv::Mat &mat)
SegmentationTool::MatToQImageAdded for image manipulation.
Definition: SegmentationTool.cpp:36
static cv::Mat qImage2Mat(const QImage &qimage)
SegmentationTool::qImage2Mat Added for image manipulation.
Definition: SegmentationTool.cpp:9