Neighbouring image segments
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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 comentario
Ashish Uthama
el 4 de Feb. de 2011
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.
Respuestas (2)
Brett Shoelson
el 4 de Feb. de 2011
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 comentarios
Greg
el 28 de Mzo. de 2014
Intels entry into the developer board market are the Edison and Galileo boards. https://communities.intel.com/docs/DOC-22192
0 comentarios
Ver también
Categorías
Más información sobre Image Segmentation and Analysis en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!