当前位置:网站首页>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
边栏推荐
- Sikulix选取相对位置的图片(进阶版)
- 树结构二叉树
- 轻松上手Fluentd,结合 Rainbond 插件市场,日志收集更快捷
- Unity sub thread calls UI of main thread
- Quickly understand the commonly used symmetric encryption algorithm, and no longer have to worry about the interviewer's thorough inquiry
- Differences and performance of array, list, ArrayList, directory and LinkedList in C #
- 拜登簽署兩項旨在加强政府網絡安全的新法案
- Introduction to groovy syntax
- [Software Engineering] planning and project management
- 网络地址转换NAT
猜你喜欢

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

【毕业设计】基于半监督学习和集成学习的情感分析研究

Installing and using protobuf-c

Shan Zhiguang, chairman of BSN Development Alliance: DDC can provide the underlying support for the development of China's meta universe industry

一文彻底弄懂工厂模式(Factory)
![[PR] basic process](/img/e6/13a5703cfb8e5c51ed06fe9b0d9485.png)
[PR] basic process

基于SSM框架实现的甜品饮品店前后台管理系统甜品商城蛋糕店【源码+数据库】
![[Software Engineering] design module](/img/08/d55af729a8241e109fdeb96c896670.png)
[Software Engineering] design module

Verification code is the natural enemy of automation? See how the great God solved it

Getting started with go web programming: validators
随机推荐
【考研攻略】北京交通大学网络空间安全专业2018-2022年考研数据分析
网站存在的价值是什么?为什么要搭建独立站
Thoroughly understand the factory mode
Messiari annual report-2021
基于SSM框架实现的甜品饮品店前后台管理系统甜品商城蛋糕店【源码+数据库】
Installing and using protobuf-c
【Pr】基础流程
U++ 迭代 排序 查询 学习笔记
ThoughtWorks. QRcode and zxing Net QR code, URL can be directly jumped
Neuron+ekuiper realizes data collection, cleaning and anti control of industrial Internet of things
MySQL learning notes 2022
Cve-2022-22965 reappearance
d的破坏与安全
Cosmos、Polkadot
数据库中如何使用SQL进行修改&amp;删除
谷歌竞价账户可以探测到全球市场吗?
看完这篇 教你玩转渗透测试靶机Vulnhub——DriftingBlues-5
直播出海 | 国内直播间再出爆品,「外卷」全球如何致胜
Front and back management system of dessert beverage store based on SSM framework dessert mall cake store [source code + database]
After reading this article, I will teach you to play with the penetration test target vulnhub - drivetingblues-5