---
title: 집계된 라이다 및 카메라 시퀀스
slug: api-guide/ko/zITz6tXWks2-tGOo1bSR5
docTags: 
createdAt: 2024-12-16T14:22:23.000Z
---

:::hint{type="info"}
**집계(Aggregation) 기능이 작업 정의(Task Definition)/어노테이션 지침(Annotation Instruction)으로 이전됩니다.**

Kognic IO v2.9.0부터 집계된(aggregated) 씬에 대한 지원 방식이 변경됩니다.

이제 어노테이션 지침(이전 명칭: 작업 정의)에서, 씬 자체가 집계된 라이다 및 카메라 시퀀스가 아니더라도 집계된 뷰를 사용하여 어노테이션을 수행하도록 요구할 수 있습니다.

이러한 경우에도 표준 라이다 및 카메라 시퀀스 씬을 사용할 수 있게 되어, 아래에 설명된 것처럼 별도로 *집계된* 라이다 및 카메라 시퀀스 씬을 만들 필요가 없어졌습니다.

이 방식을 사용하면 하나의 라이다 및 카메라 시퀀스 씬을 집계형 또는 순차형 설정을 혼합하여 여러 번 어노테이션할 수 있으며, 선택적으로 서로 다른 사전 어노테이션을 사용할 수도 있습니다.

이 작업 방식에 대해 더 자세히 알고 싶으시면 Kognic으로 문의해 주세요.
:::

`AggregatedLidarsAndCamerasSeq` 씬은 카메라 이미지와 라이다 포인트 클라우드의 시퀀스로 구성되며, 각 프레임은 1-20개의 카메라 이미지와 1-20개의 포인트 클라우드로 이루어집니다(포인트 클라우드를 사전에 집계한 경우, 첫 번째 프레임은 1-20개의 포인트 클라우드로 구성되고 나머지 프레임에는 포인트 클라우드가 없습니다). `AggregatedLidarsAndCamerasSeq`가 `LidarsAndCamerasSeq`와 다른 점은 포인트 클라우드가 어노테이션 과정에서 시간에 따라 집계되어 첫 번째 프레임의 좌표계를 기준으로 하나의 큰 포인트 클라우드가 된다는 것입니다. 따라서 이 유형의 씬에는 자차 모션 데이터가 **필수**입니다. `AggregatedLidarsAndCamerasSeq` 객체의 각 필드가 무엇에 해당하는지에 대한 자세한 내용은 [개요](docId\:xAwAXwb1W8z2C0XhkUn4P) 섹션을 참고하세요.

사용할 좌표계에 대한 자세한 내용은 [좌표계](docId:2yUiGk3M8sJI14b4ZEkqq)를 참고하세요.

```python
from __future__ import absolute_import

from datetime import datetime
from typing import Optional
from uuid import uuid4

import kognic.io.model.scene.aggregated_lidars_and_cameras_seq as ALCSM
from examples.calibration.calibration import create_sensor_calibration
from kognic.io.client import KognicIOClient
from kognic.io.logger import setup_logging
from kognic.io.model import CreateSceneResponse, EgoVehiclePose, Image, PointCloud, Position, RotationQuaternion


def run(client: KognicIOClient, dryrun: bool = True, **kwargs) -> Optional[CreateSceneResponse]:
    print("Creating Lidar and Camera Sequence Scene...")

    lidar_sensor1 = "lidar"
    cam_sensor1 = "RFC01"
    cam_sensor2 = "RFC02"
    metadata = {"location-lat": 27.986065, "location-long": 86.922623, "vehicle_id": "abg"}

    # Create calibration
    # (Please refer to the API documentation about calibration for more details)
    calibration_spec = create_sensor_calibration(
        f"Collection {datetime.now()}",
        [lidar_sensor1],
        [cam_sensor1, cam_sensor2],
    )
    created_calibration = client.calibration.create_calibration(calibration_spec)

    scene = ALCSM.AggregatedLidarsAndCamerasSequence(
        external_id=f"Aggregated-LCS-full-example-{uuid4()}",
        frames=[
            ALCSM.Frame(
                frame_id="1",
                relative_timestamp=0,
                point_clouds=[
                    PointCloud(
                        filename="./examples/resources/point_cloud_RFL01.las",
                        sensor_name=lidar_sensor1,
                    ),
                ],
                images=[
                    Image(
                        filename="./examples/resources/img_RFC01.jpg",
                        sensor_name=cam_sensor1,
                    ),
                    Image(
                        filename="./examples/resources/img_RFC02.jpg",
                        sensor_name=cam_sensor2,
                    ),
                ],
                metadata={"dut_status": "active"},
                ego_vehicle_pose=EgoVehiclePose(
                    position=Position(x=1.0, y=1.0, z=1.0),
                    rotation=RotationQuaternion(w=0.01, x=1.01, y=1.01, z=1.01),
                ),
            ),
            ALCSM.Frame(
                frame_id="2",
                relative_timestamp=500,
                point_clouds=[
                    PointCloud(
                        filename="./examples/resources/point_cloud_RFL02.las",
                        sensor_name=lidar_sensor1,
                    ),
                ],
                images=[
                    Image(
                        filename="./examples/resources/img_RFC11.jpg",
                        sensor_name=cam_sensor1,
                    ),
                    Image(
                        filename="./examples/resources/img_RFC12.jpg",
                        sensor_name=cam_sensor2,
                    ),
                ],
                ego_vehicle_pose=EgoVehiclePose(
                    position=Position(x=2.0, y=2.0, z=2.0),
                    rotation=RotationQuaternion(w=0.01, x=2.01, y=2.01, z=2.01),
                ),
            ),
            ALCSM.Frame(
                frame_id="3",
                relative_timestamp=1000,
                point_clouds=[
                    PointCloud(
                        filename="./examples/resources/point_cloud_RFL02.csv",
                        sensor_name=lidar_sensor1,
                    ),
                ],
                images=[
                    Image(
                        filename="./examples/resources/img_RFC11.jpg",
                        sensor_name=cam_sensor1,
                    ),
                    Image(
                        filename="./examples/resources/img_RFC12.jpg",
                        sensor_name=cam_sensor2,
                    ),
                ],
                ego_vehicle_pose=EgoVehiclePose(
                    position=Position(x=3.0, y=3.0, z=3.0),
                    rotation=RotationQuaternion(w=0.01, x=2.01, y=2.01, z=2.01),
                ),
            ),
        ],
        calibration_id=created_calibration.id,
        metadata=metadata,
    )
    # Create scene
    return client.aggregated_lidars_and_cameras_seq.create(scene, dryrun=dryrun, **kwargs)


if __name__ == "__main__":
    setup_logging(level="INFO")
    client = KognicIOClient()

    # Project - Available via `client.project.get_projects()`
    project = "<project-identifier>"

    run(client, project=project)
```

:::hint{type="success"}
### dryrun으로 씬 검증하기

메서드 호출 시 `dryrun` 파라미터를 true로 설정하면, API를 사용해 씬을 검증만 하고 실제로 생성하지는 않습니다.
:::

:::hint{type="success"}
### 캘리브레이션 재사용하기

가능하다면 여러 씬에 동일한 캘리브레이션을 재사용할 수 있으며, 그렇게 하는 것이 좋습니다.
:::
