Setting up Emgu CV and IronPython: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
Updated ironpython instruction for Emgu CV 2.2 and IronPython 2.7 |
||
(4 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
To use [[Emgu CV]] with IronPython, please follow the steps below: | To use [[Emgu CV]] 2.2 with IronPython (2.7) on Windows, please follow the steps below: | ||
* Download IronPython | * Download IronPython installable from its official web page http://ironpython.codeplex.com/ | ||
* | * Run IronPython-{version}.msi and follow the instruction to install IronPython | ||
* | * Go to the folder that contains both | ||
** | ** OpenCV binaries (all the "opencv_{module name}{version}.dll" files) | ||
** | ** Emgu CV binaries (Emgu.CV.dll, Emgu.CV.UI.dll Emgu.Util.dll, ZedGraph.dll) | ||
* Copy Emgu.CV.dll | * Copy EmguInit.py to the same Folder. The EmguInit.py contains the following code | ||
<source lang="python"> | |||
* | import clr | ||
clr.AddReferenceToFile("Emgu.Util.dll") | |||
clr.AddReferenceToFile("Emgu.CV.dll") | |||
clr.AddReferenceToFile("Emgu.CV.ML.dll") | |||
clr.AddReferenceToFile("Emgu.CV.UI.dll") | |||
from Emgu.CV import * | |||
from Emgu.CV.UI import * | |||
from Emgu.CV.Structure import * | |||
from System import * | |||
</source> | |||
* Run the ipy.exe program. (On Mono, call "mono ipy.exe") | * Run the ipy.exe program. (On Mono, call "mono ipy.exe") | ||
Line 18: | Line 27: | ||
<source lang="python"> | <source lang="python"> | ||
import EmguInit | import EmguInit | ||
from | from EmguInit import * | ||
</source> | </source> | ||
* You are ready to go. | |||
* You are ready to go. Now try to run the following simple program | |||
<source lang="python"> | |||
image = Image[Gray, Byte](320, 240) | |||
image.SetRandNormal(MCvScalar(100), MCvScalar(100)) | |||
ImageViewer.Show(image) | |||
</source> | |||
* The next step you might want to try is the [[Face Detection from IronPython]] example. |
Latest revision as of 21:04, 28 October 2010
To use Emgu CV 2.2 with IronPython (2.7) on Windows, please follow the steps below:
- Download IronPython installable from its official web page http://ironpython.codeplex.com/
- Run IronPython-{version}.msi and follow the instruction to install IronPython
- Go to the folder that contains both
- OpenCV binaries (all the "opencv_{module name}{version}.dll" files)
- Emgu CV binaries (Emgu.CV.dll, Emgu.CV.UI.dll Emgu.Util.dll, ZedGraph.dll)
- Copy EmguInit.py to the same Folder. The EmguInit.py contains the following code
import clr
clr.AddReferenceToFile("Emgu.Util.dll")
clr.AddReferenceToFile("Emgu.CV.dll")
clr.AddReferenceToFile("Emgu.CV.ML.dll")
clr.AddReferenceToFile("Emgu.CV.UI.dll")
from Emgu.CV import *
from Emgu.CV.UI import *
from Emgu.CV.Structure import *
from System import *
- Run the ipy.exe program. (On Mono, call "mono ipy.exe")
- From the IronPython command line, run the following command:
import EmguInit
from EmguInit import *
- You are ready to go. Now try to run the following simple program
image = Image[Gray, Byte](320, 240)
image.SetRandNormal(MCvScalar(100), MCvScalar(100))
ImageViewer.Show(image)
- The next step you might want to try is the Face Detection from IronPython example.