forked from Brick-Mover/RAISR
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHashBuckets.h
31 lines (24 loc) · 1.19 KB
/
HashBuckets.h
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
#ifndef TEST_HASHBUCKETS_H
#define TEST_HASHBUCKETS_H
#include "Utils.h"
#include <stdexcept>
class HashBuckets {
public:
HashBuckets(cv::Mat img, unsigned scale, unsigned patchLen);
std::array<int, 3> hash(int r, int c, int rot, bool flip); // get the hash value of the image in range
void breakImg(int rot, bool mirror); // break the image into patches
static const double sigma; // the sigma value of the Gaussian filter
static const int numOfAngle = 24;
static const int numOfStrength = 3;
static const int numOfCoherence = 3;
private:
// Members(images, image gradients, buckets, etc.)
cv::Mat img; // the original image, read as CV_8U1
cv::Mat imgGx; // the image's gradient in the horizontal direction, CV_64F for matrix operation
cv::Mat imgGy; // the image's gradient in the vertical direction, CV_64F for matrix operation
cv::Mat W; // the diagonal weighting matrix generated from 2D Gaussian filter, CV_64F
unsigned scale; // the scaling ratio
unsigned patchLen; // the size of the patch
int bucketCnt[24][3][3]; // count the number of patches in each bucket
};
#endif //TEST_HASHBUCKETS_H