Face Detection from IronPython: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
mNo edit summary |
||
Line 1: | Line 1: | ||
Note: This example is base on Emgu CV 1.4.0.0 | Note: This example is base on Emgu CV 1.4.0.0 | ||
Assume that you have follow | Assume that you have follow everything from [[Setting up Emgu CV and IronPython]]. This example is going to show you how to do face detection from IronPython. | ||
First copy the lena.jpg file from [[OpenCV]] sample directory to the IronPython folder. Then copy the haarcascade_frontalface_alt2.xml file to the IronPython folder as well. | First copy the lena.jpg file from [[OpenCV]] sample directory to the IronPython folder. Then copy the haarcascade_frontalface_alt2.xml file to the IronPython folder as well. Then follow the steps below: | ||
*Create the detector by calling | *Create the detector by calling |
Revision as of 00:18, 31 October 2008
Note: This example is base on Emgu CV 1.4.0.0
Assume that you have follow everything from Setting up Emgu CV and IronPython. This example is going to show you how to do face detection from IronPython.
First copy the lena.jpg file from OpenCV sample directory to the IronPython folder. Then copy the haarcascade_frontalface_alt2.xml file to the IronPython folder as well. Then follow the steps below:
- Create the detector by calling
detector = HaarCascade("haarcascade_frontalface_alt2.xml")
- Read the image
image = Image[Bgr, Byte]("lena.jpg")
- Detect the objects
objectsDetected = image.Convert[Gray, Byte]().DetectHaarCascade(detector)[0]
- Draw the objects
for obj in objectsDetected: image.Draw[float](obj, Bgr(255, 255, 255), 1)
- Display the image
ImageViewer.Show(image)