CloseNxN

Closing operation with a user defined N×N structuring element.

 

function call:

[out_img1]=vsg('CloseNxN',in_img1, conv_arr);

 

Arguments:

in_img1 mask image, 3 channel RGB, 1 channel greyscale or binary image, or DICOM image.

conv_arr – an integer array specifying the mask with which the input image will be processed.

 

Description:

Closing is the dual morphological operation of opening. This transformation has the effect of filing in holes and blocking narrow valleys in the image set A, when a structuring element B is applied.

out_img1 – An image which has dimensions the same as the input image. This is the result of successive morphological dilation and erosion of the input image.

 

Example:

img = openimage('crown.jpg');

h=figure;image(uint8(img));set(h,'Name','Input image');

[out_img1]=vsg('Threshold',img,100);

h=figure;image(uint8(out_img1));set(h,'Name','Threshold');

array = ones(5,5);

[out_img2]=vsg('CloseNxN',out_img1,array);

[out_img3]=vsg('CloseNxN',img,array);

h=figure;image(uint8(out_img2));set(h,'Name','CloseNxN - binary image');

h=figure;image(uint8(out_img3));set(h,'Name','ClosenxN - grey scale image');

Notes:

1. For DICOM images, the function operates on all slices separately.

2. For RGB images, the function operates on all colour planes separately.

Home       Functions       Back