-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathdetect.py
74 lines (57 loc) · 1.52 KB
/
detect.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
## Detect mirror symmetry
#### Author: yiran jing
#### Date: Feb 2020
import sys
import cv2
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import glob
from mirror_symmetry import * # class and helper function
def main():
argc = len(sys.argv)
if not (argc == 2):
print("Usage: python detect.py choice")
return
elif sys.argv[1] =='example': # run butter fly example
detecting_mirrorLine('butterfly.png', "butterflywith Mirror Line", show_detail = True)
return
elif sys.argv[1] =='test': # run test case
"""
test animal and people image
"""
test_case("images/1_*.png")
"""
test symmetry architecture
"""
test_case("images/2_*.png")
"""
test other natural phenomenon
"""
test_case("images/3_*.png")
"""
test symmetry object with reflection
"""
test_case("images/4_*.png")
"""
test symmetry object with shadow
"""
test_case("images/5_*.png")
"""
test rotational symmetry
"""
test_case("images/6_*.png")
"""
test images includes multiple symmetry objects
"""
test_case("images/7_*.png")
"""
test non-symmetry object
"""
test_case("images/8_*.png")
return
else:
print("Error")
return
if __name__ == '__main__':
main()