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!