microsoft / HoloLens2ForCV

Sample code and documentation for using the Microsoft HoloLens 2 for Computer Vision research.
MIT License
494 stars 144 forks source link

Processing of recordings fails (save_pclouds.py) #32

Closed brookman closed 4 years ago

brookman commented 4 years ago

I record with those settings:

std::vector<ResearchModeSensorType> AppMain::kEnabledRMStreamTypes = {
    ResearchModeSensorType::DEPTH_LONG_THROW,
    ResearchModeSensorType::LEFT_FRONT,
    ResearchModeSensorType::LEFT_LEFT,
    ResearchModeSensorType::RIGHT_FRONT,
    ResearchModeSensorType::RIGHT_RIGHT
};
/* Supported not-ResearchMode streams:
{
    PV,  // RGB
    EYE  // Eye gaze tracking
}*/
std::vector<StreamTypes> AppMain::kEnabledStreamTypes = { StreamTypes::PV, StreamTypes::EYE };

When processing a recording with the provided python scripts I am getting the following error:

(recorder console) process 0
Extracting 2020-09-26-164659\Depth Long Throw.tar
Extracting 2020-09-26-164659\PV.tar
Extracting 2020-09-26-164659\VLC LF.tar
Extracting 2020-09-26-164659\VLC LL.tar
Extracting 2020-09-26-164659\VLC RF.tar
Extracting 2020-09-26-164659\VLC RR.tar
Processing images
.................................................................................................................
Saving point clouds
.Transform not found for timestamp 1.3245605218805149e+17
.Traceback (most recent call last):
  File "StreamRecorderConverter/recorder_console.py", line 278, in <module>
    main()
  File "StreamRecorderConverter/recorder_console.py", line 274, in main
    rs.cmdloop()
  File "C:\Users\[REDACTED]\AppData\Local\Programs\Python\Python37\lib\cmd.py", line 138, in cmdloop
    stop = self.onecmd(line)
  File "C:\Users\[REDACTED]\AppData\Local\Programs\Python\Python37\lib\cmd.py", line 217, in onecmd
    return func(arg)
  File "StreamRecorderConverter/recorder_console.py", line 89, in do_process
    recording_name)
  File "C:\[REDACTED]\HoloLens2ForCV\Samples\StreamRecorder\StreamRecorderConverter\process_all.py", line 38, in process_all
    save_pclouds(w_path, sensor_name)
  File "C:\[REDACTED]\HoloLens2ForCV\Samples\StreamRecorder\StreamRecorderConverter\save_pclouds.py", line 327, in save_pclouds
    disable_project_pinhole
  File "C:[REDACTED]\HoloLens2ForCV\Samples\StreamRecorder\StreamRecorderConverter\save_pclouds.py", line 164, in save_single_pcloud
    rgb_tmp = Path(rgb_parts[1]) / Path(rgb_parts[2])
IndexError: tuple index out of range

The script seems to work if I change the tuple indices from 1, 2 to 0, 1 for rgb_tmp and depth_tmp on lines 164 and 166 respectively:

rgb_tmp = Path(rgb_parts[0]) / Path(rgb_parts[1])
depth_parts = Path(depth_proj_path).parts[2:]
depth_tmp = Path(depth_parts[0]) / Path(depth_parts[1])
IkbeomJeon commented 4 years ago

It may have been caused by this, https://github.com/microsoft/HoloLens2ForCV/pull/29 I also report the solution, try to do it.