src/utils.py
def fill_region(image,mask,value=1):
	"""
	Fill masked region of the image with given value
	"""
	im = image.copy().ravel()
	if image.ndim > 2:
		im_h, im_w, im_ch = image.shape
	else:
		im_ch = 1
		im_h, im_w = self.image.shape
	# linear indices of masked pixels
	ind = masked_indices(mask)
	for i in ind:
		for ch in range(im_ch):
			im.data[i*im_ch+ch] = value
	return im.reshape(image.shape)

	Fill masked region of the image with given value
	
Fill masked region of the image with given value
Fill masked region of the image with given value
def fill_region(image,mask,value=1):
	im = image.copy().ravel()
	if image.ndim > 2:
		im_h, im_w, im_ch = image.shape
	else:
		im_ch = 1
		im_h, im_w = self.image.shape
	ind = masked_indices(mask)
	for i in ind:
		for ch in range(im_ch):
			im.data[i*im_ch+ch] = value
	return im.reshape(image.shape)
def fill_region ( image , mask , value = 1 ) : im = image . copy ( ) . ravel ( ) if image . ndim > 2 : im_h , im_w , im_ch = image . shape else : im_ch = 1 im_h , im_w = self . image . shape ind = masked_indices ( mask ) for i in ind : for ch in range ( im_ch ) : im . data [ i * im_ch + ch ] = value return im . reshape ( image . shape )
Fill masked region of the image with given value
Fill masked region of the image with given value
"""
	Fill masked region of the image with given value
	""" # linear indices of masked pixels
image
mask
value