-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathfunctions.hpp
60 lines (47 loc) · 1.79 KB
/
functions.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#ifndef FUNCTIONS_HPP
#define FUNCTIONS_HPP
#include <opencv2/core/core.hpp>
#include "structs.h"
using namespace cv;
using namespace std;
/*
Return all colors which have at least one component (R,G,B) set to 255
*/
void rgb_borders(Mat &dst);
/*
HSV Histogram Stretch (Auto-Levels)
converts the image to HSV colorspace and then applies histogram equalization
to the V channel, and converts back to RGB. This is used to make copies that
are better viewable
*/
void hsv_histogram_stretch(Mat &src, Mat &dst);
/*
HSV Colorspace Histogram for the image. Count all occurrences of (H,S) and sum the V component, representing the average V in HSV colorspace for each color.
*/
void hsv_histogram(Mat &src, Mat &dst, bool whitebg = false);
/*
Lab Colorspace Histogram for the image. Count all occurrences of (a,b) and sum the L component, representing the average L in Lab colorspace for each color.
*/
void lab_histogram(Mat &src, Mat &dst, bool whitebg = false);
void lab_histogram_fast(Mat &src, Mat &dst, bool whitebg = false);
/*
Apply Error Level Analysis to the image. Resave source image at a known quality and subtract the known quality from the source image.
*/
void error_level_analysis(Mat &src, Mat &dst, int quality = 90);
/*
Colorized X and Y Sobel filters.
*/
void luminance_gradient(Mat &src, Mat &dst);
/*
Turn every pixel value to the average of the magnitude of its cross-shaped neighbors.
*/
void average_distance(Mat &src, Mat &dst);
/*
Estimate JPEG quality using Hackerfactor and Imagemagick estimates
*/
int estimate_jpeg_quality(const char *filename, vector<qtable> &qtables, vector<double> &quality_estimates);
/*
Copy-Move detection using DCT
*/
void copy_move_dct(Mat &src, Mat &dst, int retain = 4, double qcoeff = 1.0);
#endif