Python: получите только лучший результат на матплоте - PullRequest
0 голосов
/ 02 декабря 2018

Результат вида повторения сюжета.Как я могу только посчитать лучший результат сюжета ??

Там только 31 Extra.

Но результат показывает его 96.

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

Вот код

1 2 3

до этого

#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

Я пытаюсьпосчитать лучший результат по размерам дерева.

...