|
|
@@ -1,5 +1,5 @@
|
|
1
|
1
|
from django.core.management.base import BaseCommand
|
|
2
|
|
-from ...xword import extract_crossword
|
|
|
2
|
+from ...xword import extract_crossword_grid, grid_to_png
|
|
3
|
3
|
|
|
4
|
4
|
|
|
5
|
5
|
class Command(BaseCommand):
|
|
|
@@ -37,7 +37,7 @@ class Command(BaseCommand):
|
|
37
|
37
|
group.add_argument('--html')
|
|
38
|
38
|
|
|
39
|
39
|
def handle(self, *args, **options):
|
|
40
|
|
- image, warnings = extract_crossword(
|
|
|
40
|
+ warnings, grid, num_rows, num_cols, block_img = extract_crossword_grid(
|
|
41
|
41
|
options['input_file_name'],
|
|
42
|
42
|
gaussian_blur_size=options['gaussian_blur_size'],
|
|
43
|
43
|
adaptive_threshold_block_size=options['adaptive_threshold_block_size'],
|
|
|
@@ -49,7 +49,12 @@ class Command(BaseCommand):
|
|
49
|
49
|
line_detector_element_size=options['line_detector_element_size'],
|
|
50
|
50
|
sampling_block_size_ratio=options['sampling_block_size_ratio'],
|
|
51
|
51
|
sampling_threshold_quantile=options['sampling_threshold_quantile'],
|
|
52
|
|
- sampling_threshold=options['sampling_threshold'],
|
|
|
52
|
+ sampling_threshold=options['sampling_threshold']
|
|
|
53
|
+ )
|
|
|
54
|
+ image = grid_to_png(
|
|
|
55
|
+ grid,
|
|
|
56
|
+ num_rows,
|
|
|
57
|
+ num_cols,
|
|
53
|
58
|
grid_line_thickness=options['grid_line_thickness'],
|
|
54
|
59
|
grid_square_size=options['grid_square_size'],
|
|
55
|
60
|
grid_border_size=options['grid_border_size']
|