Skip to content

손 찾기 ​

인스턴스 선언 ​

손 찾기(HandDetection) 블록을 작업 영역에 추가하면, Python 코드에는 다음과 같은 인스턴스 선언이 자동으로 삽입됩니다:

python
hand_detection = HandDetection(0)
# 여러 인스턴스가 있는 경우
hand_detection_1 = HandDetection(1)

매개변수 ​

이름구분설명범위 / 종류기본값
index드롭다운 옵션인스턴스 번호 (0부터 시작)0 이상 정수0

카메라 장치 선택하기 ​

손 찾기를 위한 카메라를 설정합니다.

device

매개변수 ​

이름구분설명범위 / 종류기본값
unit드롭다운 옵션카메라 장치 이름시스템 카메라 라벨-

Python ​

python
hand_detection = HandDetection(0)

hand_detection.device('')

모델 로드하기 ​

학습된 손 모델을 불러옵니다. '손 찾기' 모듈의 기능들을 사용하기 위해서는 이 작업이 반드시 필요합니다.

load_model

매개변수 ​

이름구분설명범위 / 종류기본값
wait체크박스로드 완료 대기 여부TRUE / FALSETRUE

Python ​

python
hand_detection = HandDetection(0)

hand_detection.load_model(wait=True)

최대 손 수 설정하기 ​

손을 찾을 때, 한 손을 기준으로 찾을지, 양손을 기준으로 찾을지 결정합니다.

max_hands

매개변수 ​

이름구분설명범위 / 종류기본값
unit드롭다운 옵션손 개수한 손(one), 두 손(both)-

Python ​

python
hand_detection = HandDetection(0)

hand_detection.max_hands('one')
hand_detection.max_hands('both')

한 번 인식하기 ​

현재 화면에 있는 손을 찾아 딱 한번 표시합니다.

detect_once

매개변수 ​

(없음)

Python ​

python
hand_detection = HandDetection(0)

hand_detection.detect_once()

연속 인식 시작 / 중지 ​

현재 화면에 있는 손을 계속해서 따라가며 화면 상에 표시합니다.

detect_continuous

매개변수 ​

이름구분설명범위 / 종류기본값
unit드롭다운 옵션동작시작(start), 중지(stop)-

Python ​

python
hand_detection = HandDetection(0)

# unit = "start"
hand_detection.detect_continuous()
# unit = "stop"
hand_detection.stop()

인식 화면 표시하기 ​

카메라 화면에 손 찾기 결과를 표시할지 말지를 결정합니다.

display

매개변수 ​

이름구분설명범위 / 종류기본값
on드롭다운 옵션표시 ON / OFF보이기(on=True), 숨기기(off=False)TRUE

Python ​

python
hand_detection = HandDetection(0)

hand_detection.display(True)
hand_detection.display(False)

손 부위 좌표 ​

지정한 손의 손바닥/손목 위치 정보를 반환합니다.

hand_data

매개변수 ​

이름구분설명범위 / 종류기본값
side드롭다운 옵션손 방향왼손(left), 오른손(right)-
unit드롭다운 옵션손 부위손바닥(palm), 손목(wrist)-
pos드롭다운 옵션좌표/크기 종류x, y-

Python ​

python
hand_detection = HandDetection(0)

hand_detection.hand('left', 'palm', 'x')
hand_detection.hand('right', 'wrist', 'y')
hand_detection.hand('left', 'hand', 'min_x')
hand_detection.hand('right', 'palm', 'width')

손가락 관절 좌표 ​

지정한 손가락의 관절 좌표를 반환합니다.

joint_data

매개변수 ​

이름구분설명범위 / 종류기본값
side드롭다운 옵션손 방향왼손(left), 오른손(right)-
unit드롭다운 옵션손가락엄지(thumb), 검지(index), 중지(middle), 약지(ring), 새끼(pinky)-
joint드롭다운 옵션관절 위치첫째 마디(first), 둘째 마디(second), 셋째 마디(third), 끝(last)-
pos드롭다운 옵션좌표x, y-

Python ​

python
hand_detection = HandDetection(0)

hand_detection.finger('left', 'index', 'first', 'x')
hand_detection.finger('right', 'thumb', 'last', 'y')

손 사각형 정보 ​

지정한 손 영역 사각형의 위치/크기 값을 반환합니다.

hand_square

매개변수 ​

이름구분설명범위 / 종류기본값
side드롭다운 옵션손 방향왼손(left), 오른손(right)-
unit드롭다운 옵션손 부위손(hand), 손바닥(palm)-
pos드롭다운 옵션사각형 정보최소 x(min_x), 최대 x(max_x), 최소 y(min_y), 최대 y(max_y), 폭(width), 높이(height), 넓이(area)-

Python ​

python
hand_detection = HandDetection(0)

hand_detection.hand('left', 'hand', 'min_x')
hand_detection.hand('right', 'palm', 'width')

손과 손 사이 거리 ​

두 손 부위 사이의 거리를 반환합니다.

hand_to_hand_distance

매개변수 ​

이름구분설명범위 / 종류기본값
unit1입력값 (문자열)첫 번째 손 부위손: 'side_unit' (예: 'left_palm'). side=left/right, unit=palm/wrist/hand-
unit2입력값 (문자열)두 번째 손 부위손: 'side_unit' (예: 'right_palm'). side=left/right, unit=palm/wrist/hand-
type드롭다운 옵션거리 종류거리(생략 또는 None), 가로 거리(horizontal), 세로 거리(vertical)None

Python ​

python
hand_detection = HandDetection(0)

# 손 ↔ 손 / 거리
hand_detection.get_distance('left_palm', 'right_palm')

손과 손가락 사이 거리 ​

손 부위와 손가락 관절 사이의 거리를 반환합니다.

hand_to_joint_distance

매개변수 ​

이름구분설명범위 / 종류기본값
unit1입력값 (문자열)첫 번째 부위손: 'side_unit' (예: 'left_palm').side=left/right, unit=palm/wrist/hand-
unit2입력값 (문자열)두 번째 부위손가락: 'side_unit_joint' (예: 'right_index_first'). unit=thumb/index/middle/ring/pinky, joint=first/second/third/last-
type드롭다운 옵션거리 종류거리(생략 또는 None), 가로 거리(horizontal), 세로 거리(vertical)None

Python ​

python
hand_detection = HandDetection(0)

# 손 ↔ 손가락 관절 / 가로 거리
hand_detection.get_distance('left_palm', 'right_index_first')

손가락과 손가락 사이 거리 ​

두 손가락 관절 사이의 거리를 반환합니다.

joint_to_joint_distance

매개변수 ​

이름구분설명범위 / 종류기본값
unit1입력값 (문자열)첫 번째 부위손가락: 'side_unit_joint' (예: 'left_thumb_last'). unit=thumb/index/middle/ring/pinky, joint=first/second/third/last-
unit2입력값 (문자열)두 번째 부위손가락: 'side_unit_joint' (예: 'right_index_first'). unit=thumb/index/middle/ring/pinky, joint=first/second/third/last-
type드롭다운 옵션거리 종류거리(생략 또는 None), 가로 거리(horizontal), 세로 거리(vertical)None

Python ​

python
hand_detection = HandDetection(0)

# 손가락 관절 ↔ 손가락 관절 / 세로 거리
hand_detection.get_distance('left_thumb_last', 'right_index_first', 'vertical')

모델 상태 ​

손 모델 로딩 상태를 반환합니다.
아직 불러오지 않았으면 0, 불러오는 중이면 1, 불러오기를 완료했으면 2를 반환합니다.

model_state

매개변수 ​

(없음)

Python ​

python
hand_detection = HandDetection(0)

hand_detection.model_state()

손 감지 여부 ​

손을 찾았는지 여부

detected

매개변수 ​

(없음)

Python ​

python
hand_detection = HandDetection(0)

hand_detection.detected()