Method and device for generating perspective image
First Claim
1. A method for generating a perspective image, comprising:
- obtaining, by a mobile terminal, length, height and a vanishing point of a required perspective image and length and height of an original image;
determining that the required perspective image has a number of pixel points and a corresponding area less than that of the original image;
determining, by the mobile terminal in accordance with the corresponding area being less than that of the original image, for each of pixel points (x′
, y′
) in the perspective image, coordinates (x, y) of a pixel point in the original image corresponding to the pixel point (x′
, y′
), according to the length, the height and the vanishing point of the perspective image and the length and the height of the original image; and
generating, by the mobile terminal, the perspective image by duplicating the pixel point on the coordinates (x, y) in the original image onto a location in the perspective image corresponding to the coordinates (x′
, y′
));
wherein determining, for each of pixel points (x′
, y′
) in the perspective image, coordinates (x, y) of a pixel point in the original image corresponding to the pixel point (x′
, y′
), according to the length, the height and the vanishing point of the perspective image and the length and the height of the original image comprises;
determining the coordinates (x, y) of the pixel point in the original image corresponding to the pixel point (x′
, y′
) according to the length, the height and the vanishing point of the perspective image and the length and the height of the original image, the coordinates (x′
, y′
) of the pixel point in the perspective image and one or more preset functions including x=ƒ
(x′
), wherein x=ƒ
(x′
) comprises x=x′
+n×
x′
2, wherein
1 Assignment
0 Petitions
Accused Products
Abstract
A method and device for generating a perspective image are provided, which are related to multimedia technology. The method comprises the following steps: acquiring the length, height and vanishing point of a required perspective image and the length and height of an original image; for each pixel point (x′, y′) in the perspective image, determining the coordinate (x, y) of a pixel point in the original image corresponding to said pixel point; copying the pixel point at the coordinate (x, y) in the original image to the position corresponding to the coordinate (x′, y′) in said perspective image. The invention utilizes a principle that perspective image is smaller than original image, and employs a form of inverse transform, thereby the calculated pixel points are reduced, and compared with forward calculation, the calculation is greatly reduced, which improves the speed of perspective image generating and saves central processing unit (CPU) resources.
-
Citations
9 Claims
-
1. A method for generating a perspective image, comprising:
-
obtaining, by a mobile terminal, length, height and a vanishing point of a required perspective image and length and height of an original image; determining that the required perspective image has a number of pixel points and a corresponding area less than that of the original image; determining, by the mobile terminal in accordance with the corresponding area being less than that of the original image, for each of pixel points (x′
, y′
) in the perspective image, coordinates (x, y) of a pixel point in the original image corresponding to the pixel point (x′
, y′
), according to the length, the height and the vanishing point of the perspective image and the length and the height of the original image; andgenerating, by the mobile terminal, the perspective image by duplicating the pixel point on the coordinates (x, y) in the original image onto a location in the perspective image corresponding to the coordinates (x′
, y′
));wherein determining, for each of pixel points (x′
, y′
) in the perspective image, coordinates (x, y) of a pixel point in the original image corresponding to the pixel point (x′
, y′
), according to the length, the height and the vanishing point of the perspective image and the length and the height of the original image comprises;determining the coordinates (x, y) of the pixel point in the original image corresponding to the pixel point (x′
, y′
) according to the length, the height and the vanishing point of the perspective image and the length and the height of the original image, the coordinates (x′
, y′
) of the pixel point in the perspective image and one or more preset functions including x=ƒ
(x′
), wherein x=ƒ
(x′
) comprises x=x′
+n×
x′
2, wherein - View Dependent Claims (2, 3, 4, 5)
-
-
6. A device for generating a perspective image, comprising:
-
a memory configured to store computer readable program codes; and one or more processors configured to execute the computer readable program codes to implement; a unit configured to obtain length, height and a vanishing point of a required perspective image and length and height of an original image; a unit configured to determine that the required perspective image has a number of pixel points and a corresponding area less than that of the original image; a unit configured to determine, in accordance with the corresponding area being less than that of the original image, for each of pixel points (x′
, y′
) in the perspective image, coordinates (x, y) of a pixel point in the original image corresponding to the pixel point (x′
, y′
), according to the length, the height and the vanishing point of the perspective image and the length and the height of the original image; anda unit configured to generate the perspective image by duplicating the pixel point on the coordinates (x, y) in the original image onto a location in the perspective image corresponding to the coordinates (x′
, y′
);wherein the unit configured to determine, for each of pixel points (x′
, y′
) in the perspective image, coordinates (x, y) of a pixel point in the original image corresponding to the pixel point (x′
, y′
), according to the length, the height and the vanishing point of the perspective image and the length and the height of the original image comprises;a unit configured to determine the coordinates (x, y) of the pixel point in the original image corresponding to the pixel point (x′
, y′
) according to the length, the height and the vanishing point of the perspective image and the length and the height of the original image, the coordinates (x′
, y′
) of the pixel point in the perspective image and one or more preset functions including x=ƒ
(x′
), wherein x=ƒ
(x′
) comprises x=x′
+n×
x′
2, wherein - View Dependent Claims (7, 8)
-
-
9. A method for generating a perspective image, comprising:
-
obtaining, by a mobile terminal, length, height and a vanishing point of a required perspective image and length and height of an original image; determining that the required perspective image has a number of pixel points and a corresponding area less than that of the original image; determining, by the mobile terminal in accordance with the corresponding area being less than that of the original image, for each of pixel points (x′
, y′
) in the perspective image, coordinates (x, y) of a pixel point in the original image corresponding to the pixel point (x′
, y′
), according to the length, the height and the vanishing point of the perspective image and the length and the height of the original image; andgenerating, by the mobile terminal, the perspective image by duplicating the pixel point on the coordinates (x, y) in the original image onto a location in the perspective image corresponding to the coordinates (x′
, y′
);wherein determining, for each of pixel points (x′
, y′
) in the perspective image, coordinates (x, y) of a pixel point in the original image corresponding to the pixel point (x′
, y′
), according to the length, the height and the vanishing point of the perspective image and the length and the height of the original image comprises;for each of values of x′
in [0, W′
] in the perspective image, determining an abscissa x in the original image corresponding to x′
, and for each of values of y′
in [H′
x′
/2p, H′
−
H′
x′
/2p], determining an ordinate y in the original image corresponding to y′
, wherein W′
represents the length of the perspective image, H′
represents the height of the perspective image, and p represents an abscissa of the vanishing point of the perspective image.
-
Specification