Metal-to-insulator transitions in transition metal oxides : a first principles study