-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
48 lines (40 loc) · 1.26 KB
/
main.py
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
from __future__ import print_function
import cv2
import numpy as np
from progressbar import ProgressBar
from argments import get_args
from preprocess import preprocess
from canny import canny
from hough import hough
from sortLines import sortLines
from mergeLines import mergeLines
def main(args):
"""
Excute detect lines process
:param None: argment is None
"""
# read img and preprocess
pre_img, rawImg = preprocess(args)
# detect edges
#edges_img = canny(pre_img, args)
# hough trasform
lines = hough(pre_img, rawImg, args)
# postprocess
## sort lines
if (not args.opt):
sortedLines = sortLines(lines)
## merge lines
#mergedLines = mergeLines(lines, rawImg, args)
if __name__ == "__main__":
# get argments
args = get_args()
if (args.debug):
print("---------------------------------------------------------------------------")
print("=======================")
print("# run as <DEBUG MODE> #")
print("=======================")
print("[argments list]")
for key, value in vars(args).iteritems():
print(key,value)
print("---------------------------------------------------------------------------")
main(args)