title: cvtcolor in Cv2 - no attribute
body: <p>I'm writing a program to collect a series of images from a USB microscope and generate an average as a way of denoising.  I'm having to convert the image into a numpy array, sum the pixels then divide before converting back to an image.</p>
  
  <p>Somewhere along the line the channels get mixed so my output is BGR not RGB, I'm trying to use cvtcolor to rectify that but get the error:</p>
  
  <blockquote>
    <p>---> 55  RgbImage = cv2.cvtcolor(ave_image,cv2.COLOR_BGR2RGB)
        56  return RgbImage</p>
    
    <p>AttributeError: 'module' object has no attribute 'cvtcolor'</p>
  </blockquote>
  
  <p>Presumably cvtcolour isn't being imported from CV2 but I can't see why. Here's the relevant code sections. </p>
  
  <p>Lastly, although the averaging works fine, is there a more elegant way to do it? I need a simple mean not a weighted average. </p>
  
  <pre><code>import os, numpy, PIL
  from PIL import Image
  import cv2
  import time
  frameaverage=5
  
  
   def average_image():
  
   arr=numpy.zeros((h,w,3),numpy.float)
   # Build up average pixel intensities as floating
   for im in xrange(frameaverage):
      camera_capture = get_image()
      imarr=numpy.array(camera_capture,dtype=numpy.float)
      arr=arr+imarr/frameaverage
   # Round values convert to 8-bit integer
   arr=numpy.array(numpy.round(arr),dtype=numpy.uint8)
   ave_image=Image.fromarray(arr,mode="RGB")
   RgbImage = cv2.cvtcolor(ave_image,cv2.COLOR_BGR2RGB)
   return RgbImage
  </code></pre>