A hybrid optimization strategy for registering images with large local deformations and intensity variations