Helpful Posts Helpful Posts:  0
Results 1 to 10 of 10

Thread: Camera Characteristic Curve

  1. #1

    Camera Characteristic Curve

    Recently I have been using a digital camera in order to perform some scientific measurements on colour (it is a test, and I do not yet know if I will succed in this task). I have carried out some simple tests in order to understand how a digital camera works and I found a peculiar behavior ( to me it seems peculiar, but maybe it is a common known problem).

    I have carried out the following test: i have photographed a white paper keeping the aperture fixed and varying exposure times from about 1/8000s to 3s. I have then, transformed my RAW files in .png files and using matlab I have obtained the 'intensity' of each RGB channel for each photo. I have then plotted RGB vs time exposure in a semi log scale, as you can see in figure. untitled..pdf

    As you notice there is a region between 100 and 200 on the y scale, where the behavior of the camera is linear, and the three RGB channels have the same slope (I have verified this by making a linear fit).

    If now, using the same procedure I take a picture of a coloured object, in my case it was a blue object, I find that, in the linear regime, the three RGB channels have 3 quite different slopes, especially, as you can see in the second figure (only few points are shown) the R channel is much steeper than the green and blue ones. retta..pdf
    I was not expecting this result, I was expecting the three channels to have the same slope for each of the 3 RGB and of course different "intensity".

    Does someone have an explanation for this behavior? It would be very helpful.

  2. #2

    Join Date
    Oct 2009
    Location
    Maryland, USA
    Posts
    1,015
    Real Name
    Rick

    Re: Camera Characteristic Curve

    I think you may want to look at color spaces. There are a number of ways to characterize a color. What you're looking to see as a simple increase in value of RGB may be more accurately characterized as "lightness." Bruce Lindbloom has an Equations page that has equations for converting between various representations. The Lab space is one that has "lightness" and two chromaticity ratios. I think that if you looks at the equations, they'll show that changing lightness won't simply scale the RGB values.

    Cheers,
    Rick

  3. #3
    Terry Tedor's Avatar
    Join Date
    Jan 2010
    Location
    North Pole, Alaska
    Posts
    247

    Re: Camera Characteristic Curve

    Would it be possible for you to reproduce the graphs using the same x axis scaling for both? As it is right now, you're presenting the data scaled differently. I'm not saying I have an explanation, I'm just curious what the data looks like when scaled the same. It's sort of like an apples vs oranges comparison.

  4. #4
    Moderator Dave Humphries's Avatar
    Join Date
    May 2008
    Location
    Windsor, Berks, UK
    Posts
    16,737
    Real Name
    Dave Humphries :)

    Re: Camera Characteristic Curve

    Quote Originally Posted by ceciliam View Post
    ~ i have photographed a white paper keeping the aperture fixed and varying exposure times from about 1/8000s to 3s. I have then, transformed my RAW files in .png files and using matlab I have obtained the 'intensity' of each RGB channel for each photo. I have then plotted RGB vs time exposure in a semi log scale, as you can see in figure. ~
    Hi ceciliam, (Cecil?)

    Welcome to the CiC forums from me.

    I have a (possibly daft) question, as it isn't covered above (unless I missed it), the shutter speeds you give suggest a dynamic range of about 14 stops between 1/8000 and 3 seconds - did you vary the intensity of the illumination, or the ISO of the camera to equalise exposure?
    Or was the 3 seconds picture very bright (probably over-exposed and clipped) and 1/8000s very dim (black)?

    Maybe I missed something
    Was it the linearity of the sensor over that range you were testing?

  5. #5

    Re: Camera Characteristic Curve

    Quote Originally Posted by Terry Tedor View Post
    Would it be possible for you to reproduce the graphs using the same x axis scaling for both? As it is right now, you're presenting the data scaled differently. I'm not saying I have an explanation, I'm just curious what the data looks like when scaled the same. It's sort of like an apples vs oranges comparison.
    If I plot the data on a log log scale what I get is the following, but it does not give me any information concerning the behavior of the curve. loglog..pdf
    The same if I plot the data on a linear scale, I do not get any interesting information. lineare..pdf

  6. #6

    Re: Camera Characteristic Curve

    Hello Dave, and thanks for the welcome.

    I have actually covered a range of 31 stops from 1/8000s to 1/6s (sorry I was wrong on the 3s, they referred to another picture). I have kept the intesnity of the illumination constant and the ISO constant and I have not equalized the exposure. In fact, the photos I obtain by photographing a white object go from black for the 1/8000s exposure to white for the 1/6exposure.

    I was trying to test the linearity of the sensor, or better this was a test in order to tackle a more complex problem. After taking the photos and saving them as .png, using matlab, for each photo I obtain a set of 3 points (one for R, one for B and one for G) for each exposure time, and by plotting these points on the semi log scale I see that there is a region where the three channels behave linearly. My guess is that I should obtain the same chromaticity for all the photos taken with exposure times falling within this linear range, since for these photos only the luminance should change but not the chromaticity. This guess should help me once I transform the RGB channels in xyY coordinates.

    My problem is that when I take a photo of a coloured object instead of a white one the 3 channels behave linearly in a certain range of exposure times, but each in a different way (i.e. with very different slopes), and very differently from the case of the photos for the white object (where the 3 channels have the same slope).

    By the way I am using a Nikon D70, it is quite old, but at the moment it is the only camera I have in the lab!

    I hope I have answered you questions

    thanks

    marta

  7. #7
    Administrator
    Join Date
    Apr 2008
    Location
    California, USA
    Posts
    1,473
    Real Name
    Sean

    Re: Camera Characteristic Curve

    Quote Originally Posted by ceciliam View Post
    My problem is that when I take a photo of a coloured object instead of a white one the 3 channels behave linearly in a certain range of exposure times, but each in a different way (i.e. with very different slopes), and very differently from the case of the photos for the white object (where the 3 channels have the same slope).
    Why is this a problem? When photographing a given colored object, the relative ratios of R, G and B will not necessarily stay the same at different exposures. It's in fact a much more complex relationship that depends on the characteristics of the color space (as Rick mentioned). That's why each color channel has a different slope. Only the lightness should have a roughly linear slope (as you've observed).

    Now, get out and take some photos!

  8. #8
    Moderator Dave Humphries's Avatar
    Join Date
    May 2008
    Location
    Windsor, Berks, UK
    Posts
    16,737
    Real Name
    Dave Humphries :)

    Re: Camera Characteristic Curve

    Quote Originally Posted by ceciliam View Post
    I have actually covered a range of 31 stops from 1/8000s to 1/6s
    Hi Marta,

    I don't think so, a stop is a doubling or halving, so count the number of halvings to get from 1/8000 to 1/6.

    1st = 1/4000s, 2nd = 1/2000s and so on; 1/1000, 1/500, 1/250, 1/125, 1/60, 1/30, 1/15, 1/8, that's 10 stops (or just over to get to 1/6s), which is about what I'd expect from a D70 - you correctly guessed my next question there

    As for the technical stuff, I'll leave that to someone else to answer. I'm not familiar with the png format or the converter you are using, so I don't think I'll be much help.

    Cheers,

  9. #9
    New Member Tim Lookingbill's Avatar
    Join Date
    Feb 2010
    Location
    New Braunfels, Texas
    Posts
    4
    Real Name
    Tim Lookingbill

    Re: Camera Characteristic Curve

    I'm not a scientist. I base my understanding of digital camera's on what I've read and observed on the web and from experimenting with my own DSLR, a Pentax K100D. I've been wanting to examine the same thing as you only not in a lab environment.

    I've come to the conclusion that consumer grade DSLR's are not repeatably calculable scientific instruments. They are not quite that linear and predictable. There are too many variables and sensitivities involving light source voltage fluctuation, lens coatings, sensor heat buildup along with the quality of the A/D converter and software used to "interpret" the data that getting a consistent and predictable characterization of the sensor would have to be measured electronically at each photosite after the captured photons go through Bayer filtering. You'ld have to ask the manufacturer (Nikon) for that information and they ain't talking.

    Interpretation by software including your matlab can't tell the true story about a sensor's linear response. I'm not familiar with matlab but even if it's capable of measuring the RGB data before demosaicing, it's still just an interpretation because it's measuring the data after going through the A/D converter which is regulated by an electric current from the camera's battery also subject to fluctuation, instability and heat buildup. Quality of the A/D converter comes into play as well.

    I've even found among third party Raw converters that offer a linear setting where all the tone curves and color profile descriptors are turned off deliver different results with the same Raw image file. It's all interpretation after the sensor's electronic response goes through the A/D convertor.

    In short a consumer grade DSLR is not a precision instrument.
    Last edited by Tim Lookingbill; 20th February 2010 at 06:02 PM.

  10. #10

    Join Date
    Oct 2009
    Location
    Maryland, USA
    Posts
    1,015
    Real Name
    Rick

    Re: Camera Characteristic Curve

    Quote Originally Posted by Tim Lookingbill View Post
    I've come to the conclusion that consumer grade DSLR's are not repeatably calculable scientific instruments. They are not quite that linear and predictable. There are too many variables and sensitivities involving light source voltage fluctuation, lens coatings, sensor heat buildup along with the quality of the A/D converter and software used to "interpret" the data that getting a consistent and predictable characterization of the sensor would have to be measured electronically at each photosite after the captured photons go through Bayer filtering. You'ld have to ask the manufacturer (Nikon) for that information and they ain't talking.
    I think Tim's point here is a good one. There's at least one "black box" here: the camera has behavior that isn't fully documented for what you're doing. The raw converter is probably another black box, although you can probably avoid this, using one of the raw readers from one of the astronomy sites.

    But it means you have to reverse engineer what's going on in your lab setup, which will mean far more work for you.

    If you want to do experiments with a colorimeter, and want to avoid spending a lot of money, perhaps the HCFR colorimeter would help. It's free software, and can accept input from some commercial sensors that are much less expensive than a DSLR. There are also instructions for building your own sensor, if you're into building electronic circuitry.

    Cheers,
    Rick

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •