Help with multivariable optimization function
4 ビュー (過去 30 日間)
古いコメントを表示
Hello, I'm new to MATLAB and programming in general, so excuse my ignorance. I'm working on an optimization function that maximizes correlation between images by changing rotation and scale along with displacement. I don't have MATLAB's Optimization Toolbox but I do have the Image Processing Toolbox. I'm using the fminsearch function, but I don't know how to factor in multiple variables. Please review my code so far and let me know what I need to change and how so.
function corr= corrfun2(factors)
image1= imread('grid1.jpg');
image2= imread('grid2.jpg');
scale=factors(1)
rotate=factors(2)
corr= 1-normxcorr2(image1(100:200,200:300),imrotate(imresize(image2,scale),rotate));
[val,index]=min(corr);
[peakcorr,row]=min(val)
column=index(row)
0 件のコメント
回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!