Object tracking method and electronic apparatus therefor
An electronic apparatus is provided. The electronic apparatus includes a display, a first camera having a first field of view (FOV), a second camera having a second FOV that is narrower than the first FOV, at least one processor, and a memory. The electronic apparatus is configured to obtain a series of first images by using the first camera, identify a first region of interest including an object from the series of first images, when the size of the first region of interest is within a specified first range, enlarge a first image region including the first region of interest, obtain a series of second images by using the second camera while tracking the object, by moving a lens of the second camera based on movement of the first region of interest within the first image region and a magnification of the first image region, and display the series of second images on the display.
1 . An electronic device comprising:
a display;
a first camera having a first field of view (FOV);
a second camera having a second FOV narrower than the first FOV;
memory, comprising one or more storage media, storing instructions; and
one or more processors communicatively coupled to the display, the first camera, the second camera, and the memory,
wherein the instructions, when executed by the one or more processors individually or collectively, cause the electronic device to:
acquire a series of first images using the first camera,
identify a first region of interest including an object from the series of first images,
enlarge a first image region including the first region of interest if a size of the first region of interest is within a specified first range,
acquire a series of second images using the second camera while tracking the object, the series of second images being acquired by moving a lens of the second camera according to a movement amount of the lens of the second camera, and
display the series of second images on the display,
wherein the movement amount of the lens of the second camera is in inverse proportion to an enlargement magnification of the first image region and in proportion to a movement of the first region of interest within the enlarged first image region, and
wherein the enlargement magnification of the first image region corresponds to an amount of magnification of the enlarging of the first image region.
2 . The electronic device of claim 1 , wherein the instructions, when executed by the one or more processors individually or collectively, further cause the electronic device to:
determine the movement amount of the lens further based on a value set based on the enlargement magnification, the movement of the first region of interest, and an optical magnification of the first camera.
3 . The electronic device of claim 1 , wherein the instructions, when executed by the one or more processors individually or collectively, further cause the electronic device to:
determine the movement amount of the lens further based on the enlargement magnification, the movement of the first region of interest, and a movement of the first image region in the series of first images.
4 . The electronic device of claim 1 , wherein the instructions, when executed by the one or more processors individually or collectively, further cause the electronic device to:
change a direction in which the second FOV faces by moving the lens.
5 . The electronic device of claim 1 , wherein the instructions, when executed by the one or more processors individually or collectively, further cause the electronic device to:
identify a second region of interest corresponding to the object from the series of second images if the size of the first region of interest is smaller than the specified first range;
identify movement of the second region of interest from the series of second images; and
move the lens of the second camera based on the identified movement of the second region of interest.
6 . The electronic device of claim 5 , wherein the instructions, when executed by the one or more processors individually or collectively, further cause the electronic device to:
identify a first movement of the second region of interest from a first frame and a second frame subsequent to the first frame among the series of second images;
move the lens of the second camera to a specified value based on the identified first movement;
identify a second movement of the second region of interest from the second frame and a third frame subsequent to the second frame among the series of second images; and
track the object based on the movement of the lens of the second camera and a movement of the object by updating the specified value based on the identified second movement.
7 . The electronic device of claim 1 , wherein the instructions, when executed by the one or more processors individually or collectively, further cause the electronic device to:
identify the first region of interest from the series of first images if the size of the first region of interest is larger than the specified first range; and
track the object by moving the lens of the second camera based on the movement of the first region of interest in the series of first images.
8 . The electronic device of claim 1 ,
wherein the second camera includes an image sensor, a lens assembly, and a refractive member that refracts incident light to the image sensor through the lens assembly, and
wherein the instructions, when executed by the one or more processors individually or collectively, further cause the electronic device to:
move the lens by rotating the refractive member.
9 . The electronic device of claim 1 , wherein the first camera includes a wide-angle camera and the second camera includes a telephoto camera.
10 . A method performed by an electronic device for object tracking, the method comprising:
acquiring a series of first images using a first camera having a first field of view (FOV);
identifying a first region of interest including an object from the series of first images;
enlarging a first image region including the first region of interest based on a size of the first region of interest being within a specified first range; and
acquiring a series of second images using a second camera having a second FOV narrower than the first FOV while tracking the object, the series of second images being acquired by moving a lens of the second camera according to a movement amount of the lens of the second camera,
wherein the movement amount of the lens of the second camera is in inverse proportion to an enlargement magnification of the first image region and in proportion to a movement of the first region of interest within the enlarged first image region, and
wherein the enlargement magnification of the first image region corresponds to an amount of magnification of the enlarging of the first image region.
11 . The method of claim 10 , wherein the determining of the movement amount of the lens includes determining the movement amount of the lens further based on a value set based on the enlargement magnification, the movement of the first region of interest, and an optical magnification of the first camera.
12 . The method of claim 10 , wherein the determining of the movement amount of the lens includes determining the movement amount of the lens further based on the enlargement magnification, the movement of the first region of interest, and a movement of the first image region in the series of first images.
13 . The method of claim 10 , wherein the tracking of the object includes changing a direction in which the second FOV faces by moving the lens.
14 . The method of claim 10 , further comprising:
identifying a second region of interest corresponding to the object from the series of second images based on the size of the second region of interest being smaller than the specified first range;
identifying movement of the second region of interest from the series of second images; and
moving the lens of the second camera based on the movement of the second region of interest.
15 . The method of claim 14 , further comprising:
identifying a first movement of the second region of interest from a first frame and a second frame subsequent to the first frame among the series of second images;
moving the lens of the second camera to a specified value based on the first movement;
identifying a second movement of the second region of interest from the second frame and a third frame subsequent to the second frame among the series of second images; and
tracking the object based on movement of the lens of the second camera and a movement of the object by updating the specified value based on the second movement.
16 . The method of claim 10 , further comprising:
identifying the first region of interest from the series of first images based on the size of the first region of interest being larger than the specified first range; and
tracking the object by moving the lens of the second camera based on the movement of the first region of interest in the series of first images.
17 . The method of claim 10 ,
wherein the second camera includes an image sensor, a lens assembly, and a refractive member that refracts incident light to the image sensor through the lens assembly, and
wherein the electronic device moves the lens by rotating the refractive member.
18 . The method of claim 10 , wherein the first camera includes a wide-angle camera and the second camera includes a telephoto camera.