Started the code for a global optimization step of g, normals and depths in order to take care of more error sources as possible.