استفسار بالماتلاب

السلام عليكم ورحمه الله وبركاته

اود السوال عن كيفيه تحويل الفايل .mat الى صوره عاديه بحيث يمكن ان تطبق عليها ايعازات image processing وجزاكم الله خيرا

اختكم ايه

وعليكم السلام

ان شاء الله ان اكون قد فهمت سؤالك
تقومين بتحميل الملف اولا الى الوورك سبيس بالامر التالي :

load filename

بعدها تنظرين الى نوع الملف فان كان double فلا بد من تحويله الى uint8 ليتم عرضه كصورة

اشكرك كثيرا على الاجابه السريعه

لكن حبيت استفسر اذا كانت لدي صوره ملونه (colour image(RGB وحبيت احدد اللون اللي قيمته

R=250 ,G=250 ,B=0 اجعلها 0= R=0, G=0, B يعني النقطه اللي قيمتها اللونيه 250 250 0 اجعلها 0 0 0 بالصوره ونطبع الصوره

وجزاك الله مني كل خير

ايه

[CENTER][SIZE=2]

اذا كان لدى احد الخوة اقتراح اخر بالنسبه للكود فليضعه لاثراء الموضوع …وهذا الكود الذي وضعته انا ولكن لا بد من اختيار موفق للصورة ليظهر الفرق
ملاحظه البرنامج سياخذ فتره نصف دقيقه لعمليه المعالجه



a= imread('test.bmp');
ar = a(: ,: ,1); % the red matrix
ag= a(: ,: ,2);   % the green matrix
[i,j] = size(ar);
for m = 1:i
    for n = 1:j
       p = impixel(a,m,n); % read  the pixel value
        if ( [p(1) p(2) p(3)]== [ 255 255 0] )
         ar(m,n) =0; ag(m,n)=0;
end;
    end
end
a(:,:,1) =ar; % save the value to the original matrix
a(:,:,2) = ag;
imshow(a)




[/size] R=250 ,G=250 ,B=0 اجعلها 0= R=0, G=0, B يعني النقطه اللي قيمتها اللونيه 250 250 0 اجعلها 0 0 0 بالصوره ونطبع الصوره [/center]

any one can help me with solve numerical method by matlab for ex.newton method and thanx
plz reply quickly:)

[CENTER][SIZE=2]

لم افهم اي طريقه للتحليل العددي لنيوتن تريد ولكن هذه احدى الطرق وهذا هو الكود لها



 % NEWTON-RAPHSON ALGORITHM 2.3               
 %
 % To find a solution to f(x) = 0 given an
 % initial approximation p0:
 %
 % INPUT:   initial approximation p0; tolerance TOL;
 %          maximum number of iterations NO.
 %
 % OUTPUT:  approximate solution p or a message of failure
 syms('OK', 'P0', 'TOL', 'NO', 'FLAG', 'NAME', 'OUP', 'F0');
 syms('I', 'FP0', 'D','x','s');
 TRUE = 1;
 FALSE = 0;
 fprintf(1,'This is Newtons Method
');
 fprintf(1,'Input the function F(x) in terms of x
');
 fprintf(1,'For example: cos(x)
');
 s = input(' ','s');
 F = inline(s,'x');
 fprintf(1,'Input the derivative of F(x) in terms of x
');
 s = input(' ');
 FP = inline(s,'x');
 OK = FALSE;
 fprintf(1,'Input initial approximation
');
 P0 = input(' '); 
 while OK == FALSE 
 fprintf(1,'Input tolerance
');
 TOL = input(' ');
 if TOL <= 0 
 fprintf(1,'Tolerance must be positive
');
 else 
 OK = TRUE;
 end
 end
 OK = FALSE;
 while OK == FALSE 
 fprintf(1,'Input maximum number of iterations - no decimal point
');
 NO = input(' ');
 if NO <= 0 
 fprintf(1,'Must be positive integer
');
 else 
 OK = TRUE;
 end
 end
 if OK == TRUE 
 fprintf(1,'Select output destination
');
 fprintf(1,'1. Screen
');
 fprintf(1,'2. Text file
');
 fprintf(1,'Enter 1 or 2
');
 FLAG = input(' ');
 if FLAG == 2 
 fprintf(1,'Input the file name in the form - drive:\
ame.ext
');
 fprintf(1,'For example:   A:\\OUTPUT.DTA
');
 NAME = input(' ','s');
 OUP = fopen(NAME,'wt');
 else
 OUP = 1;
 end
 fprintf(1,'Select amount of output
');
 fprintf(1,'1. Answer only
');
 fprintf(1,'2. All intermediate approximations
');
 fprintf(1,'Enter 1 or 2
');
 FLAG = input(' ');
 fprintf(OUP, 'Newtons Method
');
 if FLAG == 2 
 fprintf(OUP, '  I   P                 F(P)
');
 end
 F0 = F(P0);
% STEP 1
 I = 1;
 OK = TRUE;        
% STEP 2
 while I <= NO & OK == TRUE   
% STEP 3
% compute P(I)
 FP0 = FP(P0);
 D = F0/FP0;
% STEP 6
 P0 = P0 - D;  
 F0 = F(P0);
 if FLAG == 2 
 fprintf(OUP,'%3d   %14.8e   %14.7e
',I,P0,F0);
 end
% STEP 4
 if abs(D) < TOL 
% procedure completed successfully
 fprintf(OUP,'
Approximate solution = %.10e
',P0);
 fprintf(OUP,'with F(P) = %.10e
',F0);
 fprintf(OUP,'Number of iterations = %d
',I);
 fprintf(OUP,'Tolerance = %.10e
',TOL);
 OK = FALSE;
% STEP 5
 else
 I = I+1;
 end
 end
 if OK == TRUE 
% STEP 7
% procedure completed unsuccessfully
 fprintf(OUP,'
Iteration number %d',NO);
 fprintf(OUP,' gave approximation %.10e
',P0);
 fprintf(OUP,'with F(P) = %.10e not within tolerance  %.10e
',F0,TOL);
 end
 if OUP ~= 1
 fclose(OUP);
 fprintf(1,'Output file %s created successfully 
',NAME);
 end
 end



[/size] [/center]

السلام عليكم ورحمه الله وبركاته

الاخ الفاضل لدي استفسار في الماتلاب
كيفيه اجراء alignment the two images حيث هناك صورتان بينهما اختلاف بسيط ( صورتان متشابهتان مع اختلاف بسيط في الثانيه بسبب الحركه ) واريد ان اجعل الثانيه مشابهه للاولى تماما بواسطه aligned the second image لجعلها تشابه الاولى

ولك جزيل الشكر

اختك ايه

جزاك الله كل الخير لكن انا اريد ان اعمل alignment بدون اختيار control points يعني ان تقارن صوره مع اخرئ مخزونه كمصدر refrence واغير الثانيه بحيث اجعلها تشابه الاولئ بدون اختيار النقاط الرئيسيه وجزاك الله كل الخير

اختك ايه