I'd like to convert this graded colored map into a matrix in which to each pixel a percentage of orange is assigned. In particular, taking the color palette of orange at the right of image.
I'd like to assign 100% to the brightest orange at the top and 0% to the black at the bottom. Hence, I'd like to assign to each pixel a percentage, based on the color of that single pixel in relation to the palette.
Finally, my goal consists of averaging these percentages in order to get a sort of mean percentage of orange. For the latter step, I shouldn't have any issue... but I've no idea how to face the former problem.
I am looking for a solution either in R, Matlab or Mathematica
