1
rated 0 times
[
1]
[
0]
/ answers: 1 / hits: 5103
/ 1 Year ago, fri, december 16, 2022, 3:05:52
I created a .sh script for simple OCR-ing of screenshots that I make with Shutter.
The script looks like this (ocrFile.sh
):
#!/bin/bash
convert $1 /tmp/output.pnm
cat /tmp/output.pnm | pamstretch 4 > /tmp/stretched.pnm
convert /tmp/stretched.pnm -colorspace gray /tmp/output600dpi.tif
tesseract /tmp/output600dpi.tif ./outputText -l eng
This script does some image enhancing that is required when OCRing with tesseract.
It does the job properly if it is called from the terminal. What I wanted was to do the whole process within Nemo, so I created a custom action named OCR.nemo_action
inside /home/user1/.local/share/nemo/actions
with the following content:
[Nemo Action]
Name=OCR The Screenshoot
Comment=OCR Function for Nemo File Manager
Exec=<ocrFile.sh %F>
Icon-Name=gtk-execute
Selection=Any
Extensions=png;
This Nemo action don't produce output with the script given above.
The .sh script is also in the folder for Nemo's custom actions.
Please help!
More From » bash