diff --git a/Presentations/RCOS.pdf b/Presentations/RCOS.pdf new file mode 100644 index 0000000..625c5df Binary files /dev/null and b/Presentations/RCOS.pdf differ diff --git a/Presentations/RCOSPPT.pptx b/Presentations/RCOSPPT.pptx new file mode 100644 index 0000000..4d63594 Binary files /dev/null and b/Presentations/RCOSPPT.pptx differ diff --git a/learning/FileMoniter.py b/learning/FileMoniter.py new file mode 100644 index 0000000..c31dc30 --- /dev/null +++ b/learning/FileMoniter.py @@ -0,0 +1,30 @@ +import os +import time +import platform + +def main(AskForPath = False, Intervtime = 5): + if AskForPath: + print("Enter the path: ") + print("If the program is already in the requested directory, press 'Enter' directly. (Use / to replace \\):",end = ' ') + path = input("") + if path != "": + os.chdir(path) # change the path + else: + if 'windows' in platform.platform().lower(): + path = os.getcwd() + else: + path = os.getcwdu() + allfile = os.listdir(path) + print('Current Files:', allfile) + while 1: + newfile = os.listdir(path) + if allfile != newfile: + print("Changes Found") + print('Current Files:', newfile) + time.sleep(Intervtime) + allfile = newfile + + +if __name__ == '__main__': + main() + \ No newline at end of file diff --git a/sample/AnswerSheet.py b/sample/AnswerSheet.py index 04f4439..b1779a6 100644 --- a/sample/AnswerSheet.py +++ b/sample/AnswerSheet.py @@ -1,6 +1,7 @@ from Box import Box import cv2 + class AnswerSheet(object): def __init__(self,myCentre=(0.0,0.0),myAnswerArea = 0.0): self.centre = myCentre diff --git a/sample/Box.py b/sample/Box.py index 1ab0ffc..3026300 100644 --- a/sample/Box.py +++ b/sample/Box.py @@ -7,13 +7,15 @@ def __init__(self, my_contour): self.area = cv2.contourArea(my_contour) self.centre = self.find_centre() - def find_centre(self): + def find_centre(self, printed=False): x_axis = [] y_axis = [] for point in self.contour: x_axis.append(point[0][0]) y_axis.append(point[0][1]) - # print cnts[0][0][0][0] + if printed: + pass + # print(cnts[0][0][0][0]) x_axis = sorted(x_axis) y_axis = sorted(y_axis) x_centre = int((x_axis[0] + x_axis[-1]) / 2)