Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to evaluate light linearity and additivity with a camera

Hi, lastly I am questioning the linearity and additivity of light propagation in images. As the title says I would like to see what is the contribution of light to image pixel intensity values and if the linearity and additivity of light is a valid assumption to be done or not. For that reason I established the following experiment. Imagine a room , where I set up a camera in top view (i.e. birds eye view) with two light sources of same type and light installed on two of the room corners. Then I took some images where the room was dark, i.e. light sources switched off (really hard to achieve that in reality since always there is gonna be a kind of light that the camera sensor can receive, but lets consider that I managed to do that), then only the first light source was switched on, then only the second light source was switched on and finally when both lights were switched on. These images were captured in rgb 8-bit depth (normal images normal images that can be acquired with a cheap camera sensor) with auto-setting fixed (i.e. exposure, gain, white-balance, etc...). Then I took 500 pixels and plotted their pixel intensity values for a case of one light source, second light source, both light sources and dark:

image description

from the above image what you can observe is that I have a lot of noise when the lights are off (purple graph, ideally this should be close to zero). Then if we consider that the light works additive (in the simpler case) then the yellow graph should be as much higher from the blue graph as the blue from the orange graph respectively (again this in the ideal case). However, it is not you can see that in the plot below:

image description

what you see here is

blue graph = yellow - purple (from the first graph)

orange graph = (blue - purple) + (orange - purple)

and these two ideally should be equal if additivity was the case, however we can say that they have a kind of similar pattern. However, it is obvious that what I am doing is not working. Then I searched a bit further and I found this discussion here. Apparently in order to see such a behaviour I need a better camera and to capture pixels values in raw format and in higher bit-depth. To be honest I am not sure if what I am doing makes sense, also I guess that beforehand I need a light calibration procedure with which I am not also familiar. Therefore, my question is if someone has any experience on how to check the above.

@pklab I know that you are working with different camera setups, so I do not know if you have some experience in such a subject. If you have I would be glad to hear any suggestions. Of course anyone that might have a clue is welcome to contribute to the discussion.

Thanks.

How to evaluate light linearity and additivity with a camera

Hi, lastly I am questioning the linearity and additivity of light propagation in images. As the title says I would like to see what is the contribution of light to image pixel intensity values and if the linearity and additivity of light is a valid assumption to be done or not. For that reason I established the following experiment. Imagine a room , where I set up a camera in top view (i.e. birds eye view) with two light sources of same type and light installed on two of the room corners. Then I took some images where the room was dark, i.e. light sources switched off (really hard to achieve that in reality since always there is gonna be a kind of light that the camera sensor can receive, but lets consider that I managed to do that), then only the first light source was switched on, then only the second light source was switched on and finally when both lights were switched on. These images were captured in rgb 8-bit depth (normal images normal images that can be acquired with a cheap camera sensor) with auto-setting fixed (i.e. exposure, gain, white-balance, etc...). Then I took 500 pixels and plotted their pixel intensity values for a case of one light source, second light source, both light sources and dark:

image description

from the above image what you can observe is that I have a lot of noise when the lights are off (purple graph, ideally this should be close to zero). Then if we consider that the light works additive (in the simpler case) then the yellow graph should be as much higher from the blue graph as the blue from the orange graph respectively (again this in the ideal case). However, it is not you can see that in the plot below:

image description

what you see here is

blue graph = yellow - purple (from the first graph)

orange graph = (blue - purple) + (orange - purple)

and these two ideally should be equal if additivity was the case, however we can say that they have a kind of similar pattern. However, it is obvious that what I am doing is not working. Then I searched a bit further and I found this discussion herethis discussion here. Apparently in order to see such a behaviour I need a better camera and to capture pixels values in raw format and in higher bit-depth. To be honest I am not sure if what I am doing makes sense, also I guess that beforehand I need a light calibration procedure with which I am not also familiar. Therefore, my question is if someone has any experience on how to check the above.

@pklab I know that you are working with different camera setups, so I do not know if you have some experience in such a subject. If you have I would be glad to hear any suggestions. Of course anyone that might have a clue is welcome to contribute to the discussion.

Thanks.

How to evaluate light linearity and additivity with a camera

Hi, lastly I am questioning the linearity and additivity of light propagation in images. As the title says I would like to see what is the contribution of light to image pixel intensity values and if the linearity and additivity of light is a valid assumption to be done or not. For that reason I established the following experiment. Imagine a room , where I set up a camera in top view (i.e. birds eye view) with two light sources of same type and light installed on two of the room corners. Then I took some images where the room was dark, i.e. light sources switched off (really hard to achieve that in reality since always there is gonna be a kind of light that the camera sensor can receive, but lets consider that I managed to do that), then only the first light source was switched on, then only the second light source was switched on and finally when both lights were switched on. These images were captured in rgb 8-bit depth (normal images normal images that can be acquired with a cheap camera sensor) with auto-setting fixed (i.e. exposure, gain, white-balance, etc...). Then I took 500 pixels and plotted their pixel intensity values for a case of one light source, second light source, both light sources and dark:

image description

from the above image what you can observe is that I have a lot of noise when the lights are off (purple graph, ideally this should be close to zero). Then if we consider that the light works additive (in the simpler case) then the yellow graph should be as much higher from the blue graph as the blue from the orange graph respectively (again this in the ideal case). However, it is not you can see that in the plot below:

image description

what you see here is

blue graph = yellow - purple (from the first graph)

orange graph = (blue - purple) + (orange - purple)

and these two ideally should be equal if additivity was the case, however we can say that they have a kind of similar pattern. However, it is obvious that what I am doing is not working. Then I searched a bit further and I found this discussion here. Apparently in order to see such a behaviour I need a better camera and to capture pixels values in raw format and in higher bit-depth. To be honest I am not sure if what I am doing makes sense, also I guess that beforehand I need a light calibration procedure with which I am not also familiar. Therefore, my question is if someone has any experience on how to check the above.

@pklab I know that you are working with different camera setups, so I do not know if you have some experience in such a subject. If you have I would be glad to hear any suggestions. Of course anyone that might have a clue is welcome to contribute to the discussion.

Thanks.


Update:

Ok, I did another experiment. I used a better camera Basler scA1300-32gc - scout Series and then got again some images in the same principle as I described above, i.e. again fixed camera settings (e.g. exposure, gain, etc...) but now I took the images in Bayer BG 16bit format where the 12 bits are active. Therefore, higher bit-depth. Then I again transformed my rgb image to grayscale (I am not sure how much this procedure affects the result) and measure the intensity values of the pixels. The result as you can see bellow is more or less the same as previous:

image description

and

image description

Another experiment that I tried is that I tried to solve a simple linear least square problem where my input images should a combination of bases times coeffs:

image description

I is the input images (three images two describing individually each light source and one with both lights), U is my bases which it is given and it is two images describing individually each light source and I am looking for the V which is my coeffs.

image description

image description

which multiplied with my given bases should return me an approximation of my input images which should give me a low residual error compared to the input images. The extracted coeffs can be seen below:

image description

If we want to translate this. The first two columns are fine since it tells me that the coefficient with my first basis describe mostly my image the same for the second column while correctly the third column tells me that my third image is a combination of both bases. However, if my system was linear shouldn't be the sum of two coeffs of the third column be equal to 1 or close with a small error as it is in column 1 and 2. 0.7159 + 0.7338 = 1.4497 has a quite high error hasn't it?

What do you think? I might also be wrong somewhere, therefore I am open to any suggestions or corrections.