I want to make minimum spanning tree of particular image and edges weights are computed by features like color and intensity difference among two pixels.Please help in doing so, as i don't find the way how should i proceed..PLease Help..its Urgent...

 採用された回答

Alex Taylor
Alex Taylor 2016 年 4 月 5 日
編集済み: Alex Taylor 2016 年 4 月 6 日

0 投票

The MATLAB Graph object does all kinds of great graph algorithm related things, including shortest paths, max flow, and minimum spanning trees.
As of right now, there are no utility functions that ship with MATLAB for moving a 2-D image grid to a graph object representation, but there is a MATLAB File Exchange contribution that does exactly this:
Together, it is very easy to do what you want:
A = imread('pout.tif');
G = imageGraph(size(A));
tree = minspantree(G);

4 件のコメント

Harinder  Kaur
Harinder Kaur 2016 年 4 月 6 日
Thankyou so much for your answer..When i am using this code it shows:
??? Undefined function or method 'imageGraph' for input arguments of type 'double'.
I have Matlab 2010 version. Does it work for latest version or there is some other problem???
Alex Taylor
Alex Taylor 2016 年 4 月 6 日
The MATLAB graph object was introduced in MATLAB in R2015b, you will need that version or later to use the approach I suggested.
Harinder  Kaur
Harinder Kaur 2016 年 4 月 13 日
I have installed R2015a version.But i am not able to get R2015b version.Could you please tell me some alternative?
John Lee
John Lee 2023 年 1 月 8 日
Hi Alex,
How do you visualize the results of "G" and "tree"?
Thanks,

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeImages についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by