can u please help me understand reshaping a matrix with the *operator? Tried googling and check the documentation of reshaping but couldnt find anything using it with *:
matrix = matrix.reshape(*matrix.shape, 1)
Following up that question can one of you help me understand the use of the line in this code?
gt_bg = np.all(image == background_color, axis=2)
gt_bg = gt_bg.reshape(*gt_bg.shape, 1)
n_image = np.concatenate((gt_bg, np.invert(gt_bg)), axis=2)
So at first it searches the given image where it has the same coloring as the background_color variable(e.g [255,0,0]). It returns an array with shape of the image, so for example (1920,1080) and the values are either True of False. After the second line gt_bg has the shape (1920,1080,1), after the third line (1920,1080,2). The values of that matrix is True and False for every pixel i think? so if [1655,555,0] is True [1655,555,1] is False? But about that im not sure... And this is used for training a Convolutional Neural Network for image segmentation but I just cant get why i would create n_image...
Looking forward to some help...
Cheers, Felix