#include "cv.h"
#include "highgui.h"
#include
#include
//#include "otsu.h"
int main(int argc,char** argv)
{
IplImage *src,*gray,*bw,*dst;
CvMemStorage* storage=cvCreateMemStorage(0);
CvSeq* contour=0;
char* filename=argc==2?argv[1]:"5.jpg";
if(!filename)
printf("can't open the file:%d\n",filename);
src=cvLoadImage("D:\\xsz\\Debug\\图片\\3.jpg",1);
cvNamedWindow("image",1);
cvShowImage("image",src);
gray=cvCreateImage(cvSize(src->width,src->height),src->depth,1);
cvCvtColor(src,gray,CV_BGR2GRAY);
int hei,wid;
hei=gray->height;//注意此处是gray,otsu中要用到hei,wid,已在otsu.h中全局定义;
wid=gray->width;
printf("图像的高为:%d,宽为:%d\n\n