Help with Sift Flow Algorithm - debugging the demo
이전 댓글 표시
Hello I'm trying to run the demo for this SIFT Flow code you can find here:
It takes two similar images, finds their similarities, and combines them into one essentially...
I'm getting this error when running demo.m:

Here's the full demo.m code:
im1=imread('Mars-1.jpg');
im2=imread('Mars-2.jpg');
im1=imresize(imfilter(im1,fspecial('gaussian',7,1.),'same','replicate'),0.5,'bicubic');
im2=imresize(imfilter(im2,fspecial('gaussian',7,1.),'same','replicate'),0.5,'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));
return;
% 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));
Anyway I'm assuming this is probably an easy fix, I just don't generally use MATLAB, any help or guidance much appreciated...
댓글 수: 5
Walter Roberson
2022년 1월 15일
"Please run demo.h first. If error appears, please go to "mexDenseSIFT" and "mexDiscreteFlow" subfolders and follow the instructions in readme.txt (yes, there is readme.txt in each folder) to compile the cpp files. "
Did you follow the instructions in the readme.txt files to compile the cpp files?
Steven Rudolph
2022년 1월 15일
편집: Steven Rudolph
2022년 1월 16일
Walter Roberson
2022년 1월 16일
The code needs to be recompiled.
Unfortunately there are a lot of problems with the code. It was designed in the time when MATLAB arrays could not exceed 2 gigabytes. Plus it had other random bugs.
I have gotten a clean compile for one of the two libraries (but not tested yet). The work is pretty tedious, so I have not gotten very far on the other library yet.
Steven Rudolph
2022년 1월 17일
Walter Roberson
2022년 1월 17일
I got a clean compile for both sides, except:
- one of the two has no mexFunction() routine and so cannot be called from MATLAB, which is a problem
- there are functions to save and load binary images that are coded in terms of using int to hold sizes, which is not compatible with MATLAB (only supports 31 bits, whereas MATLAB supports 48 bits). I changed everything else to be compatible with MATLAB sizes, but not those routines yet, as I do not know whether compatibility with external formats is needed.
답변 (2개)
yanqi liu
2022년 1월 17일
0 개 추천
yes,sir,may be use vlfeat toolbox,and vl_sift to get sift points and discripters
카테고리
도움말 센터 및 File Exchange에서 Feature Detection and Extraction에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

