Closed sfuerte closed 7 years ago
If there is only one byte difference, i would guess that only a final \n
has been added by vi.
In this case replacing this line https://github.com/mapillary/OpenSfM/blob/f80abbcb09a0ec6b016b967f291aa09f6567c39f/opensfm/dense.py#L314
with
return '\n'.join(header + vertices + [''])
should fix the problem.
Could confirm that this fixes the PCL reading problem? thanks!
Tested and confirmed. Your change to dense.py#L314 fixes the PCL reading issue.
Thank you!
ISSUE
Running
opensfm/bin/opensfm compute_depthmaps
to generate a point cloud inopensfm/depthmaps/merged.ply
.When trying to read the PLY file with PCL, receiving the following error:
The file itself looks normal:
"QUICK FIX"
After some Internet search, the issue is in newline formatting: dos vs unix style. Apparently, PCL is quite sensitive to that and recognizes only the former.
Easy fix can be done by
vi +":w ++ff=unix" +":q" merged.ply
.Looks like when OpenSfM writes the PLY file, it misses one character on the last line.
The size difference between the generated and converted files is just one byte:
PS
Though it's still questionable what shall be fixed:
IMHO both.