-
1 # mtglo16099
-
2 # 使用者8107137581681
//將標記處改成如下即可:
#include "stdafx.h"
//#include "stdafx.h"
#include
#include
#include
using namespace cv;
int main(int argc,char** argv)
{
IplImage *src=cvLoadImage("D:\\Lena.jpg",0);
if(src==NULL)
{
return 0;
}
cvNamedWindow("src", CV_WINDOW_AUTOSIZE);
cvShowImage("src", src);
IplImage *dst1_img=cvCreateImage(cvGetSize(src),IPL_DEPTH_8U,1);
cvSmooth (src, dst1_img, CV_GAUSSIAN, 11, 0, 0, 0);
cvNamedWindow ("Gaussian", CV_WINDOW_AUTOSIZE);
cvShowImage ("Gaussian", dst1_img);
IplImage *adaptive_img = cvCreateImage(cvGetSize(dst1_img),IPL_DEPTH_8U,1);
cvAdaptiveThreshold(dst1_img, adaptive_img, 255, ADAPTIVE_THRESH_GAUSSIAN_C, THRESH_BINARY, 7, 8); //函式改成這樣即可
cvNamedWindow ("adaptive", CV_WINDOW_AUTOSIZE);
cvShowImage ("adaptive", adaptive_img);
waitKey();
return 0;
}
回覆列表
//將標記處改成如下即可:#include "stdafx.h"//#include "stdafx.h"#include