السلام عليكم
هذا هو الcode
#include <cv.h>
#include <highgui.h>
#include <math.h>
int 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;i<image->height;i++)
for(int j=0;j<image->width;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[2]*weight); }
cvSaveImage( "copy.png", image );
cvNamedWindow( "test", 1 );
cvShowImage( "test", image );
cvWaitKey();
return 0;
}قمت بتطبيق البرنامج ورأيت النتيجة ، وهي وضع لون اسود في الزوايا وعلى اطراف الصورة.
السؤال هو كيف قام بذلك ؟
