the pixel values are 0 for background and 2 for white area
the pixel values are 0 for background and 1 for white area
how do i combine them to a new image 3 such that -every area in image 2 that is pixel value 0 remains 0 in new image -every area in image 2 that is pixel value 1 remains 1 -every area in image 1 that is pixel value 2 remains 2 in new image (including areas that are 1 in image 2)
Basically the output should look similar to the one below
I used the | method in python since im dealing with ndarrays (h,w) image3=img1|img2
Im getting new pixel values ranging from 0 1 2 and 3 What i want is only 0, 1 and 2 All images are displayed using plt.imshow(img, cmap="gray") which is why they look contrasted.