---
title: 라이다 및 카메라
slug: api-guide/ko/pxOyrVC96zBdxcsNN51o2
docTags: 
createdAt: 2024-12-16T14:16:02.000Z
---

:::hint{type="info"}
kognic-io 2.5.0부터는 씬 타입(`LidarsAndCameras`)을 노출하지 않고 단일 모델로 모든 씬 생성을 단순화한 새로운 씬 모델 사용을 권장하고 있습니다. 가능하다면 이를 채택하는 것이 좋지만, 이 모델은 단일 프레임 시퀀스를 생성하므로 `LidarsAndCameras` 씬을 요구하는 기존 요청과 호환되지 않을 수 있다는 점에 유의하세요.
:::

`LidarsAndCameras`는 1-20개의 카메라 이미지와 1-20개의 포인트 클라우드를 포함하는 *단일* 프레임으로 구성됩니다. `LidarsAndCameras` 객체의 각 필드가 무엇에 해당하는지에 대한 자세한 내용은 [개요](docId\:xAwAXwb1W8z2C0XhkUn4P) 섹션을 참고하세요.

```python
from __future__ import absolute_import

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

import kognic.io.model.scene.lidars_and_cameras as LCM
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, Image, PointCloud


def run(client: KognicIOClient, dryrun: bool = True, **kwargs) -> Optional[CreateSceneResponse]:
    print("Creating Lidars And Cameras 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 = LCM.LidarsAndCameras(
        external_id=f"lidars-and-cameras-example-{uuid4()}",
        frame=LCM.Frame(
            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,
                ),
            ],
        ),
        calibration_id=created_calibration.id,
        metadata=metadata,
    )

    # Create scene
    return client.lidars_and_cameras.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를 사용해 씬을 검증만 하고 실제로 생성하지는 않습니다.
:::
