Supporting Complex Tasks in Visual Sensor Networks