ScriptSpot

Forum topic · Scripts Wanted

Import CSV

By snah · 2017-09-30

Downloads
Description

Hi there,

I have a 3D depth sensing camera called a ZED which works similarly to a Kinect. Basically it generates a 3D model from its stereoscopic footage and it also has the ability to output a virtual camera path based on the path it has moved through real world space take a look here: https://www.youtube.com/watch?v=AFH2yN3rM78. Aside from outputting an obj file and texture it also generates a CSV file with camera coordinates and rotations. You can see what this looks like in the Motion_data.txt attached(i had to change the file type from .CSV to .TXT to be allowed to upload it). You can see in the first column is the Timestamp in nanoseconds, the next 3 columns are for rotation using quaternions and the next 3 are for position.

I have found this script that could be modified but it doesn't support animation, it just imports objects statically: http://www.scriptspot.com/3ds-max/scripts/read-data-from-csv-txt

This guy is trying to do something similar except with an Excel file and said he had some issues but managed to solve them himself, however I cant see how I would solve them: https://forums.autodesk.com/t5/3ds-max-programming/xyz-data-from-excel-g…

This guy is doing something similar but I cant work out how to apply it to my CSV file: http://www.scriptspot.com/forums/3ds-max/general-scripting/importing-txt…

Would any body be able to help me solve this? I can afford a small fee that we could negotiate?

It appears that getting the rotations to work with the CSV import might be the most complicated bit but max and the ZED SDK both share quaternions rotation styles: https://help.autodesk.com/view/3DSMAX/2018/ENU/?guid=__files_GUID_C42F8C…

Zed documentation: https://www.stereolabs.com/developers/documentation/API/classsl_1_1Rotat…

Thanks guys,
Felix

Comments (7)

.

jahman · 2017-10-02

there're two cameras in the scene. Can you check if any of them has valid rotations?

Attachments

snah · 2017-10-02

Hi Jahman, thanks for taking a look at this. I imported your cameras into the scene with my OBJ and there seemed to be an issue with scale. I am going to send you some sample files from ZED directly. These should help with troubleshooting:

The mesh: https://www.stereolabs.com/download_327af3/SVO_samples/sofa_mesh.zip

The CSV: https://www.dropbox.com/sh/v6v9lc78ki6txdr/AABwgfHiIrRVu9sqVk4k15YVa/Mot…

The AVI: https://www.dropbox.com/sh/v6v9lc78ki6txdr/AAB2nfYkilxWR8OwdqZFoPqka?dl=…

Can you test your script on these files?

.

jahman · 2017-10-02

Oh, I see. My default units are centimeters and CSV position clearly says 'm' which is meters :)
I'll check these tomorrow.

btw.
You can place a dummy in [0,0,0], link cameras to it and then select and scale dummy like this:

$.scale *= 100

This will affect camera positions so they should match

.

jahman · 2017-10-03

Well, after some trial and error...
There's a certain misalignment between mesh and camera scale and I really have no idea how to deal with it.

Zed Camera Postion Tracking

Graim · 2019-04-02

hi, im getting the same problem, did you finally solve it?

.

jahman · 2019-04-03

No, I didn't come back to it ever since

CSV import

Graim · 2019-04-26

can you send me your svo file for test purpose, im modifying the zed code and i almost finish