An electronic device (100, 400) comprising: a camera (110, 410), wherein the camera (110, 410) includes a lens assembly including one or more lenses, an image sensor (200, 415) including at least one pixel, wherein each of the at least one pixel includes a first sub-pixel, a second sub-pixel, a third sub-pixel, and a fourth sub-pixel, wherein the first sub-pixel, the second sub-pixel, the third sub-pixel, and the fourth sub-pixel are covered by a color filter, and wherein the first sub-pixel is covered by a first micro lens, the second sub-pixel is covered by a second micro lens, and the third sub-pixel and the fourth sub-pixel are covered by a third micro lens; a display (120, 430); and a processor configured to: control the image sensor to obtain a light reflected from an external object and permeating through the lens assembly by using the at least one pixel, control the image sensor to obtain first data from the first sub-pixel, second data from the second sub-pixel, third data from the third sub-pixel and fourth data from the fourth sub-pixel, generate depth data associated with the external object using the third data and the fourth data based on light permeating through the third micro lens, restore the third data and the fourth data by summing the third data and the fourth data and dividing the summed data by a ratio between the first data and the second data, such that a ratio between the third data and the fourth data is equal to the ratio between the first data and the second data, and generate pixel data using the first data, the second data, the restored third data and the restored fourth data on each pixel of the at least one pixel, generate an image based on the pixel data, control the display (120, 430) to output the image, and move one or more lenses based on the depth data. a camera (110, 410), wherein the camera (110, 410) includes a lens assembly including one or more lenses, an image sensor (200, 415) including at least one pixel, wherein each of the at least one pixel includes a first sub-pixel, a second sub-pixel, a third sub-pixel, and a fourth sub-pixel, wherein the first sub-pixel, the second sub-pixel, the third sub-pixel, and the fourth sub-pixel are covered by a color filter, and wherein the first sub-pixel is covered by a first micro lens, the second sub-pixel is covered by a second micro lens, and the third sub-pixel and the fourth sub-pixel are covered by a third micro lens; a display (120, 430); and a processor configured to: control the image sensor to obtain a light reflected from an external object and permeating through the lens assembly by using the at least one pixel, control the image sensor to obtain first data from the first sub-pixel, second data from the second sub-pixel, third data from the third sub-pixel and fourth data from the fourth sub-pixel, generate depth data associated with the external object using the third data and the fourth data based on light permeating through the third micro lens, restore the third data and the fourth data by summing the third data and the fourth data and dividing the summed data by a ratio between the first data and the second data, such that a ratio between the third data and the fourth data is equal to the ratio between the first data and the second data, and generate pixel data using the first data, the second data, the restored third data and the restored fourth data on each pixel of the at least one pixel, generate an image based on the pixel data, control the display (120, 430) to output the image, and move one or more lenses based on the depth data. control the image sensor to obtain a light reflected from an external object and permeating through the lens assembly by using the at least one pixel, control the image sensor to obtain first data from the first sub-pixel, second data from the second sub-pixel, third data from the third sub-pixel and fourth data from the fourth sub-pixel, generate depth data associated with the external object using the third data and the fourth data based on light permeating through the third micro lens, restore the third data and the fourth data by summing the third data and the fourth data and dividing the summed data by a ratio between the first data and the second data, such that a ratio between the third data and the fourth data is equal to the ratio between the first data and the second data, and generate pixel data using the first data, the second data, the restored third data and the restored fourth data on each pixel of the at least one pixel, generate an image based on the pixel data, control the display (120, 430) to output the image, and move one or more lenses based on the depth data.