컴퓨터 비젼(Computer Vision)/영상 분할과 객체 검출
-
HOG 보행자 검출컴퓨터 비젼(Computer Vision)/영상 분할과 객체 검출 2022. 2. 17. 18:16
HOG(Historgram of Oriented Gradients) feature로, 영상의 지역적 그래디언트 방향 정보를 특징 벡터로 사용 다양한 객체 인식에서 활용됨 논문 HOG 알고리즘 동작 방법 입력 영상 -> Crop -> 크기 정규화 64x128 -> 그라디언트 계산 -> 8x8 크기의 셀 분할 -> 각 셀마다 방향과 크기 성분을 이용하여 방향 히스토그램 계산 블록 히스토그램 구하기 8x8 셀 4개를 하나의 블록으로 지정 즉, 블록 하나의 크기는 16x16 8픽셀 단위로 이동 (stride = 8) 각 블록의 히스토그램 빈(bin) 개수는 4x9=36개 특징 벡터의 차원 하나의 부분 영상 패치에서의 특징 벡터 크기 7x15x36 = 3780 HOG Descriptor 객체 생성 및 보행자 검출..
-
캐스케이드 분류기컴퓨터 비젼(Computer Vision)/영상 분할과 객체 검출 2022. 2. 17. 16:28
캐스케이드 분류기(Cascade Classifier) Positive 샘플(특정 목표 객체)과 Negative 샘플(목표 객체가 아닌 것) 에 대한 최소 수 백개의 영상을 이용해 학습된되는 검출기로, 1) Haar-like feature를 사용하며, 2) Adaboost 기반의 분류를 수행하며, 3) Cascade 방식을 통해 빠른 속도로 동작한다. Haar-likfe feature 사각형 형태의 필터 집합 흰색 사각형 영역 픽셀 값의 합에서 검정색 사각형 영역 픽셀 값을 뺀 결과 값을 추출 24x24 Cropped 영상에서 얼굴 판별에 유용한 Haar-like feature를 선별 위 행은 2개의 좋은 feature을 보인다. 첫 번째 feature는 눈 영역이 코 영역보다 어둡다라는 특징에 초점을 맞..
-
템플릿 매칭컴퓨터 비젼(Computer Vision)/영상 분할과 객체 검출 2022. 2. 17. 15:14
템플릿 매칭(Template Matching) 입력 영상에서 (작은 크기의) 템플릿 영상과 일치하는 부분을 찾는 기법 템플릿: 찾을 대상이 되는 작은 영상, 패치 또는 커널이라고도 불림 템플릿 매칭 함수 cv2.matchTemplate(image, templ, method, result=None, mask=None) -> result image: 입력 영상. 8비트 또는 32비트. templ: 템플릿 영상. image 보다 같거나 작은 크기이며 같은 타입으로 지정 method: 비교 방법. cv2._TM_으로 시작하는 플래그 지정. result: 비교 결과 행렬. np.ndarray, dtype=np.float32 이미지 크기가 W*H, templ의 크기가 w*h 이면, result의 크기는 (W-w+1..
-
모벤트 기반 객체 검출컴퓨터 비젼(Computer Vision)/영상 분할과 객체 검출 2022. 2. 16. 17:07
모멘트 영상의 형태를 표현하는 일련의 실수값 특정 함수 집합과의 상관 관계(correlation) 형태로 계산 Geometric moments, Central moments, Normalized central moments, Legendre moments, ... 등이 있음 Hu's Seven Invariant Moments 3차 이하의 정규화된 중심 모멘트를 조합하여 만든 7개의 모멘트 값 영상의 크기, 회전,이동, 대칭 변환에 불변 모양 비교 함수 cv2.matchShapes(contour1, contour2, method, parameter) -> retval contour1: 첫 번째 외곽선 또는 그레이스케일 영상 contour2: 두 번째 외곽선 또는 그레이스케일 영상 method: 비교 방법 ..
-
영상 분할과 객체 검출컴퓨터 비젼(Computer Vision)/영상 분할과 객체 검출 2022. 2. 16. 15:20
그랩컷 그래프 컷(graph cut) 기반의 영약 분할 알고리즘 영상의 픽셀을 그래프 정점으로 간주하고, 픽셀들을 두 개의 그룹으로 나누는 최적의 컷(Max Flow Minimun Cut)을 찾는 방식 그랩컷 영상 분할 동작 방식 사각형 지정 자동 분할 사용자가 지정한 전경/배경 정보를 활용하여 영상 분할 그랩컷 함수 cv2.grabCut(img, mask, rect, bgdModel, fgdModel, iterCount, mode=None) -> mask, bgdModel, fgdModel img: 입력 영상. 8비트 3채널 영상. mask: 입출력 마스크. cv2.GC_BGD, cv2.GC_FGD, cv2.GC_PR_BGD, cv2.GC_PR_FGD, 4 개의 값으로 구성됨. (PR: probably..