cvSmooth
IplImage *image = cvLoadImage("r.bmp" ,1);
IplImage *gray = cvCreateImage(cvSize(image->width ,image->height) ,image->depth , 1);
IplImage *BLUR_NO_SCALE = cvCreateImage(cvSize(image->width ,image->height) ,image->depth , 1);
IplImage *BLUR = cvCreateImage(cvSize(image->width ,image->height) ,image->depth , 1);
IplImage *GAUSSIAN = cvCreateImage(cvSize(image->width ,image->height) ,image->depth , 1);
IplImage *MEDIAN = cvCreateImage(cvSize(image->width ,image->height) ,image->depth , 1);
IplImage *BILATERAL = cvCreateImage(cvSize(image->width ,image->height) ,image->depth , 1);
cvCvtColor(image , gray ,CV_BGR2GRAY);
cvShowImage("image " ,image);
cvShowImage("gray " ,gray);
cvSmooth(gray ,BLUR_NO_SCALE ,CV_BLUR_NO_SCALE ,9,9);
cvShowImage("CV_BLUR_NO_SCALE " ,BLUR_NO_SCALE);
cvSmooth(gray ,BLUR ,CV_BLUR ,9,9);
cvShowImage("CV_BLUR " ,BLUR);
cvSmooth(gray ,GAUSSIAN ,CV_GAUSSIAN ,9,9);
cvShowImage("CV_GAUSSIAN " ,GAUSSIAN );
cvSmooth(gray ,MEDIAN ,CV_MEDIAN ,9,9);
cvShowImage("CV_MEDIAN " ,MEDIAN);
cvSmooth(gray ,BILATERAL ,CV_BILATERAL ,9,9);
cvShowImage("CV_BILATERAL " ,BILATERAL );
cvWaitKey();
cvSmooth(image , outImage , smoothType , param1 )
image :原圖
outImage:輸出圖
smoothType :平滑方式
param1 :不用9會出錯,原因未明
IplImage *gray = cvCreateImage(cvSize(image->width ,image->height) ,image->depth , 1);
IplImage *BLUR_NO_SCALE = cvCreateImage(cvSize(image->width ,image->height) ,image->depth , 1);
IplImage *BLUR = cvCreateImage(cvSize(image->width ,image->height) ,image->depth , 1);
IplImage *GAUSSIAN = cvCreateImage(cvSize(image->width ,image->height) ,image->depth , 1);
IplImage *MEDIAN = cvCreateImage(cvSize(image->width ,image->height) ,image->depth , 1);
IplImage *BILATERAL = cvCreateImage(cvSize(image->width ,image->height) ,image->depth , 1);
cvCvtColor(image , gray ,CV_BGR2GRAY);
cvShowImage("image " ,image);
cvShowImage("gray " ,gray);
cvSmooth(gray ,BLUR_NO_SCALE ,CV_BLUR_NO_SCALE ,9,9);
cvShowImage("CV_BLUR_NO_SCALE " ,BLUR_NO_SCALE);
cvSmooth(gray ,BLUR ,CV_BLUR ,9,9);
cvShowImage("CV_BLUR " ,BLUR);
cvSmooth(gray ,GAUSSIAN ,CV_GAUSSIAN ,9,9);
cvShowImage("CV_GAUSSIAN " ,GAUSSIAN );
cvSmooth(gray ,MEDIAN ,CV_MEDIAN ,9,9);
cvShowImage("CV_MEDIAN " ,MEDIAN);
cvSmooth(gray ,BILATERAL ,CV_BILATERAL ,9,9);
cvShowImage("CV_BILATERAL " ,BILATERAL );
cvWaitKey();
cvSmooth(image , outImage , smoothType , param1 )
image :原圖
outImage:輸出圖
smoothType :平滑方式
param1 :不用9會出錯,原因未明
留言
張貼留言