Thereafter, a bitwise AND operation between the input image and the mask gives the segmented object.