-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvectorizer_vectorix.h
More file actions
48 lines (37 loc) · 1.19 KB
/
vectorizer_vectorix.h
File metadata and controls
48 lines (37 loc) · 1.19 KB
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
/*
* Vectorix -- line-based image vectorizer
* (c) 2016 Jan Hadrava <had@atrey.karlin.mff.cuni.cz>
*/
#ifndef VECTORIX__VECTORIZER_VECTORIX_H
#define VECTORIX__VECTORIZER_VECTORIX_H
// Vectorizer
#include <opencv2/opencv.hpp>
#include "pnm_handler.h"
#include "v_image.h"
#include "vectorizer.h"
#include "parameters.h"
#include <string>
namespace vectorix {
class vectorizer_vectorix: public vectorizer {
public:
virtual v_image vectorize(const pnm_image &image);
vectorizer_vectorix(parameters ¶ms): vectorizer(params) {
par->bind_param(param_custom_input_name, "file_input", (std::string) "");
par->add_comment("Interactive mode: 0: disable, 1: show windows and trackbars");
par->bind_param(param_interactive, "interactive", 1);
};
private:
std::string *param_custom_input_name;
int *param_interactive;
// Trackbar callback functions (passed as parameter to non-member function)
static void step1_changed(int, void *ptr);
static void step2_changed(int, void *ptr);
int interactive(int state, int key); // Process key press and decide what to do
cv::Mat orig;
cv::Mat binary;
cv::Mat skeleton;
cv::Mat distance;
void load_image(const pnm_image &original);
};
}; // namespace
#endif