Listing my ideal solution here, but open to better methods.
Would like to add images to a folder, then they are automatically cropped, unrotated, and named. If the naming could be read from the card that would be awesome. Not too hopefully for that feature though. Seems like it would be a lot of work.
What I have done so far:
I have messed with this for just a bit. Bought a book, but just don't have time.
I tested multicrop and unrotate scripts, but they fell short of the task. I probably just don't know how to use them.
I then had some stencils made from plastic with slots for the cards. I've went in and used coordinates to crop the image. But don't have this scripted, so I basically copied the image 6 times then ran 6 different commands to crop out the cards. Then rotated after.
I would like this to be as efficient as possible. It would probably be better to rotate the image first, instead of 6 times at the end. Some won't need rotated though. Also would like to get rid of the blanks when there are some. This is where I need someone with the ability. There will also be a couple different sized stencils later that I would like to be able to easily edit the sizes in the script. Nothing is set in stone on this, so if you have a better way, let me know. I would ideally like a customized duplex scanner that could do each card quickly, but don't have the $$$$$ for that one.
I intend to process this on a centos 6 vm. Not sure the time commitment or a fair rate on this, so we can negotiate that.
Hopefully these images load and you can see what I start with and what I would like to end with. If you need more let me know.
Automated image processing.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Automated image processing.
Your scanned images have a whitish border outside a blackish border and is a jpg image, so that background color is not consistent. So you must remove the whitish border first before passing to multicrop and use a moderate fuzz value. Try the following. It works for me. You can play with the fuzz value for the multicrop.
Code: Select all
convert CLX_3180_20140505_12533108.jpg -bordercolor white -border 10 \
-fuzz 50% -trim -shave 2x2 -rotate 90 miff:- |\
multicrop -f 20 - CLX_3180_20140505_12533108_trim_mcrop.png
Re: Automated image processing.
Thanks for the quick response. Works much better. Not quite sure what the options mean, but looks much better.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Automated image processing.
Code: Select all
convert CLX_3180_20140505_12533108.jpg -bordercolor white -border 10 \
-fuzz 50% -trim -shave 2x2 -rotate 90 miff:- |\
multicrop -f 20 - CLX_3180_20140505_12533108_trim_mcrop.png