CN109559368B - Processing method and device of plane picture, medium and electronic equipment - Google Patents

Processing method and device of plane picture, medium and electronic equipment Download PDF

Info

Publication number
CN109559368B
CN109559368B CN201811393155.0A CN201811393155A CN109559368B CN 109559368 B CN109559368 B CN 109559368B CN 201811393155 A CN201811393155 A CN 201811393155A CN 109559368 B CN109559368 B CN 109559368B
Authority
CN
China
Prior art keywords
dimensional model
picture
dimensional
model
silhouette
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811393155.0A
Other languages
Chinese (zh)
Other versions
CN109559368A (en
Inventor
吴韬
陈明勇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN201811393155.0A priority Critical patent/CN109559368B/en
Publication of CN109559368A publication Critical patent/CN109559368A/en
Application granted granted Critical
Publication of CN109559368B publication Critical patent/CN109559368B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/005General purpose rendering architectures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/04Texture mapping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/10Geometric effects
    • G06T15/30Clipping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2200/00Indexing scheme for image data processing or generation, in general
    • G06T2200/08Indexing scheme for image data processing or generation, in general involving all processing steps from image acquisition to 3D model generation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2210/00Indexing scheme for image generation or computer graphics
    • G06T2210/22Cropping

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Graphics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Geometry (AREA)
  • Software Systems (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The embodiment of the invention provides a processing method of a plane picture, a processing device of the plane picture, a computer readable medium and electronic equipment, wherein the processing method of the plane picture comprises the following steps: shearing the two-dimensional model according to the outline of the two-dimensional model in the plane picture to obtain a silhouette picture; according to the line spacing of the two-dimensional model in the silhouette picture, obtaining parameters for carrying out three-dimensional treatment on the two-dimensional model so as to draw based on the parameters, and obtaining a three-dimensional model; and carrying out projection removing treatment on the three-dimensional model to obtain a picture to be displayed so as to finish the three-dimensional display of the plane picture. The plane picture processed by the technical scheme of the embodiment of the invention has the effect of three-dimensional display, thereby improving the fidelity of picture display.

Description

Processing method and device of plane picture, medium and electronic equipment
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to a method for processing a planar image, a device for processing a planar image, a computer readable medium, and an electronic device.
Background
With the continuous development and popularization of internet technology, users have an increasing demand for network entertainment. Taking games as an example, a technology for processing a plane picture to achieve a three-dimensional visual effect of the plane picture currently exists. Thus, how to process a planar picture to improve its stereoscopic display effect becomes a focus of attention of a user.
In the prior art, for processing the plane pictures in the game, the stereoscopic impression of the scene is generally realized by simply processing illumination, so that the effect of stereoscopic display of the plane pictures is achieved. However, by adopting the method, the display picture lacks the space sense of plane scattered perspective, the effect of truly restoring the picture cannot be achieved, and the plane picture cannot be effectively processed.
Therefore, the fidelity of the processing method of the plane picture in the prior art needs to be improved.
It should be noted that the information disclosed in the above background section is only for enhancing understanding of the background of the invention and thus may include information that does not form the prior art that is already known to those of ordinary skill in the art.
Disclosure of Invention
The embodiment of the invention aims to provide a processing method of a plane picture, a processing device of the plane picture, a computer readable medium and electronic equipment, so that the defect of lower fidelity of the processing method of the plane picture in the prior art is overcome at least to a certain extent.
Other features and advantages of the invention will be apparent from the following detailed description, or may be learned by the practice of the invention.
According to a first aspect of an embodiment of the present invention, there is provided a method for processing a plane picture, including: shearing the two-dimensional model according to the outline of the two-dimensional model in the plane picture to obtain a silhouette picture; according to the line spacing of the two-dimensional model in the silhouette picture, obtaining parameters for carrying out three-dimensional treatment on the two-dimensional model so as to draw based on the parameters, and obtaining a three-dimensional model; and carrying out projection removing treatment on the three-dimensional model to obtain a picture to be displayed so as to finish the three-dimensional display of the plane picture.
In some embodiments of the present invention, based on the foregoing solution, the obtaining parameters for stereoscopically performing the two-dimensional model according to the line spacing of the two-dimensional model in the silhouette image includes: acquiring N line pitches of a two-dimensional model in the silhouette picture; based on a first preset proportional relation, determining the model thickness at the N lines according to the N line pitches, and taking the model thickness as a parameter for carrying out three-dimensional modeling on the two-dimensional model, wherein N is a positive integer.
In some embodiments of the present invention, based on the foregoing solution, the drawing based on the parameters obtains a three-dimensional model, including: respectively stretching the corresponding positions of the two-dimensional model according to the thicknesses of the models at the N lines; drawing the stretched model to obtain a three-dimensional model corresponding to the two-dimensional model.
In some embodiments of the present invention, based on the foregoing solution, cutting the two-dimensional model according to the contour of the two-dimensional model in the planar picture to obtain the silhouette picture includes: shearing the M two-dimensional models according to the outlines of the M two-dimensional models in the plane pictures to obtain M silhouette pictures corresponding to the M two-dimensional models; according to the line spacing of the two-dimensional model in the silhouette picture, obtaining parameters for carrying out three-dimensional treatment on the two-dimensional model so as to draw based on the parameters, and obtaining a three-dimensional model comprises the following steps: and for each of the M silhouette pictures, obtaining parameters for carrying out three-dimensional treatment on the two-dimensional model according to line spacing of the two-dimensional model in the silhouette picture so as to draw based on the parameters, and obtaining M three-dimensional models, wherein M is a positive integer.
In some embodiments of the present invention, after obtaining the M three-dimensional models, based on the foregoing scheme, the method further includes: and splicing the M three-dimensional models to obtain the three-dimensional model corresponding to the plane picture.
In some embodiments of the present invention, based on the foregoing solution, after obtaining the three-dimensional model corresponding to the planar picture, the method further includes: taking the texture of the two-dimensional model in the plane picture as a reference, and carrying out texture drawing on the three-dimensional model; and/or coloring the three-dimensional model by taking the color of the two-dimensional model in the plane picture as a reference.
In some embodiments of the present invention, based on the foregoing solution, before the performing the de-projection processing on the three-dimensional model to obtain the picture to be displayed, the method further includes: and adjusting the display size of the three-dimensional model in an engine according to a second preset proportional relation based on the display size of the two-dimensional model in the plane picture.
According to a second aspect of an embodiment of the present invention, there is provided a processing apparatus for a planar picture, including: the shearing module is used for shearing the two-dimensional model according to the outline of the two-dimensional model in the plane picture to obtain a silhouette picture; the drawing module is used for obtaining parameters for carrying out three-dimensional treatment on the two-dimensional model according to the line spacing of the two-dimensional model in the silhouette picture so as to draw based on the parameters and obtain a three-dimensional model; and the processing module is used for carrying out projection removal processing on the three-dimensional model to obtain a picture to be displayed so as to finish the three-dimensional display of the plane picture.
According to a third aspect of embodiments of the present invention, there is provided a computer readable medium having stored thereon a computer program which, when executed by a processor, implements a method for processing a flat picture as described in the first aspect of the above embodiments.
According to a fourth aspect of an embodiment of the present invention, there is provided an electronic device including: one or more processors; and a storage device for storing one or more programs, which when executed by the one or more processors, cause the one or more processors to implement the method for processing a flat picture according to the first aspect of the embodiments.
The technical scheme provided by the embodiment of the invention can have the following beneficial effects:
in the technical schemes provided by some embodiments of the present invention, on one hand, a two-dimensional model is cut according to a contour of the two-dimensional model in a plane picture to obtain a silhouette picture, so that the silhouette picture is generated according to the two-dimensional model and is closer to the two-dimensional model, and a gap between the three-dimensional model and the two-dimensional model after three-dimensional is reduced; furthermore, according to the line spacing of the two-dimensional model in the silhouette picture, parameters for carrying out three-dimensional treatment on the two-dimensional model are obtained, and drawing is carried out based on the parameters to obtain a three-dimensional model, so that visual angle lasting possibly caused after three-dimensional treatment of the two-dimensional model can be avoided, and the drawing accuracy of the three-dimensional model can be improved; on the other hand, the picture to be displayed is obtained by carrying out projection removing processing on the three-dimensional model so as to finish the three-dimensional display of the plane picture, so that the two-dimensional model in the picture to be displayed has a three-dimensional effect, the picture to be displayed is also the plane picture, the plane attribute, the modeling sense and the picture mood of the plane picture are reserved, and the fidelity of the three-dimensional display of the plane picture is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention as claimed.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention. It is evident that the drawings in the following description are only some embodiments of the present invention and that other drawings may be obtained from these drawings without inventive effort for a person of ordinary skill in the art. In the drawings:
fig. 1 schematically shows a flow chart of a method of processing a planar picture according to an embodiment of the invention;
fig. 2 schematically shows a flow chart of a method of processing a flat picture according to another embodiment of the invention;
fig. 3 schematically shows a flow chart of a method of processing a flat picture according to a further embodiment of the invention;
fig. 4 schematically shows a block diagram of a processing apparatus for a planar picture according to an embodiment of the invention;
fig. 5 shows a schematic diagram of a computer system suitable for use in implementing an embodiment of the invention.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. However, the exemplary embodiments may be embodied in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the invention. One skilled in the relevant art will recognize, however, that the invention may be practiced without one or more of the specific details, or with other methods, components, devices, steps, etc. In other instances, well-known methods, devices, implementations, or operations are not shown or described in detail to avoid obscuring aspects of the invention.
The block diagrams depicted in the figures are merely functional entities and do not necessarily correspond to physically separate entities. That is, the functional entities may be implemented in software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
The flow diagrams depicted in the figures are exemplary only, and do not necessarily include all of the elements and operations/steps, nor must they be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the order of actual execution may be changed according to actual situations.
In the prior art, for processing a plane picture in a game, the stereoscopic impression of a scene is generally realized through illumination, however, the displayed picture lacks the spatial impression of plane scattered perspective, loses the original sense of mood and modeling, cannot play the effect of truly restoring the picture, and can possibly cause the lasting viewing angle after the three-dimension of the plane picture, so that the fidelity of picture display is lower. Therefore, the processing method of the plane picture in the prior art cannot effectively display the plane picture, and the fidelity of the three-dimensional display is to be improved.
In this embodiment, a method for processing a planar picture is provided first, which overcomes, at least to some extent, the defect that the fidelity of the planar picture processed by the prior art needs to be improved.
Fig. 1 schematically illustrates a flowchart of a method for processing a flat picture according to an embodiment of the present invention, and an execution subject of the method for processing a flat picture may be a server for processing a flat picture.
Referring to fig. 1, a method of processing a flat picture according to an embodiment of the present invention includes the steps of:
step S101, cutting a two-dimensional model according to the outline of the two-dimensional model in a plane picture to obtain a silhouette picture;
step S102, according to the line spacing of the two-dimensional model in the silhouette picture, obtaining parameters for carrying out three-dimensional treatment on the two-dimensional model so as to draw based on the parameters, and obtaining a three-dimensional model;
and step S103, carrying out projection removing processing on the three-dimensional model to obtain a picture to be displayed so as to finish the three-dimensional display of the plane picture.
In the technical scheme provided by the embodiment shown in fig. 1, on one hand, a two-dimensional model is sheared according to the outline of the two-dimensional model in a plane picture to obtain a silhouette picture, so that the silhouette picture is generated according to the two-dimensional model and is closer to the two-dimensional model, and the gap between the three-dimensional model and the two-dimensional model after three-dimensional treatment is reduced; furthermore, according to the line spacing of the two-dimensional model in the silhouette picture, parameters for carrying out three-dimensional treatment on the two-dimensional model are obtained, and drawing is carried out based on the parameters to obtain a three-dimensional model, so that visual angle lasting possibly caused after three-dimensional treatment of the two-dimensional model can be avoided, and the drawing accuracy of the three-dimensional model can be improved; on the other hand, the picture to be displayed is obtained by carrying out projection removing processing on the three-dimensional model so as to finish the three-dimensional display of the plane picture, so that the two-dimensional model in the picture to be displayed has a three-dimensional effect, the picture to be displayed is also the plane picture, the plane attribute, the modeling sense and the picture mood of the plane picture are reserved, and the fidelity of the three-dimensional display of the plane picture is improved.
The specific implementation of each step in fig. 1 is described in detail below:
in step S101, the two-dimensional model is cut according to the contour of the two-dimensional model in the planar picture, so as to obtain a silhouette picture.
In an exemplary embodiment, the planar picture may be a two-dimensional picture such as an ancient painting, a photograph, or the like; a two-dimensional model in a planar picture, i.e., a character in a picture (e.g., mountain, character, animal, etc.); the outline of the two-dimensional model in the plane picture is the composition line of the drawn character (such as the line of the mountain drawn in the ancient painting); the silhouette picture represents only the outline of a two-dimensional model, namely, only the outline shapes of people, buildings, mountains, trees and the like in the picture are represented, and the detailed schlieren level of the silhouette picture is not represented, which is similar to a character image cut by scissors.
In an exemplary embodiment, referring to the above example, in 3Ds MAX software, a two-dimensional model in an ancient painting or other painting may be selected to perform outline clipping to obtain a silhouette picture. Wherein, for the same plane picture, the shearing angle is fixed. By way of example, the shearing angle may be set to 30 degrees in top view. Of course, according to actual needs, other angles can be set as the shearing angles, which all belong to the protection scope of the invention.
In an exemplary embodiment, the planar image includes a plurality of two-dimensional models (for example, M are positive integers), so that the M two-dimensional models need to be cut according to line outlines of the M two-dimensional models in the planar image, so as to obtain corresponding M silhouette images. The outer contour shearing is carried out on the M two-dimensional models in the plane picture by adopting the same shearing angle, so that M sheared shadow pictures obtained after shearing are obtained under the same visual angle, and the method is beneficial to improving the fidelity of the picture display of the processed picture.
In step S102, according to the line spacing of the two-dimensional model in the silhouette image, parameters for stereoscopically implementing the two-dimensional model are obtained, so as to draw based on the parameters, and a three-dimensional model is obtained.
In an exemplary embodiment, fig. 2 schematically shows a flowchart of a method for processing a planar picture according to another embodiment of the present invention, and specifically shows a flowchart for obtaining a three-dimensional model from a silhouette picture.
Referring to fig. 2, the method provided by this embodiment includes step S201 to step S203, and step S102 is explained below in conjunction with fig. 2.
In step S201, N line pitches of the two-dimensional model in the silhouette image are acquired.
In an exemplary embodiment, after M silhouette pictures are obtained, N line pitches of the two-dimensional model in each silhouette picture need to be obtained, where N is a positive integer.
In step S202, for each of the M silhouette pictures, parameters for stereoscopically implementing the two-dimensional model are obtained according to N line pitches of the two-dimensional model in the silhouette picture, so as to draw based on the parameters, and M three-dimensional models are obtained.
In an exemplary embodiment, for each silhouette image, the model thickness at the N lines is determined according to the pitch of the N lines in a preset proportional relationship, and the model thickness is used as a parameter for stereoscopically transforming the two-dimensional model. For example: the line-to-line spacing is 1 cm, then one can rely on 1:1, setting the thickness of the model at the two lines to be 1 cm, and correspondingly setting the three-dimensional parameters of the two-dimensional model at the two lines to be 2 cm; similarly, if the distance between the other two lines is 2 cm, the thickness of the model at this point can be set to 2 cm, that is, the three-dimensional model at this point has a three-dimensional parameter of 2 cm.
In an exemplary embodiment, after obtaining the two-dimensional model stereographic parameters (i.e., model thickness), the corresponding locations of the two-dimensional model need to be stretched according to the parameters, such as: the thickness of the former was 1 cm, and then the former was raised forward by 1 cm during stretching, and the stretched former was drawn in 3Ds MAX. And respectively carrying out the same processing procedure on the M silhouette pictures, and drawing to obtain corresponding M three-dimensional models.
In step S203, the M three-dimensional models are spliced to obtain a three-dimensional model corresponding to the planar picture.
In an exemplary embodiment, after obtaining M three-dimensional models corresponding to the two-dimensional models, the M three-dimensional models obtained by stitching the planar pictures need to be compared to obtain the three-dimensional models corresponding to the planar pictures.
In an exemplary embodiment, after the three-dimensional model corresponding to the planar picture is obtained, rendering processing is further required to be performed on the three-dimensional model by comparing the planar picture, so as to achieve the effect of restoring the picture and improving the fidelity of the picture. Fig. 3 schematically shows a flowchart of a method for processing a planar picture according to still another embodiment of the present invention, and specifically shows a flowchart for rendering a resulting three-dimensional model.
Referring to fig. 3, the method provided by this embodiment includes step S301 and step S302, and step S203 is explained below in conjunction with fig. 3.
In step S301, texture drawing is performed on the three-dimensional model with the texture of the two-dimensional model in the planar picture as a reference; and/or coloring the three-dimensional model by taking the color of the two-dimensional model in the plane picture as a reference.
In an exemplary embodiment, after obtaining the three-dimensional model corresponding to the planar picture, if there are multiple three-dimensional models corresponding to the same planar picture, it is necessary to confirm the line position in the body paint 3D first, and after confirming the line position, the three-dimensional model is only a basic model with three-dimensional sense, and lacks color and texture. Therefore, it is necessary to perform texture drawing and coloring processing on the three-dimensional model, so that the model achieves the display effect identical to that of the original plane picture.
In an exemplary embodiment, the three-dimensional model corresponding to the plane picture needs to be put into Adobe Photoshop software, and then texture drawing is required to be performed on the three-dimensional model corresponding to the plane picture according to textures of the two-dimensional model in the original picture; if the plane picture is a gray picture, no coloring treatment is needed; and if the plane picture is a color picture, coloring the three-dimensional model corresponding to the plane picture according to the color of the two-dimensional model in the plane picture.
In step S302, based on the display size of the two-dimensional model in the planar picture, the display size of the three-dimensional model in the engine is adjusted according to a second preset proportional relationship.
In an exemplary embodiment, after texture drawing and coloring processing are performed on the three-dimensional model corresponding to the planar picture, a complete three-dimensional model can be obtained. Furthermore, the complete three-dimensional model is put into a NeoX game engine according to the display size of the two-dimensional model in the plane picture, and the display size is 1:1 to adjust the display size of the three-dimensional model to achieve the display effect of the highest reduction degree of the two-dimensional model in the complete model and the plane picture. The display proportion can be set according to the actual situation, and belongs to the protection scope of the invention.
After the three-dimensional model in step S102 is determined through the embodiments shown in fig. 2 and fig. 3, with continued reference to fig. 1, in step S103, a projection removing process is performed on the three-dimensional model to obtain a picture to be displayed, so as to complete the three-dimensional display of the plane picture.
In the exemplary embodiment, after the display size is adjusted, in the NeoX game engine, the three-dimensional model needs to be subjected to a projection removing process, and the projection removing process is performed to better restore the planar effect of the planar picture (ancient picture), so that the planar effect of the planar picture is achieved, the model is planar, the character is stereoscopic, that is, the display effect of 'the character walks in the picture', the modeling sense of the ancient picture is ensured, and the realistic effect of stereoscopic display of the planar picture is achieved.
The following describes an embodiment of the apparatus of the present invention, which may be used to execute the above-mentioned processing method of a planar picture of the present invention.
Fig. 4 schematically shows a block diagram of a processing device for a flat picture according to an embodiment of the invention, which may be provided in a server for processing flat pictures.
Referring to fig. 4, a block diagram 400 of a processing apparatus for plane pictures according to an embodiment of the present invention includes the following modules: a clipping module 401, a rendering module 402 and a processing module 403. The details are set forth below:
and the shearing module 401 is configured to shear the two-dimensional model according to the contour of the two-dimensional model in the plane picture, so as to obtain a silhouette picture.
In an exemplary embodiment, in 3Ds MAX software, a two-dimensional model in an ancient painting or other painting photograph may be selected for outer contour clipping to obtain a silhouette picture. The shearing angle can be set to be a uniform 30-degree fixed viewing angle in a top view, because the 30-degree angle in a top view is the most perfect shearing angle obtained by testing a large number of viewing angles. Of course, according to actual needs, other shearing angles can be set, which all belong to the protection scope of the invention.
In an exemplary embodiment, the planar image may include a plurality of two-dimensional models (for example, M are positive integers), so that the clipping module is configured to clip the M two-dimensional models according to line outlines of the M two-dimensional models in the planar image, to obtain corresponding M silhouette images.
And the drawing module 402 is configured to obtain parameters for stereoscopically drawing the two-dimensional model according to the line spacing of the two-dimensional model in the silhouette image, so as to obtain a three-dimensional model based on the parameters.
In an exemplary embodiment, for each silhouette image, the model thickness at the N lines is determined according to the pitch of the N lines in a preset proportional relationship, and the model thickness is used as a parameter for stereoscopically transforming the two-dimensional model. For example: the line-to-line spacing is 1 cm, then one can rely on 1:1, setting the thickness of the model at the two lines to be 1 cm, and correspondingly setting the three-dimensional parameters of the two-dimensional model at the two lines to be 2 cm; similarly, if the distance between the other two lines is 2 cm, the thickness of the model at this point can be set to 2 cm, that is, the three-dimensional model at this point has a three-dimensional parameter of 2 cm.
In an exemplary embodiment, after obtaining the two-dimensional model stereographic parameters (i.e., model thickness), the corresponding locations of the two-dimensional model need to be stretched according to the parameters, such as: the thickness of the former was 1 cm, and then the former was raised forward by 1 cm during stretching, and the stretched former was drawn in 3Ds MAX. And respectively carrying out the same processing procedure on the M silhouette pictures, and drawing to obtain corresponding M three-dimensional models.
And the processing module 403 is configured to perform a projection removing process on the three-dimensional model to obtain a picture to be displayed, so as to complete the stereoscopic display of the planar picture.
In an exemplary embodiment, the processing module is configured to draw a texture of the three-dimensional model with reference to a texture of the two-dimensional model in the planar picture; and/or coloring the three-dimensional model by taking the color of the two-dimensional model in the plane picture as a reference.
In an exemplary embodiment, after obtaining the three-dimensional model corresponding to the planar picture, if there are multiple three-dimensional models corresponding to the same planar picture, it is necessary to confirm the line position in the body paint 3D first, and after confirming the line position, the three-dimensional model is only a basic model with three-dimensional sense, and lacks color and texture. Therefore, the processing module needs to perform texture drawing and coloring processing on the three-dimensional model, so that the model achieves the display effect identical to that of the original plane picture.
In an exemplary embodiment, the three-dimensional model corresponding to the plane picture needs to be put into Adobe Photoshop software, and then the processing module needs to draw the texture of the three-dimensional model corresponding to the plane picture according to the texture of the two-dimensional model in the original picture; if the plane picture is a gray picture, no coloring treatment is needed; if the plane picture is a color picture, the processing module needs to perform coloring processing on the three-dimensional model corresponding to the plane picture according to the color of the two-dimensional model in the plane picture.
In an exemplary embodiment, the processing module is further configured to adjust a display size of the three-dimensional model in the engine according to a second preset scaling relationship based on a display size of the two-dimensional model in the planar picture; and carrying out projection removing treatment on the three-dimensional model to obtain a picture to be displayed so as to finish the three-dimensional display of the plane picture.
Since each functional module of the processing apparatus for a flat picture according to the exemplary embodiment of the present invention corresponds to a step of the exemplary embodiment of the processing method for a flat picture, for details not disclosed in the embodiment of the apparatus of the present invention, please refer to the embodiment of the processing method for a flat picture according to the present invention.
Referring now to FIG. 5, there is illustrated a schematic diagram of a computer system 500 suitable for use in implementing an electronic device of an embodiment of the present invention. The computer system 500 of the electronic device shown in fig. 5 is only an example and should not be construed as limiting the functionality and scope of use of embodiments of the invention.
As shown in fig. 5, the computer system 500 includes a Central Processing Unit (CPU) 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 section 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data required for the system operation are also stored. The CPU 501, ROM 502, and RAM 503 are connected to each other through a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
The following components are connected to the I/O interface 505: an input section 506 including a keyboard, a mouse, and the like; an output portion 507 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker, and the like; a storage portion 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a LAN card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. The drive 510 is also connected to the I/O interface 505 as needed. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as needed so that a computer program read therefrom is mounted into the storage section 508 as needed.
In particular, according to embodiments of the present invention, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 509, and/or installed from the removable media 511. The above-described functions defined in the system of the present application are performed when the computer program is executed by a Central Processing Unit (CPU) 501.
The computer readable medium shown in the present invention may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present invention may be implemented by software, or may be implemented by hardware, and the described units may also be provided in a processor. Wherein the names of the units do not constitute a limitation of the units themselves in some cases.
As another aspect, the present application also provides a computer-readable medium that may be contained in the electronic device described in the above embodiment; or may exist alone without being incorporated into the electronic device. The computer-readable medium carries one or more programs that, when executed by one of the electronic devices, cause the electronic device to implement the processing method of a flat picture as described in the above embodiments.
For example, the electronic device may implement the method as shown in fig. 1: step S101, cutting a two-dimensional model according to the outline of the two-dimensional model in a plane picture to obtain a silhouette picture; step S102, according to the line spacing of the two-dimensional model in the silhouette picture, obtaining parameters for carrying out three-dimensional treatment on the two-dimensional model so as to draw based on the parameters, and obtaining a three-dimensional model; and step S103, carrying out projection removing processing on the three-dimensional model to obtain a picture to be displayed so as to finish the three-dimensional display of the plane picture.
As another example, the electronic device may implement the various steps shown in fig. 2 or 3.
It should be noted that although in the above detailed description several modules or units of a device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functions of two or more modules or units described above may be embodied in one module or unit in accordance with embodiments of the invention. Conversely, the features and functions of one module or unit described above may be further divided into a plurality of modules or units to be embodied.
From the above description of embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or may be implemented in software in combination with the necessary hardware. Thus, the technical solution according to the embodiments of the present invention may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.) or on a network, and includes several instructions to cause a computing device (may be a personal computer, a server, a touch terminal, or a network device, etc.) to perform the method according to the embodiments of the present invention.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It is to be understood that the invention is not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

Claims (8)

1. A method for processing a planar picture, comprising:
shearing the two-dimensional model according to the outline of the two-dimensional model in the plane picture to obtain a silhouette picture;
acquiring N line pitches of a two-dimensional model in the silhouette picture; determining the model thickness at the N lines according to the N line pitches based on a first preset proportional relation, and taking the model thickness as a parameter for carrying out three-dimensional modeling on the two-dimensional model, wherein N is a positive integer;
respectively stretching the corresponding positions of the two-dimensional model according to the thicknesses of the models at the N lines; drawing a stretched model to obtain a three-dimensional model corresponding to the two-dimensional model; and carrying out projection removing treatment on the three-dimensional model to obtain a picture to be displayed so as to finish the three-dimensional display of the plane picture.
2. The method of claim 1, wherein cropping the two-dimensional model from the contour of the two-dimensional model in the planar picture to obtain the silhouette picture comprises:
shearing the M two-dimensional models according to the outlines of the M two-dimensional models in the plane pictures to obtain M silhouette pictures corresponding to the M two-dimensional models;
according to the line spacing of the two-dimensional model in the silhouette picture, obtaining parameters for carrying out three-dimensional treatment on the two-dimensional model so as to draw based on the parameters, and obtaining a three-dimensional model comprises the following steps:
and for each of the M silhouette pictures, obtaining parameters for carrying out three-dimensional treatment on the two-dimensional model according to line spacing of the two-dimensional model in the silhouette picture so as to draw based on the parameters, and obtaining M three-dimensional models, wherein M is a positive integer.
3. The method of claim 2, further comprising, after obtaining the M three-dimensional models:
and splicing the M three-dimensional models to obtain the three-dimensional model corresponding to the plane picture.
4. A method according to claim 3, further comprising, after obtaining the three-dimensional model corresponding to the planar picture:
taking the texture of the two-dimensional model in the plane picture as a reference, and carrying out texture drawing on the three-dimensional model; and/or
And coloring the three-dimensional model by taking the color of the two-dimensional model in the plane picture as a reference.
5. The method according to claim 1, wherein before the performing the de-projection processing on the three-dimensional model to obtain the picture to be displayed, the method further comprises:
and adjusting the display size of the three-dimensional model in an engine according to a second preset proportional relation based on the display size of the two-dimensional model in the plane picture.
6. A processing apparatus for a planar picture, comprising:
the shearing module is used for shearing the two-dimensional model according to the outline of the two-dimensional model in the plane picture to obtain a silhouette picture;
the drawing module is used for obtaining N line intervals of the two-dimensional model in the silhouette picture; determining the model thickness at the N lines according to the N line pitches based on a first preset proportional relation, and taking the model thickness as a parameter for carrying out three-dimensional modeling on the two-dimensional model, wherein N is a positive integer;
respectively stretching the corresponding positions of the two-dimensional model according to the thicknesses of the models at the N lines; drawing a stretched model to obtain a three-dimensional model corresponding to the two-dimensional model;
and the processing module is used for carrying out projection removal processing on the three-dimensional model to obtain a picture to be displayed so as to finish the three-dimensional display of the plane picture.
7. A computer-readable medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method of processing a flat picture according to any one of claims 1 to 5.
8. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs which when executed by the one or more processors cause the one or more processors to implement the method of processing a flat picture as claimed in any one of claims 1 to 5.
CN201811393155.0A 2018-11-21 2018-11-21 Processing method and device of plane picture, medium and electronic equipment Active CN109559368B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811393155.0A CN109559368B (en) 2018-11-21 2018-11-21 Processing method and device of plane picture, medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811393155.0A CN109559368B (en) 2018-11-21 2018-11-21 Processing method and device of plane picture, medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN109559368A CN109559368A (en) 2019-04-02
CN109559368B true CN109559368B (en) 2023-06-09

Family

ID=65866787

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811393155.0A Active CN109559368B (en) 2018-11-21 2018-11-21 Processing method and device of plane picture, medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN109559368B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101958007A (en) * 2010-09-20 2011-01-26 南京大学 Three-dimensional animation posture modeling method by adopting sketch
CN105719277A (en) * 2016-01-11 2016-06-29 国网新疆电力公司乌鲁木齐供电公司 Transformer station three-dimensional modeling method and system based on surveying and mapping and two-dimensional image
CN107622524A (en) * 2017-09-29 2018-01-23 百度在线网络技术(北京)有限公司 Display methods and display device for mobile terminal

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101958007A (en) * 2010-09-20 2011-01-26 南京大学 Three-dimensional animation posture modeling method by adopting sketch
CN105719277A (en) * 2016-01-11 2016-06-29 国网新疆电力公司乌鲁木齐供电公司 Transformer station three-dimensional modeling method and system based on surveying and mapping and two-dimensional image
CN107622524A (en) * 2017-09-29 2018-01-23 百度在线网络技术(北京)有限公司 Display methods and display device for mobile terminal

Also Published As

Publication number Publication date
CN109559368A (en) 2019-04-02

Similar Documents

Publication Publication Date Title
CN109427088B (en) Rendering method for simulating illumination and terminal
US11961325B2 (en) Image processing method and apparatus, computer-readable medium, and electronic device
CN107358643B (en) Image processing method, image processing device, electronic equipment and storage medium
CN108682030B (en) Face replacement method and device and computer equipment
CN110378947B (en) 3D model reconstruction method and device and electronic equipment
CN108833877B (en) Image processing method and device, computer device and readable storage medium
CN113240783B (en) Stylized rendering method and device, readable storage medium and electronic equipment
CN112581632B (en) House source data processing method and device
TW200907854A (en) Universal rasterization of graphic primitives
CN112734896A (en) Environment shielding rendering method and device, storage medium and electronic equipment
CN114782613A (en) Image rendering method, device and equipment and storage medium
CN112258619A (en) Image processing method and device
CN110363837B (en) Method and device for processing texture image in game, electronic equipment and storage medium
CN110838167B (en) Model rendering method, device and storage medium
CN110930492B (en) Model rendering method, device, computer readable medium and electronic equipment
CN109559368B (en) Processing method and device of plane picture, medium and electronic equipment
CN110378948B (en) 3D model reconstruction method and device and electronic equipment
CN110751026B (en) Video processing method and related device
CN116778015A (en) Model edge tracing method and device, electronic equipment and storage medium
CN113808246B (en) Method and device for generating map, computer equipment and computer readable storage medium
CN113223137B (en) Generation method and device of perspective projection human face point cloud image and electronic equipment
CN113034350B (en) Vegetation model processing method and device
CN110363860B (en) 3D model reconstruction method and device and electronic equipment
CN110390717B (en) 3D model reconstruction method and device and electronic equipment
WO2016058288A1 (en) Depth-of-field rendering method and apparatus

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant