Image generation system and image generation method
Through the image generation system and method, three-dimensional models and conversion relationships are used to process virtual effects, which solves the problem of unnatural virtual effects caused by curved surfaces and covering objects in augmented reality, and realizes natural virtual effect generation.
Patent Information
- Application Number
- CN202010504225.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-05
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2040-06-05
AI Technical Summary
In augmented reality applications, curved surfaces and occluder coverage of real objects lead to unnatural virtual effects.
Through the image generation system and method, a three-dimensional model is used to form a virtual effect, and predetermined content is added to the image plane according to the conversion relationship, combined with the captured image, to form a composite image to overcome the problem of curved surfaces and obstruction coverage, and provide a natural virtual effect .
It achieves the generation of natural virtual effects on curved surfaces and covered objects, thereby enhancing the naturalness of the virtual effects.
Smart Images

Figure CN113763566B
Abstract
Description
Technical Field
[0001] The present invention relates to a simulation technology, and in particular to an image generation system and an image generation method for virtual-reality fusion. Background Art
[0002] Nowadays, technologies for simulating sensations, perceptions and / or environments, such as virtual reality (VR), augmented reality (AR), mixed reality (MR) and extended reality (XR), are gaining popularity. These technologies can be applied in a variety of fields, such as gaming, military training, healthcare, remote work, etc.
[0003] In AR applications, the virtual world / objects can be combined and interacted with real-world scenes. For example, if you hold an empty bottle, the screen image can show different flowers growing out of the bottle. For another example, if you hold a milk powder can, the screen image can show nutritional information on the can in large fonts and in a ticker-shaped format. For another example, in the screen image, a real building with bright lights is covered with a medieval appearance. For another example, in the screen image, the model's skin color is changed.
[0004] It is worth noting that the aforementioned AR applications may face the following problem: since the real objects have curved surfaces and the real objects in the captured images may be covered by other obstructions, the additionally applied virtual effects may be unnatural. Summary of the invention
[0005] The present invention is directed to an image generation system and an image generation method, which form a virtual effect based on a three-dimensional model and determine a shielded area to make the virtual effect in an enhanced image more natural.
[0006] According to an embodiment of the present invention, an image generation method includes the following steps: obtaining a captured image. Determining a predetermined object in the captured image. Determining a conversion relationship between the predetermined object and a corresponding three-dimensional model. Adding predetermined content to an image plane according to the conversion relationship to form a composite image. Combining the composite image with the captured image to form an enhanced image. The conversion relationship is related to a conversion relationship between a first coordinate of the predetermined object on the image plane where the captured image is located and a second coordinate of the three-dimensional model in three-dimensional space. The composite image includes the predetermined content, and the predetermined content has not previously appeared on the predetermined object or the three-dimensional model.
[0007] According to an embodiment of the present invention, an image generation system includes (but is not limited to) an image capture device, a memory, and a processor. The image capture device is used to capture an image. The memory is used to store a program code corresponding to an image generation method used in the image generation system. The processor couples the image capture device and the memory and is configured to execute the program code. The image generation method includes the following steps: obtaining a captured image. Determining a predetermined object in the captured image. Determining a conversion relationship between the predetermined object and the corresponding three-dimensional model. Adding predetermined content to an image plane according to the conversion relationship to form a composite image. Combining the composite image with the captured image to form an enhanced image. The conversion relationship is related to the conversion relationship between a first coordinate of the predetermined object on the image plane where the captured image is located and a second coordinate of the three-dimensional model in three-dimensional space. The composite image includes predetermined content, and the predetermined content has not previously appeared on the predetermined object or the three-dimensional model.
[0008] Based on the above, the image generation system and the image generation method of the embodiments of the present invention find the three-dimensional model corresponding to the predetermined object, add predetermined content based on the three-dimensional model and convert the three-dimensional model to the image plane, and finally combine the formed synthetic image with the captured image to form an enhanced image suitable for curved surfaces and covered by obstructions, thereby providing a natural virtual effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] The accompanying drawings are included to provide a further understanding of the present invention and are incorporated in and constitute a part of this specification. The drawings illustrate embodiments of the present invention and together with the description serve to explain the principles of the present invention.
[0010] Figure 1 is a block diagram of components of an image generation system according to an embodiment of the present invention;
[0011] Figure 2 is a flow chart of an image generating method according to an embodiment of the present invention;
[0012] Figure 3 An instance of capturing an image;
[0013] Figure 4 A schematic diagram for illustrating the conversion between captured images and three-dimensional models;
[0014] Figure 5 is an instance of a mask image.
[0015] Description of Figure Numbers
[0016] 100: Image generation system;
[0017] 110: image capture device;
[0018] 130: memory;
[0019] 150: Display;
[0020] 170: processor;
[0021] S210~S290: steps;
[0022] TO: reserved object;
[0023] OO: shelter;
[0024] C1, C2: feature points;
[0025] TM: three-dimensional model;
[0026] FP: picture plane;
[0027] OR: Mask the image. DETAILED DESCRIPTION
[0028] Reference will now be made in detail to exemplary embodiments of the present invention, examples of which are illustrated in the accompanying drawings. Whenever possible, the same reference numerals are used in the drawings and the description to refer to the same or like parts.
[0029] Figure 1 FIG. 1 is a block diagram of components of an image generation system 100 according to an embodiment of the present invention. Figure 1 The image generation system 100 includes but is not limited to: an image capture device 110, a memory 130, a display 150, and a processor 170. The image generation system 100 may be one or more electronic devices such as smart phones, tablets, or head-mounted displays (HMDs).
[0030] The image capture device 110 may be a monochrome camera or a color camera, a stereo camera, a digital video camera, a time-of-flight (ToF) detector, or other sensors capable of capturing images. In one embodiment, the image capture device 110 is used to capture images.
[0031] The memory 130 may be any type of fixed or removable random-access memory (RAM), read-only memory (ROM), flash memory, similar devices, or a combination of the above devices. In one embodiment, the memory 130 is used to record program code, device configuration, buffer data, or permanent data (such as image data, object data, three-dimensional model, conversion relationship, internal parameters of the image capture device 110, etc.), and these data will be introduced later.
[0032] The display 150 may be a liquid crystal display (LCD), a light-emitting diode (LED) display, an organic light-emitting diode (OLED) display, or other displays. In one embodiment, the display 150 is used to display images. It should be noted that in some embodiments, the display 150 may be a display of an external device (e.g., a smartphone, a tablet, etc.), and the external device may be placed on the body of the head-mounted display.
[0033] The processor 170 is coupled to the image capturing device 110 , the memory 130 , and the display 150 , and the processor 170 is configured to load and execute the program code stored in the memory 130 to perform the process of the exemplary embodiment of the present invention.
[0034] In some embodiments, the functions of the processor 170 may be implemented using a programmable unit such as a central processing unit (CPU), a microprocessor, a microcontroller, a digital signal processing (DSP) chip, a field programmable gate array (FPGA), etc. The functions of the processor 170 may also be implemented by an independent electronic device or an integrated circuit (IC), and the operation of the processor 170 may also be implemented by software.
[0035] It should be noted that the processor 170 may not be provided in the same device as the image capture device 110 and / or the display 150. However, the devices respectively equipped with the image capture device 110, the display 150 and the processor 170 may further include a communication transceiver with a compatible communication technology (e.g., Bluetooth, wireless fidelity (Wi-Fi), infrared (IR) or a physical transmission line) to transmit or receive data to each other. For example, the memory 130 and the processor 170 may be separated into a computing device. This computing device may be a desktop computer, a laptop computer, a server, a smart phone, or a tablet device. The image capture device 110 and the display 150 are also separated into another electronic device (e.g., a smart phone or a tablet), and the two devices can communicate wirelessly or wired.
[0036] In order to facilitate understanding of the operation process of the embodiment of the present invention, the following will give a number of examples to describe in detail the operation process of the image generation system 100 in the embodiment of the present invention. Hereinafter, the method described in the embodiment of the present invention will be described in conjunction with the various components and modules in the image generation system 100. The various processes of the method can be adjusted according to the implementation situation, and are not limited thereto.
[0037] Figure 2 is a flow chart of an image generation method according to an embodiment of the present invention. Figure 2 , the processor 170 obtains one or more captured images through the image capture device 110 (step S210). Specifically, in applications such as AR, XR or other reality-related technologies, the virtual world / objects can be combined and interacted with the real scene. Therefore, the image generation system 100 obtains real-time captured images. The captured image is the picture of the real scene in the field of view (FoV) captured by the image capture device 110.
[0038] Next, the processor 170 determines the corresponding predetermined object based on the captured image (step S230). Specifically, the processor 170 can detect the predetermined object based on image recognition technology. In one embodiment, the surface of the three-dimensional predetermined object in the real scene has a reference pattern. The reference pattern can be a graphic identifier such as a one-dimensional, two-dimensional or three-dimensional code, or it can be a predetermined geometric shape, object appearance, text, number, symbol or a combination thereof. In addition, the reference pattern has identification information such as the type, number, model, or serial number of the predetermined object. The processor 170 can decode the image corresponding to the reference pattern in the captured image to obtain the aforementioned identification information and identify the predetermined object accordingly. For example, Figure 3 For an example of capturing an image. Figure 3 , the processor 170 can recognize that the predetermined object TO is a medicine can based on the rabbit head pattern shown in the figure.
[0039] In some embodiments, the processor 170 further obtains a corresponding three-dimensional model according to the recognition result of the reference pattern. The memory 130 stores a plurality of types, models or styles of three-dimensional models (e.g., point cloud, STL, FBX, COLLADA, 3DS, OBJ or other formats) to form a three-dimensional model database. Each three-dimensional model has independent and corresponding identification information. The processor 170 can compare the identification information obtained from the recognition result with the three-dimensional model database, and obtain a three-dimensional model in the three-dimensional model database that matches the identification information. The use of these three-dimensional models will be introduced later.
[0040] In another embodiment, the processor 170 detects one or more feature information from the captured image. The processor 170 may obtain feature information in the captured image based on image recognition technology (e.g., scale-invariant feature transform (SIFT), haar feature, Adaboost, support vector machine (SVM), or neural network algorithms). Feature information may be feature points and their position, scale, rotation invariant, grayscale, color, direction, or other information set by feature extraction. On the other hand, each three-dimensional model in the three-dimensional model database has independent and corresponding feature information. The processor 170 will compare the feature information in the captured image with the three-dimensional model in the three-dimensional model database, and obtain the three-dimensional model corresponding to the matching feature information in the three-dimensional model database according to the comparison result, thereby identifying the predetermined object.
[0041] After determining the predetermined object, the processor 170 may further determine the conversion relationship between the predetermined object and the corresponding three-dimensional model (step S250). Specifically, a two-dimensional captured image can usually provide two-dimensional position information (such as camera coordinates) of the predetermined object in the image plane (or imaging plane) where it is located. The image plane refers to the plane onto which the light refracted by an object in the real world is projected after passing through a pinhole. However, any object in the real world is in fact three-dimensional. It is usually difficult to infer correct or accurate real surface information (such as curved surface information) of an object based solely on two-dimensional position information. The embodiment of the present invention infers the surface information of the predetermined object through the three-dimensional model corresponding to the two-dimensional object, and then obtains the curved surface of the predetermined object, or infers whether the predetermined object is obscured.
[0042] It is worth noting that the orientation and distance of the predetermined object in the real world by the image capture device 110 may be different from the default orientation and viewing relative distance of the three-dimensional model. In order to convert the predetermined object in the captured image and the three-dimensional model in the three-dimensional space, it is necessary to first obtain the conversion relationship required for the conversion. The conversion relationship is related to the conversion relationship between one or more first coordinates of the predetermined object on the image plane where the captured image is located and one or more corresponding second coordinates of the corresponding three-dimensional model in the three-dimensional space. Among them, the first feature point corresponding to the first coordinate will be the same as the second feature point corresponding to the second coordinate after conversion, or the second feature point corresponding to the second coordinate will be the same as the first feature point corresponding to the first coordinate after conversion.
[0043] For example, Figure 4 This is a diagram to illustrate the conversion of captured images and 3D models. Figure 4, a first feature point C1 (assuming it is located at the ear tip of the rabbit head pattern) corresponding to a first coordinate reaches the position of a corresponding second feature point C2 (assuming it is located at the ear tip of the rabbit head pattern) on the three-dimensional model after displacement and / or rotation conversion. Or, the second feature point C2 is converted to the first feature point C1.
[0044] From a mathematical point of view, the transformation relationship can be a transformation matrix. The product of the second coordinate (in vector form) and the transformation matrix is the first coordinate (in vector form), and the mathematical relationship is as follows:
[0045]
[0046] The first coordinate of a first feature point in the predetermined object is [u1 v1 1] T , the second coordinate of a second feature point in the three-dimensional model is [x1 y1 z1] T , k may be referred to as an intrinsic parameter matrix (related to the focal length, origin position, resolution, pixel angle, optical characteristics and / or distortion factors of the image capture device 110), and the transformation matrix is [R|t]. The transformation matrix may also be referred to as an extrinsic parameter matrix and is composed of the displacement and / or rotation required to transform the second coordinate into the first coordinate.
[0047] Regarding the determination of the conversion relationship, in an embodiment where the surface of the predetermined object has a reference pattern, the processor 170 may determine the conversion relationship based on one or more first coordinates of the reference pattern on the image plane. That is, the aforementioned first feature point is located on the reference pattern. The processor 170 may derive the conversion relationship based on one or more second coordinates of the reference pattern in the three-dimensional space and the corresponding first coordinates on the three-dimensional model. That is, the relationship of how the second coordinate is converted to the first coordinate, or how the first coordinate is converted to the second coordinate. From a mathematical point of view, the conversion matrix can be obtained by inputting the known first coordinate, the second coordinate and the internal parameter matrix.
[0048] In the embodiment of feature comparison, the processor 170 may determine the conversion relationship based on the first coordinate of the first feature point in the feature information of the predetermined object on the image plane. The aforementioned first feature point is located on the predetermined object. Similarly, the processor 170 may derive the conversion relationship based on one or more second coordinates of the corresponding second feature point on the three-dimensional model in the three-dimensional space and the corresponding first coordinate.
[0049] The processor 170 may add the predetermined content to the image plane according to the conversion relationship to form a composite image (step S270). Specifically, the predetermined content is not previously present on the predetermined object or three-dimensional model, and the composite image will eventually include the predetermined content. In one embodiment, the predetermined content includes a texture that has not previously appeared on the three-dimensional model and the predetermined object. Texture is a virtual special effect that is preset or selected by the user, such as color change, presentation of a predetermined pattern, text or picture, and may be related information or advertisements of the predetermined object corresponding to the real object. The processor 170 may paste / cover this texture on the characteristic interest area of the three-dimensional model to form an additional virtual special effect on the three-dimensional model, and the virtual special effect takes into account the surface characteristics. Then, the processor 170 may project the texture on the three-dimensional model onto the image plane according to the conversion relationship to form a composite image. Projection is to convert the second coordinate of the second feature point on the texture to the first coordinate on the image plane. For example, the first coordinate can be obtained by inputting a known conversion matrix, a second coordinate and an internal parameter matrix.
[0050] In another embodiment, the predetermined content includes an occlusion image that has not previously appeared on the three-dimensional model. The occlusion image is an area in which an occlusion object (ie, different from the predetermined object) covers the predetermined object in the captured image. Figure 3 For example, a portion of the predetermined object TO is obscured by the obstructing object OO (taking an orange as an example). The processor 170 can project the three-dimensional model onto the image plane according to the conversion relationship to form a reference image. The reference image can represent the situation where the predetermined object is not obscured by any obstructing object. The projection method is the same as the aforementioned conversion and will not be repeated here. Then, the processor 170 can obtain the obscured image (as part of the composite image) based on the difference between the reference image and the predetermined object in the captured image (i.e., determine whether the predetermined object is obscured). For example, the feature comparison result between the two images is used to obtain the area where the reference image is different from the image corresponding to the predetermined object. Figure 5 This is an example of masking an image OR. Figure 5 The masking image OR is the area where the predetermined object TO overlaps with the masking object OO.
[0051] It should be noted that in some embodiments, the processor 170 may also detect that the predetermined object is not blocked. In addition, the predetermined content may also be the content that already exists on the original predetermined object or 3D model, and the processor 170 regenerates it on the 3D model to be projected onto the image plane.
[0052] After the image corresponding to the predetermined content (e.g., the projected texture image and / or the masking image, etc.) is determined, the processor 170 may combine the synthesized image with the captured image to form an enhanced image (step S290). Specifically, the processor 170 may first overlay the projected texture on the captured image (i.e., to form a new captured image), and then overlay the masking image on the new captured image (i.e., to form a new enhanced image). That is, the masking image is overlaid on the captured image after the aforementioned virtual effect is projected onto the captured image, so that the virtual effect can be naturally generated on the surface of the object (not as if it is forcibly pasted). In one embodiment, the synthesized image is a combination of the projected texture image and the masking image. In other embodiments, the synthesized image is only the projected texture image (e.g., the predetermined object is not masked).
[0053] In some embodiments, the processor 170 may further display an enhanced image through the display 150. This enhanced image is the result of combining the real scene with the virtual effect. In addition, as the orientation of the image capture device 110 changes or moves, the synthesized image can also be overlaid on the captured image according to the aforementioned position correspondence. That is, the projected texture image and / or the masked image also turns or moves accordingly. In this way, the user can watch the AR effect in real time.
[0054] In summary, in the image generation system and the image generation method of the embodiments of the present invention, predetermined content is formed based on the three-dimensional model corresponding to the predetermined object, and the predetermined content such as texture and masking image are respectively overlaid on the captured image, so that the virtual effect is more natural.
[0055] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. An image generation method, characterized in that: include: Get the captured image; determining a corresponding predetermined object according to the captured image; Determining a conversion relationship between the predetermined object and the corresponding three-dimensional model, wherein the conversion relationship is related to a conversion relationship between at least one first coordinate of the predetermined object on the image plane where the captured image is located and at least one second coordinate of the three-dimensional model in the three-dimensional space; Adding at least one predetermined content to the image plane according to the conversion relationship to form a composite image, wherein the composite image includes the at least one predetermined content; the at least one predetermined content includes a texture that has not previously appeared on the three-dimensional model and the predetermined object, and a masking image that has not previously appeared on the three-dimensional model; as well as combining the composite image with the captured image to form an enhanced image, The step of adding the at least one predetermined content to the image plane according to the conversion relationship comprises: Projecting the three-dimensional model onto the image plane according to the conversion relationship to form a reference image; as well as The masking image is obtained based on the difference between the reference image and the predetermined object in the captured image, wherein the masking image is the area in the captured image where the masking object covers the predetermined object, and the composite image is a combination of the projected texture image and the masking image, and the masking image is overlaid on the captured image.
2. The image generation method according to claim 1, characterized in that: The step of adding the at least one predetermined content to the image plane according to the conversion relationship comprises: forming the texture on the three-dimensional model; and The texture on the three-dimensional model is projected onto the image plane according to the conversion relationship to form the synthetic image.
3. The image generation method according to claim 1, characterized in that: The surface of the predetermined object has a reference pattern, and the step of determining the predetermined object in the captured image includes: detecting the reference pattern from the captured image to identify the predetermined object; and The corresponding three-dimensional model is obtained according to the recognition result.
4. The image generation method according to claim 3, characterized in that: After the step of obtaining the corresponding three-dimensional model, the method further includes: The conversion relationship is determined according to the at least one first coordinate of the reference pattern on the image plane.
5. The image generation method according to claim 1, characterized in that: The step of determining the predetermined object in the captured image comprises: Detecting at least one feature information from the captured image; Comparing the at least one feature information with a three-dimensional model database; and The corresponding three-dimensional model is obtained according to the comparison result.
6. The image generation method according to claim 5, characterized in that: After the step of obtaining the corresponding three-dimensional model, the method further includes: The conversion relationship is determined according to the at least one first coordinate of the feature point in the at least one feature information on the image plane.
7. An image generation system, characterized in that: include: An image capture device, capturing an image; A memory storing a program code corresponding to the image generation method used in the image generation system; A processor is coupled to the image capture device and the memory and is configured to execute the program code. The image generation method includes: Acquire a captured image by the image capture device; determining a corresponding predetermined object according to the captured image; Determining a conversion relationship between the predetermined object and the corresponding three-dimensional model, wherein the conversion relationship is related to a conversion relationship between at least one first coordinate of the predetermined object on the image plane where the captured image is located and at least one second coordinate of the three-dimensional model in the three-dimensional space; adding at least one predetermined content to the image plane according to the conversion relationship to form a composite image, wherein the composite image includes the at least one predetermined content; the at least one predetermined content includes a texture that has not previously appeared on the three-dimensional model and the predetermined object, and a masking image that has not previously appeared on the three-dimensional model; and combining the composite image with the captured image to form an enhanced image, The step of adding the at least one predetermined content to the image plane according to the conversion relationship comprises: projecting the three-dimensional model onto the image plane according to the conversion relationship to form a reference image; and The masking image is obtained based on the difference between the reference image and the predetermined object in the captured image, wherein the masking image is the area in the captured image where the masking object covers the predetermined object, and the composite image is a combination of the projected texture image and the masking image, and the masking image is overlaid on the captured image.
8. The image generation system according to claim 7, characterized in that: The image generation method further comprises: forming the texture on the three-dimensional model; and The texture on the three-dimensional model is projected onto the image plane according to the conversion relationship to form the synthetic image.
9. The image generation system according to claim 7, characterized in that: The surface of the predetermined object has a reference pattern, and the image generation method further includes: detecting the reference pattern from the captured image to identify the predetermined object; and The corresponding three-dimensional model is obtained according to the recognition results.
10. The image generation system according to claim 9, characterized in that: And the image generation method also includes: The conversion relationship is determined according to the at least one first coordinate of the reference pattern on the image plane.
11. The image generation system according to claim 7, characterized in that: The image generation method further comprises: Detecting at least one feature information from the captured image; Comparing the at least one feature information with a three-dimensional model database; and The corresponding three-dimensional model is obtained according to the comparison result.
12. The image generation system according to claim 11, characterized in that: The image generation method further comprises: The conversion relationship is determined according to the at least one first coordinate of the feature point in the at least one feature information on the image plane.
