1. A method implemented by an electronic device, the method comprising: obtaining first depth information based on a first image obtained from a first image sensor and a second image obtained from a second image sensor; obtaining second depth information based on the second image obtained from the second image sensor and a third image obtained from a third image sensor; determining a distance between the electronic device and a subject included in at least one image among the first image, the second image and the third image; selecting one of the first depth information and the second depth information based on the distance; and generating a final image having the subjects based on the selected depth information.