当前位置:网站首页>Resolution: argument 'radius' is required to be an integer
Resolution: argument 'radius' is required to be an integer
2022-04-23 13:39:00 【Jia Lanxiang】
cv2.error: OpenCV(3.4.14) :-1: error: (-5:Bad argument) in function 'circle'
> Overload resolution failed:
> - Argument 'radius' is required to be an integer
> - Argument 'radius' is required to be an integer
Problem description : stay opencv Programming , Drawing a circle is wrong , The code is
cv2.circle(image, (x + w/2, y + w/2), w/2, (152, 251, 152), 1) # Draw a circle
In the above code block w/2 As the radius of
reason : An integer divided by 2 There may be a decimal point , Half a pixel cannot be processed , Must be r Convert to an integer int type .
Solution :
take w/2 Change to integer ::
r = math.ceil(w/2)
Code meaning :Math.ceil() “ Rounding up ”, That is, the decimal part is directly rounded off , And go to the positive part 1
Case study : math.ceil(3.1415926) The result is 4
Tips : need
import math
版权声明
本文为[Jia Lanxiang]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230604509407.html
边栏推荐
- The difference between string and character array in C language
- Machine learning -- PCA and LDA
- MySQL 8.0.11 download, install and connect tutorials using visualization tools
- On the bug of JS regular test method
- web三大组件之Filter、Listener
- Processbuilder tool class
- MySQL 8.0.11下载、安装和使用可视化工具连接教程
- Imx6ull QEMU bare metal tutorial 2: usdhc SD card
- 【视频】线性回归中的贝叶斯推断与R语言预测工人工资数据|数据分享
- Zero copy technology
猜你喜欢
How do ordinary college students get offers from big factories? Ao Bing teaches you one move to win!
[point cloud series] multi view neural human rendering (NHR)
@优秀的你!CSDN高校俱乐部主席招募!
Vscode tips
Solve the problem of Oracle Chinese garbled code
Riscv MMU overview
CSDN College Club "famous teacher college trip" -- Hunan Normal University Station
"Xiangjian" Technology Salon | programmer & CSDN's advanced road
[wechat applet] flex layout usage record
Stack protector under armcc / GCC
随机推荐
[point cloud series] multi view neural human rendering (NHR)
Common types and basic usage of input plug-in of logstash data processing service
RTOS mainstream assessment
playwright控制本地穀歌瀏覽打開,並下載文件
torch. Where can transfer gradient
Innobackupex incremental backup
EMMC / SD learning notes
[andorid] realize SPI communication between kernel and app through JNI
Interface idempotency problem
切线空间(tangent space)
[point cloud series] relationship based point cloud completion
在 pytorch 中加载和使用图像分类数据集 Fashion-MNIST
TCP 复位gongji原理和实战复现
[point cloud series] deepmapping: unsupervised map estimation from multiple point clouds
innobackupex增量备份
@优秀的你!CSDN高校俱乐部主席招募!
SAP UI5 应用开发教程之七十二 - SAP UI5 页面路由的动画效果设置试读版
MySQL5.5安装教程
X509 parsing
torch. Where can transfer gradient