Electronic device for generating depth map and operation method thereof
A method of generating a depth map corresponding to input data includes providing light to a target object in a plurality of patterns that change over time, obtaining a plurality of captured images respectively corresponding to the plurality of patterns, by photographing the target object to which the light is provided, obtaining the input data by preprocessing the plurality of captured images and generating the depth map based on the input data.
1 . A method of generating a depth map corresponding to input data, the method comprising:
providing light to a target object in a plurality of patterns that change over time;
obtaining a plurality of captured images respectively corresponding to the plurality of patterns, by photographing the target object to which the light is provided;
obtaining a plurality of illumination images respectively corresponding to the plurality of patterns by photographing a light-emitting device configured to provide the light;
obtaining the input data by preprocessing the plurality of captured images and the plurality of illumination images; and
generating the depth map based on the input data.
2 . The method of claim 1 , wherein each of the plurality of patterns comprises a light-emitting region to which the light is provided, and
wherein a position of the light-emitting region changes over time.
3 . The method of claim 1 , wherein each of the plurality of patterns comprises a light-emitting region to which the light is provided, and
wherein an area of at least a partial region of the light-emitting region changes over time.
4 . The method of claim 1 , wherein an illumination of the light in each of the plurality of patterns changes over time.
5 . The method of claim 1 , further comprising obtaining characteristic information of the light-emitting device,
wherein the obtaining of the input data comprises obtaining the input data by preprocessing the plurality of captured images, the plurality of illumination images, and the characteristic information.
6 . The method of claim 5 , wherein the characteristic information comprises information about a size of the light-emitting device.
7 . The method of claim 5 , further comprising:
providing sub-light to the target object; and
obtaining sub-characteristic information of a sub-light-emitting device configured to provide the sub-light,
wherein the obtaining of the plurality of captured images comprises obtaining the plurality of captured images by photographing the target object to which the light and the sub-light are provided, and
wherein the obtaining of the input data comprises obtaining the input data by preprocessing the plurality of captured images, the plurality of illumination images, the characteristic information, and the sub-characteristic information.
8 . The method of claim 1 , further comprising comparing an intensity of an ambient illumination of the target object with an intensity of a threshold illumination,
wherein the light is provided to the target object based on the intensity of the ambient illumination being less than or equal to the intensity of the threshold illumination, and
wherein the threshold illumination is a maximum illumination at which the plurality of captured images reflecting changes in the plurality of patterns that change over time are able to be obtained.
9 . The method of claim 1 , wherein the generating of the depth map comprises generating the depth map by providing a depth map generation module with the input data, and
wherein the depth map generation module comprises an autoencoder.
10 . An electronic device for generating a depth map corresponding to input data, the electronic device comprising:
a light-emitting device configured to provide light to a target object in a plurality of patterns that change over time;
a measuring device comprising at least one camera configured to obtain a plurality of captured images respectively corresponding to the plurality of patterns by photographing the target object to which the light is provided;
a memory storing one or more instructions; and
at least one processor configured to execute the one or more instructions stored in the memory to:
receive a plurality of illumination images that are previously captured, the plurality of illumination images being obtained by photographing the light-emitting device, the plurality of illumination images respectively corresponding to the plurality of patterns;
obtain the input data by preprocessing the plurality of captured images and the plurality of illumination images, and
generate the depth map based on the input data.
11 . The electronic device of claim 10 , wherein each of the plurality of patterns comprises a light-emitting region to which the light is provided, and
wherein a position of the light-emitting region changes over time.
12 . The electronic device of claim 10 , wherein each of the plurality of patterns comprises a light-emitting region to which the light is provided, and
wherein an area of at least a partial region of the light-emitting region changes over time.
13 . The electronic device of claim 10 , wherein an illumination of the light in each of the plurality of patterns changes over time.
14 . The electronic device of claim 10 , wherein the at least one processor is further configured to execute the one or more instructions to
receive characteristic information of the light-emitting device, and
obtain the input data by preprocessing the plurality of captured images, the plurality of illumination images, and the characteristic information.
15 . The electronic device of claim 14 , wherein the characteristic information comprises information about a size of the light-emitting device.
16 . The electronic device of claim 14 , further comprising a sub-light-emitting device configured to provide sub-light to the target object,
wherein the measuring device is further configured to obtain the plurality of captured images by photographing the target object to which the light and the sub-light are provided, and
wherein the at least one processor is further configured to execute the one or more instructions to
receive sub-characteristic information of the sub-light-emitting device, and
obtain the input data by preprocessing the plurality of captured images, the plurality of illumination images, the characteristic information, and the sub-characteristic information.
17 . The electronic device of claim 10 , wherein the at least one processor is further configured to execute the one or more instructions to generate the depth map by providing a depth map generation module with the input data, and
wherein the depth map generation module comprises an autoencoder.
18 . A non-transitory computer-readable recording medium storing instructions that, when executed by at least one processor, cause the at least one processor to:
provide light toward a target object in a plurality of patterns that change over time;
obtain a plurality of captured images respectively corresponding to the plurality of patterns, by photographing the target object toward which the light is provided;
obtain a plurality of illumination images respectively corresponding to the plurality of patterns by photographing a light-emitting device configured to provide the light;
obtain input data by preprocessing the plurality of captured images and the plurality of illumination images; and
generate a depth map based on the input data.