본문 바로가기
카테고리 없음

토픽 발행

by 서나하 2025. 6. 6.

토픽(topic)

노드들끼리 데이터를 주고받기 위해 사용하는 이름 붙은 통신 채널

Publish 하는 노드는 데이터를 전파하고, Subscribe 하는 노드는 그 데이터를 수신하는 개념.

 

 

열화상 카메라

system_profiler SPCameraDataType

프레임 추출하는 코드

import cv2
import datetime

camera_index = 0
cap = cv2.VideoCapture(camera_index)

if not cap.isOpened():
    print(f"Cannot open camera {camera_index}.")
    exit()

ret, frame = cap.read()
if ret:
    now = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
    filename = f"thermal_frame_{now}.png"
    cv2.imwrite(filename, frame)
    print(f"{filename} saved successfully.")
else:
    print("Failed to read frame.")

cap.release()

print("Fin.")

 

 

도커 환경에서 이 맥에 연결된 카메라에 접근할 수 있게 해야 함.

 

댓글