-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExperiment.py
More file actions
32 lines (28 loc) · 1.21 KB
/
Experiment.py
File metadata and controls
32 lines (28 loc) · 1.21 KB
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
import os
import subprocess
# list of the images I used from smallest to biggest in size
imageList = ["img1.jpg","img4.jpg","img3.jpg","img5.jpg","img2.jpg"]
# method to run the programs and take parameters of the program to be ran and the window size to be used in that program
def process(run,windowSize):
# loop through the list of images
for img in imageList:
# for each image I run the program and window size received as arguments 5 times to determine the optimum time the program takes to execute
for i in range(0,5):
os.system("java -cp bin "+run+ " "+img+" "+img+" "+str(windowSize))
# call the the method with the following arguments for each of the 4 programs
process("MedianFilterSerial",3)
process("MedianFilterParallel",3)
process("MeanFilterSerial",3)
process("MeanFilterParallel",3)
process("MedianFilterSerial",5)
process("MedianFilterParallel",5)
process("MeanFilterSerial",5)
process("MeanFilterParallel",5)
process("MedianFilterSerial",11)
process("MedianFilterParallel",11)
process("MeanFilterSerial",11)
process("MeanFilterParallel",11)
process("MedianFilterSerial",15)
process("MedianFilterParallel",15)
process("MeanFilterSerial",15)
process("MeanFilterParallel",15)