Find perimeter of objects in binary image

- example
`BW2 = bwperim(BW)`

`BW2 = bwperim(BW,conn)`

returns
a binary image that contains only the perimeter pixels of objects
in the input image `BW2`

= bwperim(`BW`

)`BW`

. A pixel is part of the
perimeter if it is nonzero and it is connected to at least one zero-valued
pixel. The default connectivity is 4 for two dimensions, 6 for three
dimensions, and `conndef(ndims(BW), 'minimal')`

for
higher dimensions. If you do not specify a return value, `bwperim`

displays
the result in a figure window.

where `BW2`

= bwperim(`BW`

,`conn`

)`conn`

specifies
the desired connectivity.

Code Generation support: Yes.

MATLAB Function Block support: Yes.

`bwarea`

| `bwboundaries`

| `bweuler`

| `bwtraceboundary`

| `conndef`

| `imfill`

Was this topic helpful?