You can find a sample project for this plugin in
\Samples\ImageStudio within the full download
Provides automatic and manual red-eye detection and correction. For automatic face and eye detection, OpenCV is required. Requires V3.2 or higher.
A NuGet package for this plugin is not available, due to the vast number of dependencies.
OpenCV does not support being used from multiple app domains. If you get a "Type Initializer Exception", restart the application pool and verify that it only contains 1 application, and that overlapped recycle is disabled.
You must disable overlapped recycling on the application pool running this plugin. OpenCV cannot handle multiple instances per plugin.
- r.eyes=x1,y1,x2,y2,a,x1,y1,x2,y2,a,… (groups of 5 coordinates, the fifth of which is the accuracy value)
- r.detecteyes=true - Responds with a JSON result. See the Faces plugin documentation for details.
- r.getlayout=true - Responds with image layout info in JSON. See the Faces plugin documentation for details.
- Add ImageResizer.Plugins.RedEye.dll to your project using Visual Studio. If you copy & paste to /bin, you'll need to also copy the files listed under Managed Dependencies.
<add name="RedEye" downloadNativeDependencies="true" />inside
- If you're not comfortable allowing the plugin to automatically download the correct bitness versions of the unmanaged dependencies, then set downloadNativeDependencies="false" and keep reading.
- Manually copy the required xml files to the /bin folder of your application (see Feature classification files)
- Manually copy all required dlls to the /bin folder of your application. (see Using the 2.3.1 pre-compiled binaries)
Feature classification files
You can download all the XML files in a single .ZIP file. You only need to copy the following into the /bin folder.
Using the 2.3.1 pre-compiled binaries
All dlls must match in bitness. All dlls are bitness specific. You can't run OpenCV x86 on an x64 app pool or vice versa.
Manually getting the binaries
The provided binaries are for OpenCV 2.3.1. If a newer version is released, you can get it yourself.
- Download either the x86 or x64 build of OpenCvSharp.
- Extract to a folder, and copy OpenCvSharp.dll and OpenCvSharp.dll.config. The x86 and x64 builds are actually identical.
- Go to SourceForge, the opencvlibrary project, the Files section, the opencv-win folder [Link].
- Select the latest version and download the OpenCV-[Version]-win-superpack.exe file.
- Extract it somewhere (you'll want to delete it later, it's over 1GB uncompressed)
Files to copy from extracted OpenCV-2.3.1-win-superpack package
- tbb.dll (From opencv\build\common\tbb\ia32\vc9 or opencv\build\common\tbb\intel64\vc9
- opencv_calib3d231.dll (From opencv\build\x64\vc9\bin or opencv\build\x86\vc9\bin)
This plugin (RedEye plugin) is part of the Elite Edition
Where is the plugins section?
<plugins> section is located in Web.config, and is nested inside the
<resizer> element, which is nested inside
<configuration>. For examples, see this sample Web.config file.
Where can I find the dll?
We prefer that you install via NuGet, but you can also find the plugin DLL files in the /dlls/release folder of your download.
How do I typically install a plugin via Web.Config?
- In Visual Studio, right click on your project and choose "Add reference". Browse to the plugin DLL and click "OK".
- In the <plugins> section of Web.config, insert <add name="PluginName" />
- Look at the plugin documentation to see what configuration options (if any) are available.