Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

learn existing OCR implementation #74

Open
ttaliacc opened this issue Sep 25, 2024 · 3 comments
Open

learn existing OCR implementation #74

ttaliacc opened this issue Sep 25, 2024 · 3 comments
Assignees

Comments

@ttaliacc
Copy link
Collaborator

Before we implement try to implement and embed the ML model to the quick entry form, we should firstly find out how the OCR works. It will be ideal for us to synchronize our implementation with OCR's.

@ttaliacc ttaliacc self-assigned this Sep 25, 2024
@ttaliacc
Copy link
Collaborator Author

@ttaliacc
Copy link
Collaborator Author

ttaliacc commented Oct 8, 2024

The OCR engines are Tesseract and Digi-Leap

related files

  • collections/editor/includes/imgprocessor.php: use ocrImage to trigger the function
  • js/symb/collections.editor.imgtools.js: use Sends this data (image ID, region, mode, etc.) to the server via AJAX to process the image. After the AJAX request completes, it receives the OCR text, updates the relevant UI elements, and re-enables the button.
  • collections/editor/rpc/ocrimage.php: backend component responsible for handling OCR requests from the frontend. When an image is sent for OCR processing, this script receives the request, processes the image using Tesseract or Digi-Leap accordingly. It also allows to get crop of images for different OCR use cases.
  • classes/SpecProcessorOcr.php: This class manages the OCR process, including loading the image, cropping, and interacting with Tesseract and Digi-Leap.

@ttaliacc
Copy link
Collaborator Author

We found the OCR is actually a local running instance. To run it, the user will need to install the Tesseract locally, and the funcion private function ocrImageViaTesseract($url = "") of classes/SpecProcessorOcr.php will pass the URL to the instance and use the OCR. This is also why we were not able to run the OCR of the old entry form but also didn't see any error in log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant