第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Networkx 中的“計數(shù)”邊緣屬性是什么?

Networkx 中的“計數(shù)”邊緣屬性是什么?

溫溫醬 2021-06-04 18:46:42
我不明白什么是由下面的函數(shù)計算出的區(qū)域鄰接圖的“計數(shù)”屬性:skimage.future.graph.rag_boundary()。解釋了“重量”屬性,但沒有解釋“計數(shù)”屬性。即使在閱讀源代碼時,我也不明白它是什么。有人能幫我嗎 ?謝謝這是來源:def rag_boundary(labels, edge_map, connectivity=2):    """ Comouter RAG based on region boundaries    Given an image's initial segmentation and its edge map this method    constructs the corresponding Region Adjacency Graph (RAG). Each node in the    RAG represents a set of pixels within the image with the same label in    `labels`. The weight between two adjacent regions is the average value    in `edge_map` along their boundary.    labels : ndarray        The labelled image.    edge_map : ndarray        This should have the same shape as that of `labels`. For all pixels        along the boundary between 2 adjacent regions, the average value of the        corresponding pixels in `edge_map` is the edge weight between them.    connectivity : int, optional        Pixels with a squared distance less than `connectivity` from each other        are considered adjacent. It can range from 1 to `labels.ndim`. Its        behavior is the same as `connectivity` parameter in        `scipy.ndimage.filters.generate_binary_structure`.    Examples    --------    >>> from skimage import data, segmentation, filters, color    >>> from skimage.future import graph    >>> img = data.chelsea()    >>> labels = segmentation.slic(img)    >>> edge_map = filters.sobel(color.rgb2gray(img))    >>> rag = graph.rag_boundary(labels, edge_map)    """    conn = ndi.generate_binary_structure(labels.ndim, connectivity)    eroded = ndi.grey_erosion(labels, footprint=conn)    dilated = ndi.grey_dilation(labels, footprint=conn)    boundaries0 = (eroded != labels)    boundaries1 = (dilated != labels)    labels_small = np.concatenate((eroded[boundaries0], labels[boundaries1]))    labels_large = np.concatenate((labels[boundaries0], dilated[boundaries1]))    n = np.max(labels_large) + 1
查看完整描述

1 回答

?
森欄

TA貢獻(xiàn)1810條經(jīng)驗 獲得超5個贊

權(quán)重矩陣對應(yīng)于區(qū)域之間邊界處像素值的平均值。計數(shù)矩陣對應(yīng)于沿這些邊界的像素數(shù)。因此,rag[i][j]['count']包含沿區(qū)域邊界的像素數(shù)ij。

代碼使用了一些花哨的SciPy 稀疏矩陣技巧來提高效率。我(謙虛地;)推薦 Elegant SciPy 的第 5 章(可在http://elegant-scipy.org免費(fèi)在線獲取)以了解有關(guān)這些格式的更多信息。


查看完整回答
反對 回復(fù) 2021-06-09
  • 1 回答
  • 0 關(guān)注
  • 146 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號