1. A method of extracting a portion of an image, wherein the image is formed by a plurality of pixels, the method comprising: generating a polygon in response to receiving one or more user inputs; displaying the polygon as an overlay on the image; categorizing pixels of the image as part of a foreground or background of the image, wherein the categorizing comprises: classifying pixels that are enclosed by an inner boundary of the polygon as part of the foreground; classifying pixels that are not enclosed by an outer boundary of the polygon as part of the background; and determining whether each pixel between the inner and outer boundary of the polygon is part of the background, foreground, or both the background and foreground; and extracting a foreground of the image based on the pixels categorized as part of the foreground.