I have to Encode an Image for Semantic Segmentation. The Input Image is of shape (128, 256, 3) with 128 x 256 RGB Values. I want an Output Shape of (128, 256) where every 1 represent, that the pixel matched the given Color and 0 represents, that another RGB Value was present.
[[20, 20, 20], [30, 30, 30], [40, 40, 40]] with the Filter [20,20,20] should result in [1, 0, 0]
Any Help would be greatly appreciated.
Optimally This Method should be feasible to apply to an array of shape (16, 128, 256, 3) with 16 pictures in it, applying the filter to every picture.
[[20, 20, 20], [30, 30, 30], [40, 40, 40]]is 2D, so the filter should be 20 only and the result will be[[1,1,1],[0,0,0],[0,0,0]], is it correct?