I have a binary raster image as shown below:
import rasterio
import numpy as np
path = r'D:\LE07_L1TP_147048_20070221_20170105_01_T1\LE07_L1TP_147048_20070221_20170105_01_T1_B1.tif'
with rasterio.open(path) as dataset:
image = dataset.read(1)
mask = np.where(image > 1, 255, 0)
white_pixels = np.array(np.where(mask == 255))
pixel_1 = white_pixels[:,0]
pixel_4 = white_pixels[:,-1]
By running the above code I am able to get locations of "pixel_1" & "pixel_4". Can someone help me out in getting pixel locations of "pixel_2" & "pixel_3".