Batch color correct 300,000 faces?

Discuss digital image processing techniques and algorithms. We encourage its application to ImageMagick but you can discuss any software solutions here.
Post Reply
BJ12
Posts: 3
Joined: 2011-11-19T00:54:01-07:00
Authentication code: 8675308

Batch color correct 300,000 faces?

Post by BJ12 »

Hi All,

I'm struggling finding a product that can color correct the faces of thousands of images. I can certain train the software so it performs better if needed. Many of the faces are "red" and need to be fixed. Others are faded with little color. I suspect the application would need to have algorithms centric to skin tones, not necessarily faces. I've tried a couple low end products and they will do OK on a few images, but some that were find get screwed up.

Any help sure would be appreciated. No Photoshop.

Happy Thanksgiving.
BJ
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: Batch color correct 300,000 faces?

Post by NicolasRobidoux »

I would build on http://www.vips.ecs.soton.ac.uk/index.p ... edirect=no, keeping in mind that a NIP2 GUI workspace can be easily be transformed into a batch operation
http://www.vips.ecs.soton.ac.uk/index.p ... _with_Nip2 and that since NIP2 (New Image Processor 2) is simply a GUI for the VIPS (Virtual Image Processing System) library, you can, with some work, turn pretty much anything NIP2 into a C, C++, Python or Ruby program that does the same thing.

VIPS/NIP2 are screamingly fast when you set toggles correctly (and possibly compile from source). It saw a major release recently: http://libvips.blogspot.com/2011/09/maj ... n-726.html

Disclaimer: I am a VIPS developer.
BJ12
Posts: 3
Joined: 2011-11-19T00:54:01-07:00
Authentication code: 8675308

Re: Batch color correct 300,000 faces?

Post by BJ12 »

NIcholas,

Thank you so much. However, I'm not a graphic artist or developer, this is a one time project. When the very first or second sentence starts out: "It fits a curve to the Macbeth greyscale to remove camera gamma, does a least-mean-square to find the 3x3 matrix from linear camera... RGB to CIE XYZ.....8- and 16-bit source images." its probably not a good product for me. The due dilligence required to get up to speed to understand the language alone - I'm afraid would make it very frustrating to use - not to mention very time consuming. It looks like it has some great features, but speaks to a different crowd. Past experience has shown that operational expects of an app tend to match their verbage - making this tool for the experienced user.

I have a greater appreciation for the "Auto Correct" button in MS Picture Manager now.
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: Batch color correct 300,000 faces?

Post by NicolasRobidoux »

Indeed, the VIPS/NIP2 learning curve is very steep. However, it is an excellent tool for color management. And if you knew what skin tones you are targeting and the faces fill a large enough and fairly constant (roughly centered, say) portion of the image, once you have your small catalogue of target skin "tones" it should not be too hard to correct all the images so that the least disruptive of the set is chosen to correct each one. The reason to use a small catalogue of skin tones instead of a single one is, I hope, clear.

(Pretty terse, I know.)
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: Batch color correct 300,000 faces?

Post by NicolasRobidoux »

Let me be a bit less terse. (This being said, I apologize for having to use technical language: Someone who knows how to do colour correction could use the following method, irregardless of whether it's done with VIPS/NIP2, ImageMagick or whatever. But this is certainly not "one button" usage.)

Suppose that your images are such that, the centered portion of it with half the height and width of the whole image is always almost all "face," not background or clothing (otherwise, use software that automatically finds where the face is; neither VIPS/NIP2 nor ImageMagick can, at least that I know), and let me assume at this point that there is only one type of skin tone in your 200,000 images. I'll explain how to deal with the other case later.

In a proper colour space (CIE XYZ, for example), compute the colour histogram for a "perfect" example, making sure not to use too any pixels that are not "face." Even better, compute the colour histograms for several similar "perfect" samples, and "average" them properly.

Now, equalize the histogram of all the other images so that the colour histograms for the center portion matches the above "fixed" histogram.

-----

What to do with multiple groups of skin tones (I know it's a continuum...).

Compute one histogram per "group of skin tones." You may have many such groups. I imagine a dozen or so may be enough. Then, compare the colour histogram of the center portions of each of your 200,000 images, figure out which one is closest, and colour correct using this one. (You can also colour correct using every one of the dozen, and then select out of the 12 results the one which is least different from the original in the center section.)

The above process can be programmed so it runs in batch.

But it certainly is not "one button push" at this point.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Batch color correct 300,000 faces?

Post by fmw42 »

I have a histmatch script that may be of some use for unix systems. See the link below
BJ12
Posts: 3
Joined: 2011-11-19T00:54:01-07:00
Authentication code: 8675308

Re: Batch color correct 300,000 faces?

Post by BJ12 »

Nicolas,

I think it would be faster, and much safer, to manually extract those images that need to be fixed. It could be one out of every 30. Then fix them one by one and reinsert back into the database. Following your suggestion would certainly alter some that need nothing, and decide which "tone group" does the least amount of damage to the good ones. Or, I can hire someone to fix them for me. can fix them for me. I really have not interest in getting up to speed on all that mention it would require.
Post Reply