8-8(opencv-python鼠标键盘响应)

应用:制作数据集:in:车牌区域图片,out:精确定位的四点坐标
1、遍历文件夹中的图片,寻找车牌区域
2、鼠标点击四次,自动按顺序保存:左上、右上、左下、右下四点坐标
3、按键保存或忽略跳过。

numpy.array to list

  1. 直接用list()函数
  2. 用array.tolist()函数
>>> print a
[[10  2]
 [ 5  8]
 [ 0  0]
 [ 0  0]]
>>> lista = list(a)
>>> print lista
[array([10,  2], dtype=uint8), array([5, 8], dtype=uint8), array([0, 0], dtype=uint8), array([0, 0], dtype=uint8)]
>>> l = sorted(lista)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()


>>> lista = a.tolist()
>>> print lista
[[10, 2], [5, 8], [0, 0], [0, 0]]
>>> l = sorted(lista)
>>> print l
[[0, 0], [0, 0], [5, 8], [10, 2]]


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值