Neighbouring image segments
1 回表示 (過去 30 日間)
古いコメントを表示
Hello!
I am using EDISON Wrapper to segment an image. It returns segment labels (and segmented image). What would be the best (the fastest) way to find neighbouring segments of each segment.
Any suggestion is more than welcome! Thank you!
1 件のコメント
Ashish Uthama
2011 年 2 月 4 日
Maybe you could link/say more about what 'EDISON' is. If it just returns labels, then its probably not enough information. If you have access to the Image Processing toolbox, look at |regionprops|, it returns the centroid information of each segment which you could use.
回答 (2 件)
Brett Shoelson
2011 年 2 月 4 日
randomName: I also have no idea what EDISON Wrapper is. BUT...given any list of linear indices, IDX, into your [M x N] image, you can quickly and easily find their neighbors using BSXFUN:
neighbors = bsxfun(@plus, idx, neighbor_offsets)
neighbor_offsets is a list of relative offsets; add M to get eastern neighbors, subtract M to get Western neighbors, add 1 to get southern neighbors, etc. Here's a list of the offsets for 8-connected neighbors:
% East M % Southeast M + 1 % South 1 % Southwest -M + 1 % West -M % Northwest -M - 1 % North -1 % Northeast M - 1
Thus, for example, to find all eastern and southern neighbors of pixels given by indices [200,400, 450], use:
neighbors = bsxfun(@plus, [200, 400, 450], [M, 1])
CAVEAT: Beware the edges! If you use those neighbor values to try to index outside of your image, you'll get an error. You will have to pad your image or pare your results to make sure you stay within the image borders. (Our image processing functions handle that for you.)
Cheers, Brett
0 件のコメント
Greg
2014 年 3 月 28 日
Intels entry into the developer board market are the Edison and Galileo boards. https://communities.intel.com/docs/DOC-22192
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Image Segmentation and Analysis についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!