-
Notifications
You must be signed in to change notification settings - Fork 0
/
process.py
45 lines (35 loc) · 1.18 KB
/
process.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
import base_functions as bf
import analysis as an
import argparse
def main():
parser = argparse.ArgumentParser(description='Process Image through CloudNine Algorithm')
parser.add_argument("image_path", metavar="image_path", type=str,
help="Path to HDF5 Image to process as per algorithm")
args = parser.parse_args()
filename = args.image_path
data = bf.load_image(filename)
bf.get_image_information(filename)
bf.plot_hist_bin(data, 16)
grey = an.get_grey_level_array(data)
text = an.get_texture_analysis(data)
shape = an.get_shape_analysis(data, False)
#print(shape)
finalArray = {
"grey": grey,
"texture": text,
"shape": shape
}
print("Feature Array: ",finalArray)
def apply_algorithms(filename):
data = bf.load_image(filename) # load image
grey = an.get_grey_level_array(data) # grey-level array
text = an.get_texture_analysis(data) # texture analysis
shape = an.get_shape_analysis(data, False) # shape analysis
finalArray = {
"grey": grey,
"texture": text,
"shape": shape
}
return finalArray
if __name__ == "__main__":
main()