You are here : matlabImage Processingbwconvhull

bwconvhull() - Image Processing

CH = bwconvhull(BW) computes the convex hull of all objects in BW and returns CH, a binary convex hull image.

CH = bwconvhull(BW, method) specifies the desired method for computing the convex hull image.

CH = bwconvhull(BW, 'objects', conn) specifies the desired connectivity used when defining individual foreground objects.

The conn parameter is only valid when the method is 'objects'.


Syntax

CH = bwconvhull(BW)
CH = bwconvhull(BW, method)
CH = bwconvhull(BW, 'objects', conn)


Example

subplot(2,2,1);
I = imread('coins.png');
imshow(I);
title('Original');
    
subplot(2,2,2);
BW = I > 100;
imshow(BW);
title('Binary');
    
subplot(2,2,3);
CH = bwconvhull(BW);
imshow(CH);
title('Union Convex Hull');
    
subplot(2,2,4);
CH_objects = bwconvhull(BW,'objects');
imshow(CH_objects);
title('Objects Convex Hull');


Output / Return Value


Limitations


Alternatives / See Also


Reference