|Image Processing Toolbox User's Guide|
Filling a Region
Filling is a process that fills a region of interest by interpolating the pixel values from the borders of the region. This process can be used to make objects in an image seem to disappear as they are replaced with values that blend in with the background area.
To fill a region of interest, you can use the
roifill function. This function is useful for image editing, including removal of extraneous details or artifacts.
roifill performs the fill operation using an interpolation method based on Laplace's equation. This method results in the smoothest possible fill, given the values on the boundary of the region.
roipoly, you select the region of interest with the mouse. When you complete the selection,
roifill returns an image with the selected region filled in.
This example shows how to use
roifill to fill a region in an image.
ind2grayto convert it to a grayscale image.
roifilland then use the mouse to select the region you want to fill (shown in red in the following figure).
roifillreturns the modified image in
|Filtering a Region||Image Deblurring|
© 1994-2005 The MathWorks, Inc.