Image Processing Method, Apparatus, Electronic Device, and Readable Storage Medium
By using candidate three-dimensional object models to match and adjust in image processing, the problem of lack of personalization of image processing is solved, and the adjustment efficiency and effect are improved.
Patent Information
- Application Number
- CN202110567288.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-24
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2041-05-24
AI Technical Summary
The lack of personalization of image processing in the prior art, which results in a long time for users to adjust objects in images and inconsistent effects, making it difficult to meet actual needs.
By acquiring the target objects in the initial image, using the candidate three-dimensional object model for matching, the target objects are automatically adjusted to generate a personalized target image.
It realizes personalized adjustment of image processing, improves adjustment efficiency, and meets the actual needs of users.
Smart Images

Figure CN113762059B_ABST
Abstract
Description
Technical Field
[0001] This application relates to computer vision technology and image processing in the field of artificial intelligence technology. Specifically, this application relates to an image processing method, apparatus, electronic device, and readable storage medium. Background Art
[0002] With the rapid development of computer technology, terminal applications for processing images can be installed in terminal devices such as smart phones, personal digital assistants, in-vehicle devices, and tablet computers. For example, cameras, photo editing software, etc. At this time, users can adjust the objects in the original image and perform subsequent processing based on the adjusted image. For example, people can appropriately adjust their own face photos and then make the adjusted face photos public for others to view.
[0003] When adjusting the original image, processing is performed according to a unified adjustment algorithm, lacking personalization and being difficult to meet the actual application requirements. Summary of the Invention
[0004] This application provides an image processing method, apparatus, electronic device, and readable storage medium, which can improve the image processing effect and meet the actual needs of users.
[0005] On the one hand, an embodiment of this application provides an image processing method, which includes:
[0006] Obtain an initial image and identify the target object included in the initial image;
[0007] Determine a target three-dimensional object model from at least one candidate three-dimensional object model according to the target object, where each candidate three-dimensional object model corresponds to a candidate object;
[0008] Adjust the target object in the initial image according to the target three-dimensional object model to obtain a target image.
[0009] On the other hand, an embodiment of this application provides an image processing apparatus, which includes:
[0010] An image acquisition module, configured to obtain an initial image and identify the target object included in the initial image;
[0011] A target three-dimensional object model determination module, configured to determine a target three-dimensional object model from at least one candidate three-dimensional object model according to the target object, where each candidate three-dimensional object model corresponds to a candidate object;
[0012] An adjustment module, configured to adjust the target object in the initial image according to the target three-dimensional object model to obtain a target image.
[0013] In another aspect, an embodiment of the present application provides an electronic device, including a processor and a memory: The memory is configured to store a computer program, and when the computer program is executed by the processor, the processor is caused to execute an image adjustment method.
[0014] In yet another aspect, an embodiment of the present application provides a computer-readable storage medium for storing a computer program, which when run on a computer, enables the computer to execute an image adjustment method.
[0015] The beneficial effects brought by the technical solutions provided in the embodiments of the present application are as follows:
[0016] In the embodiments of the present application, when it is necessary to adjust a target object in an initial image, a target three-dimensional object model matching the target object in the initial image can be obtained, and then the target object in the initial image can be automatically adjusted according to the target three-dimensional object model, realizing personalized adjustment and improving the adjustment efficiency, so as to better meet the actual needs of users. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for description in the embodiments of the present application.
[0018] Figure 1a Schematic diagram of an image processing system architecture provided in an embodiment of the present application;
[0019] Figure 1b Schematic diagram of a process of an image processing method provided in an embodiment of the present application;
[0020] Figure 2a Schematic diagram of adjusting the position of key feature points provided in an embodiment of the present application;
[0021] Figure 2b Schematic diagram of a process of generating a three-dimensional face model provided in an embodiment of the present application;
[0022] Figure 3 Schematic diagram of a sample face image provided in an embodiment of the present application;
[0023] Figure 4 Schematic diagram of a sample face image including key feature points provided in an embodiment of the present application;
[0024] Figure 5 Schematic diagram of an initial three-dimensional face model provided in an embodiment of the present application;
[0025] Figure 6 Schematic diagram of a process of adjusting a face image provided in an embodiment of the present application;
[0026] Figure 7 Schematic diagram of an unadjusted face image provided by an embodiment of the present application;
[0027] Figure 8 Schematic diagram of a target 3D face model provided by an embodiment of the present application;
[0028] Figure 9 Schematic diagram of key point features in an unadjusted face image provided by an embodiment of the present application;
[0029] Figure 10 Schematic diagram of the relationship between key point features in a target 3D face model and key point features in an unadjusted face image provided by an embodiment of the present application;
[0030] Figure 11 Schematic diagram of key point features to be adjusted in an unadjusted face image provided by an embodiment of the present application;
[0031] Figure 12 Schematic diagram of the effect of an adjusted face image provided by an embodiment of the present application;
[0032] Figure 13 Schematic diagram of the structure of an image processing device provided by an embodiment of the present application;
[0033] Figure 14 Schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[0034] The embodiments of the present application will be described in detail below. Examples of the embodiments are shown in the accompanying drawings, where the same or similar reference numerals denote the same or similar elements or elements with the same or similar functions from beginning to end. The embodiments described below by referring to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be construed as a limitation to the present application.
[0035] Those skilled in the art can understand that, unless specifically stated otherwise, the singular forms "a", "an", "the", and "said" used herein may also include the plural forms. It should be further understood that the term "comprising" used in the specification of this application means the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or their groups. It should be understood that when we say an element is "connected" or "coupled" to another element, it can be directly connected or coupled to other elements, or there may also be intermediate elements. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The phrase "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.
[0036] With the rapid development of computer technology, users usually adjust the objects in the image (such as human faces, animals, plants, etc.) to achieve better effects. For example, when a user adjusts the human face in an image, currently there are two methods: manual shaping and automatic shaping. Among them, manual shaping means that for an image containing a human face, the user uses specific software to shape it according to their own preferences, while automatic shaping means using a unified adjustment algorithm to automatically modify the human face in the human face image. However, when using the manual shaping method, the technical requirements for the user's adjustment are relatively high, and it takes a long time to complete, resulting in the problem of time-consuming. Moreover, due to the lack of a unified specification and a fixed adjustment range, the human faces of the same person in different images will be different, which is likely to cause inconsistent external senses. When using the automatic shaping method, since the same algorithm is used for different users, the shaping effects of different users will be similar, resulting in the problem of lack of personalization.
[0037] Based on this, the embodiments of this application provide an image adjustment method, device, electronic device, and readable storage medium, aiming to solve some or all of the problems existing in the prior art.
[0038] Optionally, when adjusting an image based on the image adjustment method provided in the embodiments of the present application, technologies such as computer vision technology related to artificial intelligence are involved. For example, the features of an object in an image can be extracted through a neural network model (the features of a face in a face image are extracted through a neural network model). Among them, Artificial Intelligence (AI) is a theory, method, technology, and application system that uses a digital computer or a machine controlled by a digital computer to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can react in a way similar to human intelligence. Artificial intelligence also studies the design principles and implementation methods of various intelligent machines to enable the machines to have the functions of perception, reasoning, and decision-making.
[0039] Artificial intelligence technology is an interdisciplinary subject that involves a wide range of fields, including both hardware-level technologies and software-level technologies. The basic technologies of artificial intelligence generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, and mechatronics. The software technologies of artificial intelligence mainly include several major directions such as computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0040] And computer vision technology (Computer Vision, CV) refers to a science that studies how to enable machines to "see". Further, it refers to using cameras and computers to replace human eyes to perform machine vision such as object recognition, tracking, and measurement on targets, and further performing graphic processing to make the computer-processed images more suitable for human eyes to observe or be transmitted to instruments for detection. As a scientific discipline, computer vision studies related theories and technologies and attempts to establish an artificial intelligence system that can obtain information from images or multi-dimensional data. Computer vision technology usually includes technologies such as image processing, image recognition, image semantic understanding, image retrieval, OCR, video processing, video semantic understanding, video content / behavior recognition, three-dimensional object reconstruction, 3D technology, virtual reality, augmented reality, simultaneous localization and mapping, and also includes common biometric recognition technologies such as face recognition and fingerprint recognition.
[0041] Optionally, in the embodiments of the present application, each candidate three-dimensional object model can be stored in the form of a database (Database). Among them, the database can be simply regarded as an electronic filing cabinet - a place for storing electronic files, and users can perform operations such as adding, querying, updating, and deleting data in the files. The so-called "database" is a data set that is stored together in a certain way, can be shared by multiple users, has the smallest possible redundancy, and is independent of application programs.
[0042] A database management system (DBMS for short) is a computer software system designed for managing databases. Generally, it has basic functions such as storage, retrieval, security guarantee, backup, etc. Database management systems can be classified according to the database models they support, such as relational, XML (Extensible Markup Language); or according to the types of computers they support, such as server clusters, mobile phones; or according to the query languages used, such as SQL (Structured Query Language), XQuery; or according to performance impulse weight
[0043] The following uses specific embodiments to elaborate in detail on the technical solutions of this application and how the technical solutions of this application solve the above technical problems. These several specific embodiments below can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The following will describe the embodiments of this application in conjunction with the accompanying drawings.
[0044] Optionally, the method provided in the embodiments of this application can be executed by any electronic device. For example, it can be executed independently by a server, independently by a terminal device, or jointly executed through data communication between a server and a terminal device. Among them, the server can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The terminal can be a smart phone, a tablet computer, a notebook computer, a desktop computer, a vehicle-mounted device, etc., but is not limited thereto. The terminal device and the server can be directly or indirectly connected through wired or wireless communication methods, and this application does not make any restrictions here.
[0045] Optionally, the category of the target object included in the image to be adjusted in the embodiments of this application is not limited. For example, it can be a human face, etc. For the sake of convenient description, in the embodiments of this application, the human face will be used as the target object for description.
[0046] Optionally, Figure 1a Shows an architecture diagram of an image processing system applicable to the image processing method provided in the embodiments of this application, such as Figure 1aAs shown in the figure, the image processing system may specifically include a terminal device 10 with an image acquisition function and a server 12. When a user needs to adjust a captured face image, the user can use the terminal device 10 to acquire the face image, and then send the face image to the server 12 through the network 20. The server 12 adjusts the face in the received face image based on the method provided in the embodiments of the present application, obtains the adjusted face image, and sends it to the terminal device 10 through the network 20. The terminal device 10 provides the received adjusted face image to the user.
[0047] Figure 1b FIG. shows a schematic flowchart of an image processing method provided in an embodiment of the present application. As Figure 1b shown, the method includes:
[0048] Step S101: Obtain an initial image and identify a target object included in the initial image.
[0049] It can be understood that the initial image is an image selected by the user that needs to be adjusted for the target object it contains. The initial image can be an image selected by the user from a picture library or an image currently captured by an image acquisition device. The initial image includes a target object, and the target object includes, but is not limited to, a face, an animal, or a plant, etc. Moreover, the initial image can be an image in the form of a sketch, a Chinese ink painting, a sculpture, a handicraft, etc.
[0050] Step S102: Determine a target three-dimensional object model from at least one candidate three-dimensional object model according to the target object, where each candidate three-dimensional object model corresponds to a candidate object.
[0051] Step S103: Adjust the target object in the initial image according to the target three-dimensional object model to obtain a target image.
[0052] Specifically, each candidate three-dimensional object model can be pre-stored, and each candidate three-dimensional object model corresponds to a candidate object. The candidate three-dimensional object models corresponding to the same object can be obtained through sample images containing the object. Correspondingly, after identifying the target object included in the initial image, the target three-dimensional object model can be determined from at least one candidate three-dimensional object model based on the identified target object, and then the target object included in the initial image can be adjusted according to the target three-dimensional object model to obtain a target image.
[0053] In the embodiments of the present application, when it is necessary to adjust the target object in the initial image, a target three-dimensional object model matching the target object in the initial image can be obtained, and then the target object in the initial image can be automatically adjusted according to the target three-dimensional object model, realizing personalized adjustment and improving the adjustment efficiency, so as to better meet the actual needs of users.
[0054] In an alternative embodiment of the present application, determining a target three-dimensional object model from at least one candidate three-dimensional object model according to the target object includes:
[0055] Calculating the matching degree between each candidate object and the target object respectively;
[0056] Based on the matching degrees corresponding to each candidate object, determining a target object model from at least one candidate three-dimensional object model.
[0057] Optionally, when determining a target three-dimensional object model from at least one candidate three-dimensional object model, the matching degree between the candidate object of each candidate three-dimensional object model and the target object in the initial image can be calculated respectively, and then the target three-dimensional object model can be determined from at least one candidate three-dimensional object model according to the matching degrees corresponding to each candidate object. For example, the candidate three-dimensional object model corresponding to the candidate object with the highest matching degree with the target object can be determined as the target three-dimensional object model.
[0058] In an alternative embodiment of the present application, determining a target three-dimensional object model from at least one candidate three-dimensional object model according to the target object includes:
[0059] Determining at least one recommended object model from at least one candidate three-dimensional object model according to the target object, and presenting the at least one recommended object model to the user;
[0060] Responding to the user's selection operation, determining a target three-dimensional object model from at least one recommended object model.
[0061] Optionally, after obtaining the initial image (for example, after the user captures a face image using an image acquisition device), at least one recommended object model can be determined from at least one candidate 3D object model based on the target object in the initial image and presented to the user. The user can select the model of their interest from the presented recommended object models and trigger a selection operation. At this time, the recommended object model included in the selection operation can be determined as the target 3D object model. Among them, when determining at least one recommended object model from at least one candidate 3D object model, the matching degree between the candidate object in each candidate 3D object model and the target object can be calculated respectively, and at least one recommended object model can be determined from at least one candidate 3D object model based on the calculated matching degree. For example, the candidate 3D object model with a matching degree greater than a set value can be determined as the recommended object model.
[0062] Optionally, the embodiments of the present application do not limit the manner of presenting the recommended object model. For example, the thumbnail of the recommended object model and / or the identifier of the recommended object model, introduction information (such as the name of the object), or the at least one recommended object model can be displayed in sequence according to the calculated matching degree, etc.
[0063] In an alternative embodiment of the present application, adjusting the target object in the initial image according to the target 3D object model to obtain a target image includes:
[0064] Obtaining a target 2D image of the target 3D object model, where the target 2D image is a 2D image obtained after performing at least one projection transformation on the target 3D object model;
[0065] Adjusting the target object in the initial image according to the reference object in the target 2D image to obtain a target image.
[0066] Optionally, after determining the target 3D object model, at least one projection transformation can be performed on the target 3D object model to obtain at least one 2D image, and then the target 2D image corresponding to the target 3D object model can be determined from the obtained 2D images, and the target object in the initial image can be adjusted according to the reference object (i.e., the candidate object included in the target 2D image) in the target 2D image to obtain a target image.
[0067] In an alternative embodiment of the present application, the method further includes:
[0068] Performing at least one projection transformation on the target 3D object model to obtain at least one candidate 2D image corresponding to the target 3D object model;
[0069] Obtaining the target 2D image of the target 3D object model includes:
[0070] Determine the matching degree between the target object and the candidate objects in each candidate two-dimensional image;
[0071] Determine the target two-dimensional image from each candidate two-dimensional image according to the matching degree corresponding to each candidate two-dimensional image.
[0072] Optionally, when performing at least one projection transformation process on the target three-dimensional object model to obtain at least one candidate two-dimensional image corresponding to the target three-dimensional object model, the target three-dimensional object model can be rotated multiple times by a set angle based on a set direction, and then the front projection is performed on the target three-dimensional object model after each rotation. The two-dimensional image obtained by the projection is the candidate two-dimensional image corresponding to the target three-dimensional object model. For example, the target three-dimensional object model can be rotated 10 degrees based on the set direction, and then the front projection is performed on the target three-dimensional object model rotated 10 degrees to obtain a candidate two-dimensional image. Then, the target three-dimensional object model rotated 10 degrees is rotated 10 degrees again based on the set direction, and the front projection is performed on the rotated target three-dimensional object model to obtain another candidate two-dimensional image.
[0073] It can be understood that for a three-dimensional object model, after obtaining at least one candidate two-dimensional image corresponding to the three-dimensional object model, the obtained at least one candidate two-dimensional image can be stored in association with the three-dimensional object model. When the three-dimensional object model is used as the target three-dimensional object model to adjust the target object in the initial image, the stored at least one candidate two-dimensional image can be directly obtained, thereby reducing the amount of data processing and improving the data processing efficiency.
[0074] Furthermore, the matching degree between the candidate object in each candidate two-dimensional image and the target object in the initial image can be determined, and the candidate two-dimensional image with the highest matching degree can be determined as the target two-dimensional image. At this time, the candidate object in the target two-dimensional image is the reference object, and the angle of the reference object is the most similar to the angle of the target object in the initial image compared with the set direction. Then, the target object in the initial image is adjusted according to the reference object in the target two-dimensional image to obtain the target image.
[0075] In an alternative embodiment of the present application, determining the matching degree between the target object and the reference object in each candidate two-dimensional image includes at least one of the following:
[0076] For each candidate two-dimensional image, determine the matching degree between the candidate object and the target object according to the matching degree between at least one feature point of the candidate object in the candidate two-dimensional image and at least one corresponding feature point of the target object in the initial image;
[0077] For each candidate two-dimensional image, determine the matching degree between the candidate object and the target object according to the matching degree between the first object feature of the candidate object in the candidate two-dimensional image and the second object feature of the target object.
[0078] Among them, feature points refer to points where the image grayscale value changes drastically or points with a large curvature on the image edge (i.e., the intersection of two edges). Feature points can reflect the essential features of the image and can identify the objects in the image. For example, for the feature points in a face image, they can refer to the key pixel points used to identify each part of the face. For example, the key pixel points used to identify the eye part can be regarded as the eye feature points for identifying the eyes. At this time, based on this eye feature point, the specific position of the eye in the face can be known.
[0079] Optionally, when determining the matching degree between the candidate object in each candidate two-dimensional image and the target object, different methods can be adopted. One optional method is to determine the matching degree between the candidate object and the target object based on the matching degree of at least one feature point of the object in the candidate two-dimensional image and at least one corresponding feature point of the target object in the initial image. At this time, the higher the matching degree between the candidate object and the target object, the more similar the angle between the candidate object in the two-dimensional image and the target object in the initial image.
[0080] Among them, for a two-dimensional image, when determining the matching degree of at least one feature point of the candidate object in the candidate two-dimensional image and at least one corresponding feature point of the target object in the initial image, the position of at least one feature point of the candidate object in the two-dimensional image can be converted into a first feature matrix, and the position of at least one corresponding feature point of the target object can be converted into a second feature matrix. The matching degree between the candidate object in the candidate two-dimensional image and the target object is reflected by calculating the distance between the first feature matrix and the second feature matrix. When the distance is smaller, it indicates that the matching degree between the candidate object in the candidate two-dimensional image and the target object is higher. On the contrary, when the distance is larger, it indicates that the matching degree between the candidate object in the candidate two-dimensional image and the target object is lower.
[0081] Another optional implementation method is to extract the second object feature representing the target object in the initial image and the first object feature representing the candidate object in the candidate two-dimensional image, and then determine the matching degree between each candidate object and the target object according to the second object feature and the first object features of each candidate object. Correspondingly, the higher the matching degree between the two object features, the higher the matching degree between the candidate object and the target object. On the contrary, the lower the matching degree between the two object features, the lower the matching degree between the candidate object and the target object, and the less similar the angle between the candidate object and the target object.
[0082] It can be understood that after obtaining the feature points in a candidate two-dimensional image and the positions of the feature points in the candidate two-dimensional image, the feature points in the candidate two-dimensional image and the positions of the feature points in the candidate two-dimensional image can be associated and stored with the candidate two-dimensional image. When subsequent processing needs to be performed based on the feature points in the candidate two-dimensional image or the positions of the feature points in the candidate two-dimensional image, the stored feature points in the candidate two-dimensional image and the positions of the feature points in the candidate two-dimensional image can be directly obtained for subsequent processing, thereby reducing the amount of data processing and further improving the data processing efficiency.
[0083] In an alternative embodiment of the present application, adjusting the target object in the initial image according to the reference object in the target two-dimensional image to obtain an adjusted target image includes:
[0084] Adjusting at least one second feature point corresponding to the target object in the initial image according to at least one first feature point of the reference object in the target two-dimensional image to obtain the target image.
[0085] Specifically, at least one first feature point of the reference object in the target two-dimensional image can be identified to determine at least one first feature point of the reference object, and at least one second feature point corresponding to the target object in the initial image and the reference object can be identified. Then, taking at least one first feature point of the reference object as a reference, the corresponding at least one second feature point is adjusted to obtain the target image. For example, for any second feature point of the target object in a certain initial image, the position of the second feature point can be adjusted to the position of the first feature point corresponding to the second feature point in the target two-dimensional image. It can be understood that since the feature points represent key pixel points, that is, the feature points are composed of key pixel points, the essence of adjusting the feature points is to adjust the key pixel points represented by the feature points. At this time, the actual operation reflected in adjusting the position of the feature points is to adjust the position of the key pixel points represented.
[0086] In one example, such as Figure 2aAs shown, assuming that the target object is a human face, at this time, for the position of the feature point (such as point A) used to represent the eyes in the initial image, the position of point A in the image to be adjusted can be adjusted according to the position of the corresponding feature point (such as point A') in the target two-dimensional image, that is, the position of point A is adjusted to the position of point A'; similarly, when it is necessary to adjust the position of the feature point (such as point B) used to represent the nose in the initial image, the position of point B in the initial adjusted image can be adjusted to the position of point B' according to the position of the corresponding feature point (such as point B') in the target two-dimensional image, etc. Among them, when adjusting the positions of feature points A and B, it is to adjust the positions of the key pixel points that make up feature point A and the key pixel points that make up feature point B respectively according to the relationships of A->A' (that is, using feature point A' as the reference for adjusting the position of feature point A) and B->B' (that is, using feature point B' as the reference for adjusting the position of feature point B).
[0087] In an alternative embodiment of the present application, adjusting at least one second feature point corresponding to the target object in the initial image according to at least one first feature point of the reference object in the target two-dimensional image includes:
[0088] Adjusting the first region in the target two-dimensional image and the second region in the initial image to the same size, where the first region is the image region corresponding to at least one first feature point in the target two-dimensional image, and the second region is the image region corresponding to at least one second feature point in the initial image;
[0089] Adjusting the positions of at least one second feature point corresponding to the target object in the initial image according to the positions of at least one first feature point in the adjusted first region.
[0090] Optionally, in practical applications, the size of the reference object in the target two-dimensional image may be different from the size of the target object in the initial image. At this time, if the positions of the feature points of the target object are directly adjusted based on the feature points of the reference object in the target two-dimensional image, the target object in the obtained target image may be unnatural, resulting in a poor final processing effect. Based on this, in the embodiments of the present application, the size of the image region (i.e., the first region) corresponding to at least one first feature point in the target two-dimensional image can be adjusted to be the same as the size of the image region (i.e., the second region) corresponding to at least one second feature point in the initial image in the initial image, and then the positions of at least one second feature point of the target object corresponding to the second key point region are adjusted according to the positions of at least one first feature point in the adjusted first region.
[0091] In an alternative embodiment of the present application, for any candidate three-dimensional object model, the candidate three-dimensional object model is obtained by the following method:
[0092] Obtain at least two sample images corresponding to the same candidate object at different angles;
[0093] Identify at least one feature point of the candidate object in at least two sample images respectively;
[0094] Generate a candidate three-dimensional object model corresponding to the candidate object included in the sample image according to at least one feature point of the candidate object in at least two sample images.
[0095] Optionally, any candidate three-dimensional object model can be obtained by using at least two sample images including the candidate object corresponding to the candidate three-dimensional object model. Since the same candidate object may have different angles in actual applications, in order to ensure the accuracy of the finally generated candidate three-dimensional object model, multiple images corresponding to the same candidate object at different angles can be obtained. For example, assuming that a candidate three-dimensional object model corresponding to person A needs to be generated, at this time, at least two sample images including person A can be obtained, and the at least two sample images respectively correspond to different angles of person A, such as one sample image includes the front face of person A, and the other sample image includes the side face of person A, etc. Further, at least one feature point of the candidate object in each sample image can be identified, and then a candidate three-dimensional object model corresponding to the candidate object can be generated according to at least one feature point of the candidate object in at least two sample images.
[0096] In an alternative embodiment of the present application, when generating a candidate three-dimensional object model corresponding to the candidate object included in the sample image according to at least one feature point of the object in at least two sample images, at least one feature point of the object identified in the at least two sample images can be used as a reference feature point, and then the depth information of the feature point is extracted from the reference feature point to obtain the source feature point corresponding to the reference feature point, and a candidate three-dimensional object model corresponding to the candidate object is generated according to the obtained source feature point.
[0097] It can be understood that the three-dimensional depth information extraction can be a process based on reference feature points, and by matching the feature points of a standard three-dimensional object model, the feature points in the three-dimensional object model can be deduced. For example, when the candidate object is a certain person, each facial feature point of the person (such as points of the face contour, eye contour, nose, lips, etc.) in at least two sample images can be identified as reference feature points, and then on the basis of these reference feature points, the source feature points of the three-dimensional object model corresponding to the person can be further obtained. For example, by performing depth information extraction on the reference feature points such as the face contour, eye contour, nose, lips, etc., 1000 source feature points with depth information can be obtained. Further, a candidate three-dimensional object model corresponding to the person can be generated according to these 1000 deepened source feature points. At this time, these 1000 deepened source feature points are the vertices of each triangular patch in the candidate three-dimensional object model of the person.
[0098] It should be noted that for three-dimensional modeling based on two-dimensional key feature points to obtain the three-dimensional object model of an object, the specific manner of the embodiments of the present application is not limited, and any existing three-dimensional modeling method can be used. The above-described manner is only an optional manner.
[0099] In an optional embodiment of the present application, generating a candidate three-dimensional object model corresponding to a candidate object included in a sample image according to at least one feature point of the object in at least two sample images includes:
[0100] Generating a candidate initial three-dimensional object model corresponding to the object according to at least one feature point of the object in at least two sample images, where the initial three-dimensional object model includes at least one feature point of the candidate object in at least two sample images;
[0101] Obtaining an adjustment request for the candidate object in the initial candidate three-dimensional object model;
[0102] Adjusting the candidate object in the initial candidate three-dimensional object model according to the adjustment request to obtain a candidate three-dimensional object model.
[0103] Optionally, after identifying at least one feature point of an object in at least two sample images, an initial three-dimensional object model corresponding to the candidate object can be generated based on the identified at least one feature point. At this time, the user can trigger an adjustment request for the candidate object in the initial candidate three-dimensional object model according to their preferences, so as to adjust the initial candidate three-dimensional object model, and further ensure that the finally generated candidate three-dimensional object model better meets the requirements and satisfies their preferences. For example, the user can trigger an adjustment request by dragging the feature points of the candidate object in the initial candidate three-dimensional object model. When the adjustment request is obtained, the positions of the feature points of the candidate object in the initial candidate three-dimensional object model can be adjusted according to the adjustment request to obtain a candidate three-dimensional object model.
[0104] Among them, the adjustment request includes the identifier of the feature point to be adjusted in the initial candidate three-dimensional object model (that is, the feature point whose position the user selects to adjust), and the position of the feature point to be adjusted after adjustment. Correspondingly, when the adjustment request is obtained, the position of each feature point to be adjusted can be adjusted to obtain the adjusted feature point, and then based on the adjusted feature points and the unadjusted feature points in the initial candidate three-dimensional object model, the candidate three-dimensional object model can be obtained.
[0105] Of course, in practical applications, to ensure that the finally generated candidate three-dimensional object model is more natural, when adjusting the candidate object in the initial candidate three-dimensional object model according to the adjustment request, for each feature point to be adjusted, the position of the feature point can be adjusted first to obtain the adjusted feature point, then the associated feature points associated with the feature point (that is, the feature points that can affect each other) are determined, and the positions of its associated feature points are adaptively adjusted according to the adjusted feature point. Finally, based on the adjusted positions of the feature points of the candidate object in the initial candidate three-dimensional object model, the candidate three-dimensional object model can be obtained.
[0106] In an alternative embodiment of the present application, the method further includes:
[0107] Performing object feature extraction on at least one of the at least two sample images to obtain object features corresponding to at least one sample image;
[0108] Respectively taking the object features corresponding to the extracted sample images as the third object features corresponding to the candidate objects in the candidate three-dimensional object model, and associatively storing the third object features with the candidate three-dimensional object model.
[0109] Determining a target three-dimensional object model from at least one candidate three-dimensional object model according to the target object includes:
[0110] Extracting the second object feature of the target object included in the initial image;
[0111] For each candidate three-dimensional object model, determine the matching degree between the second object feature and each third object feature corresponding to the candidate object in the candidate three-dimensional object model, and obtain at least one matching degree corresponding to the candidate three-dimensional object model;
[0112] According to at least one matching degree corresponding to each candidate three-dimensional object model, determine the target three-dimensional object model from at least one candidate three-dimensional object model.
[0113] Optionally, for at least two acquired sample images, object features of at least one of the at least two sample images can be extracted to obtain object features corresponding to at least one sample image, and the object features corresponding to each extracted sample image are respectively used as the third object features corresponding to the candidate objects in the corresponding candidate three-dimensional object model, and are stored in association with the three-dimensional object model. Thus, when adjusting the initial image, the target three-dimensional object model can be determined according to the third object feature.
[0114] Optionally, after the initial image is acquired, feature extraction can be performed on the target object in the initial image to obtain the features of the target object (i.e., the second object feature). For example, the initial image can be input into a neural network model for feature extraction, and the second object feature of the target object included in the initial image can be obtained through the neural network model. For each candidate three-dimensional model, the second object feature corresponding to each candidate object can be pre-stored, and the second object feature is obtained by performing feature extraction on the object in the sample image that results in the candidate three-dimensional object model containing the candidate object.
[0115] Correspondingly, for each candidate three-dimensional object model, the matching degree between the first object feature and each third object feature corresponding to the candidate object pre-stored can be calculated respectively to obtain at least one matching degree corresponding to the candidate three-dimensional object model. Then, according to at least one matching degree corresponding to each candidate three-dimensional object model, a three-dimensional object model corresponding to the same object as the initial image is determined from each candidate three-dimensional object model. At this time, the object corresponding to the target three-dimensional object model is the target object in the initial image. Further, the target object in the initial image can be adjusted according to the target three-dimensional object model to obtain the target image.
[0116] In an alternative embodiment of the present application, determining the target three-dimensional object model from at least one candidate three-dimensional object model according to at least one matching degree corresponding to each candidate three-dimensional object model includes:
[0117] For each candidate three-dimensional object model, determine the matching degree between the candidate three-dimensional object model and the target object according to at least one matching degree corresponding to the candidate three-dimensional object model;
[0118] Determine a target 3D object model that matches the target object from at least one candidate 3D object model according to the matching degree between each candidate 3D object model and the target object.
[0119] Optionally, since a candidate 3D object model may be obtained from multiple sample images, the candidate object in this candidate 3D object model may correspond to multiple third object features. To ensure that the target 3D object model that best matches the target object is determined from each candidate 3D object model, the matching degree between the second object feature and each third object feature can be determined respectively according to the second object feature and the third object features corresponding to the candidate objects in each candidate 3D object model. At this time, each candidate 3D object model may correspond to at least one matching degree. Then, the matching degree between the candidate object in each candidate 3D object model and the target object can be determined according to the at least one matching degree corresponding to each candidate 3D object model. Further, according to the matching degree between the candidate object in each candidate 3D object model and the target object, a target 3D object model that matches the target object is determined from each candidate 3D object model. For example, the candidate 3D object model with the highest matching degree between the candidate object in the candidate 3D object model and the target object can be used as the target 3D object model, or the average value of at least one matching degree of the candidate 3D object model can be determined, and then the candidate 3D object model with the largest average value is used as the target 3D object model.
[0120] Optionally, to better understand the method provided in the embodiments of the present application, the method will be described in detail below in combination with a specific application scenario. In this example, the initial image is a face image. At this time, the target object is the face included in the face image, and the corresponding 3D object model is a 3D face model. In practical applications, an image adjustment software, i.e., a photo editing software, can be installed on the user terminal. When the user uses it for the first time, the user can be prompted to create a 3D face model database. The 3D object model database stores 3D face models corresponding to different people. The process of generating a 3D face model will be described in detail below by taking the determination of a 3D face model of a person as an example, specifically as Figure 2b shown.
[0121] Step S201, obtain multiple sample face images of the same person from different angles.
[0122] Specifically, when a 3D face model corresponding to a certain person needs to be generated, sample face images of this person from different angles can be obtained through an image acquisition device, so as to ensure that the finally generated 3D face model is more accurate. For example, as Figure 3 shown, 2 face images of the same person at different angles can be obtained as sample face images.
[0123] Step S202: Identify at least one feature point of the face in each sample face image, and generate an initial three-dimensional face model corresponding to the person based on the at least one feature point of the face in each sample face image.
[0124] Specifically, at least one feature point of the face in each sample face image can be identified, and then an initial three-dimensional face model can be generated based on the at least one feature point of the face in each sample face image. For example, as Figure 4 shown, feature points such as the facial contour, eye contour, nose, and lips in each sample face image can be obtained, and then an initial three-dimensional face model as shown in Figure 5 can be generated (for convenience of display, Figure 5 it is shown in the form of a two-dimensional image). The initial three-dimensional face model includes feature points in various regions such as the facial contour, eye contour, nose region, and lip region, that is, Figure 5 it shows a schematic diagram of the feature points of a face image, where the black dots shown are the feature points of the face in this schematic diagram, and Figure 5 the color of the initial three-dimensional face model shown has grayscale for the convenience of display. In actual applications, it can be white or other colors. Here, it is just a schematic illustration.
[0125] Step S203: Obtain an adjustment request for the face in the initial candidate three-dimensional face model, and adjust the feature points of the face in the initial candidate three-dimensional face model according to the adjustment request to obtain a candidate three-dimensional face model.
[0126] Optionally, after generating the initial three-dimensional face model of the person, the initial three-dimensional face model of the person and the feature points of the included face can be displayed to the user through a terminal device. At this time, the user can trigger an adjustment request for the feature points of the face in the initial candidate three-dimensional face model according to their own preferences, so as to realize the adjustment of the initial candidate three-dimensional face model, and further ensure that the finally generated candidate three-dimensional face model meets the requirements and satisfies their own preferences. For example, the user can trigger an adjustment request by dragging the feature points of the object in the initial candidate three-dimensional face model. After obtaining the adjustment request, the position of the feature points of the face in the initial candidate three-dimensional face model can be adjusted according to the adjustment request to obtain a candidate three-dimensional face model.
[0127] Step S204: Extract face features from at least one of each sample face image to obtain the object features corresponding to each sample face image.
[0128] Step S205: Respectively use the face features corresponding to each sample face image as the third object feature of the candidate object in the candidate 3D face model, and associate and store them with the 3D face model in the 3D face model database.
[0129] Optionally, for the obtained sample face images, at least one of the sample face images can also be subjected to face feature extraction to obtain the face features corresponding to each sample face image. Then, respectively use the face features corresponding to each sample face image as the third object feature of the candidate object in the corresponding candidate 3D face model, and associate and store them with the 3D face model in the 3D object model database. Thus, when adjusting the face image, the target 3D face model can be determined according to the third face feature.
[0130] Furthermore, when the user needs to adjust the face image, the 3D face model database can be called through the image adjustment software to adjust the face image to obtain the adjusted face image, specifically as Figure 6 shown.
[0131] Step S601: The user selects an initial face image as shown in Figure 7 from the image library.
[0132] Step S602: Determine the target 3D face model that matches the face from each candidate 3D face model included in the 3D face model database.
[0133] Specifically, the second object feature of the face included in the initial face image and the third object feature corresponding to the candidate object in each pre-stored candidate 3D face model can be obtained. Then, determine the matching degree between the second object feature and the third object feature corresponding to each pre-stored candidate object, and determine the target 3D face model that matches the initial face image from each candidate 3D face model according to the determined matching degree. The positions of the feature points included in the target 3D face model can be represented by 3D coordinates, specifically as Figure 8 shown (for the convenience of display, a 2D image is used in the figure to show the target 3D face model. The black dots shown in the figure are the feature points of the face, and two 3D coordinate axes corresponding to the feature points are shown as an example).
[0134] Step S603: Perform at least one projection transformation process on the target 3D face model to obtain at least one candidate 2D image corresponding to the target 3D face model, and determine the target 2D image from the at least one candidate 2D image.
[0135] Specifically, the target three-dimensional face model can be rotated multiple times at a set angle, and then a front projection is performed on the target three-dimensional face model after each rotation to obtain at least one candidate two-dimensional image corresponding to the target three-dimensional face model. For example, the target three-dimensional face model can be rotated 10 degrees to the right direction, and then a front projection is performed on the target three-dimensional face model rotated 10 degrees to obtain a candidate two-dimensional image. Then, based on a 10-degree rotation to the right direction, the target three-dimensional face model rotated 10 degrees is further rotated, and a front projection is performed on the rotated target three-dimensional face model to obtain another candidate two-dimensional image. Further, the matching degree between the face in each two-dimensional image and the face in the initial face image can be determined, and the two-dimensional image with the highest matching degree is determined as the target two-dimensional image.
[0136] Step S604: Adjust the face in the initial face image according to the face in the target two-dimensional image to obtain an adjusted face image.
[0137] Specifically, at least one first feature point of the face in the target two-dimensional image and at least one second feature of the face in the initial face image can be identified (specifically, as shown by the black dots within the rectangular frame in Figure 9 ), the size of the image region corresponding to at least one first feature point included in the target two-dimensional image (i.e., the first region) is adjusted to be the same as the size of the image region corresponding to at least one second feature point of the face in the initial face image (i.e., the second region). At this time, at least one first feature point included in the target two-dimensional image corresponds one-to-one with at least one second feature point of the face in the initial face image ( Figure 10 illustrates with the face contour feature points and mouth feature points as an example, Figure 10 the black dots shown therein are the feature points of the face, and the black dots at both ends of each solid line are the corresponding feature points); further, according to the positions of the feature points in the adjusted first region, the positions of the corresponding face feature points in the initial face image can be adjusted. For example, as shown in Figure 11 , the positions of some face contour feature points in the initial face image (i.e., Figure 11 the black dots on the face contour in Figure 12 ) are adjusted based on the direction of the arrow to obtain an adjusted face image, specifically as shown in Figure 12 , where the face contour within the rectangular area in
[0138] Step S605: Save the adjusted face image.
[0139] An embodiment of the present application provides an image processing device, as shown in Figure 13As shown in the figure, the image processing apparatus 60 may include: an image acquisition module 601, a target three-dimensional object model determination module 602, and an adjustment module 603. Among them,
[0140] The image acquisition module 601 is configured to acquire an initial image and identify a target object included in the initial image;
[0141] The target three-dimensional object model determination module 602 is configured to determine a target three-dimensional object model from at least one candidate three-dimensional object model according to the target object, where each candidate three-dimensional object model corresponds to a candidate object;
[0142] The adjustment module 603 is configured to adjust the target object in the initial image according to the target three-dimensional object model to obtain a target image.
[0143] Optionally, when the target three-dimensional object model determination module determines the target three-dimensional object model from at least one candidate three-dimensional object model according to the target object, it is specifically configured to:
[0144] Calculate the matching degree between each candidate object and the target object respectively;
[0145] Based on the matching degrees corresponding to each candidate object, determine the target object model from at least one candidate three-dimensional object model.
[0146] Optionally, when the target three-dimensional object model determination module determines the target three-dimensional object model from at least one candidate three-dimensional object model according to the target object, it is specifically configured to:
[0147] Determine at least one recommended object model from at least one candidate three-dimensional object model according to the target object, and display the at least one recommended object model to the user;
[0148] In response to the user's selection operation, determine the target three-dimensional object model from at least one recommended object model.
[0149] Optionally, when the adjustment module adjusts the target object in the initial image according to the target three-dimensional object model to obtain a target image, it is specifically configured to:
[0150] Acquire a target two-dimensional image of the target three-dimensional object model, where the target two-dimensional image is a two-dimensional image obtained by performing at least one projection transformation process on the target three-dimensional object model;
[0151] Adjust the target object in the initial image according to the reference object in the target two-dimensional image to obtain a target image.
[0152] Optionally, when the target three-dimensional object model determination module acquires the target two-dimensional image, it is specifically configured to:
[0153] Perform at least one projection transformation process on the target three-dimensional object model to obtain at least one candidate two-dimensional image corresponding to the target three-dimensional object model;
[0154] Determine the matching degree between the target object and the candidate object in each candidate two-dimensional image;
[0155] Determine the target two-dimensional image from each candidate two-dimensional image according to the matching degree corresponding to each candidate two-dimensional image.
[0156] When determining the matching degree between the target object and the reference object in each candidate two-dimensional image, the target three-dimensional object model determination module is specifically used for at least one of the following:
[0157] For each candidate two-dimensional image, determine the matching degree between the candidate object and the target object according to the matching degree between at least one feature point of the candidate object in the candidate two-dimensional image and at least one feature point corresponding to the target object in the initial image;
[0158] For each candidate two-dimensional image, determine the matching degree between the candidate object and the target object according to the matching degree between the first object feature of the candidate object in the candidate two-dimensional image and the second object feature of the target object.
[0159] Optionally, when the adjustment module adjusts the target object in the initial image according to the reference object in the target two-dimensional image to obtain the target image, it is specifically used for:
[0160] Adjust at least one second feature point corresponding to the target object in the initial image according to at least one first feature point of the reference object in the target two-dimensional image to obtain the target image.
[0161] Optionally, when the adjustment module adjusts at least one second feature point corresponding to the target object in the initial image according to at least one first feature point of the reference object in the target two-dimensional image, it is specifically used for:
[0162] Adjust the first region in the target two-dimensional image and the second region in the initial image to the same size, where the first region is the image region corresponding to at least one first feature point in the target two-dimensional image, and the second region is the image region corresponding to at least one second feature point in the initial image;
[0163] Adjust the positions of the respective second feature points corresponding to the target object in the initial image according to the positions of the respective first feature points in the adjusted first key point region.
[0164] Optionally, the device further includes a model generation module. For any candidate three-dimensional object model, the candidate three-dimensional object model is obtained by the model generation module through the following method:
[0165] Obtain at least two sample images corresponding to the same candidate object at different angles;
[0166] Identify at least one feature point of the candidate object in at least two sample images respectively;
[0167] Generate a candidate three-dimensional object model corresponding to the candidate object included in the sample image according to at least one feature point of the candidate object in at least two sample images.
[0168] Optionally, when generating a candidate three-dimensional object model corresponding to the candidate object included in the sample image according to at least one feature point of the object in at least two sample images, the model generation module is specifically used for:
[0169] Generate an initial three-dimensional object model corresponding to the candidate object according to at least one feature point of the object in at least two sample images, and the initial three-dimensional object model includes at least one feature point of the candidate object in at least two sample images;
[0170] Obtain an adjustment request for the candidate object in the initial three-dimensional object model;
[0171] Adjust the candidate object in the initial three-dimensional object model according to the adjustment request to obtain a candidate three-dimensional object model.
[0172] Optionally, the device further includes a storage module for:
[0173] Extract object features of at least one of at least two sample images to obtain object features corresponding to at least one sample image;
[0174] Respectively use the object features corresponding to the extracted sample images as the third object features corresponding to the candidate objects in the candidate three-dimensional object model, and store the third object features in association with the candidate three-dimensional object model;
[0175] When determining the target three-dimensional object model from at least one candidate three-dimensional object model according to the target object, the target three-dimensional object model determination module is specifically used for:
[0176] Extract the second object feature of the target object included in the initial image;
[0177] For each candidate three-dimensional object model, determine the matching degree between the second object feature and each third object feature corresponding to the candidate object in the candidate three-dimensional object model to obtain at least one matching degree corresponding to the candidate three-dimensional object model;
[0178] Determine the target three-dimensional object model from at least one candidate three-dimensional object model according to at least one matching degree corresponding to each candidate three-dimensional object model.
[0179] Optionally, when determining the target 3D object model from at least one candidate 3D object model according to at least one matching degree corresponding to each candidate 3D object model, the target 3D object model determination module is specifically configured to:
[0180] For each candidate 3D object model, determine the matching degree between the candidate 3D object model and the target object according to at least one matching degree corresponding to the candidate 3D object model;
[0181] Determine the target 3D object model from at least one candidate 3D object model according to the matching degrees between each candidate 3D object model and the target object.
[0182] The image processing device according to the embodiment of the present application can execute an image processing method provided by the embodiment of the present application. The implementation principle is similar and will not be described in detail here.
[0183] Wherein, the image processing device may be a computer program (including program code) running in a computer device. For example, the image processing device is an application software; the device can be used to execute the corresponding steps in the method provided by the embodiment of the present application.
[0184] In some embodiments, the image processing device provided by the embodiment of the present application can be implemented in a combination of software and hardware. As an example, the image processing device provided by the embodiment of the present application can be a processor in the form of a hardware decoding processor, which is programmed to execute the image processing method provided by the embodiment of the present application. For example, the processor in the form of a hardware decoding processor can adopt one or more application specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field programmable gate arrays (FPGAs) or other electronic components.
[0185] In other embodiments, the image processing device provided by the embodiment of the present application can be implemented in a software manner. Figure 13 Fig. shows an image processing device 60, which may be software in the form of a program and a plug-in, etc., and includes a series of modules, including an image acquisition module 601, a target 3D object model determination module 602, and an adjustment module 603; wherein, the image acquisition module 601, the target 3D object model determination module 602, and the adjustment module 603 are used to implement the image processing method provided by the embodiment of the present application.
[0186] An embodiment of the present application provides an electronic device, such as Figure 14 shown, Figure 14 The electronic device 2000 shown in Figure 14 includes: a processor 2001 and a memory 2003. Among them, the processor 2001 and the memory 2003 are connected, such as connected through a bus 2002. Optionally, the electronic device 2000 may further include a transceiver 2004. It should be noted that in practical applications, the transceiver 2004 is not limited to one, and the structure of the electronic device 2000 does not constitute a limitation to the embodiments of the present application.
[0187] Among them, the processor 2001 is applied in the embodiments of the present application and is used to implement Figure 13 the functions of each module shown in Figure 13 .
[0188] The processor 2001 may be a CPU, a general-purpose processor, a DSP, an ASIC, an FPGA or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It can implement or execute various exemplary logic blocks, modules and circuits described in connection with the disclosure of the present application. The processor 2001 may also be a combination for implementing computing functions, such as a combination including one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0189] The bus 2002 may include a path for transmitting information between the above components. The bus 2002 may be a PCI bus or an EISA bus, etc. The bus 2002 may be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, Figure 14 only a thick line is used in Figure 14 to represent it, but it does not mean that there is only one bus or one type of bus.
[0190] The memory 2003 may be a ROM or other type of static storage device that can store static information and computer programs, a RAM or other type of dynamic storage device that can store information and computer programs, or an EEPROM, a CD-ROM or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store or in the form of a data structure the desired computer program and can be accessed by a computer, but is not limited thereto.
[0191] The memory 2003 is used to store the computer program of the application program for executing the solution of the present application and is controlled by the processor 2001 to execute. The processor 2001 is used to execute the computer program of the application program stored in the memory 2003 to implement Figure 13 the actions of the image processing device provided by the embodiment shown in Figure 13 .
[0192] An embodiment of the present application provides an electronic device, including a processor and a memory: The memory is configured to store a computer program, and when the computer program is executed by the processor, the processor implements any one of the methods in the above embodiments.
[0193] An embodiment of the present application provides a computer-readable storage medium for storing a computer program, and when the computer program runs on a computer, the computer can execute any one of the methods in the above embodiments.
[0194] According to one aspect of the present application, there is provided a computer program product or a computer program. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in the above various optional implementation manners.
[0195] The terms and implementation principles related to a computer-readable storage medium in the present application can specifically refer to an image processing method in an embodiment of the present application, which will not be elaborated here.
[0196] It should be understood that although the steps in the flowchart of the accompanying drawings are shown in sequence according to the indication of the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise clearly stated in this article, the execution of these steps has no strict order limit, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed alternately or alternately with at least a part of other steps or sub-steps or stages of other steps.
[0197] The above are only some implementation manners of the present application. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present application, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present application.
Claims
1. An image processing method, characterized in that, Including: Obtain an initial image and identify a target object included in the initial image; Determine a target three-dimensional object model from at least one candidate three-dimensional object model according to the target object, where each candidate three-dimensional object model corresponds to a candidate object; Obtain at least one candidate two-dimensional image corresponding to the target three-dimensional object model, and the at least one candidate two-dimensional image is obtained by performing at least one projection transformation process on the target three-dimensional object model; Determine the matching degree between the target object and the candidate objects in each of the candidate two-dimensional images; Determine a target two-dimensional image from each of the candidate two-dimensional images according to the matching degree corresponding to each candidate two-dimensional image; Adjust the target object in the initial image according to the candidate object in the target two-dimensional image to obtain a target image.
2. The method according to claim 1, wherein The determining the target three-dimensional object model from at least one candidate three-dimensional object model according to the target object includes: Calculate the matching degree between each candidate object and the target object respectively; Determine the target object model from at least one candidate three-dimensional object model based on the matching degree corresponding to each candidate object.
3. The method according to claim 1, wherein The determining the target three-dimensional object model from at least one candidate three-dimensional object model according to the target object includes: Determine at least one recommended object model from the at least one candidate three-dimensional object model according to the target object and display the at least one recommended object model to the user; In response to a user selection operation, determine the target three-dimensional object model from the at least one recommended object model.
4. The method according to claim 1, characterized in that, The determining the matching degree between the target object and the candidate objects in each of the candidate two-dimensional images includes at least one of the following: For each candidate two-dimensional image, determine the matching degree between the candidate object and the target object according to the matching degree between at least one feature point of the candidate object in the candidate two-dimensional image and at least one feature point corresponding to the target object in the initial image; For each candidate two-dimensional image, determine the matching degree between the candidate object and the target object according to the matching degree between the first object feature of the candidate object in the candidate two-dimensional image and the second object feature of the target object.
5. The method according to claim 1, characterized in that The adjusting the target object in the initial image according to the candidate object in the target two-dimensional image to obtain the target image includes: Adjust at least one second feature point corresponding to the target object in the initial image according to at least one first feature point of the candidate object in the target two-dimensional image to obtain the target image.
6. The method according to claim 5, wherein The adjusting at least one second feature point corresponding to the target object in the initial image according to at least one first feature point of the candidate object in the target two-dimensional image includes: Adjust a first region in the target two-dimensional image and a second region in the initial image to the same size, where the first region is an image region corresponding to the at least one first feature point in the target two-dimensional image, and the second region is an image region corresponding to the at least one second feature point in the initial image; Adjust the positions of the second feature points corresponding to the target object in the initial image according to the positions of the first feature points in the adjusted first key point region.
7. The method according to claim 1, wherein For any one of the candidate 3D object models, the candidate 3D object model is obtained by the following method: Obtain at least two sample images corresponding to the same candidate object at different angles; Identify at least one feature point of the candidate object in at least two of the sample images; Generate a candidate 3D object model corresponding to the candidate object included in the sample images according to at least one feature point of the candidate object in at least two of the sample images.
8. The method according to claim 7, wherein The generating a candidate 3D object model corresponding to the candidate object included in the sample images according to at least one feature point of the object in at least two of the sample images includes: Generate an initial 3D object model corresponding to the candidate object according to at least one feature point of the object in at least two of the sample images, where the initial 3D object model includes at least one feature point of the candidate object in at least two of the sample images; Obtain an adjustment request for the candidate object in the initial 3D object model; Adjust the candidate object in the initial 3D object model according to the adjustment request to obtain the candidate 3D object model.
9. The method according to claim 8, wherein The method further includes: Extract object features of at least one of the at least two sample images to obtain object features corresponding to at least one sample image; Respectively use the object features corresponding to the extracted sample images as the third object features corresponding to the candidate object in the candidate 3D object model, and store the third object features in an associated manner with the candidate 3D object model; The determining a target 3D object model from at least one candidate 3D object model according to the target object includes: Extract the second object features of the target object included in the initial image; For each candidate 3D object model, determine the matching degree between the second object features and each of the third object features corresponding to the candidate object in the candidate 3D object model to obtain at least one matching degree corresponding to the candidate 3D object model; Determine the target 3D object model from the at least one candidate 3D object model according to at least one matching degree corresponding to each candidate 3D object model.
10. The method according to claim 9, characterized in that The determining a target 3D object model from the at least one candidate 3D object model according to at least one matching degree corresponding to each candidate 3D object model includes: For each candidate 3D object model, determine the matching degree between the candidate 3D object model and the target object according to at least one matching degree corresponding to the candidate 3D object model; Determine the target 3D object model from at least one of the candidate 3D object models according to the matching degrees between each candidate 3D object model and the target object.
11. An image processing apparatus, characterized in that, Includes: An image acquisition module, configured to acquire an initial image and identify the target object included in the initial image; A target three-dimensional object model determination module, configured to determine a target three-dimensional object model from at least one candidate three-dimensional object model according to the target object, where each candidate three-dimensional object model corresponds to a candidate object; obtain at least one candidate two-dimensional image corresponding to the target three-dimensional object model, and the at least one candidate two-dimensional image is obtained by performing at least one projection transformation process on the target three-dimensional object model; determine the matching degree between the target object and the candidate objects in each candidate two-dimensional image; and determine a target two-dimensional image from each candidate two-dimensional image according to the matching degree corresponding to each candidate two-dimensional image. An adjustment module, configured to adjust the target object in the initial image according to the candidate object in the target two-dimensional image to obtain a target image.
12. The device according to claim 11, characterized in that, When determining the target three-dimensional object model from at least one candidate three-dimensional object model according to the target object, the target three-dimensional object model determination module is configured to: Calculate the matching degree between each candidate object and the target object respectively; Based on the matching degree corresponding to each candidate object, determine the target object model from at least one candidate three-dimensional object model.
13. The device according to claim 11, characterized in that, When determining the target three-dimensional object model from at least one candidate three-dimensional object model according to the target object, the target three-dimensional object model determination module is configured to: Determine at least one recommended object model from the at least one candidate three-dimensional object model according to the target object, and display the at least one recommended object model to the user; In response to a user selection operation, determine the target three-dimensional object model from the at least one recommended object model.
14. The device according to claim 11, characterized in that When determining the matching degree between the target object and the candidate objects in each candidate two-dimensional image, the target three-dimensional object model determination module is configured to perform at least one of the following: For each candidate two-dimensional image, determine the matching degree between the candidate object and the target object according to the matching degree between at least one feature point of the candidate object in the candidate two-dimensional image and at least one feature point corresponding to the target object in the initial image; For each candidate two-dimensional image, determine the matching degree between the candidate object and the target object according to the matching degree between the first object feature of the candidate object in the candidate two-dimensional image and the second object feature of the target object.
15. The device according to claim 11, characterized in that, When adjusting the target object in the initial image according to the candidate object in the target two-dimensional image to obtain the target image, the adjustment module is configured to: Adjust at least one second feature point corresponding to the target object in the initial image according to at least one first feature point of the candidate object in the target two-dimensional image to obtain the target image.
16. The device according to claim 15, characterized in that, When adjusting at least one second feature point corresponding to the target object in the initial image according to at least one first feature point of the candidate object in the target two-dimensional image, the adjustment module is configured to: Adjust the first region in the target two-dimensional image and the second region in the initial image to the same size, where the first region is the image region corresponding to the at least one first feature point in the target two-dimensional image, and the second region is the image region corresponding to the at least one second feature point in the initial image; Adjust the positions of the respective second feature points corresponding to the target object in the initial image according to the positions of the respective first feature points in the adjusted first key point region.
17. The device according to claim 11, characterized in that, The apparatus further includes a model generation module. For any candidate three-dimensional object model, the candidate three-dimensional object model is obtained by the model generation module in the following manner: Obtain at least two sample images corresponding to the same candidate object at different angles; Identify at least one feature point of the candidate object in the at least two sample images respectively; Generate a candidate three-dimensional object model corresponding to the candidate object included in the sample images according to the at least one feature point of the candidate object in the at least two sample images.
18. The device according to claim 17, characterized in that, When generating a candidate three-dimensional object model corresponding to the candidate object included in the sample images according to the at least one feature point of the object in the at least two sample images, the model generation module is configured to: Generate an initial three-dimensional object model corresponding to the candidate object according to the at least one feature point of the object in the at least two sample images, where the initial three-dimensional object model includes the at least one feature point of the candidate object in the at least two sample images; Obtain an adjustment request for the candidate object in the initial three-dimensional object model; Adjust the candidate object in the initial three-dimensional object model according to the adjustment request to obtain the candidate three-dimensional object model.
19. The device according to claim 18, characterized in that, The apparatus further includes a storage module, and the storage module is configured to: Extract object features from at least one of the at least two sample images to obtain object features corresponding to the at least one sample image; Respectively use the extracted object features corresponding to each sample image as the third object features corresponding to the candidate object in the candidate three-dimensional object model, and store the third object features in association with the candidate three-dimensional object model; When determining a target three-dimensional object model from at least one candidate three-dimensional object model according to the target object, the target three-dimensional object model determination module is configured to: Extract the second object feature of the target object included in the initial image; For each candidate three-dimensional object model, determine the matching degree between the second object feature and the respective third object features corresponding to the candidate object in the candidate three-dimensional object model to obtain at least one matching degree corresponding to the candidate three-dimensional object model; Determine a target three-dimensional object model from the at least one candidate three-dimensional object model according to the at least one matching degree corresponding to each candidate three-dimensional object model.
20. The device according to claim 19, characterized in that, When determining a target three-dimensional object model from the at least one candidate three-dimensional object model according to the at least one matching degree corresponding to each candidate three-dimensional object model, the target three-dimensional object model determination module is configured to: For each of the candidate three-dimensional object models, determine the matching degree between the candidate three-dimensional object model and the target object according to at least one matching degree corresponding to the candidate three-dimensional object model; Determine the target three-dimensional object model from at least one of the candidate three-dimensional object models according to the matching degrees between the candidate three-dimensional object models and the target object.
21. An electronic device, characterized in that, Comprising a processor and a memory: The memory is configured to store a computer program, which, when executed by the processor, causes the processor to execute the method according to any one of claims 1-10.
22. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a computer program, which, when running on a computer, enables the computer to execute the method according to any one of claims 1-10 above.
Citation Information
Patent Citations
Image processing method and device, electronic equipment and storage medium
CN108876708A
Face image processing method, device and electronic device
CN109242760A