Added fuctionality through calculation of image energy