Computer Vision - LAB 03_1. FACE RECOGNITION (LBPH)
·
Python/COMPUTER VISION
Computer Vision - LBPH(Local Binary Patterns Histograms)LBPH(Local Binary Patterns Histograms) 알고리즘은 얼굴 인식에서 널리 사용되는 기법으로, 간단한 구조를 가지고 있다. 이 알고리즘은 이미지의 텍스처를 분석하여 특징을 추출하고, 이를 기반으로 얼굴salmon1113.tistory.com 앞선 내용에서 전처리를 거친 이미지를 바탕으로 LBPH 알고리즘을 통해 얼굴 분류기를 학습시키고, 실행시키고, 평가해보겠다. 1. Training (LBPH)from PIL import Image import cv2 import numpy as np import os def get_image_data():.........ids, face..
Computer Vision - LBPH(Local Binary Patterns Histograms)
·
Python/COMPUTER VISION
LBPH(Local Binary Patterns Histograms) 알고리즘은 얼굴 인식에서 널리 사용되는 기법으로, 간단한 구조를 가지고 있다. 이 알고리즘은 이미지의 텍스처를 분석하여 특징을 추출하고, 이를 기반으로 얼굴을 인식하게된다. 1. Local Binary Patterns (LBP):이미지를 작은 셀(cell)로 나누고, 각 셀의 중앙 픽셀 값을 기준으로 주변 픽셀들과 비교한다. 중앙값보다 크거나 같으면 1, 작으면 0으로 이진화하여 8비트 바이너리 패턴을 생성한다. 예를 들어, 아래와 같은 행렬에서 중앙값(8)을 기준으로 계산하면: 8이상이면 '1', 미만이면 '0'으로 변환한다. 그 후, 패턴을 시계방향으로 읽어 이진수(11100010)를 생성하고, 이를 십진수(226)로 변환하여 저장..
Computer Vision - LAB 02_2. FACE DETECT (CNN with Dlib)
·
Python/COMPUTER VISION
import cv2import dlibimage = cv2.imread("D:\Project\COMPUTER_VISION\Computer Vision Masterclass\Images\people2.jpg")cnn_detector = dlib.cnn_face_detection_model_v1("D:\Project\COMPUTER_VISION\Computer Vision Masterclass\Weights\mmod_human_face_detector.dat")detections = cnn_detector(image, 1)for face in detections: l, t, r, b, c = face.rect.left(), face.rect.top(), face.rect.right(), face.rec..
Computer Vision - LAB 02_1. FACE DETECT (HOG with Dlib)
·
Python/COMPUTER VISION
import cv2import dlibimage = cv2.imread("D:\Project\COMPUTER_VISION\Computer Vision Masterclass\Images\people2.jpg")face_detector_hog = dlib.get_frontal_face_detector()detections = face_detector_hog(image, 1)for face in detections: l, t, r, b = face.left(), face.top(),face.right(),face.bottom() cv2.rectangle(image, (l,t),(r,b),(0,255,0), 2)cv2.imshow("image",image)cv2.waitKey(0)cv2.destroy..
Computer Vision - HOG(History of Oriented Gradients)
·
Python/COMPUTER VISION
HOG(방향 그래디언트 히스토그램)는 CNN과 같이 컴퓨터 비전 및 이미지 처리에서 널리 사용되는 특징 기술(feature descriptor)로, 이미지 내에서 에지(edge)의 방향 분포 를 분석하여 물체의 형태를 인식하는 데 사용된다. 특히 객체 검출(Object Detection) 에 효과적이다. HOG는 Gradient(기울기) 정보를 기반으로 객체의 형상을 인식하며, 이를 이해하려면 Gradient의 크기(Magnitude)와 방향(Direction) 개념을 살펴보자. 1. Gradient(기울기)란?Gradient는 함수의 변화율 을 나타내는 미분 개념이다.이미지에서 Gradient는 픽셀의 밝기(Intensity)가 어떻게 변화하는지를 나타내며, 주어진 방향으로 얼마나 빠르게 밝기가 변하는..