VAT  3.0
Video Analysis Tool
ImageTransforms.h
1 #ifndef _IMAGETRANSFORMS_H_
2 #define _IMAGETRANSFORMS_H_
3 
4 #include <QImage>
5 #include "opencv2/opencv.hpp"
6 #include "geometric.h"
7 
9  public:
10  static void ImageROI(QImage &input, QImage &output, int dx, int dy, int width, int height);
11  static void binarize(QImage&, uchar T=128);
12  //Converts a 24 or 32 bits color image, returning a 8 bits image, with grayscale color table.
13  static QImage toGrayscale(QImage& im);
14  //Converts color image in a grayscale image stored in out, respecting its format.
15  static void toGrayscale(QImage& in, QImage& out);
16  static QImage fromIndexedToARGB32(QImage& im);
17 
18  //Copies pixels to previously created images, between Indexed and RGB888 formats,
19  //ignoring color palette.
20  static void fromIndexedToRGB888(QImage& im_in, QImage& im_out);
21  static void show(QImage& im, QString label);
22  //Copies pixels. Checks if there is enough room, and if there is a
23  //difference in terms
24  static bool copyPixelsMatToQImage(cv::Mat &im_in, QImage &im_out);
25  static bool copyPixelsQImageToMat(QImage &im_in, cv::Mat &im_out);
26  static bool copyPixelsQImage32ToMat24(QImage &im_in, cv::Mat &im_out);
27 
28  //Eliminates extra pixels per row, and returns a clean array.
29  static uchar *suppressExtraPixelSpace(QImage *image);
30  static uchar *suppressExtraPixelSpace(cv::Mat &image);
31 
32  //Obtains image roi from 1-channel image
33  static void genROIFromMat(cv::Mat &image_roi, cv::Mat &image, BoundingBox &roi);
34 
35 
36 };
37 
38 #endif // _IMAGETRANSFORMS_H_
Definition: ImageTransforms.h:8