einzeln00
einzeln00

Reputation: 13

How to calculate gamma correction value from camera captured display test test image?

I want to develop an instrument device which can calculate a display system's gamma correction value, the idea is used a calibrated camera (e.g. raw output from DSLR through PTP over USB)to capture a gray scale gradient by value (gamma = 0, Y=0,1 step =bit(Y)), then use openCV or other image processing software to determine the actual gray values and compare to the input values to calculate gamma by curve fitting or something else.

could this be possible?

Upvotes: 1

Views: 2005

Answers (1)

gavinb
gavinb

Reputation: 20018

This is possible, certainly. It depends to a great extent on the capture device, specifically its accuracy and linearity. You mention it's a calibrated camera, but that could mean a number of things (eg. it is calibrated to a certain output colour space). Just by being calibrated doesn't tell you everything about its characteristics. For example, when reading the RAW data, do you get a linearisation table? Or do you have the OECF of the device? These are the two main ways you can transform the sensor output to a suitable metric for your gamma calculations.

The control loop might look something like:

Monitor ===> Sensor ===> LUT ==> Measurements
   ^                                  |
   |                                  |
   +<-- GPU <--- OS <-- Control SW ---+

where the sensor is your camera, and the LUT is either the given linearisation table or generated from the OECF.

You also need to ensure that between the graphics library, operating system, driver and GPU hardware, that you know exactly what transformations are being applied to your specified colours so you know just what is being displayed on the monitor. (For example, conversion between various RGB colour spaces).

Depending on the monitor gamut, you may find you get a different response for greyscale versus a single pure channel also, so you probably want to measure R, G, B and W separately.

Typically, dedicated sensors (photodiodes et al) are used for this sort of thing rather than a DSLR, but you can certainly start with that and see what kind of results you get!

You might be interested in these FLOSS tools:

  • ColorHug - display colorimeter; custom hardware and software
  • dispcalGUI - colour calibration software (supports a range of commercial hardware)

Upvotes: 1

Related Questions