项目作者: solivr

项目描述 :
Cython wrapper for cv::Mat class
高级语言: Python
项目地址: git://github.com/solivr/cython_opencvMat.git
创建时间: 2017-02-09T11:15:41Z
项目社区:https://github.com/solivr/cython_opencvMat

开源协议:MIT License

下载


cython wrapper np.array <-> cv::Mat

Implementation of cython wrapper to allow the convertion between a numpy.array and a cv::Mat and the other way arround (cv::Mat to numpy.array).

To build, run python setup.py build_ext --inplace.

Then try :

  1. import opencv_mat
  2. from scipy import misc
  3. im_np = misc.imread(filename/image)
  4. im_np2Mat2np = opencv_mat.np2Mat2np(im_np)

We get back im_np2Mat2np which is the same as im_np.

Feel free to integrate the cdef np2Mat and cdef Mat2np functions to your code!

Used with Python 3.5 and Opencv 3.2