当前位置:网站首页>Reading of double pointer instrument panel (II) - Identification of dial position
Reading of double pointer instrument panel (II) - Identification of dial position
2022-06-22 14:50:00 【Jialanxiang】
The contents of this chapter : Dial position identification and position fixation
Upper dial :

analysis :
1. The dial is round , There are multiple circular interferences in the whole frame of video , Including the small circle in the center of the pointer , A large circle and a small circle on the outside of the dial and the circle outside the screenshot .
2. Circle Recognition itself involves a lot of computation , Will take up a lot of resources
solve :
1. Circular dial standard identification
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) # Convert to gray channel
A, binary = cv2.threshold(gray, 0, 255, cv2.THRESH_BINARY + cv2.THRESH_OTSU) # Two valued
circles = cv2.HoughCircles(
binary, cv2.HOUGH_GRADIENT, 2, 1000, param1=100, param2=100, minRadius=10, maxRadius=5000) # Hoff identification
if circles is not None: # If a circle is recognized
for circle in circles[0]:
# Get the coordinates and radius of the circle
x = int(circle[0])
y = int(circle[1])
r = int(circle[2])
MX1 = x - r
MX2 = x + r
MY1 = y - r
MY2 = y + r
JDMX1 = 0
if MX1 < 0:
JDMX1 = -MX1
MX1 = MX1 - MX1
print(1)
if MX2 < 0:
MX2 = MX2 - MX2
print(2)
if MY1 < 0:
JDMY1 = -MY1
MY1 = MY1 - MY1
print(3)
if MY2 < 0:
MY2 = MY2 - MY2
print(4)
draw(MY1, MY2, MX1, MX2)
def draw(MY1, MY2, MX1, MX2):
while (True):
ret, frame = cap.read()
maxTable = frame[MY1: MY2, MX1: MX2] # Cut out the square of the identified circle
a, b, c, d = msk(maxTable, x, y)
# cv2.imshow('maxTable', maxTable)
cv2.circle(frame, (x, y), r, (255, 255, 255), 3) # Mark circle
cv2.circle(frame, (x, y), 3, (255, 255, 0), -1) # Mark the center of the circle 2. Use the first calculated position of the center of the circle and the radius of the circle to intercept , Make the circular position fixed , Subsequent operations are analyzed at the intercepted location
边栏推荐
- Network address translation nat
- [Software Engineering] acquire requirements
- 数据采集之:巧用布隆过滤器提取数据摘要
- Messiari annual report-2021
- How to solve the problem of amount accuracy in financial applications (take quorum and golang as examples)
- 【无标题】
- 【毕业设计】基于半监督学习和集成学习的情感分析研究
- 看完這篇 教你玩轉滲透測試靶機Vulnhub——DriftingBlues-5
- 谷歌竞价账户可以探测到全球市场吗?
- Sikulix select the picture of relative position (advanced version)
猜你喜欢

Using pictures to locate app elements sikulix

扩散模型又杀疯了!这一次被攻占的领域是...

看完这篇 教你玩转渗透测试靶机Vulnhub——DriftingBlues-5

C# Winform 相册功能,图片缩放,拖拽,预览图分页

Understand the quality assurance of open source software (OSS)

Unity商业游戏常用真机调试插件

Is the encryption market a "natural disaster" or a "man-made disaster" in the cold winter?

如何实现接口异常场景测试?测试方法探索与测试工具实现
![[untitled]](/img/ff/f23e5275683d4d7b13fcb94cc77702.png)
[untitled]

Fluentd is easy to get started. Combined with the rainbow plug-in market, log collection is faster
随机推荐
树结构二叉树
If you want to know the stock account opening discount link, how do you know? Is it safe to open an account online?
看完這篇 教你玩轉滲透測試靶機Vulnhub——DriftingBlues-5
Front and back management system of dessert beverage store based on SSM framework dessert mall cake store [source code + database]
Fluentd is easy to get started. Combined with the rainbow plug-in market, log collection is faster
请问,中衍期货是不是靠谱的?资金安全吗?
Database employment consulting system for your help
芯片硅片与流片技术
世界上所有的知名网络平台
Zhongshanshan: engineers after being blasted will take off | ONEFLOW u
Unity商业游戏常用真机调试插件
机器学习之随机森林
Vscode个性化设置:让一个小萌妹陪你敲代码
Transformers vit image model vector acquisition
Stm32f1 and stm32subeide programming example - Optical intermittent sensor drive
Struggle, programmer -- Chapter 47 the so-called Iraqis are on the water side
Fluentd is easy to get started. Combined with the rainbow plug-in market, log collection is faster
Chengdu test equipment development_ Array introduction of C language for single chip microcomputer
Differences and performance of array, list, ArrayList, directory and LinkedList in C #
Verification code is the natural enemy of automation? See how the great God solved it