How to reverse foreground color and background color on mask ?
Hello guys. I have a mask like this :
I want to reverse background color and foreground color for using Morphological Transformations on my image
Before
Background-color:Dark
Foreground color-White
After
Background-color:White
Foreground color-Dark
background[np.where((background > [0,0,0]).all(axis = 2))] =[255,255,255]
I write piece of code on phyton but i can't implement this code on javascript.How can i do with javascript?
simply invert the Image using bitwise_not