Augmented reality visualizer for swimming pools
An augmented reality visualizer for swimming pools is described herein. In one example, a system can receive images of a target area for a swimming pool from a camera. The system can generate an augmented reality environment by analyzing the images. The augmented reality environment can include a virtual swimming pool overlaying at least one image of the target area. The system can then output the augmented reality environment on a display for viewing by a user.
1 . A method comprising:
receiving, by a processor, one or more images of a target area for a swimming pool from a camera;
generating, by the processor, an augmented reality environment based on the one or more images, the augmented reality environment including a virtual swimming pool that is automatically scaled in size based on an object detected in the one or more images; and
outputting, by the processor, the augmented reality environment for display.
2 . The method of claim 1 , further comprising:
detecting the object by analyzing the one or more images; and
determining a size for the virtual swimming pool based on the detected object.
3 . The method of claim 2 , wherein the object is a vertical object extending vertically upward from a horizontal plane.
4 . The method of claim 3 , further comprising determining the horizontal plane by analyzing the one or more images using an image-processing algorithm.
5 . The method of claim 4 , further comprising determining a vertical plane that is perpendicular to the horizontal plane by analyzing the one or more images, wherein the vertical object is located in the vertical plane.
6 . The method of claim 3 , wherein the horizontal plane corresponds to ground level.
7 . The method of claim 3 , wherein the vertical object includes a tree, a rock, or a fence post.
8 . The method of claim 2 , wherein determining the size for the virtual swimming pool based on the object comprises:
estimating a distance between the camera and the object; and
determining the size for the virtual swimming pool based on the distance.
9 . The method of claim 2 , further comprising:
determining that the object is located outside the target area; and
based on determining that the object is located outside the target area, using the object as a visual anchor for calculating the size of the virtual swimming pool.
10 . The method of claim 1 , wherein the processor is part of a handheld device.
11 . A non-transitory computer-readable medium comprising program code that is executable by a processor for causing the processor to:
receive one or more images of a target area for a swimming pool from a camera;
generate an augmented reality environment based on the one or more images, the augmented reality environment including a virtual swimming pool that is automatically scaled in size based on an object detected in the one or more images; and
output the augmented reality environment for display.
12 . The non-transitory computer-readable medium of claim 11 , further comprising program code that is executable by the processor for causing the processor to:
detect the object by analyzing the one or more images; and
determine a size for the virtual swimming pool based on the detected object.
13 . The non-transitory computer-readable medium of claim 12 , wherein the object is a vertical object extending vertically upward from a horizontal plane.
14 . The non-transitory computer-readable medium of claim 13 , further comprising program code that is executable by the processor for causing the processor to:
determine the horizontal plane by analyzing the one or more images using an image-processing algorithm.
15 . The non-transitory computer-readable medium of claim 14 , further comprising program code that is executable by the processor for causing the processor to:
determine a vertical plane that is perpendicular to the horizontal plane by analyzing the one or more images, wherein the vertical object is located in the vertical plane.
16 . The non-transitory computer-readable medium of claim 13 , wherein the horizontal plane corresponds to ground level.
17 . The non-transitory computer-readable medium of claim 12 , further comprising program code that is executable by the processor for causing the processor to determine the size for the virtual swimming pool based on the object by:
estimating a distance between the camera and the object; and
determining the size for the virtual swimming pool based on the distance.
18 . The non-transitory computer-readable medium of claim 12 , further comprising program code that is executable by the processor for causing the processor to:
determine that the object is located outside the target area; and
based on determining that the object is located outside the target area, use the object as a visual anchor for calculating the size of the virtual swimming pool.
19 . The non-transitory computer-readable medium of claim 11 , wherein the processor and the camera are parts of a handheld device.
20 . A handheld device comprising:
a camera;
a display;
a processor communicatively coupled to the camera and the display; and
a memory including instructions executable by the processor for causing the processor to:
receive one or more images of a target area for a swimming pool from the camera;
generate an augmented reality environment based on the one or more images, the augmented reality environment including a virtual swimming pool that is automatically scaled in size based on an object detected in the one or more images; and
output the augmented reality environment on the display.