[opencv]cvLaplace

IplImage* img = cvLoadImage( "test.jpg",CV_LOAD_IMAGE_GRAYSCALE );
   if(img==NULL) return (-1);
   IplImage* dst= cvCreateImage(cvGetSize(img),IPL_DEPTH_16S,1);
   if(dst==NULL) return (-1);

   cvLaplace(img,dst);

    //IplImage* img_edge = cvCreateImage(cvGetSize(img),IPL_DEPTH_8U,1);
	//cvConvertScaleAbs(img_edge , dst, 1 , 0);

   cvSaveImage("lpimg.jpg",dst);
   IplImage* img_edge = cvLoadImage( "lpimg.jpg",CV_LOAD_IMAGE_GRAYSCALE );
   /cvNamedWindow("org",CV_WINDOW_AUTOSIZE);
   //cvNamedWindow("after Laplace",CV_WINDOW_AUTOSIZE);
   //cvShowImage("org",img);
   //cvShowImage("after Laplace ",img_edge);
   cvWaitKey(0);
   cvReleaseImage(&img);
   cvReleaseImage(&dst);
   //cvReleaseImage(&img_edge);
   cvDestroyAllWindows();
   
   system("pause");

你可能感兴趣的:(opencv)