title: cv2.imread flags not found
body: <p>I recently started working with openCV and python and decided to analyze some sample code to get an idea of how things are done.</p>
  
  <p>However, the sample code I found, keeps throwing this error:</p>
  
  <pre><code>Traceback (most recent call last):
  File "test.py", line 9, in &lt;module&gt;
  img = cv2.imread(sys.argv[1],cv2.CV_LOAD_IMAGE_COLOR) ## Read image file
  AttributeError: 'module' object has no attribute 'CV_LOAD_IMAGE_COLOR'
  </code></pre>
  
  <p>The code I was using can be found below:</p>
  
  <pre><code>import cv2
  import sys
  import numpy as np
  
  if len(sys.argv) != 2: ## Check for error in usage syntax
      print "Usage : python display_image.py &lt;image_file&gt;"
  
  else:
      img = cv2.imread(sys.argv[1], cv2.CV_LOAD_IMAGE_COLOR) ## Read image file
  
  if img == None: ## Check for invalid input
      print "Could not open or find the image"
  else:
      cv2.namedWindow('Display Window') ## create window for display
      cv2.imshow('Display Window', img) ## Show image in the window
      print "size of image: ", img.shape ## print size of image
      cv2.waitKey(0) ## Wait for keystroke
      cv2.destroyAllWindows() ## Destroy all windows
  </code></pre>
  
  <p>Is this a problem with my installation? I used <a href="http://www.samontab.com/web/2012/06/installing-opencv-2-4-1-ubuntu-12-04-lts/">this website</a> as a guide to install python and openCV.</p>