You are here : matlabImage Processingimhmin

# imhmin() - Image Processing

```I2 = imhmin(I,h) suppresses
all minima in the intensity image I whose depth
is less than h, where h is a
scalar. Regional minima are connected components of pixels with a
constant intensity value, t, whose external boundary
pixels all have a value greater than t. By default, imhmin uses
8-connected neighborhoods for 2-D images, and 26-connected neighborhoods
for 3-D images. For higher dimensions, imhmax uses conndef(ndims(I),'maximal').I2 = imhmin(I,h,conn) computes
the H-minima transform, where conn specifies the
connectivity.Code Generation support:
Yes.MATLAB Function Block support:
Yes.```

### Syntax

`I2 = imhmin(I,h) exampleI2 = imhmin(I,h,conn)`

### Example

```Calculate H-Minima TransformOpen This Example
Create a sample image with two regional minima.a = 10*ones(10,10);
a(2:4,2:4) = 7;
a(6:8,6:8) = 2

a =

10    10    10    10    10    10    10    10    10    10
10     7     7     7    10    10    10    10    10    10
10     7     7     7    10    10    10    10    10    10
10     7     7     7    10    10    10    10    10    10
10    10    10    10    10    10    10    10    10    10
10    10    10    10    10     2     2     2    10    10
10    10    10    10    10     2     2     2    10    10
10    10    10    10    10     2     2     2    10    10
10    10    10    10    10    10    10    10    10    10
10    10    10    10    10    10    10    10    10    10

Suppress all minima below a specified value. Note how the region with pixels valued 7 disappears in the transformed image because its depth is less than the specified h value.b = imhmin(a,4)

b =

10    10    10    10    10    10    10    10    10    10
10    10    10    10    10    10    10    10    10    10
10    10    10    10    10    10    10    10    10    10
10    10    10    10    10    10    10    10    10    10
10    10    10    10    10    10    10    10    10    10
10    10    10    10    10     6     6     6    10    10
10    10    10    10    10     6     6     6    10    10
10    10    10    10    10     6     6     6    10    10
10    10    10    10    10    10    10    10    10    10
10    10    10    10    10    10    10    10    10    10```