An image-processing device , comprising: one or more circuits configured to: receive a sequence of image frames from an image capture device ; select a first foreground mask from one or more foreground masks of an object in an input image frame of said received sequence of image frames estimated by binarizing a difference between the pixel values of said input image frame and a background image of said input image frame such that regions of the input image frame for which the difference is larger than a specified threshold value are the estimated foreground masks; identify a first set of pixels with a first mask value to be updated to a second mask value in a boundary region of said first foreground mask, wherein said first mask value and said second mask value corresponds to one of: a foreground mask value and a background mask value; and determine a second foreground mask based on at least said identification of said first set of pixels in said boundary region of said first foreground mask; wherein said one or more circuits are further configured: to apply a mean shift filter to each boundary pixel of said boundary region for correction of mislabeled mask values associated with said first foreground mask for said determination of said second foreground mask; and to utilize a plurality of sample vectors in a specified window size in a vicinity of said boundary region during application of said mean shift filter, wherein said plurality of sample vectors corresponds to color components, a depth component, the vertical coordinate and horizontal coordinate of a spatial position and the mask value of each pixel associated with said boundary region. receive a sequence of image frames from an image capture device ; select a first foreground mask from one or more foreground masks of an object in an input image frame of said received sequence of image frames estimated by binarizing a difference between the pixel values of said input image frame and a background image of said input image frame such that regions of the input image frame for which the difference is larger than a specified threshold value are the estimated foreground masks; identify a first set of pixels with a first mask value to be updated to a second mask value in a boundary region of said first foreground mask, wherein said first mask value and said second mask value corresponds to one of: a foreground mask value and a background mask value; and determine a second foreground mask based on at least said identification of said first set of pixels in said boundary region of said first foreground mask; wherein said one or more circuits are further configured: to apply a mean shift filter to each boundary pixel of said boundary region for correction of mislabeled mask values associated with said first foreground mask for said determination of said second foreground mask; and to utilize a plurality of sample vectors in a specified window size in a vicinity of said boundary region during application of said mean shift filter, wherein said plurality of sample vectors corresponds to color components, a depth component, the vertical coordinate and horizontal coordinate of a spatial position and the mask value of each pixel associated with said boundary region. to apply a mean shift filter to each boundary pixel of said boundary region for correction of mislabeled mask values associated with said first foreground mask for said determination of said second foreground mask; and to utilize a plurality of sample vectors in a specified window size in a vicinity of said boundary region during application of said mean shift filter, wherein said plurality of sample vectors corresponds to color components, a depth component, the vertical coordinate and horizontal coordinate of a spatial position and the mask value of each pixel associated with said boundary region. <EOS>