머신러닝/openCV 8

openCV 중급 손가락으로 그리기

손가락으로 글씨를 쓰고, 해당 수식을 gemini 모델로 계산하여 답을 나오게 하는 코드이다.  handTrackingModule.py#Importing All the Required Librariesimport cv2import mediapipe as mpclass handDetector(): def __init__(self, mode = False, max_hands = 1, model_complexity = 1, min_det_conf = 0.7, min_tracking_confidence = 0.7): self.mode = mode self.max_hands = max_hands self.model_complexity = model_complexity ..

머신러닝/openCV 2025.03.05

openCV 기초, mediapipe 설치 에러 해결하기, dll문제

1. 발생한 에러ImportError: DLL load failed while importing _framework_bindings: DLL 초기화 루틴을 실행할 수 없습니다. mediapipe 를 임포트 하려고 하는 중에 발생한 에러였다.  이를 해결하기 위한 방법으로 챗이 제안한 것은 다양했다. 다른 방법으로는 해결되지 않았다. 마지막 방법이었던 파이썬 3.9를 설치하니 바로 해결! 결국 파이썬 버전이 맞지 않아서 되지 않았던 것이다.  찾아보니, 나와 같은 mediapipe 설치 에러 문제가 많이 발생하는데 설치한 패키지와 파이썬 버전의 호환 때문이 대다수다.  파이썬을 설치하는 방법은 아래의 공식홈페이지에서 3.9 버전 중 하나를 설치하는 것https://www.python.org/download..

머신러닝/openCV 2025.03.04

openCV 기초 shape detection, contour, approx, 다각형 찾기, bounding 그리기

목차contour : 이미지에서 동일한 색상 또는 강도를 가진 영역의 경계를 나타내는 곡선. openCV에서는 contour를 이용하여 물체의 외곽선을 감지하고 분석하는 데 사용함.  steps1. convert the image into Gray Scale2. Find the edges in the image using Canny Edge Detector3. Find and Draw the Contours4. Find the Corner Points  1. convert the image into Gray Scale2. Find the edges in the image using Canny Edge Detectorimport cv2image = cv2.imread("../Resources/Images/..

머신러닝/openCV 2025.02.22

openCV 기초, join, 사진 합치기 쌓기, 색깔 감지하기, bitwise_and, mask

목차 openCV 기초, join, 사진 합치기 쌓기, 색깔 감지하기, bitwise_and, mask 1. 가로 및 세로로 쌓기import cv2import numpy as npimage = cv2.imread("../Resources/Images/image2.jpg")#We will stack the images with itself, first i will use the horizontal stack functionimageHor = np.hstack((image, image, image, image))imageVert = np.vstack((image, image, image))cv2.imshow("Horizontal Stack", imageHor)cv2.imshow("Vertical Stack"..

머신러닝/openCV 2025.02.20