Skip to content
Navigation Menu
Sign in
Products
Platform
GitHub
Repository hosting, code review, and collaboration
Copilot
AI coding agent for tasks, projects, and automated work
Build & Ship
Actions
CI/CD and automation
Code Quality
Quality analysis, fixes, and enforcement
Codespaces
Cloud development environments
Secure
Code Security
Vulnerability detection and remediation
Secret Protection
Secret scanning and leak prevention
All Features
Developers
Learn
Documentation
Training
Certifications
Build
Build with Copilot
Customize Copilot
Integrations
Explore
Trending repos
GitHub Sponsors
Developer articles
Changelog
Changelog
Your source for the latest features, improvements, and fixes across GitHub products, all in one place.
Businesses
By Stage
Enterprises
Team
Startups
Nonprofits
By Industry
Healthcare
Financial services
Manufacturing
Government
See all industries
Evaluate GitHub
Why GitHub
Customer Stories
Business insights
Trust Center
Add-ons
GitHub Advanced Security
Enterprise-grade code security
Copilot for business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Resources
Learn & Connect
Documentation
Resource center
Blog
Events & webinars
Community Forum
Customer Stories
Integrations
Support
Customer support
Training
GitHub Status
Company
About
Partners
Changelog
GitHub Universe
GitHub Universe
The event for developers, by developers — talks, workshops, and what’s next for GitHub.
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
ConAlgorithm
OpenCV-Python-Tutorial
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
master
Breadcrumbs
OpenCV-Python-Tutorial
/
ch35-BRIEF
/
brief.py
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
35 lines (26 loc) · 1.1 KB
master
Breadcrumbs
OpenCV-Python-Tutorial
/
ch35-BRIEF
/
brief.py
Copy path
Top
File metadata and controls
Code
Blame
35 lines (26 loc) · 1.1 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# -*- coding: utf-8 -*-
# @Time : 2017/7/13 下午3:38
# @Author : play4fun
# @File : brief.py
# @Software: PyCharm
"""
brief.py:
算法使用的是已经平滑后的图像
非常重要的一点是 BRIEF 是一种特征描述符 它不提供查找特征的方法。 所以我们不得不使用其他特征检测器 比如 SIFT 和 SURF 等。
原始文献推荐 使用 CenSurE 特征检测器 种算法很快。而且 BRIEF 算法对 CenSurE 关键点的描述效果 比 SURF 关键点的描述更好。
简单来 BRIEF 是一种对特征点描述符运算和匹 的快速方法。 这种算法可以实现很高的识别率,除非出现平面内的大旋 。
"""
import
numpy
as
np
import
cv2
from
matplotlib
import
pyplot
as
plt
img
=
cv2
.
imread
(
'../data/blox.jpg'
,
0
)
# Initiate FAST detector
star
=
cv2
.
xfeatures2d
.
StarDetector_create
()
# Initiate BRIEF extractor
brief
=
cv2
.
xfeatures2d
.
BriefDescriptorExtractor_create
()
# find the keypoints with STAR
kp
=
star
.
detect
(
img
,
None
)
# compute the descriptors with BRIEF
kp
,
des
=
brief
.
compute
(
img
,
kp
)
print
(
brief
.
descriptorSize
())
print
(
des
.
shape
)
You can’t perform that action at this time.