matlab - Ubuntu 错误 : "filename" cannot execute binary file

标签 matlab ubuntu sift

我正在 Ubuntu 上研究 matlab R2013a。我指的是这段代码:

sift_bin = fullfile('lib/sift/bin/siftfeat');   
[pf,nf,ef] = fileparts(filename);
desc_file = [fullfile(pf,nf) '.txt'];
im1=imread(filename);
if (size(im1,1)<=1000 && size(im1,2)<=1000)
    status1 = system([sift_bin ' -x -o ' desc_file ' ' filename]);
else
    status1 = system([sift_bin ' -d -x -o ' desc_file ' ' filename]);
end

但它给出了一个错误:
lib/sift/bin/siftfeat cannot execute binary file

系统调用有什么问题吗?

lib/sift/bin/siftfeat 是 sift 库的路径。

最佳答案

使用file确保该文件是可执行文件并查看其体系结构的实用程序

system('file /bin/ls')
/bin/ls: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked
(uses shared libs), for GNU/Linux 2.6.24,
BuildID[sha1]=0xf31e99218b4d7034cf8257055686bca22f5a3c01, stripped
ans = 0

然后uname -a显示系统架构
system('uname -a')
Linux optiPlex7010 3.8.0-35-generic #50-Ubuntu SMP Tue Dec 3 01:24:59 UTC 2013
x86_64   x86_64 x86_64 GNU/Linux
ans = 0

如您所见,我有 64 位 Linux,可执行文件也是 64 位。但是,对于 32 位系统,可执行文件支持是向后兼容的。这意味着 64 位系统可以同时执行 32 位和 64 位可执行文件,但 32 位系统只能执行 32 位可执行文件。

从您的评论中,我看到您正在尝试在 32 位系统中启动 64 位可执行文件,但它无法做到这一点。您应该会找到 siftfeat 的 32 位版本或者如果可能的话,将您的操作系统更改为 64 位。

关于matlab - Ubuntu 错误 : "filename" cannot execute binary file,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21645125/

相关文章:

mongodb - 将 Parse.com 应用程序迁移到 AWS EC2 Ubuntu 时出现的问题

opencv - SiftFeatureDetector .detect函数损坏?

opencv - 如何在OpenCV中利用SIFT提取的特征得到目标物体周围的矩形

c++ - David Lowe 的 SIFT——关于尺度空间和图像坐标的问题(奇怪的偏移问题)

matlab - 将值的赋值向量化为 3D 数组

matlab - 在 MATLAB 中删除/操作数据

ubuntu - Monit 似乎在命令行上工作,但在 Web 界面中得到 404 'There is no service by that name'

linux - 在 BASH 命令中使用变量?

matlab - 卷积后 MatLab 中 -1 的移位

python - 从 python 运行 MATLAB 脚本 + 传递参数