0

I am doing a segmentation task using MATLAB. To analyze the performance of my algorithm, I need the area of intersection of each connected component in both images.

In what way are the connected components labelled in an image? Also, does PixelIdxList list all the linear indices of points that are a part of the connected component?

horchler
  • 18,384
  • 4
  • 37
  • 73
Mojo Jojo
  • 369
  • 3
  • 11
  • 31
  • 1
    What is `PixelIdxList`? one of the outputs from `bwconncomp`, I assume? Edit your question to show your actual code. – horchler Nov 21 '15 at 21:20
  • use `sparse`! it's not a trivial use, but it can give you the area of intersections. – Shai Nov 23 '15 at 08:16

1 Answers1

0

In what way are the connected components labelled in an image?

bwconncomp discovers the connected components by either using 4-(or 8)-connected neighborhood for 2D images or 6-(18, 26)-connected neighborhood for 3D images. Labels are enumerated starting from the left-top corner in 2D and in 3D (first slice).

Also, does PixelIdxList list all the linear indices of points that are a part of the connected component?

Yes. So, once both images are labelled, you can use intersect to find intersection between different labels. Also, you might want to read about Jaccard index.

xeroqu
  • 425
  • 5
  • 14
  • It is using a 4 connected neighborhood. I will try intersect if it works to find intersection between labels in both images. – Mojo Jojo Nov 27 '15 at 19:11