opencv源代码不就有?你去查cvMatchShape 里面有计算hu矩的源代码。
这里有你要的问题答案,如果不是,在问,http://blog.csdn.net/shandianling/article/details/6456097