The present invention relates to an image processing system and a method thereof, more particularly to an image processing system and a method implemented to a series of images in a video film of an outdoor scene for simulating free-falling objects (such as raindrops, snowflakes, hailstones, or sand) related to natural weather in the images, so as to produce effects approximating real effects of natural weather in the video film.
Recently, with the rapid advancement of digital photography technologies, various electronic devices (such as digital cameras, digital video cameras, notebook computers, and mobile phones) equipped with digital image-capturing elements are continuously developed and improved, with increasingly enhanced image quality, steadily decreasing product volumes, and gradually descending selling prices. Therefore, these electronic devices capable of capturing images are more and more popular in the market, and people have been accustomed to using these image-capturing electronic devices to record moments in their daily life and work.
Especially, urban landscape designers, streetscape designers, or people interested in home environment design would normally use the aforesaid image-capturing electronic devices to record video films of urban landscape, streetscape or home environment before starting a related design, so that real scenic effects of different weather conditions (such as rain, snow, hail, or sandstorm) can be simulated in the video films as a reference for streetscape or home environment design. In addition, after the urban landscape, streetscape or home environment design is completed using an image design software, it is also desirable to speedily simulate real scenic effects of different weather conditions in virtual video films of the designed streets or home environment, so that the street or home environment design can be adjusted until the final version shows optimal visual effects of different weather conditions in accordance with design requirements. Therefore, it is a common need shared by urban landscape designers, streetscape designers, home environment designers, and those interested in relevant designs to have an image processing software capable of simulating real scenic effects of different weather conditions in actually recorded or virtual video films of urban landscape, streetscape, or home environment.
More specifically, different objects (such as raindrops, snowflakes, hailstones, or sand) fall from the sky under different weather conditions (such as rain, snow, hail, or sandstorm). These objects, depending on their sizes, degrees of transparency, and falling speeds, impart various textures to and have diverse impacts on outdoor scenery. In addition, some lightweight falling objects (such as snowflakes or sand) are easily influenced by wind fields in outdoor scenery so as to produce dynamically changing textures in the outdoor scenery and thus have greater impacts on the outdoor scenery than do relatively heavy falling objects. Hence, an important issue to be addressed by the present invention is how to simulate real effects of natural weather in a video film of an outdoor scene according to the different properties of falling objects (such as raindrops, snowflakes, hailstones, or sand) under different weather conditions, so that the simulated video film shows various effects (such as analogous gradation, ground deposition, and light reflection) of the free-falling objects and provides a virtual outdoor scene which approximates the real outdoor scene under natural weather conditions.
In view of the aforementioned common need of urban landscape designers, streetscape designers, or those interested in home environment design, the inventor of the present invention conducted extensive research and finally succeeded in developing an image processing system and method for simulating real effects of natural weather in a video film as disclosed herein.
A primary objective of the present invention is to provide an image processing system for simulating free-falling objects related to natural weather in a series of images in a video film of an outdoor scene. The image processing system includes: a display device for showing a simulated video film; a storage device for storing an image processing procedure; and a processor coupled to the storage device for executing the image processing procedure, wherein the image processing procedure includes: defining types of the free-falling objects, wherein each type of the free-falling objects corresponds to a predetermined size, a predetermined shape, a predetermined transparency, and a predetermined falling speed; reading the size, the shape, the transparency, and the falling speed of the free-falling objects according to a selected type of the free-falling objects so as to randomly generate falling positions of the free-falling objects and form a vertical falling texture of the free-falling objects in each of the images; detecting a grayscale value of each of the images, and defining a certain region of the image where the grayscale value exceeds a predetermined grayscale value as a deposited region of the free-falling objects; simulating a deposited status of the free-falling objects in each of the images according to a status of the free-falling objects; and integrating the vertical falling texture and the deposited status of the free-falling objects into the video film of the outdoor scene.
Another objective of the present invention is to provide an image processing method which is applied to a video film of an outdoor scene so as to simulate effects of free-falling objects (such as raindrops, snowflakes, hailstones, or sand) in a series of images of the video film. The method includes steps of: defining types of the free-falling objects, wherein each of the types corresponds to a predetermined size, a predetermined shape, a predetermined property, and a predetermined falling speed; randomly generating falling positions of the free-falling objects according to a selected type of the free-falling objects so as to form a vertical falling texture of the free-falling objects in each of the images; detecting a grayscale value of each of the images and defining a certain region of the image where the grayscale value exceeds a predetermined grayscale value as a deposited region of the free-falling objects; simulating a deposited status (such as water-deposited status or snow-deposited status) of the free-falling objects in each of the images according to a status (such as liquid state or solid state) of the free-falling objects; and finally adjusting a brightness of each of the images according to the property (such as light reflection or transparency) of the free-falling objects. In the present invention, the number, the size, and the deposited amount of the free-falling objects are adjustable to enable the method of the present invention to simulate various effects (such as analogous gradation, ground deposition, and light reflection) of the free-falling objects in the video film. As a result, the outdoor scene shown in the video film is provided with simulated effects approximating real effects of natural weather (such as rain, snow, hail, or sandstorm).
The structure and the technical means adopted by the present invention to achieve the above and other objectives can be best understood by referring to the following detailed description of the preferred embodiments and the accompanying drawings, wherein:
The present invention provides an image processing system and method for simulating real effects of natural weather in a video film, wherein the image processing system is a personal electronic apparatus (such as a computer, a digital camera, etc.) for processing a video film of an outdoor scene captured by an electronic device capable of capturing images or a video film of an outdoor scene created by an image design software. The video film includes a series of images. The image processing system and method according to the present invention simulate effects of objects (such as raindrops, snowflakes, hailstones, or sand) free-falling from the sky in each of the images so as to make the video film more interesting.
The image processing system of the present invention comprises: a display device, a storage device, and a processor. The display device is configured to show a simulated video film for users to view. The storage device is a hard disk or an optical disk and stores an image processing procedure composed of computer executable commands. The processor executes the image processing procedure stored in the storage device, so as to simulate effects of objects free-falling from the sky in a video film of an outdoor scene.
Referring to
Referring now to
In a step 100, the size, the shape, the transparency, and the falling speed corresponding to the free-falling objects are read according to the type of the free-falling objects selected by the user. Taking raindrops for example, in the first preferred embodiment of the present invention, 32×2 pixels are used to present the vertical texture of raining lines formed by the raindrops while a grayscale value of 200 is used to represent the transparency of the raindrops. In addition, in the first preferred embodiment of the present invention, the method determines a possible form of the free-falling objects in the simulated outdoor scene according to the selected type of the free-falling object. Taking snowflakes for example, the method reads snowflakes of different shapes and three-dimensional effects so as to generate snowflakes rich in diversity and gradation, thereby enhancing the three-dimensional effects of a snowy scene. In other embodiment of the present invention, the pattern, the size, the transparency, and the falling speed corresponding to the free-falling objects are designed so as to be adjustable by the user.
In a step 101, falling positions of the free-falling objects are randomly generated, and a vertical falling texture of the free-falling objects is generated according to the read falling speed of the free-falling objects. Taking raining lines for example, in the first preferred embodiment of the present invention, the falling speed of the raining lines is defined by Newton's law: V=V0+gt, wherein g=9.8.
In a step 102, a grayscale value of each of the images is detected so as to define a certain region of the image where the grayscale vale exceeds a predetermined grayscale value (i.e., a brighter region) as a deposited region of the free-falling objects. Then, a deposited status of the free-falling objects in the deposited region is simulated according to a status (such as liquid state or solid state) of the free-falling objects. In other embodiments of the present invention, a deposited amount of the free-falling objects in the deposited region is designed so as to be adjustable by the user.
In a step 103, a brightness of each of the images is adjusted according to the property (such as light reflection or transparency) of the free-falling objects. For example, on a rainy day, the environmental brightness is darker than on a sunny day due to the shade of clouds, so that the grayscale value of a highly bright outdoor scene should be lowered. On a snowy day, however, the environmental brightness is not apparently different from that on a sunny day, so that it is unnecessary to increase the brightness of each of the images.
In a step 104, the simulated vertical falling texture of the free-falling objects, the simulated deposited status of the free-falling objects in the deposited region, and the adjusted brightness of each of the images are integrated respectively into each of the images corresponding to the outdoor scene in the video film, so as to simulate various effects of the free-falling objects (such as analogous gradation, ground deposition, and light reflection) in the video film. As a result, the outdoor scene shown in the video film is provided with scenic effects approximating real effects of natural weather (such as rain, snow, hail, or sandstorm).
Referring to
Referring to
In a step 400, the size, the shape, the transparency, and the falling speed corresponding to the free-falling objects are read according to the type of the free-falling objects selected by the user. In addition, in the second preferred embodiment of the present invention, the method determines a possible form of the free-falling objects in the simulated outdoor scene according to the selected type of the free-falling objects, so that the generated free-falling objects are rich in diversity and gradation, thereby enhancing the three-dimensional effects of the outdoor scene. In other embodiments of the present invention, the size, the shape, the transparency, and the falling speed corresponding to the free-falling objects are designed so as to be adjustable by the user.
In a step 401, falling positions of the free-falling objects are randomly generated, and a vertical falling texture of the free-falling objects is generated according to the read falling speed of the free-falling objects.
In a step 402, it is determined according to the type of the free-falling objects selected by the user whether or not wind fields affect falling tracks of the free-falling objects in the simulated outdoor scene. If yes, a step 403 is executed; if not, a step 404 is executed. For example, on a rainy day, raining lines will change their paths under the influence of wind. Thus, raining lines affected by wind fields have complex and changing paths which are difficult to simulate. Presently, in the field of realistic rendering of graphics, a rainy scene with wind is simulated mostly by a simple approach in which inclined raining lines are used. It has never been attempted to add raining lines to a simulated virtual wind field. Therefore, in the second preferred embodiment of the present invention, the influence of wind fields on the falling tracks of raining lines is not considered.
In the step 403, an influence of the three-dimensional wind field on the falling tracks of the free-falling objects is analyzed and calculated according to the three-dimensional wind field built up by the wind-field simulation module 31, and then the falling texture of the free-falling objects is adjusted according to the influence of the three-dimensional wind field on the falling tracks, so as to simulate dynamic gradation of the free-falling objects in each of the images according to a natural scene based on a physical model. For example, a scene of floating snowflake is created by adding snowflakes to a wind field. In other embodiments of the present invention, an intensity and a direction corresponding to the three-dimensional wind field are designed so as to be adjustable by the user.
In the step 404, a grayscale value of each of the images is detected so as to define a certain region of the image where the grayscale value exceeds a predetermined grayscale value (i.e., a brighter region) as a deposited region of the free-falling objects and then simulate a deposited status of the free-falling objects in the deposited region according to a status (such as liquid state or solid state) of the free-falling objects. In other embodiments of the present invention, a deposited amount of the free-falling objects in the deposited region is designed so as to be adjustable by the user.
In a step 405, a brightness of each of the images is adjusted according to the property (such as light reflection or transparency) of the free-falling objects.
In a step 406, the simulated falling texture of the free-falling objects, the simulated deposited status of the free-falling objects in the deposited region, and the adjusted brightness of each of the images are integrated respectively into each of the images corresponding to the outdoor scene in the video film. Thus, various effects (such as dynamic gradation, ground deposition, and light reflection) of the free-falling objects are simulated in the video film according to a natural scene based on a physical model, so that the outdoor scene shown in thee video film is provided with simulated effects approximating real effects of natural weather under the influence different wind fields.
Referring now to
In a step 500, a three-dimensional space corresponding to the outdoor scene in the video film is discretized into an Nx*Nx*Nz grid, and a distribution of the wind field at each grid point is represented by Fi(r,t), wherein r represents each grid point; t is time; i is the number of directions along which wind may move; and Fi is a fluid density moving along each direction i. In the second preferred embodiment of the present invention, a wind field model with 15 directions (i.e., i=15) is established. A direction of the wind field {right arrow over (ci)} is represented by the following function:
Accordingly, a dynamic model of the three-dimensional wind field of the present invention is constructed and represented by the following function:
wherein
is a wind field density at each grid point;
is a speed field; τ is a relaxation time; and Fieq(u(r,t), p(r,t)) is a balanced distribution of the wind field and represented by the following function:
wherein {right arrow over (cia)} is a direction component of the direction {right arrow over (ci)} of the wind field in a grid space coordinate a; cs2=⅓; and ωi is a parameter to be determined as follows:
In addition to constructing the dynamic model of the three-dimensional wind field in the previous step, a boundary condition of the wind field is set in a step 501. In the second preferred embodiment of the present invention, the wind field has six boundaries including an upper boundary, a lower boundary, a front boundary, a rear boundary, a left boundary, and a right boundary. The lower boundary is the ground. A wind blowing to the ground will rebound, so that the lower boundary is defined as a rebound boundary, and Fi of each grid point at the lower boundary is reversed to generate a reversed value. The remaining five boundaries are defined as open boundaries, and Fi of each grid point at the five boundaries will not be changed.
In a step 502, the wind field is initialized. In the second preferred embodiment of the present invention, an initial status of Fi at each grid point is set to a balanced status. In other words, to begin with, ρ at each grid point is set, and then Fi is calculated according to a weight ω of each direction {right arrow over (ci)} of the wind field. In addition, to prevent system instability caused by completely symmetric initialization, it is necessary to add a very small constants ε during the initialization process so as to produce the following initialization function:
F
i(r,0)=ρωi+ε
After finishing the initialization of the wind field, wind particle densities in different directions at the boundaries of the wind field are changed in a step 503 to generate a wind. Assuming the grid point to which wind is to be applied has a wind particle density ρ, the direction of the wind field is {right arrow over (cw)}, and a variation of the wind particle density in each direction i at the grid point is ΔFi, i=0,1, . . . 14, then the function ΔFi=λiεiρV is obtained, wherein λi is determined as follows:
wherein
and Δci is an included angle between {right arrow over (ci)} and {right arrow over (cw)}.
In a step 504, it is determined according to the type of the free-falling objects selected by the user whether or not the pattern (i.e., shape) of the free-falling objects affects falling tracks of the free-falling objects in the wind field of the simulated outdoor scene. If yes, a step 505 is executed; if not, a step 506 is executed.
In a step 505, shape information corresponding to the free-falling objects is read according to the type of the free-falling objects selected by the user. Taking snowflakes as the free-falling objects for example, in the second preferred embodiment of the present invention, each snowflake is defined as a sphere with a radius of about 1 to 5 pixels, and 10 snowflake shapes are provided. The position of each snowflake is defined by a coordinate of the center of the sphere, while a grayscale of color of the sphere gradually lightens from the center of the sphere to an edge of the sphere in accordance with a normal distribution. Furthermore, incomplete spheres are also included. As a result, the simulated outdoor scene shows real configurations of the free-falling objects, and the generated free-falling objects are rich in diversity and gradation, thereby enhancing the three-dimensional effects of the outdoor scene.
In a step 506, falling positions of the free-falling objects are randomly generated in a three-dimensional space corresponding to the outdoor scene in the video film, and a vertical falling texture of the free-falling objects is generated according to the read falling speed of the free-falling objects.
In a step 507, a wind speed at each grid point in the dynamic model of the three-dimensional wind field built up previously is applied to a corresponding one of the free-falling objects (such as snowflakes) whose falling position coincides with each said grid point, so that the free-falling objects move along directions of the wind speeds at the corresponding grid points, respectively. Thus, the outdoor scene shown in the video film is provided with simulated effects approximating real effects of natural weather (such as snowflakes floating in the wind).
While the invention has been described by means of specific embodiments, numerous modifications and variations could be made thereto by those skilled in the art without departing from the scope and spirit of the invention set forth in the claims.
Number | Date | Country | Kind |
---|---|---|---|
200810184107.0 | Dec 2008 | CN | national |