/*================================================================== = 代码内容:最大熵阈值分割 = 修改日期:2009-3-3 = 作者:crond123 = 博客:http://blog.youkuaiyun.com/crond123/ = E_Mail:crond123@163.com ====================================================================*/ #include "stdafx.h" #include "cv.h" #include "highgui.h" #pragma comment(lib,"highgui.lib") #pragma comment(lib,"cv.lib") #pragma comment(lib,"cvaux.lib") #pragma comment(lib,"cxcore.lib") int HistogramBins = 256; float HistogramRange1[2]={0,255}; float *HistogramRange[1]={&HistogramRange1[0]}; typedef enum {back,object} entropy_state; double caculateCurrentEntropy(CvHistogram * Histogram1,int cur_threshold,entropy_state state) { int start,end; if(state == back) { sta