Depth estimation using variant features
In one embodiment, an apparatus includes accessing an image, captured by a first camera, of an object that includes a size-invariant feature and a size-variant feature and determining a size of the size-invariant feature in the image. The method further includes determining, based on the determined size of the size-invariant feature in the image, a distance between the camera and the object and determining a size of the size-variant feature in the image. The method further includes determining, based on the determined distance between the camera and the object and based on the determined size of the size-variant feature in the image, an actual size of the size-variant feature.
1 . A method comprising:
accessing an initial image, captured by a first camera, of an object comprising a size-invariant feature and a size-variant feature;
determining a size of the size-invariant feature in the initial image;
determining, based on the determined size of the size-invariant feature in the initial image, a distance between the camera and the object;
determining a size of the size-variant feature in the initial image;
determining, based on the determined distance between the camera and the object and based on the determined size of the size-variant feature in the initial image, an actual size of the size-variant feature;
accessing a subsequent image, captured by a second camera, of at least the size-variant feature;
determining a size of the size-variant feature in the subsequent image; and
determining, based on the determined actual size of the size-variant feature and the determined size of the size-variant feature in the subsequent image, a distance between the second camera and an object comprising the size-variant feature.
2 . The method of claim 1 , further comprising:
determining that an appearance of the size-invariant feature in the initial image satisfies one or more visibility criteria; and
determining the size of the size-invariant feature in the initial image in response to the determination that the size-invariant feature in the initial image satisfies the one or more visibility criteria.
3 . The method of claim 1 , wherein the accessed initial image is a first one of a plurality of accessed initial images of the object, the method further comprising:
determining, for each of the plurality of accessed initial images, a visibility of the size-invariant feature in that image;
selecting, based on the determined visibility of the size-invariant feature in each of the plurality of accessed initial images, a particular initial image as the first one of the plurality initial images.
4 . The method of claim 1 , wherein the object comprising the size-variant feature in the subsequent image is the same object comprising the size-invariant feature and the size-variant feature in the initial image.
5 . The method of claim 1 , wherein the first camera is the same as the second camera.
6 . The method of claim 4 , wherein the size-variant feature is a first size-variant feature of a plurality of size-variant features of the object, the method further comprising:
determining, for each of the plurality of size-variant features, a visibility of the size-variant feature in the subsequent image; and
selecting, based on the determined visibility of the size-variant features, a particular size-variant feature as the first size-variant feature.
7 . The method of claim 6 , wherein the determined visibility is based on one or more of:
an occlusion of the respective size-variant feature;
a coverage area of the respective size-variant feature relative to a coverage threshold;
an angle between a plane of the subsequent image and the respective size-variant feature; or
a rotation of the object.
8 . The method of claim 4 , further comprising determining, based on the determined distance between the second camera and the object, a distance between the object and a device.
9 . The method of claim 8 , further comprising automatically adjusting a position of the device based on the determined distance between the object and the device.
10 . The method of claim 9 , wherein the object comprises a person's face, and the device comprises a display screen.
11 . The method of claim 10 , further comprising automatically adjusting the position of the display screen based on one or more preferences of the person.
12 . The method of claim 10 , wherein the display screen is part of a computer monitor.
13 . The method of claim 10 , further comprising:
identifying the person; and
associating the actual size of the size-variant feature with the identity of the person.
14 . An apparatus comprising one or more non-transitory computer readable storage media storing instructions; and one or more processors coupled to the non-transitory computer readable storage media, the one or more processors operable to execute the instructions to:
access an initial image, captured by a first camera, of an object comprising a size-invariant feature and a size-variant feature;
determine a size of the size-invariant feature in the initial image;
determine, based on the determined size of the size-invariant feature, a distance between the camera and the object;
determine a size of the size-variant feature in the initial image;
determine, based on the determined distance between the camera and the object and based on the determined size of the size-variant feature, an actual size of the size-variant feature
access a subsequent image, captured by a second camera, of at least the size-variant feature;
determine a size of the size-variant feature in the subsequent image; and
determine, based on the determined actual size of the size-variant feature and the determined size of the size-variant feature in the subsequent image, a distance between the second camera and an object comprising the size-variant feature.
15 . The apparatus of claim 14 , wherein the object comprising the size-variant feature in the subsequent image is the same object comprising the size-invariant feature and the size-variant feature in the initial image.
16 . A method comprising:
accessing a subsequent image, captured by a second camera, of an object comprising a size-variant feature;
determining a size of the size-variant feature in the subsequent image;
accessing an actual size of the size-variant feature, wherein the actual size of the size-variant feature is based on:
a determined size of the size-invariant feature in an initial image, captured by a first camera, of an object comprising a size-invariant feature and the size-variant feature;
a distance, determined based on the determined size of the size of the size-invariant feature in the initial image captured by the first camera, between the first camera and the object in the initial image; and
a size of the size-variant feature in the initial image captured by the first camera; and
determining, based on the actual size of the size-variant feature and the determined size of the size-variant feature in the subsequent image, a distance between the second camera and the object comprising the size-variant feature.
17 . The method of claim 16 , wherein the object comprising the size-variant feature in the subsequent image is the same object comprising the size-invariant feature and the size-variant feature in the initial image.
18 . The method of claim 16 , further comprising determining, based on the determined distance between the second camera and the object, a distance between the object and a device.
19 . The method of claim 18 , further comprising automatically adjusting a position of the device based on the determined distance between the object and the device.
20 . The method of claim 19 , wherein the object comprises a person's face, and the device comprises a display screen.