Image processing method and apparatus, device, and medium
By determining the coverage area and edge of virtual objects in image processing, and adjusting the effect based on time variables, the problem of relying on lidar to obtain three-dimensional information in the existing technology is solved, and the coverage effect of adding virtual objects on a two-dimensional plane is achieved. Improved convenience and efficiency of image processing.
Patent Information
- Application Number
- PCT/CN2024/076061
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-02-24
- Filing Date
- 2024-02-05
- Publication Date
- 2024-08-29
AI Technical Summary
When adding effects such as snow, catkins, and fallen flowers in image processing, the existing technology needs to rely on laser radar and other equipment to obtain three-dimensional spatial information, resulting in high costs, complex calculations, and time-consuming, making it difficult to meet convenience needs.
In the image processing method, the image to be processed is obtained, the coverage area and edge of the virtual object are determined, the coverage effect is adjusted based on the time variable, and the coverage effect of the virtual object is added. The entire process is carried out in a two-dimensional plane, avoiding the construction of a three-dimensional space grid. .
It reduces the computational complexity, improves the convenience of image processing, reduces the dependence on laser radar and other equipment, and achieves the coverage effect of adding virtual objects on a two-dimensional plane.
Smart Images

Figure CN2024076061_29082024_PF_FP_ABST
Abstract
Description
Image processing method, device, equipment and medium
[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on February 24, 2023, with application number 202310179296.7 and invention name “A method, device, equipment and medium for image processing”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present disclosure relates to the field of computer technology, and in particular to an image processing method, apparatus, device, and medium. Background Art
[0003] With the continuous development of image processing technology, different effects can be added to images to increase the diversity of image processing and meet the needs of different users. For example, special effects props and AR scenes can be used to add spatially realistic effects such as snow, catkins, and falling flowers. However, current image processing requires the assistance of equipment such as LiDAR to obtain the image's three-dimensional spatial information to achieve a good real-world effect. This acquisition is costly, computationally complex, and time-consuming.
[0004] Summary of the Invention
[0005] In view of this, the present disclosure provides an image processing method, apparatus, device and medium, which add the overlay effect of virtual objects in the image without relying on equipment such as lidar to reconstruct the three-dimensional space, thereby improving the convenience of image processing.
[0006] To achieve the above objectives, the technical solutions provided by this disclosure are as follows:
[0007] In a first aspect of the present disclosure, an image processing method is provided, characterized in that the method comprises:
[0008] Get the image to be processed;
[0009] determining a coverage area of a virtual object based on the image to be processed;
[0010] Determining a coverage edge of the virtual object based on the coverage area and a time variable;
[0011] A coverage effect of the virtual object is obtained based on the coverage area and the coverage edge.
[0012] In a second aspect of the present disclosure, an image processing apparatus is provided, the apparatus comprising:
[0013] A first acquiring unit, configured to acquire an image to be processed;
[0014] a determining unit, configured to determine a coverage area of a virtual object based on the image to be processed;
[0015] The determining unit is further configured to determine a coverage edge of the virtual object based on the coverage area and the time variable;
[0016] A second acquisition unit is configured to obtain a coverage effect of the virtual object based on the coverage area and the coverage edge.
[0017] In a third aspect of the present disclosure, an electronic device is provided, the device comprising: a processor and a memory;
[0018] The memory is used to store instructions or computer programs;
[0019] The processor is configured to execute the instructions or computer program in the memory so that the electronic device executes the method described in the first aspect.
[0020] In a fourth aspect of the present disclosure, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium. When the instructions are executed on a device, the device executes the method described in the first aspect.
[0021] In a fifth aspect of the present disclosure, a computer program product is provided, wherein the computer program product comprises a computer program / instructions, and when the computer program / instructions are executed by a processor, the method described in the first aspect is implemented.
[0022] It can be seen that the present disclosure has the following beneficial effects:
[0023] In the present disclosure, after acquiring the image to be processed, the coverage area corresponding to the virtual object in the image to be processed is determined, and the coverage edge of the virtual object is determined based on the coverage area and the time variable. Since the coverage degree of the virtual object in the coverage area changes with time, the corresponding coverage edge changes. Therefore, it is necessary to determine the coverage edge of the virtual object based on the coverage area and the time variable. Then, the coverage effect of the virtual object is obtained based on the coverage area and the coverage edge. That is, after determining the coverage area and the coverage edge, the virtual object is added to the corresponding coverage area. That is, through the technical solution provided by the present disclosure, when adding the coverage effect of the virtual object to the image to be processed, there is no need to rely on the laser radar to construct the three-dimensional space of the scene in the image to be processed. The entire processing process is carried out on a two-dimensional plane, which reduces calculations and improves convenience. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments recorded in the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0025] FIG1 is a flow chart of an image processing method provided by an embodiment of the present disclosure;
[0026] FIG2a is an image to be processed provided by an embodiment of the present disclosure;
[0027] FIG2 b is a scene normal map provided by an embodiment of the present disclosure;
[0028] FIG2c is a schematic diagram of a snow-covered edge provided by an embodiment of the present disclosure;
[0029] FIG3a is a scene depth map provided by an embodiment of the present disclosure;
[0030] FIG3 b is a scene normal offset map provided by an embodiment of the present disclosure;
[0031] FIG4 is a structural diagram of a snow rendering device provided by an embodiment of the present disclosure;
[0032] FIG5 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0033] In order to enable those skilled in the art to better understand the solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the embodiments described are only part of the embodiments of the present disclosure, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present disclosure without making any creative efforts shall fall within the scope of protection of the present disclosure.
[0034] Currently, when processing image special effects or adding effects like snow, catkins, and falling petals to AR scenes, it's necessary to rely on devices like LiDAR to obtain the image's three-dimensional spatial information. For example, rendering snow scenes in images primarily relies on a mobile device's LiDAR to reconstruct a three-dimensional spatial mesh and add a snow texture to that mesh. This implementation can reconstruct the three-dimensional environment well, but requires LiDAR hardware support and has a low coverage rate. Furthermore, when rendering snow scenes in real-time interactive scenarios, if the scene is complex, such as one with many objects, constructing the three-dimensional spatial mesh can take a long time.
[0035] Based on this, the present application provides an image processing method, which determines the coverage area corresponding to the virtual object in the image to be processed after obtaining the image to be processed, and determines the coverage edge corresponding to the virtual object based on the coverage area and the time variable. Since the coverage degree of the virtual object varies with time, it is necessary to determine the coverage edge of the virtual object based on the coverage area and the time variable. After determining the coverage area and the coverage edge, the coverage effect of the virtual object is added to the image to be processed based on the coverage area and the coverage edge. That is, when adding the coverage effect of the virtual object to the image to be processed, there is no need to construct a 3D spatial grid for the scene in the image to be processed. The addition of the coverage effect can be achieved on a two-dimensional screen, which reduces the processing complexity and improves convenience.
[0036] It is understandable that before using the technical solutions of each embodiment of the present disclosure, the type, scope of use, usage scenarios, etc. of the personal information involved should be informed to the user in an appropriate manner in accordance with relevant laws and regulations, and the user's authorization should be obtained.
[0037] For example, in response to a user's active request, a prompt message is sent to the user to clearly inform the user that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the electronic device, application, server, storage medium, or other software or hardware that performs the operation of the disclosed technical solution based on the prompt message.
[0038] As an optional but non-limiting implementation, in response to receiving a user's active request, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. Furthermore, the pop-up window may also contain a selection control for the user to select "agree" or "disagree" to provide personal information to the electronic device.
[0039] It is understandable that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0040] To facilitate understanding of the technical solutions provided by the present disclosure, they will be described below with reference to the accompanying drawings.
[0041] Refer to Figure 1, which is a flow chart of an image processing method provided by the present disclosure. As shown in Figure 1, the method can be executed by an image processing client, which can be deployed in an electronic device. The electronic device can include a mobile phone, tablet computer, laptop computer, desktop computer, vehicle terminal, wearable electronic device, all-in-one machine, smart home device and other devices with communication functions, and can also be a virtual machine or a device simulated by a simulator. As shown in Figure 1, the method can include the following steps:
[0042] S101: Acquire an image to be processed.
[0043] In this embodiment, first, an image to be processed is obtained, where the image to be processed refers to an image to which a virtual object overlay effect is to be added. The image to be processed can be a pre-photographed image or an image captured in real time by a user based on an image processing client.
[0044] S102: Determine a coverage area of a virtual object based on the image to be processed.
[0045] After acquiring the image to be processed, the corresponding coverage area for the virtual objects is determined based on the image to be processed, as different images contain different scenes. Virtual objects are objects added to the image to be processed, such as snow, leaves, and catkins. Users can select the virtual objects to be added through the image processing client.
[0046] In some embodiments, the coverage area of a virtual object can be determined by obtaining a scene normal map based on the image to be processed and obtaining a motion direction vector of the virtual object; and determining the coverage area of the virtual object based on the scene normal map and the motion direction vector. Specifically, the image to be processed is transformed to obtain a scene normal map corresponding to the image to be processed. For example, FIG2a shows the image to be processed, and FIG2b shows the scene normal map corresponding to the image to be processed.
[0047] After obtaining the scene normal map and the virtual object's motion direction, the virtual object's coverage area can be determined by: sampling the scene normal map based on the pixel coordinates of the image to be processed to obtain a pixel normal vector; obtaining a coverage value based on the pixel normal vector and the virtual object's motion direction vector; and determining the virtual object's coverage area based on the coverage value. Specifically, the pixel normal vector is first obtained from the scene normal map, the coverage value is calculated by combining the pixel normal vector and the motion direction vector, and the coverage area of the virtual object is determined based on the size of the coverage value.
[0048] The movement direction of the virtual object may be pre-configured, or the image processing client may obtain the gravity direction based on the gravity sensor of the electronic device as the movement direction of the virtual object.
[0049] In some implementations, a dot product can be performed on the pixel normal vector and the motion direction vector to obtain a dot product result, i.e., a coverage value. If the dot product result is greater than a preset threshold, it is determined that the pixel corresponding to the pixel normal vector needs to be covered; if the dot product result is less than or equal to the preset threshold, it is determined that the pixel corresponding to the pixel normal vector does not need to be covered. The preset threshold can be set according to actual application conditions, for example, the preset threshold is 0.
[0050] S103: Determine the coverage edge of the virtual object based on the coverage area and the time variable.
[0051] After determining the coverage area, the virtual object's coverage of the coverage area changes over time, and the corresponding coverage edge changes. Therefore, it is necessary to determine the coverage edge of the virtual object based on the coverage area and time variables. For example, if a snow effect is added to the image to be processed, the snow will change from no snow to a small amount of snow over time, and the snow cover thickness will change, so the snow cover edge will also change.
[0052] In some embodiments, the coverage edge of a virtual object can be determined by: obtaining an edge texture vector based on the edge of the coverage area; determining edge information based on the edge texture vector and a time variable; and determining the coverage edge of the virtual object based on the edge information. Specifically, an edge texture vector corresponding to the coverage area is obtained, and then new edge information is determined based on the edge texture vector and the time variable, and the coverage edge of the virtual object is determined based on the edge information.
[0053] The edge information can be determined based on the edge texture vector and the time variable in the following ways: determining the cover thickness of the virtual object based on the time variable and the movement speed of the virtual object; and determining the edge information based on the edge texture vector and the cover thickness. For example, in the application scenario shown in Figure 2a, the determined cover area of the virtual object includes the desktop area, and the edge of the cover area is the edge of the desktop. As the snow accumulates, as shown in Figure 2c, the edge of the snow cover will change, becoming smoother than the edge of the desktop.
[0054] S104: Obtaining a coverage effect of the virtual object based on the coverage area and the coverage edge.
[0055] After obtaining the coverage area and coverage edge corresponding to the virtual object, the coverage effect of the virtual object is added to the coverage area. The edge corresponding to the virtual object in the image to be processed is determined by the coverage edge determined in S103.
[0056] When rendering a virtual object in an image to be processed, the virtual object's texture map can be sampled to obtain shading data for the virtual object, and then the shading data can be rendered into the image to be processed. The texture map of the virtual object can include a base color map, a normal map, a metallic, roughness, and ambient occlusion (MRAO) blend map, etc. The obtained shading data includes the base color, normal vector, metallic, roughness, and ambient occlusion intensity.
[0057] In some embodiments, a virtual object overlay effect can be added to the image to be processed by: updating the overlay area based on the overlay edge to obtain an updated overlay area; and rendering the virtual object in the updated overlay area. That is, as the overlay thickness of the virtual object changes over time, the corresponding overlay area of the virtual object in the image to be processed will also change, necessitating a new overlay area to add the virtual object overlay effect to the new overlay area. For example, in the application scenario shown in Figure 2a, adding a snow overlay effect may result in the snow taking on a cone-like shape as the snow accumulates. During this process, the snow cover area continuously decreases.
[0058] In some embodiments, the processed image can be further processed to add more effects and enhance realism. Specifically, a scene depth map is obtained based on the processed image; the processed image is processed based on the scene depth map to obtain an overlay effect. The overlay effect can be determined based on the virtual object, such as a fog or water vapor effect. Specifically, the processed image is transformed to obtain a scene depth map, and the depth values in the scene depth map are used to interpolate the processed image to obtain the overlay effect. For example, the processed image shown in Figure 2a is transformed to obtain the scene depth map shown in Figure 3a.
[0059] Normally, after the image to be processed is transformed, the depth in the scene depth map is nonlinear, that is, the depth accuracy is high near the camera, and the depth accuracy is low far away. To avoid affecting the superposition effect due to different depth accuracy, first obtain a first distance and a second distance based on the scene depth map; use the first distance and the second distance to correct the depth value in the scene depth map to obtain a corrected scene depth map; use the corrected scene depth map to process the image to be processed to obtain a superposition effect. The first distance refers to the distance between the near plane corresponding to the camera device and the camera device, and the second distance refers to the distance between the far plane corresponding to the camera device and the camera device. The camera device is used to obtain the image to be processed.
[0060] In some implementations, to emphasize the thickness of a virtual object's overlay, a normal offset can be used to increase the edge's shadow and enhance the perception of thickness. Specifically, the normal vectors of the pixels covering the overlay edge are offset based on the virtual object's motion direction to increase the shadow of the overlay edge. For example, as shown in Figure 3b, if the virtual object's motion vector is downward, the normal vectors of the pixels covering the overlay edge are offset downward.
[0061] It can be seen that after acquiring the image to be processed, the coverage area corresponding to the virtual object in the image to be processed is determined, and the coverage edge of the virtual object is determined based on the coverage area and the time variable. Since the coverage degree of the virtual object in the coverage area changes with time, the corresponding coverage edge changes. Therefore, it is necessary to determine the coverage edge of the virtual object based on the coverage area and the time variable. Then, the coverage effect of the virtual object is obtained based on the coverage area and the coverage edge. That is, after determining the coverage area and the coverage edge, the virtual object is added to the corresponding coverage area. That is, through the technical solution provided by the present disclosure, when adding the coverage effect of the virtual object to the image to be processed, there is no need to rely on the laser radar to construct the three-dimensional space of the scene in the image to be processed. The entire processing process is carried out on a two-dimensional plane, which reduces calculations and improves convenience.
[0062] Based on the above method embodiment, the embodiment of the present application provides a snow rendering device and an electronic device, which will be described below with reference to the accompanying drawings.
[0063] Refer to Figure 4, which is a structural diagram of an image processing device provided in an embodiment of the present application. As shown in Figure 4, the device may include: a first acquisition unit 401, a determination unit 402 and a second acquisition unit 403.
[0064] The first acquisition unit 401 is used to acquire an image to be processed;
[0065] A determining unit 402 is configured to determine a coverage area of a virtual object based on the image to be processed;
[0066] The determining unit 402 is further configured to determine a coverage edge of the virtual object based on the coverage area and the time variable;
[0067] The second acquiring unit 403 is configured to acquire a coverage effect of the virtual object based on the coverage area and the coverage edge.
[0068] In some embodiments, the determination unit 402 is specifically configured to obtain a scene normal map based on the image to be processed, and obtain a motion direction vector of the virtual object; and determine a coverage area of the virtual object based on the scene normal map and the motion direction vector.
[0069] In some embodiments, the determination unit 402 is specifically used to sample the scene normal map based on the pixel coordinates of the image to be processed to obtain a pixel normal vector; obtain a coverage value based on the pixel normal vector and the motion direction vector of the virtual object; and determine the coverage area of the virtual object based on the coverage value.
[0070] In some embodiments, the determining unit 402 is specifically configured to obtain an edge texture vector based on an edge of the coverage area; determine edge information based on the edge texture vector and a time variable; and determine a coverage edge of the virtual object based on the edge information.
[0071] In some embodiments, the determining unit 402 is specifically configured to determine the cover thickness of the virtual object based on a time variable and a movement speed of the virtual object; and determine edge information based on the edge texture vector and the cover thickness.
[0072] In some implementations, the second acquiring unit 403 is specifically configured to update the coverage area based on the coverage edge to obtain an updated coverage area; and render the virtual object in the updated coverage area.
[0073] In some embodiments, the second acquiring unit 403 is further configured to obtain a scene depth map based on the image to be processed; and process the image to be processed based on the scene depth map to obtain a superposition effect.
[0074] In some embodiments, the second acquisition unit 403 is specifically configured to acquire a first distance and a second distance based on the scene depth map; correct a depth value in the scene depth map using the first distance and the second distance to obtain a corrected scene depth map; and process the image to be processed using the corrected scene depth map to obtain a superposition effect.
[0075] In some embodiments, the second acquiring unit 403 is further configured to offset the pixel normal direction vector of the covered edge using the motion direction vector of the virtual object to increase the shadow effect of the covered edge.
[0076] It should be noted that the specific implementation of each unit in this embodiment can refer to the relevant description in the above-mentioned method embodiment. The division of units in the embodiment of the present disclosure is schematic and is only a logical function division. There may be other division methods in actual implementation. The functional units in the embodiment of the present disclosure can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. For example, in the above-mentioned embodiment, the processing unit and the sending unit can be the same unit or different units. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
[0077] Referring to FIG5 , a schematic diagram of the structure of an electronic device 500 suitable for implementing embodiments of the present disclosure is shown. Terminal devices in embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. The electronic device shown in FIG5 is merely an example and should not limit the functionality or scope of use of embodiments of the present disclosure.
[0078] As shown in Figure 5, the electronic device 500 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. Various programs and data required for the operation of the electronic device 500 are also stored in the RAM 503. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0079] Typically, the following devices may be connected to the I / O interface 505: an input device 506 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 508 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 509. The communication device 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. Although FIG5 shows the electronic device 500 with various devices, it should be understood that not all of the devices shown are required to be implemented or present. More or fewer devices may alternatively be implemented or present.
[0080] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 509, or installed from the storage device 508, or installed from the ROM 502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.
[0081] The electronic device provided by the embodiment of the present disclosure and the method provided by the above embodiment belong to the same inventive concept. For technical details not fully described in this embodiment, please refer to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
[0082] An embodiment of the present disclosure provides a computer storage medium having a computer program stored thereon. When the program is executed by a processor, the method provided in the above embodiment is implemented.
[0083] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.
[0084] In some embodiments, the client and server can communicate using any currently known or later developed network protocol, such as HTTP (Hypertext Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or later developed network.
[0085] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0086] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device can perform the method.
[0087] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including, but not limited to, object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on the remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0088] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0089] The units involved in the embodiments described in this disclosure may be implemented in software or hardware, wherein the name of a unit / module does not, in some cases, limit the unit itself.
[0090] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0091] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0092] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Reference can be made to the common and similar parts between the various embodiments. For the systems or devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method description.
[0093] It should be understood that in the present disclosure, "at least one (item)" refers to one or more, and "plurality" refers to two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0094] It should also be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.
[0095] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0096] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present disclosure. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure is not limited to the embodiments shown herein, but is intended to be construed in the widest manner consistent with the principles and novel features disclosed herein.
Claims
1. An image processing method, comprising: Get the image to be processed; Determine a coverage area of a virtual object based on the image to be processed; Determine the coverage edge of the virtual object based on the coverage area and the time variable; A coverage effect of the virtual object is obtained based on the coverage area and the coverage edge.
2. The method according to claim 1, wherein determining the coverage area of the virtual object based on the image to be processed comprises: Acquire a scene normal map based on the image to be processed, and acquire a motion direction vector of the virtual object; A coverage area of the virtual object is determined based on the scene normal map and the motion direction vector.
3. The method according to claim 2, wherein determining the coverage area of the virtual object based on the scene normal map and the motion direction vector comprises: Sampling the scene normal map based on the pixel coordinates of the image to be processed to obtain a pixel normal vector; Obtaining a coverage value based on the pixel normal vector and the motion direction vector of the virtual object; Based on the coverage value, a coverage area of the virtual object is determined.
4. The method according to claim 1, wherein the determining the coverage edge of the virtual object based on the coverage area and the time variable comprises: Acquire an edge texture vector based on the edge of the coverage area; Determine edge information based on the edge texture vector and the time variable; A coverage edge of the virtual object is determined based on the edge information.
5. The method according to claim 4, wherein the determining edge information based on the edge texture vector and the time variable comprises: Determine the virtual object based on the time variable and the movement speed of the virtual object The covering thickness; Edge information is determined based on the edge texture vector and the coverage thickness.
6. The method according to claim 1, wherein the obtaining the coverage effect of the virtual object based on the coverage area and the coverage edge comprises: Updating the coverage area based on the coverage edge to obtain an updated coverage area; The virtual object is rendered in the updated coverage area.
7. The method according to claim 1, wherein the method further comprises: Obtaining a scene depth map based on the image to be processed; The image to be processed is processed based on the scene depth map to obtain a superposition effect.
8. The method according to claim 7, wherein the processing of the image to be processed based on the scene depth map to obtain a superposition effect comprises: Acquire a first distance and a second distance based on the scene depth map; Correcting the depth value in the scene depth map by using the first distance and the second distance to obtain a corrected scene depth map; The image to be processed is processed using the corrected scene depth map to obtain a superposition effect.
9. The method according to claim 1, wherein the method further comprises: The pixel normal direction vector of the covered edge is offset by using the motion direction vector of the virtual object to increase the shadow effect of the covered edge.
10. An image processing device, comprising: A first acquisition unit, used for acquiring an image to be processed; A determination unit, configured to determine a coverage area of a virtual object based on the image to be processed; The determining unit is further configured to determine a coverage edge of the virtual object based on the coverage area and the time variable; The second acquisition unit is configured to obtain the coverage effect of the virtual object based on the coverage area and the coverage edge.
11. An electronic device, wherein the device comprises: Processor and memory; The memory is used to store instructions or computer programs; The processor is used to execute the instructions or computer programs in the memory so that the electronic device executes the method according to any one of claims 1 to 9.
12. A computer-readable storage medium, wherein the computer-readable storage medium stores instructions, and when the instructions are executed on a device, the device executes the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Augmented reality processing method and device, storage medium and electronic equipment
CN111243105A
Virtual object rendering method and device, computer equipment and storage medium
CN115588066A
Image processing method and device, equipment and medium
CN116342785A
System for acquiring a 3D digital representation of a physical object
US20200143554A1
