Happy Shrimp
http://blog.csdn.net/lights_joy/(QQ group: Visual embedlinux Tools 375515651)
Welcome reprint, but please keep the author information
For a long time did not touch the image processing things, recently just need to have this demand, hope to have a more useful development environment. In the school to do image processing has been using matlab, but now just do velt Development, try to use Vs2013+python Construct a development environment that is suitable for your own use.
Next, try using SWIG to automatically encapsulate the C + + interface as a Python - usable PYD , the previous factorial code is still an example.
first fromswig.orgDownloadswig-win-3.0.5, which already contains theSwig.exe, unzip it toC:\Python27\swigwin-3.0.5, and then add this directory to thePATHthe environment variable.
in the Pyext The project adds a pyext.i the file, the contents are as follows:
/* FILE:PYEXT.I */%module pyext%inline%{int Fact (int n);%}
will be pyext.i to configure for custom builds:
To configure the build step:
Swig Auto-generated PyExt.cpp The output functions of the module are defined in:
/*----------------------------------------------- @ (target): = _pyext.so ------------------------------- -----------------*/#if py_version_hex >= 0x03000000# define swig_init pyinit__pyext#else# define Swig_init init_pyext#endif#define swig_name "_pyext"
can see SWIG the generated name was taken with the _ , do not match our project name, modify it, and remove the underscore:
/*----------------------------------------------- @ (target): = _pyext.so ------------------------------- -----------------*/#if py_version_hex >= 0x03000000# define Swig_init pyinit_pyext#else# define SWIG _init initpyext#endif#define swig_name "Pyext"
Test it:
Debug it:
Get!
??
The application of vs2013 in image processing (8): Automatic packaging and C + + interface with Swig