added remarks

This commit is contained in:
Shihaam Abdul Rahman 2024-08-03 02:01:55 +05:00
parent 00dcaf8a2b
commit 115313ce3a
Signed by: shihaam
GPG Key ID: 6DA2E87EBC227636

4
ocr.sh
View File

@ -13,6 +13,7 @@ time=$(echo "$raw_text" | grep -oE '[0-2][0-9]:[0-5][0-9]')
currency=$(echo "$raw_text" | grep -oP '(?<=Amount\s)[A-Z]{3}')
amount=$(echo "$raw_text" | grep -oP '(?<=Amount\s[A-Z]{3}\s)[0-9]{1,3}(?:,[0-9]{3})*(?:\.[0-9]{2})')
status=$(echo "$raw_text" | grep -oP '(?<=Status\s)[A-Z]+')
remarks=$(echo "$raw_text" | grep Remarks | sed 's/Remarks //')
json=$(cat <<EOF
{
@ -32,4 +33,5 @@ EOF
)
echo $json | jq
echo $raw_text
#echo $raw_text
tesseract $INPUT_IMAGE stdout --psm 6