def getFBM(trimap):
	"""
	Helper function that returns the maps of surely background, surely foreground and unknown regions.
	"""

	fgSure = trimap.copy()
	bgSure = trimap.copy()
	mid = trimap.copy()
	fgSure[fgSure != 255] = 0
	bgSure = 255 - fgSure
	mid[mid != 128] = 0
	mid[mid == 128] = 255
	bgSure = 255 - mid
	bgSure = bgSure - fgSure
	return bgSure, fgSure, mid