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