You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reassembling Shredded Document Stripes Using Word-path Metric and Greedy Composition Optimal Matching Solver
6
-
```
3
+
This repository is a C++ implementation for TMM 19 paper
4
+
> Liang, Yongqing, and Xin Li. "Reassembling Shredded Document Stripes Using Word-path Metric and Greedy Composition Optimal Matching Solver." IEEE Transactions on Multimedia (2019).
5
+
7
6
If you use these codes in your research, please cite the paper.
8
7
9
-
## Environment
8
+
**Paper correction:** The Equation (5) should be
9
+

10
+
11
+
## 1. Environment
10
12
11
13
We build and evaluate our codes under Ubuntu 18.04 and Mac OS X 10.14.5. The following packages are used in this repository:
12
14
1. OpenCV: 3.2.0
@@ -15,7 +17,7 @@ We build and evaluate our codes under Ubuntu 18.04 and Mac OS X 10.14.5. The fol
15
17
4. g++: 7.4.0
16
18
5. Python: 3.6.8
17
19
18
-
## DocDataset description
20
+
## 2. DocDataset description
19
21
20
22
Click [here](http://t.lyq.me?d=DocDataset) to download the `DocDataset`. Unzip the package and copy the `gt` and `stripes` into the `/data/` folder of the repository.
21
23
@@ -24,10 +26,106 @@ Click [here](http://t.lyq.me?d=DocDataset) to download the `DocDataset`. Unzip t
24
26
2. 3 physically shredded document puzzles. They are named as `real*_*`.
25
27
3. 1 randomly oriented puzzle named `doc3_36`.
26
28
27
-
The comparison performance results are reported in the paper.
29
+
The comparison performance results are reported in the paper Table I, Table II, and Table III.
30
+
31
+
## 3. Usage
32
+
33
+
Download this repository, the source code can be compiled into `debug` and `release` executable files.
34
+
35
+
### 3.1 Compile
36
+
37
+
To generate the executable file in the `debug` mode:
38
+
```
39
+
./autogen debug
40
+
```
41
+
To generate the executable file in the `release` mode:
42
+
```
43
+
./autogen release
44
+
```
45
+
46
+
### 3.2 Reassemble a stripe puzzle
28
47
29
-
## Usage
48
+
A quick example to reassemble the synthesized stripe puzzle
We also provide an option to run the whole dataset instead of running each test case individually.
65
+
```
66
+
./benchmark.sh doc [gen]
67
+
```
68
+
69
+
When you run the benchmark or add `--benchmark` option to `./bin/release/solver`, the results are saved in `data/scores`.
70
+
71
+
72
+
#### 3.3.1 Generate stripe puzzles
73
+
In most cases, we recommend you to use the provided dataset for fair comparison.
74
+
75
+
The `gen` provides you an alternative option when running the benchmark. It which will run the `./bin/release/generator` to generate the stripe puzzles from the groundtruth.
76
+
77
+
Details about randomly generating stripes from groundtruths can be found in `src/generator/generate_puzzle.cpp`.
78
+
79
+
#### 3.3.2 Recommend parameters
80
+
For synthetic data, default parameters are good enough.
81
+
```
82
+
const double word_conf_thres = 70;
83
+
const double lambda0 = 0.3;
84
+
const double lambda1 = 0.5;
85
+
const double U_a = 2;
86
+
const double filter_rate = 0.7;
87
+
const int candidate_factor = 4;
88
+
```
89
+
We recommend the `--samples` at least 150, 300, 1000, 8000 for 20-, 30-, 40-, and 60-stripe puzzles.
90
+
91
+
For real-word data, `real1`, `real2`, and `real3`. We report our results in the following parameters.
92
+
93
+
```
94
+
const double word_conf_thres {70}; // or 60
95
+
const double lambda0 = 0.5;
96
+
const double lambda1 = 0.7;
97
+
const double U_a = 1;
98
+
99
+
// For Real Case 1
100
+
const double filter_rate = 0.2;
101
+
const int candidate_factor {5};
102
+
103
+
// For Real Case 2
104
+
const double filter_rate = 0.5;
105
+
const int candidate_factor {3};
106
+
107
+
// For Real Case 3
108
+
const double filter_rate = 0.6;
109
+
const int candidate_factor {5};
110
+
```
111
+
We recommend the `--samples` at least larger than 8000.
112
+
113
+
### 3.4 Clean
114
+
```
115
+
./autoclean debug
116
+
```
117
+
or
118
+
```
119
+
./autoclean release
120
+
```
121
+
122
+
## 4. Reference
123
+
```
124
+
@article{liang2019reassembling,
125
+
title={Reassembling Shredded Document Stripes Using Word-path Metric and Greedy Composition Optimal Matching Solver},
0 commit comments