imageimage-processingcamerav4l2intel-edison

How can you get a B&W or Grayscale image by adjusting webcam controls?


I have a cheap webcam connected (soldered don't ask why) to an Intel Edison. The problem is I am doing experiments with video capture and wanted a B&W or grayscale image from the camera (saves overheads/delays/bandwidth involved in programmatically converting a image into grayscale). As I can only have command line and no desktop I cannot use applications such as guc view neither can I unplug the camera and connect it to a linux pc. V4l-ctl lists the following webcam options.

brightness (int)    : min=-10 max=10 step=1 default=-1 value=-1
                       contrast (int)    : min=0 max=20 step=1 default=10 value=10
                     saturation (int)    : min=0 max=10 step=1 default=4 value=4
                            hue (int)    : min=-5 max=5 step=1 default=0 value=0
 white_balance_temperature_auto (bool)   : default=1 value=0
                          gamma (int)    : min=100 max=200 step=1 default=150 value=150
                           gain (int)    : min=32 max=48 step=1 default=34 value=34
           power_line_frequency (menu)   : min=0 max=2 default=2 value=1
      white_balance_temperature (int)    : min=2800 max=6500 step=1 default=6500 value=6492
                      sharpness (int)    : min=0 max=10 step=1 default=3 value=3
         backlight_compensation (int)    : min=0 max=1 step=1 default=0 value=0
                  exposure_auto (menu)   : min=0 max=3 default=3 value=3
              exposure_absolute (int)    : min=8 max=16384 step=1 default=512 value=625 flags=inactive

Can anyone with experience in Image acquisition help me set the V4l-Ctl parameters to obtain as image direct from the webcam that is as close as a B&W or Grayscale image gets using these parameters? I am in an endless loop of trial and error your help will be appreciated.


Solution

  • Never mind the close vote. I made the color saturation control to zero and the picture is now near grayscale.