How ro fix the "Error using alpha Too many output arguments"?

2 visualizzazioni (ultimi 30 giorni)
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;

Risposta accettata

Les Beckham
Les Beckham il 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 Commenti
Francesca
Francesca il 9 Feb 2023
Spostato: Steven Lord il 9 Feb 2023
Thank you so much. It did work!
Les Beckham
Les Beckham il 9 Feb 2023
You are quite welcome. If this answer solved your problem, would you please Accept it? Thanks.

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Image Processing and Computer Vision in Help Center e File Exchange

Tag

Prodotti


Release

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by