Professional Documents
Culture Documents
8 Adjacency
8 Adjacency
subplot(1, 2, 1);
imshow(binaryImage);
title('Original Binary Image');
subplot(1, 2, 2);
imshow(label2rgb(connectedComponents, 'jet', 'k', 'shuffle'));
title('Connected Components');
```
Sets up a figure with two subplots. The first subplot displays the original binary
image (`binaryImage`). The second subplot uses `label2rgb` to create a color-coded
image of the connected components and displays it.