-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhistogram.h
More file actions
44 lines (34 loc) · 1018 Bytes
/
histogram.h
File metadata and controls
44 lines (34 loc) · 1018 Bytes
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
#ifndef HISTOGRAM_H
#define HISTOGRAM_H
#include <QImage>
#include <string>
#include <iostream>
enum ThresMethod{
ISODATA,
OTSU
};
class histogram
{
public:
histogram();
void calculateHistogram(QImage image);
void calculateAccumulatedFrequency();
void equalizeHistogram(QImage image);
int calculateThreshold(ThresMethod thres, QImage);
void thresholding(int,QImage);
int* getHistogram() {return histogramArray; }
int* getEqualizedHistogram() {return equalizedHistogram; }
int* getAccumulatedFrequency() {return accumulatedFrequency; }
uchar* originalPixels;
QImage getEqualizedImage(){return qEqualizedImage;}
QImage getThresholdedImage(){return qThresholdedImage;}
private:
int histogramArray[256] = {};
int accumulatedFrequency[256] = {};
int equalizedHistogram[256] = {};
int newValues[256] = {};
QImage qOriginalImage;
QImage qEqualizedImage;
QImage qThresholdedImage;
};
#endif // HISTOGRAM_H