Color correction/balancing - no clue :-)

bobogs wrote on 6/21/2006, 11:31 AM
I have an imaging project at my company, and we're stuck on one particular issue. I don't have much experience with digital imaging or color correction, but I use Vegas for my home video projects, so I thought I'd ask the gurus here for some help (I'm not a member of any photoshop forums). :-)

We are trying to use a webcam to capture a snapshot of a piece of carpet (camera facing down at the table), but the resulting image is way off color-wise (e.g. light green shows as a darkish blue, etc.). One of our IT guys says it should be possible to do automatic color correction of the entire image, using an API of programX (TBD...longshot?), as long as we have a reference point of true Red, Green and Blue in the image.

I generated a pure red square, green square and blue square in photoshop elements, and printed them (assume, although unlikely, that the printed images are pure r,g,b...we'll worry about that part later). We placed those three squares on the table where the carpet sample is placed, and took another snapshot. Now we have three reference points in the image.

Is it possible, even in the GUI of photoshop or some other program, to essentially say, "this area of the image needs to be 255,0,0, this other area needs to be 0,255,0, and this third area needs to be 0,0,255...and the rest of the image should adjust accordingly, in the same proportions?" Does this need to be a manual process, using r,g,b sliders (if so, that's really not an option for us)?

Am I making any sense at all??? :-) Is this how color correction/balancing works?

Thanks for any help!
Gary

Comments

Jay-Hancock wrote on 6/21/2006, 1:47 PM
Check out this tutorial from Glenn Chan:

http://glennchan.dyndns.org/spot/1-general-CC-approach.html
GlennChan wrote on 6/21/2006, 2:33 PM
1- The tutorial doesn't address the issue here. Also, the tutorial refers to media on the Absolute Training for Vegas+DVD, Vol. 4 training DVD on color correction... so that's why it says things like "this DVD".

2- Gary:
Is your project destined for print media or video media?

In either case:
You're looking at color management. For print work, ICC is designed for color management.
For video work, the reference standard (for SD) is a broadcast-grade monitor with SMPTE C or EBU colorimetry (depending on the television standard in your country; generally it's SMPTE C for NTSC, EBU for PAL). So you're looking at a broadcast monitor with SMPTE C phosphors or something like that. Then it's almost WSIWYG. But generally for video, your audience's TVs have colors that are quite off so accuracy is generally lost on your audience. NTSC is generally jokingly referred to as "never twice the same color'.

Lighting conditions are important as they affect how the colors appear (due to metamerism). Materials will have different colors depending on the light they're in. The standard is D65 lighting with a low metamerism index. Unfortunately, I don't know much about where to get such lighting.
*For work with the ICC system, there are two different standards (where one is for when cost is a concern). The lower standard specifies D50 lighting.

Basically to get accurate color you need to do:
A- If you have chromaticity co-ordinates of what the carpet is supposed to look like, then it makes your life a little easier. If you profile the output device (i.e. printer + paper) or if the device's characteristics are known (i.e. SMPTE C, EBU) then you're almost there.

Or it may be that the carpet is specified using the Pantone system, in which case you'd just use that system.

B- If not, then you'd use a color management system and just eyeball the colors.
Color management generally depends on:
Viewing conditions. D50 or D65 lighting, neutral surround at a specified illumination, etc. The lighting is necessary to deal with metamerism, and the overall viewing conditions are necessary due to perceptual effects like surround effects.
Your monitor: Needs to be calibrated and profiled.
Your output device: Needs to be profiled.
Your software: Needs to be setup properly.

For video, things are a little simpler than print. You don't need to profile your output device if it conforms to SMPTE C or EBU colorimetry (for CRTs, colorimetry is set by the phosphors used).

Those are the issues as far as I know. Without knowing whether you're doing work for print or for video, I can't tell you much more. I am not very familiar with color management for print so I can't tell you too much more there, other than to point you towards other sites.

One way to get accurate color is trial and error... output many variations and adjust your equipment until the color is pretty good. i.e. you keep printing samples until things look right. The color management systems available just simplify things so you don't have to do that.

3- As far as changing colors, what software do you want instructions for?
deusx wrote on 6/21/2006, 2:45 PM
I agree with eyeballing the whole thing and just forget about rgb math.

#1 don't use a web cam, borrow a decent digital camera

#2 if your monitor is calibrated, just open this image in any photo editor and correct colors until they look exactly like the real thing ( or closest you can get to it. )

#3 In the end being 100% accurate doesn't matter that much. It will still look different on different monitors or tvs ( because they are not calibrated ).

#4 if this is for print, then you have to read up and test a few things, because if you just click on print, what comes out of your printer will mos likely again be way off .no matter how accurate your color correction is. ( because of web cam, I suspect this is a low budget project and nothing is really calibrated, so trial and arror it is. print away, rinse and repeat until it looks right)
bobogs wrote on 6/21/2006, 6:33 PM
Holy cr*p! That's a ton of info...thanks! I only wish I understood 1/10th of it. :-)

To answer the first question, it's destined for neither print nor video...it's just meant to be an image for archival storage for future reference. Allow me to explain...

Out company tests carpet (and other flooring/materials) for insurance claims. We receive over a thousand samples per day, run them through our testing processes and produce a report for the insurance adjuster (this helps the adjuster and his insurance company give an accurate reimbursement to the claimant, instead of the old way where the adjuster looked at the carpet, said "this looks like medium-grade, and wrote a quick but usually incorrect check).

We normally keep the samples for 90 days to handle callbacks and other inquiries, then we toss the samples. We're hoping to keep an image of each sample (carpet, vinyl, laminate, wood, siding, tile, etc.) indefinitely. We're planning on doing the image capturing at our unpacking stations. However, these stations are manned by nontechnical, low-wage employees, and we don't want to burden them with having to manually adjust RGB sliders to judge the image. Also, given time constraints, it would kill our productivity if each sample had to be eyeballed and adjusted manually.

Given your comments, this might simply be a monitor calibration issue (is it ever really that simple? :-)). The developer who's working on this whole image capture piece of our system is using dual analog 19" dell LCDs running off one video card (analog and dvi port with converter) (dell precision workstation...nvidia card, i think). I'm going to suggest that he research monitor calibration and give that a shot.

We're not looking to print these images (as far as I know)...we just want something that is a reasonable representation of the item that was sent in (blue is blue and light green is not dark blue).

Thanks again for the info. Any more suggestions?
Gary
GlennChan wrote on 6/21/2006, 8:44 PM
Well basically, the color you get depends on the following:

A- The light striking the carpet. This is one source of metamerism... that's why the light matters. Explanation of metamerism:
http://www.colormatters.com/des_meta.html
B- The carpet. Does it have a stain, whatever.
C- The camera's color response. Another form of metamerism.
D- Your Dell LCD. Its colors are probably a little weird.
E- Your eyes. Not much you can do here, other than to check that you're not partially colorblind.
F- Viewing environment around your monitor.
G- (Output) If you were to print on paper or whatever, this would be another source where the colors 'change'.

So assuming that you don't need that great quality, but reasonable quality.
A: Make sure your lights aren't whacked. Use daylight-balanced incandescents or fluorescents with reasonably high CRI rating. Sodium vapour is bad.
B: N/A
C: Make sure you white balance the camera. Presumably you can set it once and then lock off the setting.
If you shoot something white in the shot, you can fix the WB in post. A Gretag macbeth chart would be overkill but it'd work.
example
A styrofoam cup will work fine as a white reference.

The camera will introduce some metamerism... which I don't think you can do much about. You could shoot the Macbeth chart (or a similar one like DSC Labs) and apply color tweaking in post to make the chips look like what they're supposed to look like. That might get you closer, or close enough.

D- This'll change how you see things... but it won't affect what you're shooting. You could use ICC + profile your monitor to get better color accuracy.
Calibrate the monitor first. If you use DVI, your LCD shouldn't need calibration. With VGA, the analog signal + circuitry may need to be calibrated.
Then you need to profile the monitor. The cheaper monitor profiling tools don't work perfectly because of metamerism. A review of some monitor profiling tools:
http://www.drycreekphoto.com/Learn/monitor_calibration_tools.htm

F: Easy test. Load up a black and white image onto your computer screen (de-saturate a color photo in Photoshop so you know it's definitely B&W). Look away from the screen for 10 seconds. Then look at the screen... is the B&W image definitely black and white?

One setup that might work:
1- Camera: dpreview.com has reviews of various cameras, with info on color accuracy. You might look at something like a Sony F828 (or its latest incarnation).
This will minimize metamerism / color inaccuracy from the camera. The RGB+E sensor arrangement supposedly delivers better color accuracy.

I would lean towards this because you really can't fix camera metamerism as far as I know. The extra resolution would presumably be handy for you. This may likely be that best thing you can do.
2- Lighting: Not sure what's good here. Daylight-balanced incandescent light may be a good choice. Or you could look at Solux products.
3- Monitoring: Get a Sony Artisan monitor or something similar.
I'm not sure if you'd need Photoshop or Photoshop Elements for ICC color management.
You may find that you don't need this... i.e. is the client going to be seeing a calibrated+profiled monitor??
4- Development: Make the capture process more idiot-proof.
And figure out the process for shooting the carpet... you might want to lock everything off in terms of controls (WB, focus in particular) and not having your equipment walk away. You may want to keep the camera a fixed distance from the carpet, that way you set the focus once.

deusx wrote on 6/21/2006, 10:38 PM
>>>However, these stations are manned by nontechnical, low-wage employees, and we don't want to burden them with having to manually adjust RGB sliders to judge the image<<<

If that's the case, forget about everything, just get a decent camera and through trial and error determine what kind of camera settings, lighting and camera distance / angle give you the most realistic image.

When you find it, stick to that, and nobody has to adjust anything in software.
Steve Mann wrote on 6/23/2006, 11:42 PM
There is a program - I really wish that I could remember the name, that looks at an RGB pattern outside your intended crop area to autocorrect the color of (almost) any image. I was initially excited about it because the demo worked with any image I sent to it. Then I saw the price. End of my interest....

(Could that be the "programX" in your original post?)

Steve M.