根据http://bbs.esrichina-bj.cn/ESRI/viewthread.php?tid=99423&highlight=
实现:
float get_ndvi(IplImage* img) { CvScalar Scalar; Scalar = cvSum(img);波段和 return float(Scalar.val[1]-Scalar.val[2])/float(Scalar.val[1]+Scalar.val[2]); }