How to conduct a regression analysis on two images?

3 views (last 30 days)
I'm currently trying to find the slope, m, and the y-intercept, b, of the linear relationship between two images. I have 7 bands from Landsat 8 imagery, and I have created another image, called cosi, that represents the angle of irradiance upon the terrain. Basically, if the value for cosi is less than or equal to 0, there is no direct irradiance due to the orientation of the topography.
I know there is a linear relationship between the radiance values for bands 1 through 7 and cosi, however I'm not able to find the slope & y-intercept of this line. I need the slope and y-intercept of the line to be able to find the value of the variable c which is needed to topographically correct the image using the C-Correction method. One would assume using the regress function would work...
b = regress(y,X) returns a p-by-1 vector b of coefficient estimates for a multilinear regression of the responses in y on the predictors in X. X is an n-by- p matrix of p predictors at each of n observations. y is an n-by-1 vector of observed responses.
However, it does not work since "y is an n-by-1 vector of observed responses," and the y in my case would be the value, i.e. the radiance, of each cell in my images of bands 1 through 7. The X value from the above definition would be cosi, since the angle of irradiance of the terrain would determine the amount of radiance leaving the terrain.
At this point I hope anyone who reads this question is still with me... I just need to find a way to get the slope and y-intercept of the linear relationship for each band and cosi. I'm going to attach all the code I've written for the C-Correction and screenshots of the paper I'm referencing to hopefully help clear up exactly what I'm trying to accomplish; I've only been working in matlab for about two weeks, so please excuse how poorly written some of my code may be.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!