应用:制作数据集:in:车牌区域图片,out:精确定位的四点坐标
1、遍历文件夹中的图片,寻找车牌区域
2、鼠标点击四次,自动按顺序保存:左上、右上、左下、右下四点坐标
3、按键保存或忽略跳过。
numpy.array to list
- 直接用list()函数
- 用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]]