An optical and infrared analysis of blue compact dwarf galaxies