问题补充说明:#include#include#includeint main(int argc,char** argv){CvPoint center;double scale=-3;IplImage* image=argc==2?cvLoadImage(argv[1]):0;if(!image)return -1;center=cvPoint(image->width/2,image->height/2);for(int i=0;iheight;i++)for(int j=0;jwidth;j++){double dx=(double)(j-center.x)/center.x;double dy=(double)(i-center.y)/center.y;double weight=exp((dx*dx+dy*dy)*scale);uchar* ptr=&CV_IMAGE_ELEM(image,uchar,i,j*3);ptr[0]=cvRound(ptr[0]*weight);ptr[1]=cvRound(ptr[1]*weight);ptr[2]=cvRound(ptr[1]*weight);}cvSaveImage("copy.png",image);cvNamedWindow("test",1);cvShowImage("test",image);cvWaitKey();return 0;}
uchar应该char种类型全称应该unsignedchar意识无符号字符型和uint(unsignedint)意思样
版权声明:文章由 百问九 整理收集,来源于互联网或者用户投稿,如有侵权,请联系我们,我们会立即处理。如转载请保留本文链接:https://www.baiwen9.com/article/379387.html