2
\$\begingroup\$

I'm working on an application that requires taking photos with a machine vision camera in outdoor areas with a wide range of lighting conditions. I have been taking some sample photos and no matter what exposure / gamma / gain settings I am trying it seems like the light parts of my images are too bright, and the dark parts are too dark.

The camera I am using quotes excellent dynamic range from what I can tell, 65dB or 20+ stops. Also a lens I used to take some sample photos.

Some basic solutions have tried:

  • Normalize photo in YUV color space (in the Y column)
  • Normalize photo in HSV space (in the V column) Was not satisfied with either of these.

Does anyone have any experience using a machine vision camera in this regard? If so what is a good thing to look for in image postprocessing / lens selection that might make the photos look as pleasing as if they came off an action cam or smartphone?

If this is not the proper forum to ask a machine vision question, please let me know! I'm new to this stack exchange thing.

Image that I took on a typical handeheld camera: handheld action cam picture

Compared to the one I took on the machine vision cam: machine vision cam picture

\$\endgroup\$
5
  • \$\begingroup\$ Does your camera offer an auto-gain or auto-iso setting? Can you adjust gamma and choose which bits to display, if it offers more than 8 bits of depth per pixel? \$\endgroup\$ Commented Dec 19, 2023 at 0:02
  • \$\begingroup\$ looks like it might have up to 12 bits per pixel, but nothing more than that \$\endgroup\$ Commented Dec 19, 2023 at 15:51
  • \$\begingroup\$ That can make all the difference in how that is converted to 8 bit (it often is) . What is the image format you use/the camera supplies? \$\endgroup\$ Commented Dec 19, 2023 at 15:53
  • \$\begingroup\$ It uses a 10-bit ADC to convert. In our application we are using BayerRG8, need the throughput to be fairly low bitrate. We might be able to squeak by with RGB8 (triple the bitrate) but probably not. \$\endgroup\$ Commented Feb 12 at 15:34
  • \$\begingroup\$ For anyone else reading this....here is what I've done so far that helped: Turned the white balance of my camera on, reduce the target amount of brightness in my picture (in genicam, this is called the Luminance Target), and decreased the gamma from 1 to around 0.5. It makes the pictures appear slightly washed out but I've found this is the best way to get detail (so far) \$\endgroup\$ Commented Feb 12 at 15:34

3 Answers 3

-1
\$\begingroup\$

I have been taking some sample photos and no matter what exposure / gamma / gain settings I am trying it seems like the light parts of my images are too bright, and the dark parts are too dark.

Before we even speak about processing that depends on type of lighting (sunny or overcast, deep shadows or not). Most straightforward solution is to take one image with exposure short enough and aperture closed enough so that nothing is clipped (it's impossible to take image with no clipping in all conditions). If you cannot prevent from highlighted parts of image from being clipped with any kind of setup you have no other way than using ND filters.

Additionally you have IR and UV problem: your camera should not respond to anything below 400 and above 700nm to create pleasing image. You definitely need an UV+IR cut filter for it (there are two variants one of which has IR cut but there is no mention of UV. You should ask OEM about it).

Your sample image definitely has unblocked UV tint.

enter image description here

no matter what exposure / gamma / gain settings

Even basic image processing is not limited to those. After you obtained correct exposure you still need:

  • colour conversion using correct colour profile for your camera
  • white balance
  • contrast - not "gain", an S-shaped tonal curve

That is bare minimum to have pleasing image but that might fail if colour reproduction of your camera is terrible. What lens you are using makes no difference compared to these aspects unless it's a door eye.

If your OEM cannot supply a colour profile then you might try using QE graph I posted above to calculate some good linear colour profile. You can also improvise with RawTherapee using colour mixer but it will be complicated. Finding some common profile for Sony IMX226 is also a good idea, it's probably same CFA for all variants.

The camera I am using quotes excellent dynamic range from what I can tell, 65dB or 20+ stops.

  1. There is no commonly accepted definition of "dynamic range".
  2. Considering that your camera's ADC is 10 bit getting anything bigger than 10 stops of range from it is a giant stretch (depending on definition of dynamic range used) and probably implies temporal noise reduction.
\$\endgroup\$
7
  • \$\begingroup\$ thanks- I do not know yet whether I like this answer the most because it is correct or because it gave me hope to optimize my situation...but marking as correct for now because it gave me the most helpful information about my situation. I can reduce the exposure enough to make the bright parts not too bright...I will start there and then try to color balance for my colour profile \$\endgroup\$ Commented Dec 18, 2023 at 14:24
  • \$\begingroup\$ @CameraTuner2020 creating colour profile from scratch will be challenging, it's better to ask OEM if they have a good colour profile for this model. \$\endgroup\$ Commented Dec 18, 2023 at 17:07
  • \$\begingroup\$ @CameraTuner2020 in any case make sure to try RawTherapee to have good amount of control over image processing (I hope that your camera outputs DNG). You can even improvise a colour profile in it using "channel mixer". \$\endgroup\$ Commented Dec 18, 2023 at 17:08
  • \$\begingroup\$ Interestingly, your camera has spectral response specification ("quantum efficiency") which can be used to create colour profile using some tricks. I also learned from the graph that your camera has strong IR and UV response which definitely ruins colour reproduction. You will definitely an UV+IR cut filter. \$\endgroup\$ Commented Dec 18, 2023 at 17:11
  • 1
    \$\begingroup\$ After a month, just want to reflect here that the "unblocked UV tint" is just improper white balancing. White blocking UV / IR is something important, its not what is causing the crazy reds in my example images \$\endgroup\$ Commented Feb 12 at 15:39
-1
\$\begingroup\$

The camera I am using quotes excellent dynamic range from what I can tell, 65dB or 20+ stops.

Practically, no camera has that kind of dynamic range - even a top of the range full frame sensor like the Canon R3 has "only" 15 stops of dynamic range in actual use (source: DxoMark). There may be some theoretical world in which the sensor in that camera has 20 stops but it's not going to get anything like that in real-world use.

If so what is a good thing to look for in image postprocessing / lens selection that might make the photos look as pleasing as if they came off an action cam or smartphone

You can't - the sensor just isn't good enough. Sorry.

\$\endgroup\$
1
  • \$\begingroup\$ You did not define "dynamic range". DXOmark does not measure some common dynamic range (there is none), they are measuring DXOmark dynamic range. \$\endgroup\$ Commented Dec 17, 2023 at 12:41
-1
\$\begingroup\$

It doesn't look sunny in the first shot. You're not comparing like with like. A good DSLR would struggle to deal with the lighting in the second shot.

A smartphone would take multiple pictures & take the best bits from each, without it even telling you what it did.

Your 'regular camera' version of that is known as bracketing.
You take several pictures, each at different exposure settings, then merge them in software. People call this HDR [high dynamic range] which is a bit of a misnomer, because what it's actually making is a lower dynamic range image than was possible at input. It probably ought to be called Compressed Dynamic Range, which might prevent additional confusion with HDR screens/displays.

Here's fairly randomly chosen article comparing several HDR-capable apps - https://expertphotography.com/free-hdr-software/

\$\endgroup\$
1
  • \$\begingroup\$ smartphones do this, I get that- but my understanding is action cams do not. Unfortunately for my use case the camera will be in motion so this strategy of combining multiple images into one does not appear viable. Thanks for your comment though! \$\endgroup\$ Commented Dec 18, 2023 at 20:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.