Difference between revisions of "Setting up Emgu CV and IronPython"
Jump to navigation
Jump to search
(Updated ironpython instruction for Emgu CV 2.2 and IronPython 2.7) |
|||
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 EmguInit.py to the same Folder. The EmguInit.py contains the following code | * Copy EmguInit.py to the same Folder. The EmguInit.py contains the following code | ||
<source lang="python"> | <source lang="python"> | ||
import clr | import clr | ||
+ | clr.AddReferenceToFile("Emgu.Util.dll") | ||
clr.AddReferenceToFile("Emgu.CV.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 import * | ||
from Emgu.CV.UI import * | from Emgu.CV.UI import * | ||
+ | from Emgu.CV.Structure import * | ||
from System import * | from System import * | ||
</source> | </source> | ||
Line 27: | Line 29: | ||
from EmguInit import * | from EmguInit import * | ||
</source> | </source> | ||
− | * You are ready to go. The next step you might want to try is the [[Face Detection from IronPython]] example. | + | |
+ | * 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.