title: Convert base64 String to an Image that's compatible with OpenCV
body: <p>I'm trying to convert a base64 representation of a JPEG to an image that can be used with OpenCV. The catch is that I'd like to be able to do this without having to physically save the photo (I'd like it to remain in memory). Is there an updated way of accomplishing this? </p>
  
  <p>I'm using python 3.6.2 and OpenCV 3.3</p>
  
  <p>Here is a partial example of the type of input I'm trying to convert:</p>
  
  <blockquote>
    <p>/9j/4AAQSkZJRgABAQAASABIAAD/4QBYRXhpZgAATU0AKgAAAAgAAgESAAMAAAA....</p>
  </blockquote>
  
  <p>I've already tried the solutions provided by these questions, but keep getting the same "bad argument type for built-in operation" error:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/33754935/read-a-base-64-encoded-image-from-memory-using-opencv-python-library">Read a base 64 encoded image from memory using OpenCv python library</a></li>
  <li><a href="https://stackoverflow.com/questions/44324944/how-to-decode-jpg-image-from-memory">How to decode jpg image from memory?</a></li>
  <li><a href="https://stackoverflow.com/questions/34009524/python-alternate-way-to-covert-from-base64-string-to-opencv">Python: Alternate way to covert from base64 string to opencv</a></li>
  </ul>