How ro fix the "Error using alpha Too many output arguments"?
2 次查看(过去 30 天)
显示 更早的评论
Hi Everyone,
I am new to Matlab, but testing a Sift Flow Algorithm, and I am getting this error:
"Error using alpha
Too many output arguments".
Any suggestions will be more than welcome. Many thanks
Here is the code:
im1=imread('a.jpg');
im2=imread('b.jpg');
im1=imresize(imfilter(im1,fspecial('gaussian',7,1.),'same','replicate'),1,'bicubic');
im2=imresize(imfilter(im2,fspecial('gaussian',7,1.),'same','replicate'),1,'bicubic');
im1=im2double(im1);
im2=im2double(im2);
%figure;imshow(im1);figure;imshow(im2);
cellsize=3;
gridspacing=1;
addpath(fullfile(pwd,'mexDenseSIFT'));
addpath(fullfile(pwd,'mexDiscreteFlow'));
sift1=mexDenseSIFT(im1,cellsize,gridspacing);
sift2=mexDenseSIFT(im2,cellsize,gridspacing);
SIFTflowpara.alpha=2*255;
SIFTflowpara.d=40*255;
SIFTflowpara.gamma=0.005*255;
SIFTflowpara.nlevels=4;
SIFTflowpara.wsize=2;
SIFTflowpara.topwsize=10;
SIFTflowpara.nTopIterations = 60;
SIFTflowpara.nIterations= 30;
tic;[vx,vy,energylist]=SIFTflowc2f(sift1,sift2,SIFTflowpara);toc
warpI2=warpImage(im2,vx,vy);
figure;imshow(im1);figure;imshow(warpI2);
% display flow
clear flow;
flow(:,:,1)=vx;
flow(:,:,2)=vy;
figure;imshow(flowToColor(flow));
% this is the code doing the brute force matching
tic;[flow2,energylist2]=mexDiscreteFlow(sift1,sift2,[alpha,alpha*20,60,30]);toc
figure;imshow(flowToColor(flow2));
return;
0 个评论
采纳的回答
Les Beckham
2023-2-8
Did you mean this line
tic;[flow2,energylist2]=mexDiscreteFlow(sift1,sift2,[alpha,alpha*20,60,30]);toc
to actually be this instead?
tic;[flow2,energylist2]=mexDiscreteFlow(sift1,sift2,[SIFTflowpara.alpha,SIFTflowpara.alpha*20,60,30]);toc
% ^^ this exists ^^
2 个评论
Les Beckham
2023-2-9
You are quite welcome. If this answer solved your problem, would you please Accept it? Thanks.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Processing and Computer Vision 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!