Trick for handling shadows
Weight each equation by the pixel brightness:
Edittex
Gives weighted least-squares matrix equation:
Edittex
Solve for N, kd as before