1. A method performed by an electronic device, comprising: determining overlapping areas from neighboring images; determining a difference measure between the overlapping areas; determining a constraint measure corresponding to at least one of the overlapping areas; and determining a seam based on a combination of the difference measure and the constraint measure.