- Using PipEnv:
- install pipenv - https://pipenv.pypa.io/en/latest/#install-pipenv-today
-
pipenv shell pipenv install
pipenv shell
python main.py
python main.py -d
loads a test source image at startup
- File -> open - opens a source image (this will remove all the current letters on canvas)
- File -> save image as.. - saves an image file of the source image which contains the placed and modified letter images on it
- *File -> save contours as.. - * saves a json file with the placed letter's coords and contours
- Load a source image to work on
- Place letters by doing the following:
- Select a letter by Left clicking on it's image on the toolbar
- Move your mouse over the output image, and carefully choose the right spot to position it
- Use the algorithm and letter modifiers to better fit the letter to it's correct form and position
- Left click to place the letter image at its current form and position
- You can select letters already placed by Left clicking to manipulate them using the selected letter modifiers:
- Right / Left - rotate letter
- Up / Down - scale letter
- = - toggle letter fill (filled letter / contours only)
- Delete / BackSpace - remove letter from canvas
- Arrow Keys - move letter around the canvas
- R - Edit window for selected letter
- press twice on the image to generate a line.
- save - save the image as tif format and adds it to the menu
- close - wont save any changes
- deformat - will call deformator class with all relevant details and make the chosen interpolation
- - to toggle screen zoom
- + / - - increase or decrease the snakes algorithm strength
- *** - toggle letter fit mode (snap to dark parts / snap to light parts)
The project uses skikit-image
active_contour algorithm behind the scenes, with a simple user interface created using tkinter (a built in ui library for python).
The live feedback is generated via back and forth comunication between the ui and the algorithm backend to give a smooth and monitored letter placing experience.
scikit-image
uses numpy and thus compatible with other image processing libraries.
letters are automaticly loaded from the resources/letters
folder, letter files should contain a black letter which will be used to extract the contours, later used in the snakes algorithm.