資源簡(jiǎn)介
用Python計(jì)算圖像對(duì)不同地物分類(lèi)精確度,
計(jì)算分類(lèi)結(jié)果圖與標(biāo)準(zhǔn)參考圖的混淆矩陣,
對(duì)分類(lèi)結(jié)果進(jìn)行評(píng)價(jià)
代碼片段和文件信息
from?PIL?import?Image
from?sklearn?import?metrics
from?sklearn.metrics?import?confusion_matrix
from?sklearn.metrics?import?classification_report
import?numpy?as?np
im_re?=?Image.open(‘picture1.tif‘)
im_pre?=?Image.open(‘picture2.png‘)
#?pix_re?=?im_re.load()
#?pix_pre?=?im_pre.load()
im_re_array?=?np.array(im_re)
im_pre_array?=?np.array(im_pre)
rows_recols_redims_re=im_re_array.shape
rows_precols_predims_pre=im_re_array.shape
#?width?=?im_re.size[0]
#?height?=?im_re.size[1]
#?widthheight=im_re.size
im_re_ture?=?[([0]?*?cols_re)?for?i?in?range(rows_re)]
im_pre_pred?=?[([0]?*?cols_pre)?for?j?in?range(rows_pre)]
for?x?in?range(rows_re):
????for?y?in?range(cols_re):
????????rgb?=?im_re_array[xy:]
????????if?r?==?255?&?g?==?255?&?b?==?255:
????????????im_re_tu
?屬性????????????大小?????日期????時(shí)間???名稱(chēng)
-----------?---------??----------?-----??----
?????文件???????2193??2018-05-31?16:36??混淆矩陣\confusion_matrix.py
?????文件????????302??2018-05-31?16:43??混淆矩陣\Readme.txt
?????目錄??????????0??2018-05-31?16:44??混淆矩陣
-----------?---------??----------?-----??----
?????????????????2495????????????????????3
評(píng)論
共有 條評(píng)論