opencv添加高斯噪声问题
代码如下:voidCopencv3Dlg::OnBnClickedButton3(){//TODO:IplImage*image=NULL;if(image)cvRele...
代码如下:
void Copencv3Dlg::OnBnClickedButton3(){ // TODO:
IplImage *image=NULL;
if(image) cvReleaseImage(&image); image = cvLoadImage("D:\\demo.jpg",1);
IplImage *img=cvCreateImage(cvGetSize(image),8,1); cvZero(img); //img为高斯噪声后图像指针// CvRNG rng = cvRNG(-1); //初始化随机数发生器cvRandArr(&rng, img, CV_RAND_NORMAL, cvScalarAll(0), cvScalarAll(15));cvAdd(image, img, img);DrawPicToHDC(img, IDC_STATIC);cvReleaseImage(&img);
}
请问,是哪里错了,我是初学者,望指点。谢谢啦 展开
void Copencv3Dlg::OnBnClickedButton3(){ // TODO:
IplImage *image=NULL;
if(image) cvReleaseImage(&image); image = cvLoadImage("D:\\demo.jpg",1);
IplImage *img=cvCreateImage(cvGetSize(image),8,1); cvZero(img); //img为高斯噪声后图像指针// CvRNG rng = cvRNG(-1); //初始化随机数发生器cvRandArr(&rng, img, CV_RAND_NORMAL, cvScalarAll(0), cvScalarAll(15));cvAdd(image, img, img);DrawPicToHDC(img, IDC_STATIC);cvReleaseImage(&img);
}
请问,是哪里错了,我是初学者,望指点。谢谢啦 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询