-
Notifications
You must be signed in to change notification settings - Fork 0
/
img_to_2D_array.h
37 lines (27 loc) · 1.06 KB
/
img_to_2D_array.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
32
33
34
35
36
37
#ifndef IMG_TO_2D_ARRAY_H
#define IMG_TO_2D_ARRAY_H
#include <opencv2/opencv.hpp>
#include <opencv2/highgui.hpp>
#include <iostream>
#include <opencv2/imgproc/imgproc.hpp>
#include <windows.h>
using namespace cv;
using namespace std;
#define RESIZE_SCALING 2.4
#define GRID_SIZE (108.5/RESIZE_SCALING)
#define CHESSBOARD_X (533/RESIZE_SCALING)
#define CHESSBOARD_Y (113/RESIZE_SCALING)
#define circle_thickness (GRID_SIZE/10.0)
#define circle_radius (GRID_SIZE/4.5)
//int mouseInputs;
class OpencvHp {
public:
void img2array(uint_fast8_t chessboard[8][8]);
void show_answer(uint_fast8_t x, uint_fast8_t y, int direction);
private:
void showimg(string windowname, const Mat &img, int x, int y);
uint_fast8_t knn(uint_fast8_t b, uint_fast8_t g, uint_fast8_t r);
static void CallBackFunc(int event, int x, int y, int flags, void* userdata);//must be static
void user_modify_board(int mouse_x, int mouse_y, uint_fast8_t chessboard[8][8], const Mat &img);
};
#endif /* IMG_TO_2D_ARRAY_H */