added experimental from and to_name
This commit is contained in:
parent
115313ce3a
commit
f9ef381c90
4
ocr.sh
4
ocr.sh
@ -14,6 +14,8 @@ 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 //')
|
||||
from=$(echo "$raw_text" | grep From | sed 's/From //')
|
||||
to_name=$(echo "$raw_text"| grep -B1 $to_number | grep -v $to_number)
|
||||
|
||||
json=$(cat <<EOF
|
||||
{
|
||||
@ -34,4 +36,4 @@ EOF
|
||||
|
||||
echo $json | jq
|
||||
#echo $raw_text
|
||||
tesseract $INPUT_IMAGE stdout --psm 6
|
||||
#tesseract $INPUT_IMAGE stdout --psm 6
|
||||
|
@ -23,7 +23,9 @@ 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]+')
|
||||
from=$(echo "$raw_text" | grep -oP '(?<=From\s)[A-Z\s]+(?=\s[A-Z][a-z])')
|
||||
remarks=$(echo "$raw_text" | grep Remarks | sed 's/Remarks //')
|
||||
from=$(echo "$raw_text" | grep From | sed 's/From //')
|
||||
to_name=$(echo "$raw_text"| grep -B1 $to_number | grep -v $to_number)
|
||||
|
||||
json=$(cat <<EOF
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user