Hi, I know this is basic, but I can't find the way to run localthresh on all the jpg files of a certain folder, i.e, I have p112.jpg, p113.jpg .... and I want to run localthresh so at the end I'll have p112-bin.gif, p113-bin-gif (it could be god or tif)
I've tried this:
$ sh localthresh -m 1 -r 15 -b 8 -n yes p*.jpg p-%d.tif
but it retrieves:
--- TOO MANY ARGUMENTS WERE PROVIDED ---
Thanks!!
applying Fred's scripts of several images
Re: applying Fred's scripts of several images
I would guess you need to write some non Imagemagickc code to loop over the images and apply the localthresh to each one in turn.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: applying Fred's scripts of several images
My scripts work on one input only. So you will have to write a loop over each file in a directory and process them one a time.
Depending where you have the script, you may have to put paths to the script or to the images, unless you put the path to where you have my scripts into your PATH environment variable. See my web site home page for such Pointers.
The directory with your images must not contain other types of files, but images. Otherwise, the ls line will need to filter on image types, such as
list=`ls *.jpg`
as an example.
Code: Select all
cd yourimagedirectory
list=`ls`
i=0
for img in $list; do
name=`convert $img -format "%t" info:`
bash localthresh arguments $img ${name}_${i}.tif
i=$((i+1))
done
The directory with your images must not contain other types of files, but images. Otherwise, the ls line will need to filter on image types, such as
list=`ls *.jpg`
as an example.
Re: applying Fred's scripts of several images
Thanks fmw42!!, I'll run in that way.