当前位置:网站首页>解决::Argument ‘radius‘ is required to be an integer
解决::Argument ‘radius‘ is required to be an integer
2022-04-23 06:05:00 【贾岚翔】
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
问题描述:在opencv编程,画出圆形时报错,代码为
cv2.circle(image, (x + w/2, y + w/2), w/2, (152, 251, 152), 1) # 画圆形
上述代码块中w/2为半径
原因:整数除以2可能会存在有小数点的情况,半个像素无法处理,必须将r转化成整数int型。
解决方案:
将w/2变为整型::
r = math.ceil(w/2)
代码意义:Math.ceil() “向上取整”, 即小数部分直接舍去,并向正数部分进1
案例: math.ceil(3.1415926)后结果为4
提示:需要
import math
版权声明
本文为[贾岚翔]所创,转载请带上原文链接,感谢
https://jialanxiang.blog.csdn.net/article/details/121359057
边栏推荐
- 基于ECS搭建云上博客(体验有礼)
- TC ebpf practice
- Oracle和mysql批量查询用户下所有表名和表名注释
- Error alarm of Postgres master-slave replication delay monitoring
- Winter combat camp hands-on combat - first understand the cloud foundation, hands-on practice ECS ECS ECS novice on the road to get the mouse cloud Xiaobao backpack shadowless
- Exception record-5
- Abnormal record-13
- Build a cloud blog based on ECS (polite experience)
- oracle创建表空间和修改用户默认表空间
- 双指针仪表盘读数(一)
猜你喜欢

Analysis of Rdam principle

Thanos Compactor组件使用

mysql和pgsql时间相关操作

Virtio and Vhost_ Net introduction

Dolphinscheduler调度sql任务建表时The query did not generate a result set异常解决

Try catch cannot catch asynchronous errors

阿里矢量库的图标使用教程(在线,下载)

OSS云存储管理实践(体验有礼)

qs. In the stringify interface, the input parameter is converted into a & connected string (with the application / x-www-form-urlencoded request header)

Dolphinscheduler调度spark任务踩坑记录
随机推荐
Prometheus alarm record persistence (historical alarm saving and Statistics)
oracle库恢复数据
Memcached source code analysis
19C中ASM network未自动启动的处理
异常记录-22
Introduction to RDMA network
Dolphinscheduler调度sql任务建表时The query did not generate a result set异常解决
Ansible basic commands, roles, built-in variables and tests judgment
Relabel of Prometheus_ Configs and metric_ relabel_ Configs explanation and usage examples
Redis practice notes and source code analysis
Chaos帶你快速上手混沌工程
oracle生成毫秒级时间戳
Abnormal record-18
mysql和pgsql时间相关操作
一个DG环境的ORA-16047: DGID mismatch between destination setting and target database问题排查及监听VNCR特性
High performance gateway for interconnection between VPC and IDC based on dpdk
异常记录-8
几款电纸书阅读器参数对比
异常记录-18
How does VirtualBox modify the IP network segment assigned to the virtual machine in the "network address translation (NAT)" network mode