Python:仅获得Matplot的最佳结果

时间:2018-12-02 05:43:03

标签: python matplotlib jupyter counting

重复绘图的结果。我怎么只算出情节的最佳结果?

只有31个Extra。

但是结果显示为96。

There's only 31 Extra. But the result shows its 96.

这是代码

1 2 3

before this one

#creating results for every tree type
#small
resultsmall = match_template(imagen, arbolsmall)
resultsmallquery = np.where(resultsmall>0.85)
#medium
resultmedium = match_template(imagen, arbolmedium)
resultmediumquery = np.where(resultmedium>0.85)
#large
resultlarge = match_template(imagen, arbollarge)
resultlargequery = np.where(resultlarge>0.85)
#extra
resultextra = match_template(imagen, arbolextra)
resultextraquery = np.where(resultextra>0.85)


def listapuntos(result):
    xlist = []
    ylist = []
    for punto in range(shape(result)[1]):
        xlist.append(result[1][punto])
        ylist.append(result[0][punto])
    return xlist, ylist



#show the interpreted results 
#small
plot(listapuntos(resultsmallquery)[0], listapuntos(resultsmallquery)[1], 'o', 
         markeredgecolor='g', markerfacecolor='none', markersize=10, label="small")
#medium
plot(listapuntos(resultmediumquery)[0], listapuntos(resultmediumquery)[1], 'o', 
         markeredgecolor='r', markerfacecolor='none', markersize=10, label="medium")
#large
plot(listapuntos(resultlargequery)[0], listapuntos(resultlargequery)[1], 'o', 
         markeredgecolor='b', markerfacecolor='none', markersize=10, label="large")
#extra
plot(listapuntos(resultextraquery)[0], listapuntos(resultextraquery)[1], 'o', 
         markeredgecolor='y', markerfacecolor='y', markersize=10, label="extra")
imshow(ImagenTotal[10:-10,10:-10,:])
legend(loc='center left', bbox_to_anchor=(1, 0.5))
#figure(figsize=(12,12));
figsize(24,24)


i = plot(listapuntos(resultextraquery))
len(i)

这是正在发生的事情 Near View

我正在尝试计算树大小的最佳结果。

0 个答案:

没有答案