Page 1 of 1

Image Sequence Equalize

Posted: 2016-06-26T11:55:07-07:00
by burt46
Hi
I have a folder with a series of images, what I would like to do is apply a histogram equalize to all images in the folder based on the properties of the first image. I looked at the

Code: Select all

–equalize
switch but I don’t know how to apply this to all images in a folder to test.

Basically all I want to do is have all images in a folder with similar brightness and contrast as I am using them in a video sequence. The images are from a timelapse camera so the variations are just in over/underexposure and I’d like to smooth them out between each image.

I would like to run this from a command line in an existing batch file.

Perhaps there is a better way of doing this. Any advice appreciated.

I did find this link, but I don’t know how to install the histmatch script.

http://superuser.com/questions/664500/n ... e-sequence

Thanks in advance

Re: Image Sequence Equalize

Posted: 2016-06-26T12:54:31-07:00
by Bonzo
The histmatch script is one of fmw42's and you need to specify more information - IM version, platform and programming language.

Re: Image Sequence Equalize

Posted: 2016-06-26T12:59:26-07:00
by burt46
Thanks for the reply.

I am using Windows 10 pro and ImageMagick 7.0.2-8. I normally use .bat files for my programming and can run loops no problem.

Re: Image Sequence Equalize

Posted: 2016-06-26T13:04:24-07:00
by fmw42
My scripts only run on Unix systems (Linux, Mac OSX or Windows with Cygwin). For Windows users, see user snibgo's web site for http://im.snibgo.com/gainbias.htm

Re: Image Sequence Equalize

Posted: 2016-06-26T13:09:23-07:00
by fmw42
You can also append all the images together, then run -equalize and then separate the images again. But that may take quite a bit of memory and make it impractical.

Re: Image Sequence Equalize

Posted: 2016-06-26T13:15:29-07:00
by Bonzo
I have just remembered this: http://www.howtogeek.com/249966/how-to- ... indows-10/

You may soon be able to run the scripts without Cygwin. I can not try it as my build is way to old and for various reasons I can not update it.

Re: Image Sequence Equalize

Posted: 2016-06-26T14:12:11-07:00
by burt46
Thanks for the tips. I like the append function but could this not be done in a similar way with mogrify through a loop?

Re: Image Sequence Equalize

Posted: 2016-06-26T14:18:52-07:00
by fmw42
burt46 wrote:Thanks for the tips. I like the append function but could this not be done in a similar way with mogrify through a loop?
You may get different results for each image if you use -equalize separately on them. If you append, then you get the equalize on the total set of pixels from all images. The hard part will be separating them unless they are all the same size, then -crop will do the job once time.

You may have to try both ways. But I think snigo's gain/bias might be the best way to go once you pick one image or process one image the way you like it best. Then gain/bias will try to match each of the other images to the same slope and intercept (contrast and brightness).

Re: Image Sequence Equalize

Posted: 2016-06-26T14:44:55-07:00
by burt46
Thanks for the tips, i did look at Snibgos bat files but to be honest it is far too advanced for me. I cant even see where to put in the variables to process my images.

Re: Image Sequence Equalize

Posted: 2016-06-26T17:57:47-07:00
by snibgo
Also see the recent thread viewtopic.php?f=1&t=29431 with a similar problem.