Hey Kumar,
Although you need the pro version of unity to write plugins, you can easily call your external code even in the free version.
C# has a nifty feature called P/Invoke - you can use this method to call functions in an external c/c++ dll you write. The easiest way to do this is to expose c-style functions from your DLL:
__declspec(dllexport) bool __stdcall isHandOpen(unsigned char * imageMap, int x, int y)
and then P/Invoke them from C# within unity:
using System.Runtime.InteropServices;
class YourDllWrapper {
[DllImport("yourdllname")]
public static extern bool isHandOpen(IntPtr imageMap, int x, int y);
}
And then you can simply call your method:
ImageGenerator Image = OpenNIContext.OpenNode(NodeType.Image) as ImageGenerator;
YourDllWrapper.isHandOpen(Image.ImageMapPtr, hand.x, hand.y); // make sure to convert hand point to projective coordinates, not real world
Of course, as you wrote, you can also use Emgu directly in unity3d and implement your palm detector within unity. If you do that make sure to set the .NET compatibility level to 2.0 in the build settings, otherwise you'll get weird errors! (We have already successfully used Emgu with image map data in unity3d, please let me know if you would like some reference code for this)
Hope that helps,
Shlomo