a weighted area determining device which determines an area of the principal object that matches the shape of the extracted principal object as a primary weighted area, and an area other than the area of the principal object as a secondary weighted area, and further divides the primary weighted area into a plurality of first weighted areas and the secondary weighted area into a plurality of second