-
-
Notifications
You must be signed in to change notification settings - Fork 22
Description
Is your feature request related to a problem? Please describe.
I'm often in a situation where I'm looking for a single recipe that I only have on paper. Like in one of my cookbooks (paper cookbooks don't have a text search...), in a magazine I only keep for one recipe and otherwise would throw away or in a cookbook at a friends house and I don't want to borrow the whole cookbook.
Describe the solution you'd like
My idea is to take a picture of the paper recipes and import it as a nextcloud-cookbook recipe.
The steps would be:
- select a picture (from storage or take a photo)
- select the areas of the picture that are relevant for the import (like title, ingredients and instructions)
- crop the different areas from the image as separate images
- use OCR to get the text from the separate images
- split the text of OCR text that should be lists (ingredients and instructions) into lists (based on line breaks)
- use the data (title text and the ingredients & instructions lists) to fill the already existing "Add recipe" form of the app
- user can do QS (OCR is not perfect) and use the existing form to create the recipe
In the config an option should be included to download the tesseract traineddata for the desired language from https://github.com/tesseract-ocr/tessdata/tree/main or https://github.com/tesseract-ocr/tessdata_best
Describe alternatives you've considered
Manually transfer the information from paper to the app...
Additional context
I created a PoC of this feature here: https://github.com/schumischumi/GetRecipe/
The app is capable to do all described steps till the splitting (will add a # before each list item) and a demo pic with a fake recipe is included. I also tested it with my phone and some german recipes.
It uses the tesseract4android library https://github.com/adaptech-cz/Tesseract4Android
But as you can see I did not really create good kotlin code and especially the asset handling is more complicated as it needs to be (at least I think that)