-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscan.sh
executable file
·48 lines (35 loc) · 1.87 KB
/
scan.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
cd /tmp/
#scanimage -d net:localhost:avision:libusb --batch=batch%d.tif --batch-count=1 --resolution 300 --format=tiff -l 14.5 -x 85 -t 10 -y 125
#convert batch1.tif -crop 817x1251+91+112 inner1.tif
# this requires at least imagemagick 6.5.8-9
#convert inner1.tif -density 300 -crop 8x12-17-19@\! -shave 10x10 +repage twistlow%d.tif
scanimage -d avision:libusb --batch=batch%d.tif --batch-count=1 --resolution 600 --format=tiff -l 14.5 -x 85 -t 10 -y 125
convert batch1.tif -density 600 -crop 1634x2502+182+224 inner2.tif
# this requires at least imagemagick 6.5.8-9
convert inner2.tif -density 600 -crop 8x12-34-38@\! -shave 20x20 +repage twisthigh%d.tif
exit 0
#-density argument added to preserve DPI
# messy file, but it has history!
# can combine these two convert lines into one
#ls circ*.png | xargs -I xxx convert -size 67x67 xc:black -fill xxx -draw "circle 33,33 23,23" xxx
# for some reason -s 12x12 doesn't work on some images
# while -s 12x12 is required for some images
# for some reason -N 1 sometimes makes it so dmtxread skips valid pages?! Without it, it finds it
cd ~/ginkgo/lab/datamatrix/
python process.py 0 /tmp/twistlow.tif
#$dmtxread -e 20 -E 32 -q 10 -t 30 -s 12x12 -m 300 -N 1 -P -n wells.tif > out1
#$dmtxread -D -e 20 -E 32 -q 10 -t 30 -m 300 -P -n wells.tif > out2
#cat out
#echo "number lineS:"
#cat out1 | wc -l
#cat out2 | wc -l
## For big scanner:
#!/bin/bash
cd /tmp/
#scanimage -d hp3900:libusb:002:002 --batch=newlow.tif --batch-count=-1 --resolution 300 --mode Gray -l 45 -t 10 -x 130 -y 275
convert newlow.tif -density 300 -crop 1250x836+134+82 inner.tif
#convert newlow.tif -density 300 -crop 1250x836+134+82 inner.tif
# this requires at least imagemagick 6.5.8-9
#convert inner.tif -crop 8x12-17-19@\! -shave 10x10 -auto-level -blur 1 +repage wells.tif
convert inner.tif -density 300 -crop 12x8-19-17@\! -shave 10x10 -auto-level +repage well%d.tif