IMF from infrared photometry of young stellar clusters in Taurus-Auriga and Orion