[Connected Domain Detection] Matlab Simulation of Connected Region Detection Based on Morphological Processing

1. Generate a certain number of disks with a certain diameter in a 1X1 window. Percolation occurs when one or more sets of intersecting or tangent disks connect the left and right (or top and bottom) sides of a 1X1 window. If there is no set of discs that can connect the left and right (or upper and lower) sides, there is no Percolation.

2. The input is: disc diameter, number of discs. The output is: the path of Percolation (in the 1X1 window, it is displayed that the group of original judgments form Percolation. For example, the ordinary disc is green, and the Percolation disc is red)

Select a different input mode, for example, the input radius is 0.2, and the input number is 6. Click on DRAW.

Obviously, there is no connection here, so when clicking on percolation,

 

The system prompts that no connection is found

 The positions of the circles given each time are random. Click again: 

In this figure, the red part just links the upper and lower edges, so it will be displayed in red.

Change to other data.

A09-11

Guess you like

Origin blog.csdn.net/ccsss22/article/details/124307000