How ro fix the "Error using alpha Too many output arguments"?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Francesca
am 8 Feb. 2023
Kommentiert: Les Beckham
am 9 Feb. 2023
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 Kommentare
Akzeptierte Antwort
Les Beckham
am 8 Feb. 2023
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 Kommentare
Les Beckham
am 9 Feb. 2023
You are quite welcome. If this answer solved your problem, would you please Accept it? Thanks.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Image Processing and Computer Vision finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!