I have two different images and I want to select one specifi band from each one of them and calculate regression between them. Each one of those bands is a result of calculation I did (in the first image , band' no. 4 is the results of NDVI calculation, and the other band is SAR db values). The problem is that I haven't found a way to do it.
I used "read" in order to try to select one band but it didn't work when I tried to do things with this.
My end goal is to actually calculate linear regression between those two bands ,which I also still don't know how to do in rasterio library.
import pandas as pd import rasterio import numpy as np from rasterio.plot import show import seaborn as sns %matplotlib inline #NDVI image NDVI = rasterio.open(r"C:\Users\PATH\TO\IMAGE\python\NDVI.tif") show(NDVI) #SAR image SAR = rasterio.open(r"C:\Users\path\to\IMAGE\python\SAR.tif") NDVIband=NDVI.read(4) SARband=SAR.read(2) #from here nothing work and I feel lost. #I thought to use this library but seems like it works only with pandas (?) from sklearn.linear_model import LinearRegression
as i'm very new to python and image processing, any clue will be valuable for me ...