#!/bin/bash

convert -size 110x380 gradient:white-black -rotate -90 ./cam/gradient.png

for f in `cd ./cam && ls *.jpg`
do
    if [ -e "./nums/$f" ]
    then
	continue
    fi
    echo $f

    convert -distort Perspective '205,225 0,0 620,53 640,0 670,206 640,150 225,310 0,150' "./cam/$f" \
     -level 5%,70% -crop 380x110+340+5 -colorspace Gray /tmp/new.png && convert /tmp/new.png ./cam/gradient.png -compose Multiply -composite\
     -sharpen 0x40 -level 5%,50% -bordercolor White "./nums/$f"
done


# 