Display method and electronic device
An electronic device may display, by using a viewfinder picture in an augmented reality (AR) application interface, an object that is in the real world in which a user is located and that is collected by a camera. The user may enable, by performing an operation, the AR application to generate a mask in an area in which a first object is located in the viewfinder picture to block the first object. Then, a three-dimensional representation of a second object is projected onto the mask, where the second object is in a field of view range of the area in which the first object is located.
1 . A method, comprising:
starting, in response to a first operation, a camera;
displaying, in response to the first operation, an application interface comprising a viewfinder frame, and wherein a viewfinder picture of the viewfinder frame comprises a target object; and
performing, in response to a second operation, a third operation, wherein the third operation comprises:
generating a first mask in a first area comprising the target object, wherein generating the first mask blocks display of the target object in the viewfinder picture; and
projecting a first three-dimensional representation onto the first mask, such that the target object disappears and a background behind the target object is displayed in the viewfinder picture,
wherein a first field of view on a three-dimensional map corresponds to a region on the three-dimensional map that corresponds to the first area,
wherein the first field of view on the three-dimensional map comprises the first three-dimensional representation and a second three-dimensional representation of the target object,
wherein the first three-dimensional representation is a three-dimensional representation other than the second three-dimensional representation within the first field of view, and
wherein each of the first three-dimensional representation and the second three-dimensional representation comprises at least one of a point cloud, a mesh, or semantics.
2 . The method of claim 1 , wherein the third operation further comprises filling, based on a third three-dimensional representation, an area that is of the first mask and to which the first three-dimensional representation is not projected, wherein the third three-dimensional representation is within a second field of view, and wherein the second field of view is adjacent to the first field of view.
3 . The method of claim 1 , further comprising performing, in response to a fourth operation, the third operation to generate a second mask in a second area and project the second three-dimensional representation to the second mask.
4 . The method of claim 1 , further comprising performing, in response to a fifth operation, the third operation to generate a third mask in a third area and project a fourth three-dimensional representation to the third mask, wherein the fourth three-dimensional representation is a deformed version of the second three-dimensional representation.
5 . The method of claim 4 , further comprising generating, based on deformation information and three-dimensional coordinates of the second three-dimensional representation, the fourth three-dimensional representation, wherein the deformation information indicates a deformation type and a deformation ratio.
6 . The method of claim 4 , further comprising zooming in, zooming out, or stretching the second three-dimensional representation to obtain the fourth three-dimensional representation.
7 . The method of claim 4 , wherein a first anchor point of the second three-dimensional representation and a second anchor point of the fourth three-dimensional representation are the same, and wherein the first anchor point is a point that is located in a direction of a perpendicular line of a center of gravity of a three-dimensional representation and that has a smallest Z-axis coordinate.
8 . The method of claim 1 , further comprising:
determining a third field of view based on pose information of the viewfinder picture, wherein the third field of view corresponds to the viewfinder picture on the three-dimensional map; and
determining a field of view of an area within the third field of view based on a location of the area in the viewfinder picture.
9 . The method of claim 8 , wherein a pose indicated by the pose information has six degrees of freedom (DoF).
10 . The method of claim 1 , further comprising determining, from three-dimensional representations within the first field of view and based on a first image block, the second three-dimensional representation, wherein the first image block is in the viewfinder picture and comprises the target object.
11 . The method of claim 1 , wherein the viewfinder picture comprises a plurality of objects, and wherein the target object is any one of the plurality of objects.
12 . The method of claim 1 , wherein the viewfinder picture comprises an editable object and a non-editable object, wherein the target object is the editable object, wherein a third three-dimensional representation corresponding to the editable object on the three-dimensional map is an editable three-dimensional representation, and wherein a fourth three-dimensional representation corresponding to the non-editable object on the three-dimensional map is a non-editable three-dimensional representation or there is no three-dimensional representation corresponding to the non-editable object on the three-dimensional map.
13 . The method of claim 12 , further comprising labeling, on the three-dimensional map, the editable three-dimensional representation and the non-editable three-dimensional representation.
14 . An electronic device, comprising:
a memory configured to store instructions;
one or more processors coupled to the memory and configured to execute the instructions to cause the electronic device to:
start, in response to a first operation, a camera;
display, in response to the first operation, an application interface, wherein the application interface comprises a viewfinder frame, and wherein a viewfinder picture of the viewfinder frame comprises a target object; and
perform, in response to a second operation, a third operation, wherein the third operation comprises:
generating a first mask in a first area comprising the target object, wherein generating the first mask blocks display of the target object in the viewfinder picture; and
projecting a first three-dimensional representation onto the first mask, such that the target object disappears and a background behind the target object is displayed in the viewfinder picture,
wherein a first field of view on a three-dimensional map corresponds to a region on the three-dimensional map that corresponds to the first area,
wherein the first field of view on the three-dimensional map comprises the first three-dimensional representation and a second three-dimensional representation of the target object,
wherein the first three-dimensional representation is a three-dimensional representation other than the second three-dimensional representation within the first field of view, and
wherein each of the first three-dimensional representation and the second three-dimensional representation comprises at least one of a point cloud, a mesh, or semantics.
15 . The electronic device of claim 14 , wherein the third operation further comprises filling, based on a third three-dimensional representation, an area that is of the first mask and to which the first three-dimensional representation is not projected, wherein the third three-dimensional representation is within a second field of view, and wherein the second field of view is adjacent to the first field of view.
16 . The electronic device of claim 14 , wherein the one or more processors are further configured to execute the instructions to cause the electronic device to:
perform, in response to a fourth operation, the third operation to generate a second mask in a second area; and
project the second three-dimensional representation to the second mask.
17 . A computer program product comprising instructions stored on a non-transitory computer-readable medium that, when executed by one or more processors, cause an apparatus to:
start, in response to a first operation, a camera;
display, in response to the first operation, an application interface, wherein the application interface comprises a viewfinder frame, and wherein a viewfinder picture of the viewfinder frame comprises a target object; and
perform, in response to a second operation, a third operation, wherein the third operation comprises:
generating a first mask in a first area comprising the target object, wherein generating the first mask blocks display of the target object in the viewfinder picture; and
projecting a first three-dimensional representation within a first field of view onto the first mask, such that the target object disappears and a background behind the target object is displayed in the viewfinder picture,
wherein a first field of view on a three-dimensional map corresponds to a region on the three-dimensional map that corresponds to the first area,
wherein the first field of view on the three-dimensional map comprises the first three-dimensional representation and a second three-dimensional representation of the target object,
wherein the first three-dimensional representation is a three-dimensional representation other than the second three-dimensional representation within the first field of view, and
wherein each of the first three-dimensional representation and the second three-dimensional representation comprises at least one of a point cloud, a mesh, or semantics.
18 . The computer program product of claim 17 , wherein the third operation further comprises filling, based on a third three-dimensional representation, an area that is of the first mask and to which the first three-dimensional representation is not projected, wherein the third three-dimensional representation is within a second field of view, and wherein the second field of view is adjacent to the first field of view.
19 . The computer program product of claim 17 , wherein the instructions, when executed by the one or more processors, cause the apparatus to:
perform, in response to a fourth operation, the third operation to generate a second mask in a second area; and
project the second three-dimensional representation to the second mask.
20 . The computer program product of claim 17 , wherein the instructions, when executed by the one or more processors, cause the apparatus to determine, from three-dimensional representations within the first field of view based on a first image block, the second three-dimensional representation, wherein the first image block is in the viewfinder picture and comprises the target object.