How to convert wand image object to open cv image (numpy array)
问题 I have imported wand using the following code from wand.image import Image as WandImage from wand.color import Color with WandImage(filename=source_file, resolution=(RESOLUTION,RESOLUTION)) as img: img.background_color = Color('white') img.format = 'tif' img.alpha_channel = False How can i convert img object to open cv (cv2) image object in python? 回答1: You would simply write to a byte-array buffer, and pass to cv2.imdecode . from wand.image import Image as WandImage from wand.color import