#ifdef _CH_
#pragma package<opencv>
#endif
#pragma comment(lib,"cv.lib")
#pragma comment(lib,"cvcam.lib")
#pragma comment(lib,"cxcore.lib")
#pragma comment(lib,"highgui.lib")
#include <cv.h>
#include <cvcam.h>
#include <cxcore.h>
#include <highgui.h>
void main()
{
//以灰度方式载入图像
IplImage *src_image=cvLoadImage("1.jpg",CV_LOAD_IMAGE_GRAYSCALE);
assert(src_image!=NULL);
IplImage *dst_image=cvCreateImage(cvGetSize(src_image),IPL_DEPTH_16S,1);
assert(dst_image!=NULL);
//执行拉普拉斯变换
cvLaplace(src_image,dst_image,7);
//创建窗口
cvNamedWindow("Show_Src");
cvNamedWindow("Show_Dst");
//显示图像
cvShowImage("Show_Src",src_image);
cvShowImage("Show_Dst",dst_image);
cvWaitKey();
//释放资源
cvReleaseImage(&src_image);
cvReleaseImage(&dst_image);
cvDestroyWindow("Show_Src");
cvDestroyWindow("Show_Dst");
}