Switched blue and red channels on output
Fixed some corner cases with the linear system
Randomly sample pixels instead of hard coded