OpenLABEL形式
15 分
openlabelは、 https //www asam net/ が開発した標準化されたアノテーション形式です。この形式には、詳細な https //www asam net/index php?eid=dumpfile\&t=f\&f=4566\&token=9d976f840af04adee33b9f85aa3c22f2de4968dd および https //openlabel asam net/v1 0 0/schema/openlabel json schema json が付属しており、形式の妥当性を確認するために使用できます。 openlabelは厳格な形式ですが、解釈の余地が一部残っています。このセクションでは、そのような部分をいくつか明確にし、標準内で行った選択について説明します。 直方体の回転 回転はy軸が前方を向くように設定されており、回転順序は xyz です。 これは、ヘディング(ヨー)が0の直方体が、軸の正方向においてy軸と整列していることを意味します。これは、前方方向がx軸に沿う https //www sis se/api/document/preview/914200/# text=this%20international%20standard%20defines%20the,to%20multi%2dunit%20vehicle%20combinations 標準とは多少異なります。iso 8855への変換は、z軸周りの回転を適用し、以下の方法でsxとsyを変更することで行えます。 import math from typing import list from scipy spatial transform import rotation def convert to iso8855(val list\[float]) > list\[float] """ converts cuboid values to iso 8855 """ \[x, y, z, qx, qy, qz, qw, sx, sy, sz] = val rotation 1 = rotation from quat(\[qx, qy, qz, qw]) rotation 2 = rotation from rotvec(\[0, 0, math pi / 2]) rot object = rotation 1 rotation 2 \[qx, qy, qz, qw] = rot object as quat() return \[x, y, z, qx, qy, qz, qw, sy, sx, sz] 非シーケンスは、1フレームのシーケンスです。 シンプルさを考慮して、非シーケンスをシーケンスと同じ方法で扱う選択をしました。これは、非シーケンスが1フレームのみのシーケンスとして表現されることを意味します。 name や type などのデータのみがトップレベル要素のキーで定義されます。その他の情報はすべてframesの下に格納されます。以下の例を参照してください。 { "objects" { "0" { "name" "car 0", "type" "car" } }, "frames" { "0" { "objects" { "0" {"object data" { }} } } } } streamは単なるテキストプロパティの一つです。 stream プロパティは、ジオメトリとプロパティがどの stream /センサー/ソースでアノテーションされたかを示すために使用されます。例えば、ここでは camera という名前の stream でアノテーションされたポイントを持つオブジェクトを示しています。ジオメトリに対応するすべての属性も同じstreamでアノテーションされていることに注意してください。 { "object data" { "point2d" \[ { "name" "point 4d2d325f", "val" \[300 5300, 286 4396], "attributes" { "text" \[ {"name" "stream", "val" "camera"}, {"name" "color", "val" "black"} ] } } ] } } リレーション 2種類のリレーションを考慮しています。2つのオブジェクト間の単方向リレーションとグループリレーションです。これらに加えて、偽リレーション、すなわち実際には他のオブジェクトへのポインタではなく、 inconclusive 、 nothing 、 unclear などの値を取るリレーションプロパティを表現する必要があります。 リレーションは単方向です。 リレーションは単方向であり、あるオブジェクト object1 が別のオブジェクトobject2にリレーションを持つ場合、 object2 が object1 にリレーションを持つことを意味しません。以下は、 car 0 がcar 1に追従しており、 car 2 が別の車に追従しているかどうか不明な例です。 { "objects" { "0" {"name" "car 0", "type" "car"}, "1" {"name" "car 1", "type" "car"}, "2" {"name" "car 2", "type" "car"} }, "relations" { "0" { "name" "0", "type" "isfollowing", "rdf subjects" \[{"type" "object", "uid" "0"}], "rdf objects" \[{"type" "object", "uid" "1"}] } } } アクションは偽リレーションを表現するために使用されます。 kognicプラットフォームでは、実際には他のオブジェクトへの参照ではない値をリレーションに割り当てることがサポートされています。例としては inconclusive や nothing があります。アクションはこれらを以下の方法で表現するために使用され、アクションの名前が値を決定し、typeがプロパティ名を決定します。 { "objects" { "0" {"name" "lane 0", "type" "lane"} }, "relations" { "0" { "name" "0", "type" "issubjectofaction", "rdf subjects" \[{"type" "object", "uid" "0"}], "rdf objects" \[{"type" "action", "uid" "0"}] } }, "actions" { "0" {"name" "nothing", "type" "is pulling or pushing"} } } stream固有のリレーション リレーションがstream固有の場合、 stream relations プロパティがあり、リレーションのリストがどのstreamに属するかを示します。 { // frames 0 // "frame properties" { "streams" { "camera front" { "description" null, "stream properties" { "stream relations" { "1" {} } } } } }, "relations" { "0" {} } } ポリゴンの表現 ポリゴンはopenlabelにおいて poly2d オブジェクトのリストで記述されます。そのうちの1つが外形を表し、残りは潜在的な穴を表します。これはブール型プロパティ is hole によって決定されます。以下は1つの穴を持つポリゴンの例です。 { "object data" { "poly2d" \[ { "name" "poly1", "mode" "mode poly2d absolute", "val" \[ ], "attributes" { "boolean" \[{"name" "is hole", "val" false}] } }, { "name" "poly2", "mode" "mode poly2d absolute", "val" \[ ], "attributes" { "boolean" \[{"name" "is hole", "val" true}] } } ] } } mode に対してサポートされている値は mode poly2d absolute のみです。絶対モードとは、 val の値がピクセル座標として解釈されることを意味します(最初の座標ペアに対する相対値としてではなく)。 マルチポリゴンの表現 マルチポリゴンは単純にポリゴンのリストであるため、 is hole プロパティを持つpoly2dオブジェクトのリストを使用して同様の方法で記述します。ただし、マルチポリゴン内で poly2d オブジェクトがどのポリゴンに属するかを決定する polygon id プロパティを追加します。以下は、それぞれ1つの穴を持つ2つのポリゴンからなるマルチポリゴンの例です。 { "object data" { "poly2d" \[ { "name" "poly1", "mode" "mode poly2d absolute", "val" \[ ], "attributes" { "text" \[{"name" "polygon id", "val" "1"}], "boolean" \[{"name" "is hole", "val" false}] } }, { "name" "poly2", "mode" "mode poly2d absolute", "val" \[ ], "attributes" { "text" \[{"name" "polygon id", "val" "1"}], "boolean" \[{"name" "is hole", "val" true}] } }, { "name" "poly3", "mode" "mode poly2d absolute", "val" \[ ], "attributes" { "text" \[{"name" "polygon id", "val" "2"}], "boolean" \[{"name" "is hole", "val" false}] } }, { "name" "poly4", "mode" "mode poly2d absolute", "val" \[ ], "attributes" { "text" \[{"name" "polygon id", "val" "2"}], "boolean" \[{"name" "is hole", "val" true}] } } ] } } mode に対してサポートされている値は mode poly2d absolute のみです。絶対モードとは、 val の値がピクセル座標として解釈されることを意味します(最初の座標ペアに対する相対値としてではなく)。 曲線の表現 注意 補間メソッドの名前が interpolation methodから interpolation method に変更されました。ただし、古いアノテーションには依然として古い名前が含まれている場合があります。 曲線は poly2d ジオメトリを使用して表現され、補間メソッドは以下の方法でテキストプロパティとして指定されます。 { "poly2d" \[ { "closed" false, "mode" "mode poly2d absolute", "name" "curve d633ca89", "val" \[ ], "attributes" { "text" \[ { "name" "interpolation method", "val" "natural cubic spline" } ] } } ] } mode に対してサポートされている値は mode poly2d absolute のみです。絶対モードとは、 val の値がピクセル座標として解釈されることを意味します(最初の座標ペアに対する相対値としてではなく)。プロパティ interpolation method は必須であり、ノードを互いに関連付ける方法を決定します。以下の値がサポートされています。 natural cubic spline catmull rom 0 5 polyline 3dレーンの表現 3dレーンは3d空間における2本の線( poly3d )として表現され、1本は右側、もう1本は左側です。テキストプロパティ lane edge が線が右側か左側かを決定します。線のclosedは常にfalseに設定されます。 { "object data" { "poly3d" \[ { "attributes" { "text" \[ { "name" "lane edge", "val" "left" }, { "name" "stream", "val" "lidar" } ] }, "closed" false, "name" "", "val" \[ 1 2647494200238287, 51 51747573498745, 2 315540290283199, 1 0807419132566136, 48 91298533071834, 2 313640304199211, 0 0892715141237751, 34 705936676401016, 2 235569814758307, 0 4442893388935316, 29 60917111552865, 2 1894531147766174, 1 0952988968721313, 17 193981050037397, 2 1397902661132875 ] }, { "attributes" { "text" \[ { "name" "lane edge", "val" "right" }, { "name" "stream", "val" "lidar" } ] }, "closed" false, "name" "", "val" \[ 1 5845765823868767, 51 49487958011918, 2 315540290283199, 1 4004322100638888, 48 888528958803036, 2 313640304199211, 0 23043085215069048, 34 68163859008775, 2 235569814758307, 0 12426061849402326, 29 589636067040036, 2 1894531147766174 ] } ] } } 2dポイントの表現 2dポイントはpoint2dとして表現されます。各 point2d にはオプションの point class 属性があります。単一ポイントの場合は省略できますが、設定する場合はオブジェクトの type と等しくなければなりません。この属性は、他のポイントベースのジオメトリへの将来の使用のために予約されています。 { "openlabel" { , "frames" { "0" { "objects" { "a940239d ff27 4480 8294 c482977a1b32" { "object data" { "point2d" \[ { "attributes" { "text" \[ { "name" "point class", "val" "apoint" }, { "name" "stream", "val" "stream1" } ] }, } ] } }, "e027e626 eb7a 4a8e a9ae 083464e137d1" { "object data" { "point2d" \[ { "attributes" { "text" \[ { "name" "stream", "val" "stream1" } ] }, } ] } } } } }, "metadata" { }, "objects" { "a940239d ff27 4480 8294 c482977a1b32" { "type" "apoint" }, "e027e626 eb7a 4a8e a9ae 083464e137d1" { "type" "anotherpoint" } }, } } 2dポイントグループの表現 ポイントグループは、複数のポイントが同じオブジェクトを参照する場合に使用されます。ポイントグループ内の各ポイントには point class 属性が必須であり、 point class はオブジェクトのtypeと異なる必要があります。 point class の値 「line reference point」 は将来の使用のために予約されています。 ジオメトリコレクションの表現 注意 kognic format version 2 2で導入されました。 タスクビューのジオメトリコレクションに関連するドキュメント。 上記リンクで説明されているジオメトリのコレクションは、 geometry collection をtypeとする予約済みリレーションを持つものとして表現されます。 { "openlabel" { "frames" { "0" { "objects" { "516b6045 87e8 40e4 a104 5eaa600e8e3a" { "object data" { "bbox" \[ { "name" "bbox abc123", "val" \[ ] } ] } }, "fe07e9cf f42c 4b48 b4d8 bab75b7e9827" { "object data" { "poly2d" \[ { "name" "curve abc123", "val" \[ ] } ] } }, "329508b7 729c 4298 8141 f329dbc32ad0" { "object data" { "poly2d" \[ { "name" "curve abc123", "val" \[ ] } ] } }, "4c321584 0e88 4578 b0f0 b5e8c974244b" { "object data" { "text" \[ { "name" "lane", "val" "right" } ] } } } } }, "metadata" { "schema version" "1 0 0", "kognic format version" "2 2", "uuid" "63698712 b18e 426b 9ad5 1b178cc29838" }, "objects" { "516b6045 87e8 40e4 a104 5eaa600e8e3a" { "name" "516b6045 87e8 40e4 a104 5eaa600e8e3a", "object data" { }, "type" "some bbox" }, "fe07e9cf f42c 4b48 b4d8 bab75b7e9827" { "name" "fe07e9cf f42c 4b48 b4d8 bab75b7e9827", "object data" { }, "type" "some line" }, "329508b7 729c 4298 8141 f329dbc32ad0" { "name" "329508b7 729c 4298 8141 f329dbc32ad0", "object data" { }, "type" "some line" }, "4c321584 0e88 4578 b0f0 b5e8c974244b" { "name" "4c321584 0e88 4578 b0f0 b5e8c974244b", "object data" { }, "type" "some collection" } }, "relations" { "0" { "name" "0", "rdf objects" \[ { "uid" "516b6045 87e8 40e4 a104 5eaa600e8e3a", "type" "object" }, { "uid" "fe07e9cf f42c 4b48 b4d8 bab75b7e9827", "type" "object" }, { "uid" "329508b7 729c 4298 8141 f329dbc32ad0", "type" "object" } ], "rdf subjects" \[ { "uid" "4c321584 0e88 4578 b0f0 b5e8c974244b", "type" "object" } ], "type" "geometry collection" } } } } 3dセグメンテーションの表現 分類はランレングス符号化(rle)によって値を表現します。例として、11122222222000000000000は#3v1#8v2#13v0に変換され、文字#の後の数字が繰り返し値の数を定義し、文字vの後に値が定義されます。 "b088dcbf c7fe 46a5 a71d 88ef49bdc107" { "object data" { "binary" \[ { "attributes" { "text" \[ { "val" "lidar", "name" "stream" } ] }, "data type" "", "encoding" "rle", "name" "labels", "val" "\<rle string>" } ] } }

