Skip to content

Commit 66f5038

Browse files
committed
093~099 Feature descriptor matching
1 parent 3f7fc30 commit 66f5038

32 files changed

+1780
-4
lines changed

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,5 +129,12 @@ code_087 | [Video Analysis-Frame Difference Moving Object Analysis](python/code_
129129
code_088 | [Video Analysis-Meanshift](python/code_088) | ✏️
130130
code_089 | [Video Analysis-CamShift](python/code_089) | ✏️
131131
code_090 | [Video Analysis-Object Movement Trajectory Drawing](python/code_090) | ✔️
132-
code_090 | [Object Detection-HAAR Cascade Classification ](python/code_091) | ✔️
133-
code_090 | [Object Detection-HAAR Feature Analysis](python/code_092) | ✔️
132+
code_091 | [Object Detection-HAAR Cascade Classification ](python/code_091) | ✔️
133+
code_092 | [Object Detection-HAAR Feature Analysis](python/code_092) | ✔️
134+
code_093 | [Object Detection-LBP Feature Analysis](python/code_093/opencv_093.py) | ✔️
135+
code_094 | [ORB Feature Critical Point Detection](python/code_094) | ✏️
136+
code_095 | [ORB Feature Descriptor Matching](python/code_095) | ✔️
137+
code_096 | [Multiple Descriptor Matching Methods](python/code_096) | ✏️
138+
code_097 | [Location of Known Objects Based on Descriptor Matches](python/code_097) | ✏️
139+
code_098 | [SIFT Feature Critical Point Detection](python/code_097) | ✔️
140+
code_099 | [SIFT Feature Descriptor Matching](python/code_097) | ✔️

README_CN.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,5 +128,12 @@ code_087 | [视频分析-帧差移动对象分析](python/code_087/opencv_087.py
128128
code_088 | [视频分析-均值迁移](python/code_088) | ✏️
129129
code_089 | [视频分析-连续自适应均值迁移](python/code_089) | ✏️
130130
code_090 | [视频分析-对象移动轨迹绘制](python/code_090) | ✔️
131-
code_090 | [对象检测-HAAR级联分类器](python/code_091) | ✔️
132-
code_090 | [对象检测-HAAR特征分析](python/code_092) | ✔️
131+
code_091 | [对象检测-HAAR级联分类器](python/code_091) | ✔️
132+
code_092 | [对象检测-HAAR特征分析](python/code_092) | ✔️
133+
code_093 | [对象检测-LBP特征分析](python/code_093/opencv_093.py) | ✔️
134+
code_094 | [ORB 特征关键点检测](python/code_094) | ✏️
135+
code_095 | [ORB 特征描述子匹配](python/code_095) | ✔️
136+
code_096 | [多种描述子匹配方法](python/code_096) | ✏️
137+
code_097 | [基于描述子匹配的已知对象定位](python/code_097) | ✏️
138+
code_098 | [SIFT 特征关键点检测](python/code_097) | ✔️
139+
code_099 | [SIFT 特征描述子匹配](python/code_097) | ✔️

python/code_093/faces_lbp.jpg

63.4 KB
Loading

python/code_093/lbpcascade_frontalface_improved.xml

Lines changed: 1469 additions & 0 deletions
Large diffs are not rendered by default.

python/code_093/opencv_093.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import cv2 as cv
2+
3+
#capture = cv.VideoCapture(1)
4+
detector = cv.CascadeClassifier("lbpcascade_frontalface_improved.xml")
5+
image = cv.imread('people.jpg')
6+
7+
faces = detector.detectMultiScale(image, scaleFactor=1.05, minNeighbors=1,
8+
minSize=(30, 30), maxSize=(200, 200))
9+
for x, y, width, height in faces:
10+
cv.rectangle(image, (x, y), (x+width, y+height), (0, 0, 255), 2, cv.LINE_8, 0)
11+
12+
cv.imshow("faces", image)
13+
cv.imwrite("faces_lbp.jpg", image)
14+
15+
c = cv.waitKey(0)
16+
'''
17+
while True:
18+
ret, image = capture.read()
19+
if ret is True:
20+
cv.imshow("frame", image)
21+
faces = detector.detectMultiScale(image, scaleFactor=1.05, minNeighbors=1,
22+
minSize=(30, 30), maxSize=(120, 120))
23+
for x, y, width, height in faces:
24+
cv.rectangle(image, (x, y), (x+width, y+height), (0, 0, 255), 2, cv.LINE_8, 0)
25+
cv.imshow("faces", image)
26+
c = cv.waitKey(50)
27+
if c == 27:
28+
break
29+
else:
30+
break
31+
'''
32+
cv.destroyAllWindows()
33+

python/code_093/people.jpg

32.3 KB
Loading

python/code_094/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#### More Detail, please check the blog of zhihu as below
2+
✈️ ✈️ ✈️ [OpenCV图像处理- 特征点检测、描述子匹配](https://zhuanlan.zhihu.com/p/74040063)

python/code_094/opencv_094.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import cv2 as cv
2+
import numpy as np
3+
4+
src = cv.imread("test.jpg")
5+
cv.namedWindow("input", cv.WINDOW_AUTOSIZE)
6+
cv.imshow("input", src)
7+
# 创建orb检测器
8+
orb = cv.ORB_create()
9+
kps = orb.detect(src)
10+
# -1表示随机颜色
11+
result = cv.drawKeypoints(src, kps, None, -1, cv.DrawMatchesFlags_DEFAULT)
12+
cv.imshow("result", result)
13+
cv.imwrite('orb_result.jpg', result)
14+
cv.waitKey(0)
15+
cv.destroyAllWindows()

python/code_094/orb_result.jpg

136 KB
Loading

python/code_094/test.jpg

119 KB
Loading

0 commit comments

Comments
 (0)