Image Processing Method and Associated Apparatus for Rendering Three-dimensional Effect Using Two-dimensional Image

An image processing method for rendering a three-dimensional by transforming a first quadrilateral image to a second quadrilateral image is provided, with at least one of the first and second quadrilateral images being a trapezoidal image. The image processing method includes providing the first quadrilateral image, generating coordinates of four vertices associated with the second quadrilateral image according to the first quadrilateral image and the three-dimensional effect; determining a relative height and a relative width according to a height and a width of the first quadrilateral image and the coordinates of the four vertices; and generating a plurality of pixel values of the second quadrilateral image with reference to a plurality of pixel values of the first quadrilateral image according to the relative height and the relative width.

Skip to: Description  ·  Claims  · Patent History  ·  Patent History
Description
CROSS REFERENCE TO RELATED PATENT APPLICATION

This patent application claims the benefit of U.S. provisional patent application No. 61/218,077 filed on Jun. 18, 2009.

FIELD OF THE INVENTION

The present invention relates to a mechanism for generating a three-dimensional (3D) effect, and more particularly, to an image processing method and an associated apparatus for rending a 3D effect using two-dimensional (2D) images.

BACKGROUND OF THE INVENTION

In a current user interface system, e.g., a user interface of a portable device like a mobile phone, methods for rendering graphics or images include a 2D image rendering approach and a 3D image rendering approach. The 2D image rendering approach is easier and less expensive to implement, yet has a disadvantage of lacking depth information. The 3D image rendering approach, although having an advantage of being capable of rendering better visual enjoyment to viewers using its depth information, is burdened with shortcomings including more complicated and more costly implementation. More specifically, when the 3D image rendering approach is realized by hardware, corresponding hardware cost is much higher than that of the 2D image rendering approach; when the 3D image rendering approach is realized by software, a processor needs to designate more resources and time in rendering the 3D images such that processor performance may be significantly degraded due to the 3D image rendering approach.

SUMMARY OF THE INVENTION

Therefore, it is an objective of the invention to provide an image processing method and an associated apparatus for rendering a 3D effect using 2D images, so as to address complications involved in the 3D image rendering approach to reduce software and hardware costs as well as enhancing an overall system performance.

The present invention provides an image processing method for rendering a 3D effect by transfoiming a first quadrilateral image to a second quadrilateral image, with at least one of the first and second quadrilateral images being a trapezoidal image. The image processing method comprises: providing the first quadrilateral image; generating four coordinates of four vertices associated with the second quadrilateral image according to the first quadrilateral image and the 3D effect; determining a relative height and a relative width according to a height and a width of the first quadrilateral image and the coordinates of the four vertices; and generating a plurality of pixel values of the second quadrilateral image according to the coordinates of the four vertices, the relative height, and the relative width with reference to a plurality of pixel values of the first quadrilateral image.

The present invention further provides an image processing apparatus for rendering a 3D effect by transforming a first quadrilateral image to a second quadrilateral image, with at least one of the first and second quadrilateral images being a trapezoidal image. The image processing apparatus comprises a target image determining unit, a pixel determining unit and a calculation unit. The target image determining unit generates coordinates of four vertices associated with the second quadrilateral image according to the first quadrilateral image and the 3D effect. The pixel determining unit determines a relative height and a relative width according to a height and a width of the first quadrilateral image and the coordinates of the vertices, and determines a corresponding relationship between a plurality of pixels of the first quadrilateral image and a plurality of pixels of the second quadrilateral image. The calculation unit generates a plurality of pixel values of the second quadrilateral image according to the corresponding relationship with reference to a plurality of pixel values of the first quadrilateral image.

BRIEF DESCRIPTION OF THE DRAWINGS

The present invention will become more readily apparent to those ordinarily skilled in the art after reviewing the following detailed description and accompanying drawings, in which:

FIG. 1 is a schematic diagram of rendering a 3D effect using 2D images according to an embodiment of the invention;

FIG. 2 is a schematic diagram of an image processing apparatus according to an embodiment of the invention;

FIG. 3 shows a schematic diagram of the quadrilateral images Q1 and Q2 according to one embodiment of the invention;

FIGS. 4A and 4B are schematic diagrams of a corresponding relationship between pixels of the trapezoidal image and pixels of the rectangular image shown in FIG. 3;

FIG. 5 is a schematic diagram of a brightness change according to an embodiment of the invention;

FIG. 6 is a schematic diagram of a vertical trapezoidal image being 2D rotated according to an embodiment of the invention;

FIG. 7 is a schematic diagram of operations for rendering a 3D effect from a rotated image that is first 2D rotated by a pixel determining unit; and

FIG. 8 is a schematic diagram of the image processing apparatus in FIG. 2 rendering a 3D cube rotation effect using two trapezoidal images at different time points.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT

For a three-dimensional (3D) rendering approach, hardware costs and system resources for rendering operation icons or images of a user interface system are quite high. Therefore, a two-dimensional rendering approach according to one embodiment of the invention is provided as a novel image processing approach for rendering operation icons or images of a user interface system, so as to render a 3D effect using 2D images without degrading an overall system performance while also bring better visual enjoyment to a user operating the user interface system. According to an embodiment of the invention, the image processing method and apparatus generate images that render at least one 3D effect, including image reshaping, rotating, twisting or expansion effects, and lighting effects. The image processing method and apparatus, based on 2D images that require no Z-axis information (i.e., image depth information), is capable of rendering the 3D effect. Thus, resources that a processor or a calculation unit designates on calculations are significantly reduced to enhance an overall system calculation performance. More specifically, when the image processing method and apparatus according to an embodiment of the invention is realized by hardware, cost of hardware previously applied for the conventional 2D image drawing method may only be slightly increased while cost of hardware previously needed to show 3D effects is reduced. Therefore, the method and apparatus of the invention offer cost advantages whether being realized by software or hardware.

Icons of a user interface system are mostly quadrilateral icons, and more particularly, rectangular and square icons. According to a principle of the invention, when a quadrilateral icon flips or rotates toward a predetermined angle, a series of images during the transformation between an original image to a final image (i.e., a generated image) are simulated as a plurality of different successive images that are trapezoidal or a rectangular in shape. Therefore, the method and apparatus according to an embodiment of the invention, according to flipping or rotation angles of different 3D effects, calculates a shape associated with each quadrilateral image to be generated in order to respectively generate a quadrilateral image. For example, the shape of a quadrilateral icon at a latter of two successive time points is calculated according to a difference between rotation angles of the two successive time points; alternatively, the shape of a quadrilateral icon at a current time points is calculated according to a difference of rotation angles between the current-time-point image and an original image—other similar modifications are also within the scope of the invention.

FIG. 1 shows a schematic diagram of rendering a 3D effect using 2D images according to an embodiment of the invention. As shown in FIG. 1, icons of the user interface system render a flipping or rotation effect in a 3D space, such as flipping vertically (e.g., icons “0” and “1”), or flipping horizontally (e.g., icons “2” and “3”). Taking the icon “0” for example, in order to render a 3D effect, a series of images transformed from an originally rectangular icon “0” are a plurality of different trapezoidal images when flipping vertically. As an angle of flipping gets larger, a height of the series of trapezoidal images of the icons “0” gradually reduces (from time t1 to t5), so as to render a visual effect of the icon “0” flipping vertically in a 3D space. Taking the icon “1” for example, a series of images transformed from an icon “1” in an originally shallow trapezoidal image are a plurality of different trapezoidal and square images when flipping vertically. As an angle of flipping gets larger, a height of the series of the trapezoidal images of the icon“1” gradually increases (from time t1 to t5), so that one may perceive the shape of the images “1” restore to a normal shape (i.e., the square image) from a shallow shape as the height of the trapezoidal images becomes larger to render a visual effect of the icon “1” flipping vertically in a 3D space. Again, taking the icon “2” for example, a series of images transformed from the icon “2” in an original square image are a plurality of different trapezoidal images when flipping horizontally. As an angle of flipping gets larger, a height of the series of the trapezoidal images of the icon “2” gradually reduces from time t1 to t5 (the height of the series of trapezoidal images of the icon “2” is a width of the images), so that one may perceive the shape of the icon “2” gradually become shallow as the height of the trapezoidal images becomes smaller to render a visual effect of the icon “1” flipping horizontally in a 3D space. Similarly, a height of a series of trapezoidal images of the icon “3” gradually becomes larger from time t1 to t5, so as to render a visual effect of the icon “3” flipping horizontally in a 3D space. To emphasize a 3D effect of the icon, brightness of a series of trapezoidal images is appropriately adjusted. For example, suppose a light source is right in front of the images. Brightness of the series of images dims as the icon “0” flips from a front side downwards to face down or as the icon “2” flips from a front side rightwards to face a side. In contrast, brightness of the series of images becomes brighter as the icon “1” flips frontwards from facing a side to a front side or as the icon “3” flips rightwards from facing a side to a front side. In FIG. 1, dots are used to indicate differences in brightness, i.e., images with a large number of dots are dimmer in brightness, images with a smaller number of dots are brighter in brightness, and the square image without any dots means it has maximum brightness. The icons “0” to “3” are used for illustrating effects provided by the method and apparatus of the invention, but are not to limit the invention thereto. Description of realizing an embodiment of the invention by hardware shall be given below.

To render a 3D effect and reducing hardware cost at the same time, according to an embodiment of the invention, only the abovementioned series of images between the trapezoidal image and the rectangular image are involved to render the 3D effect without needing depth information of the images. FIG. 2 shows a schematic diagram of an image processing apparatus 200 according to an embodiment of the invention. The image processing apparatus 200 comprises a target image determining unit 201, a memory unit 205, a pixel determining unit 210, a calculation unit 215, and a buffer 220. How a predetermined quadrilateral image among the abovementioned series of quadrilateral images is generated is discussed below. In this embodiment, pixel values of a first quadrilateral image Q1 are used to generate pixel values of a second quadrilateral image Q2, and the first and second quadrilateral images Q1 and Q2 may be temporally successive, e.g., the two quadrilateral images are the icon “0” at the time t1 and t2 in FIG. 1. The memory unit 205 is for storing a plurality of pixel values of the quadrilateral image Q1 corresponding to a 2D image. The target image determining unit 201 is for generating four coordinates of four vertices associated with the quadrilateral image Q2 according to coordinates of four vertices of the quadrilateral image Q1 and a desired 3D effect. At least one of the quadrilateral images Q1 and Q2 is a trapezoidal image. Upon obtaining the coordinates of the four vertices of the quadrilateral image Q1, the pixel determining unit 210 correspondingly outputs the plurality of pixel values of the quadrilateral image Q1 from the memory unit 205 to the buffer 200 according to the coordinates of the four vertices as well as a height and a width of the quadrilateral image Q2. The calculation unit 215 then accordingly generates the plurality of pixel values of the quadrilateral image Q2. Thus, the image processing apparatus 200 one after another generates the abovementioned series of quadrilateral images that render a 3D effect, which may be, for example, the quadrilateral image Q1 flipping in a 3D space. The quadrilateral images are outputted and displayed on a display to allow a user to perceive the rendered 3D effect from using 2D images.

In this embodiment, for example, the 2D image is an icon of a user interface system, the quadrilateral images Q1 and Q2 are images of two successive time points, the quadrilateral image Q1 is an image at a former time point of the 2D image (i.e., the icon) during the flipping or rotation. For example, the 2D image is the icon “0” in FIG. 1, the quadrilateral image Q1 is the square image of the image “0” at the time t1, and the quadrilateral image Q2 is the trapezoidal image of the icon “0” at the time t2. The quadrilateral image Q1 may also be the square image of the icon “0” at the time t3, and the quadrilateral image Q2 may also be the trapezoidal image of the icon “0” at the time t4. Further, when the 2D image is the icon “1” in FIG. 1, the quadrilateral image Q1 may be the trapezoidal image of the icon “1” at the time t2, and the quadrilateral image Q2 may be the trapezoidal image of the icon “1” at the time t3. The quadrilateral image Q1 may also be the trapezoidal image of the icon “1” at the time t4, and the quadrilateral image Q2 may also be the square image of the icon “0” at the time t5. In other words, the image processing apparatus 200 is capable of generating flipped or rotated images after according to different desired flipping or rotation angles of the icon in a 3D space.

Again with reference to FIG. 2, the target image determining unit 201 is for generating the coordinates of the four vertices of the quadrilateral image Q2 according to the coordinates of the four vertices of the quadrilateral image Q1 as well as desired angle and direction of flipping or rotation. In this embodiment, the quadrilateral image Q1 is a source image, whose data is stored in the memory unit 205. In practice, the target image determining unit 201 may be realized by hardware or software. FIG. 3 shows a schematic diagram of the quadrilateral images Q1 and Q2 according to one embodiment of the invention. As shown in FIG. 3, for example, the quadrilateral image Q1 is a rectangular image, and coordinates P21˜P24 of the four vertices outputted by the target image determining unit 201 define the quadrilateral image Q2 as a trapezoidal image. The memory unit 205 is further stored with display image data corresponding to a display image, in which the coordinates P21˜P24 generated by the target image determining unit 201 are located.

The pixel determining unit 210 comprises a source coordinate generating unit 2101 and a target coordinate generating unit 2102. The target coordinate generating unit 2102 generates a coordinate of each pixel of the trapezoidal image Q2 according to the coordinates P21˜P24 of the four vertices of the trapezoidal image Q2. More specifically, the target coordinate generating unit 2102 calculates change rates of coordinates at two sides of the trapezoidal image Q2 (i.e., the change rates of the planar coordinates P21 and P23 of the two left vertices of the trapezoidal image, and the change rates of the planar coordinates P22 and P24 of the two right vertices of the trapezoidal image) to respectively obtain a first coordinate change rate and a second coordinate change rate. With the first and second coordinate change rates, a start point and an end point at a predetermined row of a next scan line can be obtained as the trapezoidal image Q2 increases or decreases by a row; that is, coordinates of two terminal points of each scan line of the trapezoidal image can be obtained. In this embodiment, two methods are available for determining the start and end points of each scan line of the trapezoidal image Q2 shown in FIG. 3. The first method is that, the two coordinate change rates of right and left sides are respectively used to obtain a distance between coordinate start points of each two adjacent rows and a distance between coordinate end points of each two adjacent rows, and the target coordinate generating unit 2102 respectively accumulates the two coordinate change rates to a current start point and a current end point with every increasing/decreasing row, so as to obtain coordinates of the start point and end point of a next row. Further, to prevent limited calculation accuracy from deviating the generated coordinates of the start and end points, the coordinate of the start point of each row is calculated by adding a product from multiplying a number for a current row with the coordinate change rate to values of the coordinate of a vertex (e.g., the start point P21). Similarly, the coordinate of the end point of each row can be calculated in the same manner. That is, the coordinate of the end point of each row is calculated by adding a product from multiplying a number of the current row with the coordinate change rate to values of the coordinate of a vertex (e.g., the end point P24). However, the method describe above is for illustrative purposes, and proper modifications made by a person skilled in the art are within the scope of the invention.

When generating the trapezoidal image Q2, the source coordinate generating unit 2101 determines at least one corresponding pixel of the rectangular image Q1 with respect to each pixel of the trapezoidal image Q2, and outputs a coordinate of the at least one pixel to the memory unit 205, which further outputs pixel values corresponding to the at least one pixel to the buffer 220. The calculation unit 215 then generates a pixel value for each pixel of the trapezoidal image Q2 according to the pixel values corresponding to the at least one pixel in the buffer 220. FIGS. 4A and 4B show schematic diagrams illustrating operations of the source coordinate generating unit 2101 for determining a corresponding relationship between the pixels of the trapezoidal image Q2 and the pixels of the trapezoid image Q1 in FIG. 3. How a target pixel value of a target pixel among the plurality of pixels of the trapezoidal image Q2 is generated shall be described below. With reference a height H2 of the trapezoidal image Q2 and a height H1 of the rectangular image Q1, the source coordinate generating unit 2101 calculates an interval ΔH by which the rectangular Q1 correspondingly moves when corresponding image content in the trapezoidal image Q2 moves by one row. The interval ΔH is regarded as an average interval, according to which the source coordinate generating unit 2101 calculates in the rectangular image Q1 a row number of a predetermined scan line corresponding to the target pixel. With reference to a width W2 of the scan line where the target pixel is located in the trapezoidal image Q2 and a width W1 of the rectangular image Q1, the source coordinate generating unit 2101 calculates a pixel distance ΔW by which corresponding image content in the rectangular image Q1 moves when a pixel in the trapezoidal image Q2 moves, as shown in FIG. 4B. The pixel distance ΔW is regarded as an average pixel distance. According to the average pixel distance and a position of the target pixel in the scan line, the source coordinate generating unit 2101 then determines at least one pixel from the scan line, and outputs a coordinate of the at least one pixel to the memory unit 205. The memory unit 205 outputs at least one pixel value of the at least one pixel to a source data buffer 2201. The calculation unit 215 generates the target pixel value of the trapezoidal image Q2 according to the at least one pixel value in the source data buffer 2201, and stores the target pixel value of the target pixel in a target data buffer 2202.

The source coordinate generating unit 2101 calculates an average pixel distance ΔW that is correspondingly moved by in the rectangular image Q1 as a pixel in the trapezoidal image Q2 is moved. For example, when the target pixel is located at a relatively narrow part (narrower than the width W1 of the rectangular image Q1) of the trapezoidal image Q2, since W2 is narrower than W1, the average pixel distance ΔW correspondingly moved in the rectangular image Q1 is greater than the actual distance by which the pixel moves in the trapezoidal image Q2. Thus, a coordinate of a pixel in the rectangular image Q1 is selected according to the average pixel distance ΔW, and the source coordinate generating unit 2101 then outputs the selected coordinate to the memory unit 205. Upon receiving the selected coordinate, the memory unit 205 accordingly outputs the pixel value of the pixel in the rectangular image Q1 through a data bus BUS to the data buffer 2201. The pixel value is temporarily stored in the source data buffer 2201, and serves as the pixel value of the target pixel of the trapezoidal image Q2. In other embodiments, the pixel value of the target pixel of the trapezoidal image Q2 may also be an average pixel value of the pixel of the rectangular image Q1 and its neighboring pixels. In practice, when determining the coordinate of the pixel of the rectangular image Q1, the source coordinate generating unit 2101 outputs coordinates of the pixel and neighboring pixels to the memory unit 205, which outputs pixel values of the pixel and neighboring pixels to the source data buffer 2201 to temporarily store the pixels values therein. Next, according to the pixel values from the source data buffer 2201, the calculation unit 215 calculates an average pixel value that serves as the pixel value of the target pixel of the trapezoidal image Q2.

In contrast, when the target pixel is located at a relatively wide part (wider than the width W1 of the rectangular image Q1) of the trapezoidal image Q2, since W2 is wider than W1, the average pixel distance ΔW correspondingly moved in the rectangular image Q1, as also calculated by the source coordinate generating unit 2101, is smaller than the actual distance by which the pixel moves in the trapezoidal image Q2. Thus, a coordinate of a pixel in the rectangular image Q1 is selected according to the average pixel distance ΔW, and the source coordinate generating unit 2101 then outputs the selected coordinate to the memory unit 205. Upon receiving the selected coordinate, the memory unit 205 accordingly outputs the pixel value of the pixel in the rectangular image Q1 through a data bus BUS to the source data buffer 2201. The pixel value is temporarily stored in the source data buffer 2201, and serves as the pixel value of the target pixel of the trapezoidal image Q2. In FIGS. 4A and 4B for elaborating how a pixel value of a target pixel of the trapezoidal image Q2 is obtained to render a 3D effect, apart from being a rectangular image and a trapezoidal image, respectively, as shown in FIGS. 4A and 4B, the quadrilateral image Q1 and the quadrilateral image Q2 may also be other combinations of respectively a trapezoidal image and a rectangular image, and two trapezoidal images. More specifically, although the operations in FIGS. 4A and 4B involve a rectangular image to generate a trapezoidal image to further render a 3D image effect, in other embodiments, a trapezoidal image may also be utilized to generate another trapezoidal image, or a trapezoidal image may be utilized to generate a rectangular image in order to render a 3D effect; proper modifications similar to the ones above are within the scope of the invention. Further, the quadrilateral images Q1 and Q2 may be images of non-successive time points. Again with reference to FIG. 1, for example, the image processing image 200 may also generate a trapezoidal image of the icon “0” at the time t3 or a trapezoidal image at the time t5 from the rectangular image of the icon “0” at the time t1.

Through a plurality of coordinates of different pixels selected from the quadrilateral image Q1 for each of the pixels of the quadrilateral image Q2 by the source coordinate generating unit 2101, the pixel values of the selected pixels are outputted by the memory unit 205 to the source data buffer 2201. The calculation unit 215 obtains the stored pixel values temporarily stored in the source data buffer 2201 to generate a pixel value of each of pixels of the quadrilateral image Q2, and temporarily stores the generated pixel values in the target data buffer 2202. The target data buffer 2202 then writes the pixel values of the quadrilateral image Q2 back to the memory unit 205 according to the coordinates that the target coordinate generating unit 2102 for each of the pixels of the quadrilateral image Q2.

Further, according to a flipping or rotation angle of the desired 3D effect, the calculation unit 215 may correspondingly adjust pixel values of the image of the quadrilateral image Q2 temporarily stored in the source data buffer 2201, so that the quadrilateral image Q2 displays corresponding brightness different from that of the quadrilateral image Q1 to render a more realistic 3D effect. FIG. 5 shows a schematic diagram of a brightness change according to an embodiment of the invention. As shown in FIG. 5, a light source is located right in front of images. When an icon “3” displays a 3D effect, a series images thereof gradually dims (the brightness decreases as the number of dots increases in this embodiment) so that an obvious brightness difference exists between the icon “3” and an icon “4” underneath to give a more realistic 3D effect. In this embodiment, to simplify an overall design, when the icon “3” displays a 3D flipping effect, the image of the icon “3” is evenly dimmed; however, brightness of the image of the icon “3” may be varied in part; as such modification is also within the scope of the invention. In other embodiments, for example, the light source may be positioned at different angles, such as at an upper-left or upper-right angle.

In the foregoing embodiments, details for generating a vertical trapezoidal image (i.e., a trapezoid having a pair of horizontal parallel sides) are given. However, the spirit of the invention is also suitable for generating a horizontal trapezoidal image (i.e., a trapezoid having a pair of vertically parallel sides). To generate a horizontal trapezoidal image, a first coordinate change rate and a second coordinate change rate are generated respectively according to coordinate change rates of two upper vertices and coordinate change rates of two lower vertices. Therefore, for 3D effects of flipping vertically or horizontally, or for flipping or rotation at different angles, the invention is capable of rendering the desired 3D effect using 2D images. In addition, to make software and hardware designs simple, a horizontal trapezoidal image is generated by integrating a 2D rotation function with operations for generating a vertical trapezoidal image of the invention. FIG. 6 shows a schematic diagram of a vertical trapezoidal image being 2D rotated according to an embodiment of the invention. For example, the 2D rotation is realized by the image determining unit 210 to provide a rotation for at least three different angles. As shown in FIG. 6, a vertex R of an original trapezoidal image is rotated clockwise by 90 degrees, 180 degrees or 270 degrees. FIG. 7 shows a schematic diagram of operations for rendering a 3D effect from a rotated image that is first 2D rotated by the pixel determining unit 210. As shown in FIG. 7, to generate a horizontal image 815, the target coordinate generating unit 2102 first re-defines coordinates for the 2D rotation. For example, a reference point originally defined at an upper-left vertex of the icon “2” is re-defined to a lower-left vertex to render a 2D 90-degree rotation effect. In this embodiment, the original icon “2” is a to-be-processed 2D image 800. The target coordinate generating unit 2102 rotates the to-be-processed 2D image 800 by a predetermined angle (i.e., 90 degrees clockwise) to generate coordinates of vertices of a rotated 2D image 805, generates a vertical trapezoidal image 810 according to the coordinates of the vertices of the rotated 2D image 805, and horizontally rotates the vertical trapezoidal image 810 by 270 degrees (i.e., 90 degrees counterclockwise) to obtain coordinates of vertices of the desired horizontal trapezoidal image 815 by referencing the to-be-processed 2D image. A 2D rotation may also be integrated with operations for generating a horizontal trapezoidal image to generate a vertical trapezoidal image; as such modification is within the scope of the invention.

With the embodiments of the invention, the image processing method and associated method are capable of rendering a 3D effect by using 2D images without needing any depth information of icons of a user interface system. Therefore, compared with the current 3D image drawing techniques, the apparatus and method of the invention significantly lower software and hardware costs and resources. Further, although the foregoing embodiments describe only icons in a user interface system, with proper modifications, the concept of the invention is also applicable for displaying a 3D effect of an image in a user interface system, or even applicable to a display interface of a non-user interface system. In practice, referring to FIG. 8, the apparatus and method according another embodiment of the invention draw a trapezoidal image at each time point to exactly render a rotation effect of a 3D cube. Thus, a 3D effect is rendered without needing a large amount of calculation to better meet a real-time requirement of a user.

While the invention has been described in terms of what is presently considered to be the most practical and preferred embodiments, it is to be understood that the invention needs not to be limited to the above embodiments. On the contrary, it is intended to cover various modifications and similar arrangements included within the spirit and scope of the appended claims which are to be accorded with the broadest interpretation so as to encompass all such modifications and similar structures.

Claims

1. An image processing method, for rendering a three-dimensional (3D) effect by transforming a first quadrilateral image to a second quadrilateral image, at least one of the first and second quadrilateral images being a trapezoidal image, the method comprising:

providing the first quadrilateral image;
generating coordinates of four vertices associated with the second quadrilateral image according to the first quadrilateral image and the 3D effect;
determining a relative height and a relative width according to a height and a width of the first quadrilateral image, and the coordinates of the four vertices; and
generating a plurality of pixel values of the second quadrilateral image with reference to a plurality of pixel values of the first quadrilateral image according to the relative height, and the relative width.

2. The method as claimed in claim 1, wherein the 3D effect is a rotation effect of the first quadrilateral image in a 3D space.

3. The method as claimed in claim 2, wherein the step of generating the coordinates of the four vertices comprises:

generating the coordinates of the four vertices according to a rotation angle associated with the 3D effect of the first quadrilateral image.

4. The method as claimed in claim 1, further comprising:

calculating a plurality of coordinate change rates according to the coordinates of the four vertices;
wherein, the second quadrilateral image is the trapezoidal image, and the pixel values of the second quadrilateral image are generated according to the coordinate change rates, the relative height, and the relative width.

5. The method as claimed in claim 4, wherein the trapezoidal image has a pair of horizontal parallel sides, and the step of calculating the coordinate change rates comprises:

calculating coordinate change rates of two left vertices of the trapezoidal image to generate a first coordinate change rate; and
calculating coordinate change rates of two right vertices of the trapezoidal image to generate a second coordinate change rate;
wherein, the first and second coordinate change rates are utilized for obtaining coordinates of two terminal points of each horizontal scan line of the second quadrilateral image.

6. The method as claimed in claim 4, wherein the trapezoidal image has a pair of vertical parallel sides, and the step of calculating the coordinate change rates comprises:

calculating coordinate change rates of two upper vertices of the trapezoidal image to generate a first coordinate change rate; and
calculating coordinate change rates of two lower vertices of the trapezoidal image to generate a second coordinate change rate;
wherein, the first and second coordinate change rates are utilized for obtaining coordinates of two terminal points of each vertical scan line of the second quadrilateral image.

7. The method as claimed in claim 1, wherein the second quadrilateral image comprise a target pixel, the step of generating the pixel values of the second quadrilateral image comprises:

obtaining a corresponding scan line of the first quadrilateral image according to the relative height and a position of the target pixel;
determining a pixel distance according to the relative width; and
determining at least one pixel of the corresponding scan line of the first quadrilateral image according to the pixel distance and the position of the target pixel, and generating a target pixel value of the target pixel according to a pixel value of the at least one pixel.

8. The method as claimed in claim 1, wherein the first quadrilateral image has different brightness from that of the second quadrilateral image.

9. The method as claimed in claim 1, further comprising:

displaying the first quadrilateral image and the second quadrilateral image in sequence.

10. An image processing apparatus, for rendering a 3D effect by transforming a first quadrilateral image to a second quadrilateral image, at least one of the first and second quadrilateral images being a trapezoidal image, the apparatus comprising:

a target image determining unit, for generating coordinates of four vertices associated with the second quadrilateral image according to the first quadrilateral image and the 3D effect;
a pixel determining unit, for determining a relative height and a relative width according to a height and width of the first quadrilateral image and the coordinates of the four vertices, and accordingly determining a corresponding relationship between a plurality of pixels of the first quadrilateral image and a plurality of pixels of the second quadrilateral image; and
a calculation unit, for generating a plurality of pixel values of the second quadrilateral image with reference to a plurality of pixel values of the first quadrilateral image according to the corresponding relationship.

11. The apparatus as claimed in claim 10, wherein the 3D effect is a rotation effect of the first quadrilateral image in a 3D space.

12. The apparatus as claimed in claim 11, wherein the target image determining unit generates the coordinates of four vertices of the second quadrilateral image according to a rotation angle associated with the 3D effect of the first quadrilateral image.

13. The apparatus as claimed in claim 10, wherein the pixel determining unit calculates a plurality of coordinate change rates according to the coordinates of the four vertices, and when the second quadrilateral image is the trapezoidal image, the pixel determining unit determines the corresponding relationship according to the coordinate change rates, the relative height and the relative width.

14. The apparatus as claimed in claim 13, wherein the trapezoidal image has a pair of horizontal parallel sides, the pixel determining unit calculates coordinate change rates of two left vertices of the trapezoidal image to generate a first coordinate change rate, and calculates coordinate change rates of two right vertices of the trapezoidal image to generate a second coordinate change rate, and the first and second coordinate change rates are utilized for obtaining coordinates of two terminal points of each horizontal scan line of the second quadrilateral image.

15. The apparatus as claimed in claim 13, wherein the trapezoidal image has a pair of vertical parallel sides, the pixel determining unit calculates coordinate change rates of two upper vertices of the trapezoidal image to generate a first coordinate change rate, and calculates coordinate change rates of two lower vertices of the trapezoidal image to generate a second coordinate change rate, and the first and second coordinate change rates are utilized for obtaining coordinates of two terminal points of each vertical scan line of the second quadrilateral image.

16. The apparatus as claimed in claim 16, wherein the first quadrilateral image has different brightness from that of the second quadrilateral image.

Patent History
Publication number: 20100321380
Type: Application
Filed: Jun 7, 2010
Publication Date: Dec 23, 2010
Applicant: MSTAR SEMICONDUCTOR, INC. (Hsinchu Hsien)
Inventors: Ruen-Rone Lee (Hsinchu Hsien), Tsai-Sheng Wang (Hsinchu Hsien)
Application Number: 12/794,943
Classifications
Current U.S. Class: Three-dimension (345/419)
International Classification: G06T 15/00 (20060101);