convert openCV image into PIL Image in Python (for use with Zbar library)

后端 未结 4 672
长发绾君心
长发绾君心 2021-02-05 01:18

I\'m trying to use the Zbar library\'s QR code detection methods on images I extract with OpenCV\'s camera methods. Normally the QR code detection methods work with images (jpg,

4条回答
  •  忘掉有多难
    2021-02-05 02:02

    I think I may have found the answer. I'll edit later with results.

    OpenCV to PIL Image

    import Image, cv
    cv_im = cv.CreateImage((320,200), cv.IPL_DEPTH_8U, 1)
    pi = Image.fromstring("L", cv.GetSize(cv_im), cv_im.tostring())
    

    Source: http://opencv.willowgarage.com/documentation/python/cookbook.html

提交回复
热议问题