title: Snapshot captured from a webcam video in matlab is appearing bluish in color
body: <p>I am working to recognise objects on the basis of distance between particular pixels in different color spaces, but am having trouble capturing an image. I want to get a snap shot from the live video from webcam but when I get this it is appearing bluish as it is shown in the image below: </p>
  
  <p><img src="https://i.stack.imgur.com/GM6pw.jpg" alt="enter image description here"></p>
  
  <p>Code I am using to capture the image:</p>
  
  <pre><code>obj=videoinput('winvideo',1);
  preview(obj); start(obj);
  A=getsnapshot(obj); 
  </code></pre>
  
  <p>The adapter I have is:</p>
  
  <pre><code>    in=imaqhwinfo(obj)
  
      in = 
  
                  AdaptorName: 'winvideo'
                   DeviceName: 'Webcam-101'
                    MaxHeight: 120
                     MaxWidth: 160
               NativeDataType: 'uint8'
                 TotalSources: 1
      VendorDriverDescription: 'Windows WDM Compatible Driver'
          VendorDriverVersion: 'DirectX 9.0'
  </code></pre>