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

조회 수: 2 (최근 30일)
Francesca
Francesca 2023년 2월 8일
댓글: Les Beckham 2023년 2월 9일
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;

채택된 답변

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

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Processing and Computer Vision에 대해 자세히 알아보기

태그

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by