python OpenCV jpeg compression in memory : <p>In OpenCV it is possible to save an image to disk with a certain jpeg compression. Is there also a way to do this in memory? Or should I write a function using <code>cv2.imsave()</code> that loads the file and removes it again from disk? If anyone knows a better way that is also fine.</p>

<p>The use case is real-time data augmentation. Using something else than OpenCV would cause possibly unnecessary overhead. </p>

<p>Example of desired function <code>im = cv2.imjpgcompress(90)</code> </p>
