The function rectifyStereoImages can't return reprojectionMatrix.with an error "Error using rectifyStereoImages Too many output arguments."
4 次查看(过去 30 天)
显示 更早的评论
Input data:
to_reg e rif contain 2 images converted in grey level, I tried to attach but mages are bigger than 5 Mb
ptsreg = detectSURFFeatures(to_reg);
ptsrif = detectSURFFeatures(rif);
[featreg,validPtsreg] = extractFeatures(to_reg,ptsreg);
[featrif,validPtsrif] = extractFeatures(rif,ptsrif);
index_pairs = matchFeatures(featrif,featreg,'MatchThreshold',sogliaMatch);
matchedPtsrif = validPtsrif(index_pairs(:,1));
matchedPtsreg = validPtsreg(index_pairs(:,2));
[fund,inlierF] = estimateFundamentalMatrix(matchedPtsrif, matchedPtsreg,Method=tipostimaF);
figure;
showMatchedFeatures(rif,to_reg,matchedPtsrif(inlierF,:),matchedPtsreg(inlierF,:),"montage",PlotOptions=["ro","go","y--"]);
title("Point Matches After Outliers Are Removed");
This is the figure
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1165538/image.jpeg)
[t1, t2] = estimateUncalibratedRectification(fund,matchedPtsrif(inlierF,:),matchedPtsreg(inlierF,:),size(to_reg));
Now, the problem is in next command line. If I run this
[rifRect,to_regRect] = rectifyStereoImages(rif,to_reg,t1,t2, OutputView='full');
figure;
imshow(stereoAnaglyph(rifRect,to_regRect));
the program correctly run.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1165543/image.jpeg)
If I run this
[rifRect,to_regRect,reprojectionMatrix] = rectifyStereoImages(rif,to_reg,t1,t2, OutputView='full');
the program gives me the error:
Error using rectifyStereoImages
Too many output arguments.
Error in ObjectExtraction_v0 (line 75)
[rifRect,to_regRect,reprojectionMatrix] = rectifyStereoImages(rif,to_reg,t1,t2, OutputView='full');
0 个评论
回答(1 个)
Varun
2023-2-21
编辑:Varun
2023-2-21
Hello!
I believe the error is due to improper syntax while calling the rectifyStereoImages function. When using the syntax for getting a reprojectionMatrix, the function call must be in the format:
[rifRect,to_regRect,reprojectionMatrix] = rectifyStereoImages(rif,to_reg,stereoParams);
To know more, please refer to https://www.mathworks.com/help/vision/ref/rectifystereoimages.html#d124e243545 for documentation on rectifyStereoImages and https://www.mathworks.com/help/releases/R2022b/vision/ref/reconstructscene.html#d124e242860 for documentation and examples on reconstructScene.
Hope this helps!
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!