Code refactoring and process order changing

what was done:
- swap ofder of thresholding and resizing in preprocessing procedure
- code refactoring
- modification of project structure (mainly structure of folders with
images)