OpenMV 펌웨어 v5.0.0용 · MicroPython v1.28 기반 · 문서 빌드일: 2026년 6월 19일

머신 비전,
더 쉽게.

실시간 얼굴 감지, AprilTag 추적, QR 스캔, YOLO. 순수 MicroPython으로 모두 디바이스에서 실행. 호스트 컴퓨터도, 클라우드도 필요 없습니다.

새로운 소식 OpenMV 펌웨어 v5.0.0 변경 이력 보기

Hello world

import csi
import time
import ml
from ml.postprocessing.ultralytics import YoloV8

csi0 = csi.CSI()
csi0.reset()
csi0.pixformat(csi.RGB565)
csi0.framesize(csi.VGA)
csi0.snapshot(time=2000)  # let AWB/AGC stabilize

# Built-in single-class person detector model.
model = ml.Model("/rom/yolov8n_192.tflite",
                 postprocess=YoloV8(threshold=0.4))
clock = time.clock()

while True:
    clock.tick()
    img = csi0.snapshot()
    # predict returns a list per class of ((x, y, w, h), score) tuples.
    for class_dets in model.predict([img]):
        for rect, score in class_dets:
            img.draw_rectangle(rect, color=(0, 255, 0))
    print(clock.fps(), "fps")

실시간 사람 추적

온보드 YOLOv8 모델은 단일 클래스 사람 감지기 — int8 양자화되어 ROM에 탑재됩니다.

/rom/yolov8n_192.tflite에서 로드 — SD 카드나 다운로드 불필요.
NPU 탑재 보드인 OpenMV N6 및 AE3에서 실시간으로 실행됩니다.
Roboflow에서 학습시킨 YOLOv8 모델을 가져와 같은 방법으로 로드하세요.
import csi
import math
import time

csi0 = csi.CSI()
csi0.reset()
csi0.pixformat(csi.RGB565)
csi0.framesize(csi.QVGA)
csi0.snapshot(time=2000)  # let AWB/AGC stabilize
csi0.auto_gain(False)
csi0.auto_whitebal(False)

clock = time.clock()

while True:
    clock.tick()
    img = csi0.snapshot()
    for tag in img.find_apriltags():
        img.draw_detection(tag, color1=(255, 0, 0), color2=(0, 255, 0))
        deg = math.degrees(tag.rotation)
        print("ID %d  rotation %.1f deg" % (tag.id, deg))
    print(clock.fps(), "fps")

AprilTag 위치 파악 및 식별

AprilTag는 2D 기준 마커로 — 모션 블러와 부분 가려짐에 강하며 완전한 3D 포즈를 제공합니다.

내장 감지기 — 모델 파일이나 학습이 필요 없습니다.
ID와 완전한 6-DoF 포즈 반환 — x/y/z 이동 및 x/y/z 회전.
로봇 캘리브레이션, AR 마커, 실내 위치 측정에 사용하세요.
import csi
import time
import ml
from ml.postprocessing.mediapipe import BlazeFace

csi0 = csi.CSI()
csi0.reset()
csi0.pixformat(csi.RGB565)
csi0.framesize(csi.VGA)
csi0.window((400, 400))  # square window for best results
csi0.snapshot(time=2000)  # let AWB/AGC stabilize

model = ml.Model("/rom/blazeface_front_128.tflite",
                 postprocess=BlazeFace(threshold=0.4))
clock = time.clock()

while True:
    clock.tick()
    img = csi0.snapshot()
    for rect, score, keypoints in model.predict([img]):
        img.draw_rectangle(rect, color=(0, 0, 255))
        ml.utils.draw_keypoints(img, keypoints, color=(255, 0, 0))
    print(clock.fps(), "fps")

BlazeFace로 얼굴 감지

Google의 BlazeFace는 경량 TensorFlow Lite 얼굴 감지기로 바운딩 박스와 얼굴당 6개의 랜드마크를 반환합니다.

/rom/blazeface_front_128.tflite에서 로드 — 사전 양자화되어 다운로드 불필요.
얼굴당 6개의 키포인트: 눈, 코, 입, 귀.
개인 정보 걱정 없음 — 프레임이 카메라 밖으로 나가지 않습니다.
import csi
import time

csi0 = csi.CSI()
csi0.reset()
csi0.pixformat(csi.RGB565)
csi0.framesize(csi.QVGA)
csi0.snapshot(time=2000)  # let AWB/AGC stabilize
csi0.auto_gain(False)

clock = time.clock()

while True:
    clock.tick()
    img = csi0.snapshot()
    for code in img.find_qrcodes():
        img.draw_rectangle(code.rect, color=(255, 0, 0))
        print(code.payload)
    print(clock.fps(), "fps")

실시간 피드에서 QR 코드 스캔

내장 QR 디코더는 기울어지거나 왜곡되거나 부분적으로 가려진 코드를 처리합니다.

각 결과는 버전, ECC 레벨, 코너 좌표도 제공합니다.
숫자, 영숫자, 이진수, 한자 데이터 모드.
디코딩된 페이로드를 Python 문자열로 반환 — 바로 사용 가능합니다.
import csi
import time

csi0 = csi.CSI()
csi0.reset()
csi0.pixformat(csi.RGB565)
csi0.framesize(csi.QVGA)
csi0.snapshot(time=2000)  # let AWB/AGC stabilize
csi0.auto_gain(False)
csi0.auto_whitebal(False)

# LAB thresholds: (L_min, L_max, A_min, A_max, B_min, B_max)
thresholds = [
    (30, 100, 15, 127, 15, 127),   # red
    (30, 100, -64, -8, -32, 32),   # green
]

clock = time.clock()

while True:
    clock.tick()
    img = csi0.snapshot()
    for blob in img.find_blobs(thresholds, pixels_threshold=200):
        img.draw_rectangle(blob.rect, color=(255, 0, 0))
        img.draw_cross((blob.cx, blob.cy))
    print(clock.fps(), "fps")

색상 블롭 찾기

find_blobs는 하나 이상의 LAB 임계값과 일치하는 연결된 픽셀 영역을 반환합니다.

조명에 맞게 임계값을 조정하세요 — 먼저 자동 게인과 자동 화이트 밸런스를 비활성화하세요.
한 번의 호출로 다중 색상 추적을 위해 여러 임계값을 전달하세요.
pixels_threshold는 작은 감지를 필터링하고, merge=True는 겹치는 블롭을 합칩니다.
import csi
import time

csi0 = csi.CSI()
csi0.reset()
csi0.pixformat(csi.GRAYSCALE)
csi0.framesize(csi.VGA)
csi0.window((640, 80))  # narrow strip for fast linear scanning
csi0.snapshot(time=2000)  # let AWB/AGC stabilize
csi0.auto_gain(False)
csi0.auto_whitebal(False)

clock = time.clock()

while True:
    clock.tick()
    img = csi0.snapshot()
    for code in img.find_barcodes():
        img.draw_rectangle(code.rect, color=(0, 255, 0))
        print(code.payload, "(quality %d)" % code.quality)
    print(clock.fps(), "fps")

1D 바코드 읽기

프레임 어디서든 1D 바코드를 찾고 페이로드를 디코딩합니다.

ZBar 라이브러리 기반 — EAN, UPC, Code 39/93/128, Codabar, ITF, ISBN, DataBar를 인식합니다.
가장 빠른 선형 스캔을 위해 그레이스케일로 창 스트립을 사용하세요.
각 결과는 형식, 페이로드, 회전, 코너, 바운딩 사각형을 포함합니다.
import csi
import time
import ml
from ml.postprocessing.mediapipe import HandLandmarks

csi0 = csi.CSI()
csi0.reset()
csi0.pixformat(csi.RGB565)
csi0.framesize(csi.VGA)
csi0.window((400, 400))  # square window for the model
csi0.snapshot(time=2000)  # let AWB/AGC stabilize

# Connections between the 21 keypoints — palm + 5 fingers.
hand_lines = ((0, 1), (1, 2), (2, 3), (3, 4), (0, 5), (5, 6),
              (6, 7), (7, 8), (5, 9), (9, 10), (10, 11), (11, 12),
              (9, 13), (13, 14), (14, 15), (15, 16), (13, 17), (17, 18),
              (18, 19), (19, 20), (0, 17))

model = ml.Model("/rom/hand_landmarks_full_224.tflite",
                 postprocess=HandLandmarks(threshold=0.4))
clock = time.clock()

while True:
    clock.tick()
    img = csi0.snapshot()
    # predict returns a list per hand: index 0 = left, index 1 = right.
    for detections in model.predict([img]):
        for rect, score, keypoints in detections:
            ml.utils.draw_skeleton(img, keypoints, hand_lines,
                                   kp_color=(255, 0, 0),
                                   line_color=(0, 255, 0))
    print(clock.fps(), "fps")

손 키포인트 21개 추적

Google의 MediaPipe Hand Landmarks 모델은 감지된 각 손에 21개의 관절을 배치합니다 — 손목, 관절, 손가락 끝.

/rom/hand_landmarks_full_224.tflite에서 로드 — 손바닥 감지 없이 독립 실행.
손당 하나의 목록 반환 — 인덱스 0은 왼손, 인덱스 1은 오른손.
ml.utils.draw_skeleton은 한 번의 호출로 21개의 관절과 연결을 모두 그립니다.

OpenMV가 처음이신가요?

단계별 튜토리얼부터 시작하세요 — 하드웨어 설정, IDE, 기본 스크립트, 첫 번째 실제 프로젝트를 위한 팁을 다룹니다.

핵심 라이브러리

하드웨어, 카메라, 이미지 처리, ndarray, ML, 멀티태스킹, 네트워킹, 웹 서버, Bluetooth — 모두 MicroPython으로.

모든 라이브러리 보기 →

보드별 탐색

OpenMV Cam을 선택하여 핀아웃, 사양, 보드별 빠른 참조를 확인하세요.

지원되는 모든 보드 보기 →

쉴드

OpenMV Cam에 연결하는 애드온 보드 — 네트워킹, 모터 제어, 디스플레이 등.

모든 쉴드 보기 →

센서

보드 간 커넥터에 연결하는 카메라 모듈 및 센서 어댑터 — 컬러, 모노크롬, 열화상, 이벤트 기반 비전.

모든 센서 보기 →

추가 리소스

커뮤니티 & 링크