MPC-Berkeley / dlp-dataset

Dragon Lake Parking Dataset by MPC Lab.
https://sites.google.com/berkeley.edu/dlp-dataset
GNU General Public License v3.0
41 stars 6 forks source link

How to interpret the DIJ_0012_data.xml #7

Closed minhhotboy9x closed 10 months ago

minhhotboy9x commented 10 months ago

I want to convert the dataset to YOLO format so I tried to create labels from the DIJ_0012_data.xml annotation. Can you explain some elements in the XML file:

<?xml version="1.0" encoding="UTF-8"?>
<tracking_log>
    <frame id="0" timestamp="0.000000">
        <trajectory id="1" type="Car" width="1.8778" length="4.7048" utm_x="746975.45" utm_y="3856782.52" utm_angle="4.4702" speed="0.23" lateral_acceleration="0.0056" tangential_acceleration="0.0089" total_acceleration="0.0105" front_left_x="2475.57" front_left_y="358.40" front_right_x="2525.86" front_right_y="370.42" rear_left_x="2442.34" rear_left_y="481.77" rear_right_x="2492.66" rear_right_y="493.85" front_left_x_undistorted="2472.70" front_left_y_undistorted="360.68" front_right_x_undistorted="2522.71" front_right_y_undistorted="372.79" rear_left_x_undistorted="2440.01" rear_left_y_undistorted="483.49" rear_right_x_undistorted="2490.07" rear_right_y_undistorted="495.64"/>
        <trajectory id="2" type="Car" width="1.9681" length="4.9566" utm_x="747002.81" utm_y="3856781.18" utm_angle="1.1330" speed="0.86" lateral_acceleration="-0.0050" tangential_acceleration="0.0088" total_acceleration="0.0101" front_left_x="1724.78" front_left_y="463.19" front_right_x="1676.49" front_right_y="440.83" rear_left_x="1785.12" rear_left_y="342.44" rear_right_x="1736.84" rear_right_y="320.16" front_left_x_undistorted="1724.02" front_left_y_undistorted="463.40" front_right_x_undistorted="1675.57" front_right_y_undistorted="440.96" rear_left_x_undistorted="1784.14" rear_left_y_undistorted="342.94" rear_right_x_undistorted="1735.72" rear_right_y_undistorted="320.57"/>
         ...
        <raw_to_map_transform image_id="1231" cols="3" rows="3">
            <row_0 val_0="2.1930041787146255" val_1="0.57814304577217224" val_2="747156.15116714139"/>
            <row_1 val_0="11.511400840845482" val_1="3.0243866641733317" val_2="3857236.490379801"/>
            <row_2 val_0="2.984656288814898e-06" val_1="7.7454910854937287e-07" val_2="1.0001214683699959"/>
        </raw_to_map_transform>
    </frame>
    ...
   <frame id="11307" timestamp="452.280000">
        <raw_to_map_transform image_id="11307" cols="3" rows="3">
            <row_0 val_0="3.1757224812814062" val_1="0.41309171415319013" val_2="747089.03502933495"/>
            <row_1 val_0="16.584388638210658" val_1="2.1718916071704686" val_2="3856889.4187036911"/>
            <row_2 val_0="4.2999773145858969e-06" val_1="5.5356034192916995e-07" val_2="1.0000317396548299"/>
        </raw_to_map_transform>
    </frame>
    <frame id="11308" timestamp="452.320000">
        <raw_to_map_transform image_id="11308" cols="3" rows="3">
            <row_0 val_0="3.1480816240573111" val_1="0.40306059557722079" val_2="747089.04458657559"/>
            <row_1 val_0="16.441670321742944" val_1="2.120114290463111" val_2="3856889.4831806156"/>
            <row_2 val_0="4.2629720869869241e-06" val_1="5.4013541858107622e-07" val_2="1.000031757268123"/>
        </raw_to_map_transform>
    </frame>

And why some last frames don't contain any trajectory ids? Is this just a missing? Thank you very much.

XuShenLZ commented 10 months ago

I believe that only happens in the last few frames. You can just discard them. Let us know if that happens constantly in the middle of a file

minhhotboy9x commented 10 months ago

Oh, I understand. Can you show me how to convert the sizes, locations, and angles of raw files to those in which their unit is in pixel of image (width, lenght, utm_x, utm_y, utm_angle,...)? And I also see raw_to_map_transform, I don't know what it's used for.

XuShenLZ commented 10 months ago

Indicated by its name, it is the transformation from pixel coordinate to utm. If you want to reconstruct pixel coordinates, you should probably use its inverse.

minhhotboy9x commented 10 months ago

Thank you. I also found that to create bboxes of car, I need to take the points of the front and rear of the car, and get the x_max, y_max and x_min, y_min.