Help with multivariable optimization function
显示 更早的评论
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 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Image Arithmetic 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!