读取层文件在MATLAB(诺亚Snavely的工具捆扎机输出) [英] Reading a ply file in matlab (output from Noah Snavely's tool Bundler)

查看:301
本文介绍了读取层文件在MATLAB(诺亚Snavely的工具捆扎机输出)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图打开.ply文件,并使用下面的code在MATLAB中显示出来:

http://people.sc.fsu.edu/~ jburkardt / m_src / ply_display / ply_display.m

但它显示错误

  XY_DISPLAY:
输入点文件名(在'引号'!)。
C:\ SFM \例子\ ET \包\ points001.ply';
27冗长= 0;
使用ply_display&GT错误; ply_to_tri_surface(行140)
无此文件或目录

在ply_display错误(第48行)
[node_xyz,ELEMENT_NODE] = ply_to_tri_surface(ply_filename);

在ply_display&GT错误; ply_to_tri_surface(行732)
ply_display('C:\ SFM \例子\新\包\ points001.ply');

在ply_display错误(第48行)
[node_xyz,ELEMENT_NODE] = ply_to_tri_surface(ply_filename);
 

任何人都可以请帮我对此?

谢谢!

解决方案

由于要pretty的从错误输出清晰,你的错误是不是在第27行(其实我不知道为什么,显示了)。什么错误跟踪显示你是这样的:

1)错误启动时 ply_display 调用另一个函数, ply_to_tri_surface (这是在同一个文件中定义)

  

[node_xyz,ELEMENT_NODE] = ply_to_tri_surface(ply_filename);

2)在该第二功能,实际的错误正在被触发在线路140:

 使用ply_display&GT错误; ply_to_tri_surface(行140)
无此文件或目录
 

(行732参考有点红鲱鱼 - 这是因为这是正在从 ply_to_tri_surface 返回的错误 ply_display 我认为)。

看一下实际的code,这是部分导致错误(约140行) - 该程序首先试图打开文件:

  [裂,味精= FOPEN(ply_filename,RT);

  如果(FID == -1)
    错误(MSG);
  结束
 

也就是说, ply_filename - 你的层文件 - 无法找到。无论是文件名是错误的,或者你正在输入的方式(是你键入的分号在文件名的末尾?)引起的问题。

有两个选项:

1)运行 DBSTOP如果误差,然后重新运行code。当它的错误,你应该能够看到 ply_filename 包含。 (润 dbquit 退出调试模式)。

2),输入你的文件名,直接在命令行中调用该函数运行,例如当 ply_display('test.ply') ply_display(文件名)其中,文件名是previously定义的变量。

I'm trying to open .ply files and display them in matlab using the following code :

http://people.sc.fsu.edu/~jburkardt/m_src/ply_display/ply_display.m

But it is showing an error

XY_DISPLAY:
Enter the name of the point file (in 'quotes'!).
'C:\SFM\examples\ET\bundle\points001.ply';
27    verbose = 0;
Error using ply_display>ply_to_tri_surface (line 140)
No such file or directory

Error in ply_display (line 48)
[ node_xyz, element_node ] = ply_to_tri_surface ( ply_filename );

Error in ply_display>ply_to_tri_surface (line 732)
ply_display ( 'C:\SFM\examples\new one\bundle\points001.ply' );

Error in ply_display (line 48)
[ node_xyz, element_node ] = ply_to_tri_surface ( ply_filename );

Can anyone please help me regarding this ?

Thanks!

解决方案

As should be pretty clear from the error output, your error is not in line 27 (actually I don't know why that shows up). What the error trace shows you is this:

1) The error starts when ply_display calls another function, ply_to_tri_surface (which is defined in the same file).

[ node_xyz, element_node ] = ply_to_tri_surface ( ply_filename );

2) Within that second function, the actual error is being triggered at line 140:

Error using ply_display>ply_to_tri_surface (line 140)
No such file or directory

(The reference to line 732 is a bit of a red herring - that is because this is where the error is being returned from ply_to_tri_surface to ply_display I think).

Looking at the actual code, this is the part causing the error (around line 140) - where the program first tries to open your file:

  [ fid, Msg ] = fopen ( ply_filename, 'rt' );

  if ( fid == -1 )
    error ( Msg );
  end

That is, ply_filename - your ply file - cannot be found. Either the filename is wrong or the way you are inputting it (are you typing that semicolon at the end of the filename?) is causing issues.

Two options:

1) Run dbstop if error, then re-run the code. When it errors, you should be able to see what ply_filename contains. (Run dbquit to exit debug mode).

2) Input your filename directly when running by calling the function from the command line, e.g. ply_display('test.ply') or ply_display(filename) where filename is a previously defined variable.

这篇关于读取层文件在MATLAB(诺亚Snavely的工具捆扎机输出)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆