フィルターのクリア

Make a weight matrix sparce

2 ビュー (過去 30 日間)
Orr Streicher
Orr Streicher 2021 年 1 月 29 日
編集済み: Matt J 2021 年 1 月 30 日
Hi,
I have an image in size of 256x256.
I would like to implement an algorithem that use graph theory on this image so i want to calculate the weights matrix: for 2 pixcels x,y i want to calculate D(x,y)= exp(-|x-y|/sigma)
By theory, the matrix D should be in size of (256^2)x(256^2), but i understaned that this is not practical.
I read a paper said that in order to make the weight matrix sparse, it is possible to truncate the matrix to the 50 nearest neighbors.
Does anyone know how can i do it in matlab?
Or maybe another way to make the weight matrix sparse?
thanks,
Or
  2 件のコメント
Matt J
Matt J 2021 年 1 月 29 日
編集済み: Matt J 2021 年 1 月 30 日
Do you really need D, or do you simply need an algorithm that computes D*I(:) for a given image I? The latter is just a convolution operation, and can be done efficiently with FFTs.
Matt J
Matt J 2021 年 1 月 30 日
編集済み: Matt J 2021 年 1 月 30 日
Also, do you absolutely have to define D as D(x,y)= exp(-|x-y|/sigma) ? If you instead use a Mahalanobis distance, D(x,y)= exp(-|x-y|^2/sigma^2), then D can be expressed as a Kronecker product
D=kron( exp(-(xi-yi)^2/sigma) , exp(-(xj-yj)^2/sigma) )
which has a number of simplifying properties.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeGraph and Network Algorithms についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by