Connected components for periodic image

9 views (last 30 days)
Say Cook
Say Cook on 9 Apr 2014
Commented: Geoff Stanley on 15 Feb 2018
I'm trying to test for the connectivity of pixels in a square 2D binary image, but the catch is the image repeats itself periodically.
I'm wondering if I can do this using something like bwconncomp, but I'm having trouble implementing the periodic boundary condition.
For example, say I enter
B = [1 0 0 0;
0 0 0 0;
0 0 0 0;
0 0 0 1];
CC = bwconncomp(B,8) % I'm considering 8 connectivity
I get
CC =
Connectivity: 8
ImageSize: [4 4]
NumObjects: 2
PixelIdxList: {[1] [16]}
With the new code, I would get 1 object with PixelIdxList returning {[1; 16]}
Your help would be greatly appreciated...

Answers (1)

Image Analyst
Image Analyst on 10 Apr 2014
I think you'll have to "manually" relabel the blobs on the other side based on their location. Scan the border and if there's a blob there, see if there is a blob on the other side that would be touching it. If there is, reassign it's label to the blob that you're working on.

Categories

Find more on Convert Image Type in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!