title: Draw text in OpenCV and save it to file. Showing Blank image
body: <p>I am very new to opencv. Here I am trying to create an Image which will be a shape made of a string with 0's and 1's (The function random_shape generates that string). So the string is to be typed on top of a white background . Here I am able to create a White Background Image but unable to add text in front of it. It just creates a blank image. It also gives a segmentation fault if I give it different coordinates.
  Any Help is Appreciated .</p>
  
  <pre><code>font = cv2.FONT_HERSHEY_SIMPLEX    
  blank_image = np.zeros((100,100,3), np.uint8)                                                                    
  cv2.putText(blank_image,random_shape(100,100),(0,0), cv2.FONT_HERSHEY_SIMPLEX, 2,(0,255,0))
  blank_image[:,0:1*100] = (255,255,255)
  
  image=cv2.cv.fromarray(blank_image)
  cv2.cv.SaveImage('pic.jpg', image)
  </code></pre>
  
  <p>Update : I have changed my code to </p>
  
  <pre><code>blank_image = np.zeros((512,512,3), np.uint8)
  blank_image[:,0:512] = (255,255,255)
  cv2.putText(blank_image,random_shape(100,100)[0:100],(0,0), cv2.FONT_HERSHEY_\
  SIMPLEX, 0.1,(0,0,0),cv2.CV_AA)
  image=cv2.cv.fromarray(blank_image)
  cv2.cv.SaveImage('pic.jpg', image)
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/I5FHH.jpg" alt="enter image description here"></p>
  
  <p>It seems to be something garbled (its some sort of text with a line) instead of numbers. The size of the text also appears large.Any Help !!</p>