README.md

Download
markdown 131 lines 4.2 KB
  1# Computer_Vision 예제
  2
  3Computer_Vision ν΄λ”μ˜ 20개 λ ˆμŠ¨μ— ν•΄λ‹Ήν•˜λŠ” μ‹€ν–‰ κ°€λŠ₯ν•œ 예제 μ½”λ“œμž…λ‹ˆλ‹€.
  4
  5## 폴더 ꡬ쑰
  6
  7```
  8examples/
  9β”œβ”€β”€ 01_environment_basics.py     # ν™˜κ²½ μ„€μ • 및 기초
 10β”œβ”€β”€ 02_image_basics.py           # 이미지 기초 μ—°μ‚°
 11β”œβ”€β”€ 03_color_spaces.py           # 색상 곡간
 12β”œβ”€β”€ 04_geometric_transforms.py   # κΈ°ν•˜ν•™μ  λ³€ν™˜
 13β”œβ”€β”€ 05_filtering.py              # 이미지 필터링
 14β”œβ”€β”€ 06_morphology.py             # λͺ¨ν΄λ‘œμ§€ μ—°μ‚°
 15β”œβ”€β”€ 07_thresholding.py           # 이진화 및 μž„κ³„μ²˜λ¦¬
 16β”œβ”€β”€ 08_edge_detection.py         # μ—£μ§€ κ²€μΆœ
 17β”œβ”€β”€ 09_contours.py               # μœ€κ³½μ„  κ²€μΆœ
 18β”œβ”€β”€ 10_shape_analysis.py         # λ„ν˜• 뢄석
 19β”œβ”€β”€ 11_hough_transform.py        # ν—ˆν”„ λ³€ν™˜
 20β”œβ”€β”€ 12_histogram.py              # νžˆμŠ€ν† κ·Έλž¨ 뢄석
 21β”œβ”€β”€ 13_feature_detection.py      # νŠΉμ§•μ  κ²€μΆœ
 22β”œβ”€β”€ 14_feature_matching.py       # νŠΉμ§•μ  λ§€μΉ­
 23β”œβ”€β”€ 15_object_detection.py       # 객체 κ²€μΆœ 기초
 24β”œβ”€β”€ 16_face_detection.py         # μ–Όκ΅΄ κ²€μΆœ 및 인식
 25β”œβ”€β”€ 17_video_processing.py       # λΉ„λ””μ˜€ 처리
 26β”œβ”€β”€ 18_camera_calibration.py     # 카메라 μΊ˜λ¦¬λΈŒλ ˆμ΄μ…˜
 27β”œβ”€β”€ 19_dnn_module.py             # λ”₯λŸ¬λ‹ DNN λͺ¨λ“ˆ
 28└── 20_practical_project.py      # μ‹€μ „ ν”„λ‘œμ νŠΈ
 29```
 30
 31## ν™˜κ²½ μ„€μ •
 32
 33```bash
 34# κ°€μƒν™˜κ²½ 생성
 35python -m venv cv-env
 36source cv-env/bin/activate  # Windows: cv-env\Scripts\activate
 37
 38# ν•„μˆ˜ νŒ¨ν‚€μ§€ μ„€μΉ˜
 39pip install opencv-python numpy matplotlib
 40
 41# ν™•μž₯ νŒ¨ν‚€μ§€ (SIFT, SURF λ“±)
 42pip install opencv-contrib-python
 43
 44# μ–Όκ΅΄ μΈμ‹μš© (선택)
 45pip install dlib face_recognition
 46```
 47
 48## μ‹€ν–‰ 방법
 49
 50```bash
 51# κ°œλ³„ 예제 μ‹€ν–‰
 52cd Computer_Vision/examples
 53python 01_environment_basics.py
 54
 55# ν…ŒμŠ€νŠΈ 이미지 μ€€λΉ„ (ν•„μš” μ‹œ)
 56# 예제 μ‹€ν–‰ 전에 sample.jpg λ“±μ˜ ν…ŒμŠ€νŠΈ 이미지가 ν•„μš”ν•©λ‹ˆλ‹€
 57# μ›ΉμΊ  μ˜ˆμ œλŠ” 카메라가 μ—°κ²°λ˜μ–΄ μžˆμ–΄μ•Ό ν•©λ‹ˆλ‹€
 58```
 59
 60## λ ˆμŠ¨λ³„ 예제 κ°œμš”
 61
 62| 레슨 | 주제 | 핡심 ν•¨μˆ˜/κ°œλ… |
 63|------|------|---------------|
 64| 01 | ν™˜κ²½ μ„€μ • | `cv2.__version__`, μ„€μΉ˜ 확인 |
 65| 02 | 이미지 기초 | `imread`, `imshow`, `imwrite`, ROI |
 66| 03 | 색상 곡간 | `cvtColor`, BGR/HSV/LAB, `split`/`merge` |
 67| 04 | κΈ°ν•˜ λ³€ν™˜ | `resize`, `rotate`, `warpAffine`, `warpPerspective` |
 68| 05 | 필터링 | `GaussianBlur`, `medianBlur`, `bilateralFilter` |
 69| 06 | λͺ¨ν΄λ‘œμ§€ | `erode`, `dilate`, `morphologyEx` |
 70| 07 | 이진화 | `threshold`, OTSU, `adaptiveThreshold` |
 71| 08 | μ—£μ§€ κ²€μΆœ | `Sobel`, `Laplacian`, `Canny` |
 72| 09 | μœ€κ³½μ„  | `findContours`, `drawContours`, `approxPolyDP` |
 73| 10 | λ„ν˜• 뢄석 | `moments`, `boundingRect`, `convexHull` |
 74| 11 | ν—ˆν”„ λ³€ν™˜ | `HoughLines`, `HoughLinesP`, `HoughCircles` |
 75| 12 | νžˆμŠ€ν† κ·Έλž¨ | `calcHist`, `equalizeHist`, CLAHE |
 76| 13 | νŠΉμ§•μ  κ²€μΆœ | Harris, SIFT, ORB |
 77| 14 | νŠΉμ§•μ  λ§€μΉ­ | BFMatcher, FLANN, homography |
 78| 15 | 객체 κ²€μΆœ | template matching, Haar cascade |
 79| 16 | μ–Όκ΅΄ κ²€μΆœ | Haar face, dlib landmarks |
 80| 17 | λΉ„λ””μ˜€ 처리 | `VideoCapture`, λ°°κ²½ μ°¨λΆ„, μ˜΅ν‹°μ»¬ν”Œλ‘œμš° |
 81| 18 | μΊ˜λ¦¬λΈŒλ ˆμ΄μ…˜ | μ²΄μŠ€λ³΄λ“œ, μ™œκ³‘ 보정 |
 82| 19 | DNN λͺ¨λ“ˆ | `readNet`, `blobFromImage` |
 83| 20 | μ‹€μ „ ν”„λ‘œμ νŠΈ | λ¬Έμ„œ μŠ€μΊλ„ˆ, μ°¨μ„  κ²€μΆœ |
 84
 85## ν…ŒμŠ€νŠΈ 이미지 μ€€λΉ„
 86
 87예제 싀행을 μœ„ν•΄ λ‹€μŒ ν…ŒμŠ€νŠΈ 이미지가 ν•„μš”ν•©λ‹ˆλ‹€:
 88
 89```bash
 90# κ°„λ‹¨ν•œ ν…ŒμŠ€νŠΈ 이미지 생성 (예제 01에 포함)
 91python 01_environment_basics.py  # ν…ŒμŠ€νŠΈ 이미지 μžλ™ 생성
 92
 93# λ˜λŠ” 직접 이미지 μ€€λΉ„
 94# - sample.jpg: 일반 컬러 이미지
 95# - face.jpg: 얼꡴이 ν¬ν•¨λœ 이미지 (16번 예제용)
 96# - checkerboard.jpg: μ²΄μŠ€λ³΄λ“œ 이미지 (18번 예제용)
 97```
 98
 99## ν•™μŠ΅ μˆœμ„œ
100
101### 1단계: 기초 (01-04)
102```
10301 β†’ 02 β†’ 03 β†’ 04
104```
105
106### 2단계: 이미지 처리 (05-08)
107```
10805 β†’ 06 β†’ 07 β†’ 08
109```
110
111### 3단계: 객체 뢄석 (09-12)
112```
11309 β†’ 10 β†’ 11 β†’ 12
114```
115
116### 4단계: νŠΉμ§•/κ²€μΆœ (13-16)
117```
11813 β†’ 14 β†’ 15 β†’ 16
119```
120
121### 5단계: κ³ κΈ‰ (17-20)
122```
12317 β†’ 18 β†’ 19 β†’ 20
124```
125
126## 참고 자료
127
128- [OpenCV 곡식 λ¬Έμ„œ](https://docs.opencv.org/)
129- [OpenCV-Python νŠœν† λ¦¬μ–Ό](https://docs.opencv.org/4.x/d6/d00/tutorial_py_root.html)
130- [PyImageSearch](https://pyimagesearch.com/)