Target image acquisition method and device, storage medium and electronic device
By adjusting the image region using target grid and element change data in the target image, the problem of low accuracy in obtaining motion changes in a single image is solved, and precise adjustment of elements within the image region is achieved, thus improving the accuracy of image acquisition.
Patent Information
- Application Number
- CN202210039303.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-13
- Publication Date
- 2025-12-30
- Estimated Expiration
- 2042-01-13
AI Technical Summary
In existing technologies, target images generated by changing the image action of a single image may have background redundant pixel changes or non-execution area pixel changes, resulting in low accuracy.
By displaying the first target image, obtaining the image adjustment request, using the target grid to determine the adjustment area, and adjusting the target area image according to the element change data of the target action, a second target image is generated.
It improves the accuracy of target image acquisition and enables targeted adjustment of elements within the image region.
Smart Images

Figure CN114470757B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computers, and more specifically, to a method, apparatus, storage medium, and electronic device for acquiring target images. Background Technology
[0002] In recent years, the development of virtual avatars has been rapid, as seen in applications such as live streaming. Generally, live streaming virtual avatars use 3D figures or combinations of multiple 2D elements, but this approach is costly to produce. In contrast, virtual avatars presented as single images, while not as vivid as the aforementioned methods, are less expensive to produce and have considerable practical value.
[0003] In related technologies, image motion modification of a single image is usually achieved using local affine transformation. However, the resulting target image may have redundant pixel changes in the background, or pixel changes in some non-execution areas. This makes the generated target image not the virtual avatar actually needed by the user. Therefore, there is a problem of low accuracy in acquiring the target image.
[0004] There is currently no effective solution to the above problems. Summary of the Invention
[0005] The present invention provides a method, apparatus, storage medium, and electronic device for acquiring target images, so as to at least solve the technical problem of low accuracy in acquiring target images.
[0006] According to one aspect of the present invention, a method for acquiring a target image is provided, comprising: displaying a first target image, wherein the first target image contains at least two image elements of a target object; acquiring an image adjustment request triggered on the first target image, wherein the image adjustment request is used to request that the original target image elements of the target object be adjusted to the image elements exhibited by the target object when performing a target action; in response to the image adjustment request, acquiring a target grid corresponding to the element type of the original target image elements, wherein the target grid is used to determine a region image in the first target image that is adjusted in response to the image adjustment request; determining a target region image containing the original target image elements from the first target image based on the target grid; and adjusting the target region image in the first target image according to element change data corresponding to the target action to obtain a second target image.
[0007] According to another aspect of the present invention, a target image acquisition apparatus is also provided, comprising: a display unit for displaying a first target image, wherein the first target image includes at least two image elements of a target object; a first acquisition unit for acquiring an image adjustment request triggered on the first target image, wherein the image adjustment request is used to request that the original target image elements of the target object be adjusted to the image elements exhibited by the target object when performing a target action; a second acquisition unit for acquiring a target grid corresponding to the element type of the original target image elements in response to the image adjustment request, wherein the target grid is used to determine a region image in the first target image that is adjusted in response to the image adjustment request; a first determination unit for determining a target region image containing the original target image elements from the first target image based on the target grid; and a first adjustment unit for adjusting the target region image in the first target image according to element change data corresponding to the target action to obtain a second target image.
[0008] As an optional solution, the first adjustment unit includes: an adjustment module, used to adjust the first original layer of the target region image according to the element change data corresponding to the target action, to obtain a first target layer; and an integration module, used to integrate the first target image and the first target layer to obtain the second target image.
[0009] As an optional solution, the above-mentioned integration module includes: an adjustment submodule, used to adjust the transparency of the second original layer according to the first transparency of the first target layer when the second original layer of the first target image is obtained, to obtain the second original layer with the second transparency; and an integration submodule, used to integrate the first target layer with the first transparency and the second original layer with the second transparency to obtain the second target image.
[0010] As an optional solution, it includes: a third acquisition unit, configured to, after acquiring the image adjustment request triggered by the first target image, respond to the image adjustment request and acquire the target mesh structure corresponding to the element type of the original target image elements; and an input unit, configured to, after acquiring the image adjustment request triggered by the first target image, input the first target image into the target mesh structure to obtain the second target image output by the target mesh structure.
[0011] As an optional solution, it includes: a first processing unit, configured to downsample the first target image before inputting it into the target mesh structure to obtain a target image at a target resolution; a second processing unit, configured to merge the target image at the target resolution and the element change data corresponding to the target action with a matrix along the target dimension before inputting the first target image into the target mesh structure to obtain target image data; and a third processing unit, configured to upsample the target image data before inputting the first target image into the target mesh structure to obtain a target image at a resolution matching the target mesh structure, wherein the target image at a resolution matching the target mesh structure is the first target image input into the target mesh structure.
[0012] As an optional solution, it further includes: a fourth acquisition unit, configured to, when the target original image elements include a first original image element and a second original element, after acquiring the image adjustment request triggered on the first target image, respond to the image adjustment request, acquire a first grid corresponding to the element type of the first original image element, and acquire a second grid corresponding to the element type of the second original image element; a second determination unit, configured to, when the target original image elements include a first original image element and a second original element, after acquiring the image adjustment request triggered on the first target image, determine a first region image containing the first original image element from the first target image based on the first grid, and determine a second region image containing the second original image element from the first target image based on the second grid; and a second adjustment unit, configured to, when the target original image elements include a first original image element and a second original element, after acquiring the image adjustment request triggered on the first target image, adjust the first region image and the second region image in the first target image according to the element change data corresponding to the target action, to obtain the second target image.
[0013] According to another aspect of the embodiments of this application, a computer program product or computer program is provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the target image acquisition method as described above.
[0014] According to another aspect of the present invention, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the above-described method for acquiring the target image through the computer program.
[0015] In this embodiment of the invention, a first target image is displayed, wherein the first target image contains at least two image elements of a target object; an image adjustment request triggered by the first target image is obtained, wherein the image adjustment request is used to request that the original target image elements of the target object be adjusted to the image elements exhibited by the target object when performing a target action; in response to the image adjustment request, a target grid corresponding to the element type of the original target image elements is obtained, wherein the target grid is used to determine the region image in the first target image that is adjusted in response to the image adjustment request; a target region image containing the original target image elements is determined from the first target image according to the target grid; the target region image in the first target image is adjusted according to the element change data corresponding to the target action to obtain a second target image. By using the target grid to determine the image region to be adjusted in the image, and then using the change element corresponding to the adjustment action to make targeted adjustments to the elements in the image region to be adjusted in the image, the technical effect of improving the accuracy of target image acquisition is achieved, thereby solving the technical problem of low accuracy of target image acquisition. Attached Figure Description
[0016] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:
[0017] Figure 1 This is a schematic diagram of the application environment of an optional target image acquisition method according to an embodiment of the present invention;
[0018] Figure 2 This is a schematic diagram of the flow of an optional target image acquisition method according to an embodiment of the present invention;
[0019] Figure 3 This is a schematic diagram of an optional method for acquiring a target image according to an embodiment of the present invention;
[0020] Figure 4 This is a schematic diagram of another optional method for acquiring a target image according to an embodiment of the present invention;
[0021] Figure 5This is a schematic diagram of another optional method for acquiring a target image according to an embodiment of the present invention;
[0022] Figure 6 This is a schematic diagram of an optional target image acquisition device according to an embodiment of the present invention;
[0023] Figure 7 This is a schematic diagram of the structure of an optional electronic device according to an embodiment of the present invention. Detailed Implementation
[0024] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0025] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0026] According to one aspect of the present invention, a method for acquiring a target image is provided. Optionally, as an optional implementation, the above-described method for acquiring a target image may be applied to, but is not limited to, [examples of other methods]. Figure 1 The environment shown may include, but is not limited to, user equipment 102, network 110, and server 112. The user equipment 102 may include, but is not limited to, a display 108, a processor 106, and a memory 104.
[0027] The specific process can be summarized in the following steps:
[0028] In step S102, the user equipment 102 obtains an image adjustment request triggered on the first target image 1022, wherein the image adjustment request is used to request that the original image elements of the target object contained in the first target image be adjusted to the image elements exhibited by the target object when performing the target action;
[0029] In steps S104-S106, user equipment 102 sends an image adjustment request to server 112 via network 110;
[0030] In step S108, server 112 searches for the target grid corresponding to the element type of the target original image element through database 114, and uses processing engine 116 to call the target grid to determine the target region image containing the target original image element from the first target image, and adjusts the target region image in the first target image according to the element change data corresponding to the target action to obtain the second target image 1024.
[0031] In steps S110-S114, server 112 sends the second target image 1024 to user equipment 102 via network 110. Processor 106 in user equipment 102 displays the second target image 1024 on display 108 and stores the second target image 1024 in memory 104.
[0032] remove Figure 1 Beyond the illustrated example, the above steps can be performed independently by user equipment 102, i.e., user equipment 102 can perform steps such as calling the target mesh and generating the second target image 1024, thereby reducing the processing load on the server. User equipment 102 includes, but is not limited to, handheld devices (such as mobile phones), laptops, desktop computers, in-vehicle devices, etc., and this invention does not limit the specific implementation of user equipment 102.
[0033] Alternatively, as an alternative implementation method, such as Figure 2 As shown, the methods for obtaining the target image include:
[0034] S202, Display a first target image, wherein the first target image contains at least two image elements of a target object;
[0035] S204, Obtain an image adjustment request triggered on the first target image, wherein the image adjustment request is used to request that the original target image elements of the target object be adjusted to the image elements exhibited by the target object when performing the target action;
[0036] S206, in response to the image adjustment request, obtain the target grid corresponding to the element type of the target original image element, wherein the target grid is used to determine the region image in the first target image that is adjusted in response to the image adjustment request;
[0037] S208, Determine the target region image containing elements of the original target image from the first target image based on the target grid;
[0038] S210, adjust the target region image in the first target image according to the element change data corresponding to the target action to obtain the second target image.
[0039] Optionally, in this embodiment, the above-mentioned method for obtaining the target image can be applied, but is not limited to, in a live streaming scenario, such as when the target account (anchor) is associated with a client displaying the target virtual image of the target account, wherein the target virtual image can be understood, but is not limited to, as a target image that is allowed to be adjusted; based on this, the first target image of the target virtual image is displayed at the first moment; further, in response to the image adjustment request triggered by the first target image, the target grid corresponding to the element type of the target original image element of the target object contained in the first target image is obtained; then, the target area image containing the target original image element is determined from the first target image using the target grid, and the target area image in the first target image is adjusted according to the element change data corresponding to the target action to obtain the second target image of the target virtual image at the second moment.
[0040] Optionally, in this embodiment, the target object can be understood as, but is not limited to, a virtual image, such as a virtual object (a person, an animal, etc.), a virtual item (a sword, a shield, etc.), or a virtual element (a mountain, a river, etc.). The image elements of the target object can be understood as, but are not limited to, the elements used to compose the target object. For example, if the target object is a target person, then the image elements can be, but are not limited to, facial elements such as a mouth, nose, eyes, and eyelashes, and can also be, but are not limited to, accessory elements such as glasses, headdress, and mask.
[0041] Optionally, in this embodiment, the target action may be, but is not limited to, the action to be performed determined in response to an image adjustment request triggered on the first target image. For example, if the image adjustment request is triggered when the current virtual game is won, the corresponding target action may be, but is not limited to, a joyful action that instructs the target object to perform; or if the image adjustment request is triggered when the current virtual game is lost, the corresponding target action may be, but is not limited to, a sad action that instructs the target object to perform.
[0042] Optionally, in this embodiment, the target grid can be used, but is not limited to, to specifically determine the target region image corresponding to the element type containing the target original image element; for example, if the element type of the original image element to be adjusted (target original image element) is obtained as type A, then grid A (target grid) corresponding to type A is determined from multiple grids.
[0043] Optionally, in this embodiment, the element change data can be used, but is not limited to, to represent the intensity / degree of change of the image elements. For example, it is first determined that the image elements to be adjusted include elements A, B and C, and it is assumed that the element change data includes the adjustment target data 30 of element A (assuming a lower limit of 0 and an upper limit of 100), the adjustment target data 10 of element B (assuming a lower limit of 0 and an upper limit of 100) and the adjustment target data 50 of element C (assuming a lower limit of 0 and an upper limit of 100). The upper limit can be understood, but is not limited to, as the maximum intensity of change, and similarly, the lower limit can be understood, but is not limited to, as the minimum intensity of change.
[0044] To further illustrate, optional examples include... Figure 3 As shown, the target original image element 304 (mouth) contained in the target object 302 is determined, and then the element intensity of the target original image element 304 (mouth) is adjusted (up / down / left / right) according to the element change data 306, or it can be understood as adjusting the distribution information of the target original image element 304 (mouth) in the target object 302.
[0045] It should be noted that the process involves: displaying a first target image, wherein the first target image contains at least two image elements of the target object; obtaining an image adjustment request triggered on the first target image, wherein the image adjustment request is used to request that the original target image elements of the target object be adjusted to the image elements exhibited by the target object when performing the target action; responding to the image adjustment request, obtaining a target grid corresponding to the element type of the original target image elements, wherein the target grid is used to determine the region image in the first target image that is adjusted in response to the image adjustment request; determining the target region image containing the original target image elements from the first target image based on the target grid; and adjusting the target region image in the first target image based on the element change data corresponding to the target action to obtain a second target image.
[0046] To further illustrate, optional examples include... Figure 4 As shown, the first target image 404 is displayed in the live broadcast screen 402, as... Figure 4 As shown in (a), the first target image 404 contains at least two image elements of the target object 406; further assuming an image adjustment request triggered on the first target image 404 is obtained, wherein the image adjustment request is used to request that the target original image element 408 of the target object be adjusted to the image element exhibited by the target object 406 when performing the target action; further, in response to the image adjustment request, a target grid corresponding to the element type of the target original image element 408 is obtained, wherein the target grid is used to determine the region image in the first target image 406 that is adjusted in response to the image adjustment request; the target region image containing the target original image element 408 is determined from the first target image 404 according to the target grid; further as... Figure 4As shown in (b), the target area image in the first target image 404 is adjusted according to the element change data corresponding to the target action to obtain the second target image 410, and the second target image 410 is displayed in the live broadcast screen 402.
[0047] The embodiments provided in this application display a first target image, which contains at least two image elements of a target object; obtain an image adjustment request triggered on the first target image, wherein the image adjustment request is used to request that the original image elements of the target object be adjusted to the image elements exhibited by the target object when performing a target action; respond to the image adjustment request, obtain a target grid corresponding to the element type of the original image elements, wherein the target grid is used to determine the region image in the first target image that is adjusted in response to the image adjustment request; determine the target region image containing the original image elements from the first target image according to the target grid; adjust the target region image in the first target image according to the element change data corresponding to the target action to obtain a second target image. By using the target grid to determine the image region to be adjusted in the image, and then using the change element corresponding to the adjustment action to make targeted adjustments to the elements in the image region to be adjusted in the image, the technical effect of improving the accuracy of target image acquisition is achieved.
[0048] As an optional approach, the target region image in the first target image is adjusted based on the element change data corresponding to the target action to obtain the second target image, including:
[0049] S1, adjust the first original layer of the target area image according to the element change data corresponding to the target action to obtain the first target layer;
[0050] S2, integrate the first target image and the first target layer to obtain the second target image.
[0051] Optionally, in this embodiment, the original layer may be, but is not limited to, a film containing elements such as text or images. The effect presented by stacking multiple original layers together may be, but is not limited to, a target image. Furthermore, the original layer may, but is not limited to, precisely position elements on the page. The original layer may, but is not limited to, include text, images, tables, plugins, and may also, but is not limited to, nested layers within it. Specifically, the original layer may, but is not limited to, include at least one of the following: background layer, adjustment layer, fill layer, text layer, shape layer, smart layer, alpha channel, colorchange layer, etc.
[0052] As an optional approach, the first target image and the first target layer are integrated to obtain the second target image, including:
[0053] S1, after obtaining the second original layer of the first target image, adjust the transparency of the second original layer according to the first transparency of the first target layer to obtain the second original layer with the second transparency;
[0054] S2 integrates the first target layer with the first transparency and the second original layer with the second transparency to obtain the second target image.
[0055] It should be noted that by using transparency to process each target layer, both overlay operations between multiple target layers and composition operations between multiple target layers can be achieved efficiently.
[0056] Through the embodiments provided in this application, when a second original layer of a first target image is obtained, the transparency of the second original layer is adjusted according to the first transparency of the first target layer to obtain a second original layer with second transparency; the first target layer with first transparency and the second original layer with second transparency are integrated to obtain a second target image, thereby improving the efficiency of layer processing.
[0057] As an optional approach, after obtaining the image adjustment request triggered by the first target image, the following steps are included:
[0058] S1, responding to the image adjustment request, obtains the target mesh structure corresponding to the element type of the target original image element;
[0059] S2, input the first target image into the target mesh structure to obtain the second target image output by the target mesh structure.
[0060] Optionally, in this embodiment, different element types can correspond to different mesh structures. For example, element type A (such as mouth) corresponds to mesh structure A, and mesh structure A is used to modify the opening and closing and shape of the mouth; element type B (such as pupil) corresponds to mesh structure B, and mesh structure B is used to modify the shape and position of the pupil; element type C (such as eyelashes) corresponds to mesh structure C, and mesh structure C is used to modify the position of the eyelashes.
[0061] As an optional approach, before inputting the first target image into the target mesh structure, the following steps are included:
[0062] S1, perform downsampling processing on the first target image to obtain a target image with the target resolution;
[0063] S2, merge the target image at the target resolution and the element change data corresponding to the target action according to the target dimension of the matrix to obtain the target image data;
[0064] S3, perform upsampling processing on the target image data to obtain a target image with a resolution matching the target mesh structure, wherein the target image with a resolution matching the target mesh structure is the first target image of the input target mesh structure.
[0065] Optionally, in this embodiment, a set of 0-1 action digital masks A2 are first randomly created to represent the intensity of changes in different parts; the masks and the original image A1 are input into the trained deep network. First, the original image A1 data is downsampled to a certain resolution. AI and A2 are merged in the first dimension of the matrix. Then, it is upsampled and upsampled again. Based on different grids, corresponding layers are generated, such as the alpha transparency channel and the colorchange pixel layer. The original image A1 is added to the generated layer to perform a variable sampling operation to generate a new layer. Then, the above steps of generating corresponding layers based on different grids are continued until all grids are traversed. Among them, the variable sampling operation can be understood as distorting the original image, and can be used, but is not limited to, the following formula (1):
[0066] Image_new=GridSample(image_old_, F) (1)
[0067] Where F is the weight vector that is adjusted during training.
[0068] To further illustrate, optional examples include... Figure 5 As shown, a set of 0-1 action digital masks 502 are first randomly created to represent the change intensity of different parts; the action digital mask 502 and the original image data 504 are input into the trained deep network. First, the original image data 504 is downsampled to a certain resolution. The original image data 504 and the action digital mask 502 are merged in the first dimension of the matrix. Then, it is upsampled and then upsampled again. According to different grids, corresponding layers are generated, such as the transparent channel AlphaB, the pixel change layer ColorChangeB, etc. The original image data 504 is added to the generated layer to perform a change sampling operation to generate a new layer. Then, the above steps of generating corresponding layers according to different grids are continued until all grids are traversed. The image data of each stage is combined to obtain the target image data 506. Among them, the combination method of the image data of each stage (Change Sample) can be, but is not limited to, the AlphaBlend algorithm. For details, please refer to the following formula (2):
[0069] Image_new=image1*A+image2*(1-A) (2)
[0070] Where A can be, but is not limited to, Alpha (transparency channel), image1 can be, but is not limited to, the image data obtained from the Grid Sample, and image2 can be, but is not limited to, the image data obtained from the Change Sample at each stage.
[0071] As an optional approach, when the target original image elements include a first original image element and a second original element, after obtaining the image adjustment request triggered on the first target image, the method further includes:
[0072] S1, in response to the image adjustment request, obtain the first grid corresponding to the element type of the first original image element, and obtain the second grid corresponding to the element type of the second original image element;
[0073] S2, determine a first region image containing first original image elements from the first target image based on the first grid, and determine a second region image containing second original image elements from the first target image based on the second grid;
[0074] S3, adjust the first region image and the second region image in the first target image according to the element change data corresponding to the target action to obtain the second target image.
[0075] As an optional approach, when the target action includes a first action corresponding to a first original image element and a second action corresponding to a second original image element, the first region image and the second region image in the first target image are adjusted according to the element change data corresponding to the target action to obtain the second target image, including:
[0076] The first region image in the first target image is adjusted according to the element change data corresponding to the first action, and the second region image in the first target image is adjusted according to the element change data corresponding to the second action, to obtain the second target image.
[0077] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, because according to the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to the present invention.
[0078] According to another aspect of the present invention, an apparatus for acquiring a target image for implementing the above-described target image acquisition method is also provided. For example... Figure 6 As shown, the device includes:
[0079] Display unit 602 is used to display a first target image, wherein the first target image contains at least two image elements of a target object;
[0080] The first acquisition unit 604 is used to acquire an image adjustment request triggered on the first target image, wherein the image adjustment request is used to request that the original target image elements of the target object be adjusted to the image elements exhibited by the target object when performing the target action;
[0081] The second acquisition unit 606 is used to acquire the target grid corresponding to the element type of the target original image element in response to the image adjustment request, wherein the target grid is used to determine the region image in the first target image that is adjusted in response to the image adjustment request;
[0082] The first determining unit 608 is used to determine a target region image containing elements of the original target image from the first target image based on the target grid;
[0083] The first adjustment unit 610 is used to adjust the target region image in the first target image according to the element change data corresponding to the target action, so as to obtain the second target image.
[0084] Optionally, in this embodiment, the aforementioned target image acquisition device may be applied in a live streaming scenario, such as when the target account (anchor) is associated with a client displaying the target virtual image of the target account. The target virtual image may be understood as, but is not limited to, a target image that is allowed to be adjusted. Based on this, the first target image of the target virtual image is displayed at a first moment. Further, in response to an image adjustment request triggered by the first target image, the target grid corresponding to the element type of the target original image elements of the target object contained in the first target image is obtained. Then, the target area image containing the target original image elements is determined from the first target image using the target grid, and the target area image in the first target image is adjusted according to the element change data corresponding to the target action to obtain the second target image of the target virtual image at a second moment.
[0085] Optionally, in this embodiment, the target object can be understood as, but is not limited to, a virtual image, such as a virtual object (a person, an animal, etc.), a virtual item (a sword, a shield, etc.), or a virtual element (a mountain, a river, etc.). The image elements of the target object can be understood as, but are not limited to, the elements used to compose the target object. For example, if the target object is a target person, then the image elements can be, but are not limited to, facial elements such as a mouth, nose, eyes, and eyelashes, and can also be, but are not limited to, accessory elements such as glasses, headdress, and mask.
[0086] Optionally, in this embodiment, the target action may be, but is not limited to, the action to be performed determined in response to an image adjustment request triggered on the first target image. For example, if the image adjustment request is triggered when the current virtual game is won, the corresponding target action may be, but is not limited to, a joyful action that instructs the target object to perform; or if the image adjustment request is triggered when the current virtual game is lost, the corresponding target action may be, but is not limited to, a sad action that instructs the target object to perform.
[0087] Optionally, in this embodiment, the target grid can be used, but is not limited to, to specifically determine the target region image corresponding to the element type containing the target original image element; for example, if the element type of the original image element to be adjusted (target original image element) is obtained as type A, then grid A (target grid) corresponding to type A is determined from multiple grids.
[0088] Optionally, in this embodiment, the element change data can be used, but is not limited to, to represent the intensity / degree of change of the image elements. For example, it is first determined that the image elements to be adjusted include elements A, B and C, and it is assumed that the element change data includes the adjustment target data 30 of element A (assuming a lower limit of 0 and an upper limit of 100), the adjustment target data 10 of element B (assuming a lower limit of 0 and an upper limit of 100) and the adjustment target data 50 of element C (assuming a lower limit of 0 and an upper limit of 100). The upper limit can be understood, but is not limited to, as the maximum intensity of change, and similarly, the lower limit can be understood, but is not limited to, as the minimum intensity of change.
[0089] It should be noted that the process involves: displaying a first target image, wherein the first target image contains at least two image elements of the target object; obtaining an image adjustment request triggered on the first target image, wherein the image adjustment request is used to request that the original target image elements of the target object be adjusted to the image elements exhibited by the target object when performing the target action; responding to the image adjustment request, obtaining a target grid corresponding to the element type of the original target image elements, wherein the target grid is used to determine the region image in the first target image that is adjusted in response to the image adjustment request; determining the target region image containing the original target image elements from the first target image based on the target grid; and adjusting the target region image in the first target image based on the element change data corresponding to the target action to obtain a second target image.
[0090] For specific embodiments, please refer to the example shown in the target image acquisition device described above, which will not be repeated here.
[0091] The embodiments provided in this application display a first target image, which contains at least two image elements of a target object; obtain an image adjustment request triggered on the first target image, wherein the image adjustment request is used to request that the original image elements of the target object be adjusted to the image elements exhibited by the target object when performing a target action; respond to the image adjustment request, obtain a target grid corresponding to the element type of the original image elements, wherein the target grid is used to determine the region image in the first target image that is adjusted in response to the image adjustment request; determine the target region image containing the original image elements from the first target image according to the target grid; adjust the target region image in the first target image according to the element change data corresponding to the target action to obtain a second target image. By using the target grid to determine the image region to be adjusted in the image, and then using the change element corresponding to the adjustment action to make targeted adjustments to the elements in the image region to be adjusted in the image, the technical effect of improving the accuracy of target image acquisition is achieved.
[0092] As an optional solution, the first adjustment unit 610 includes:
[0093] The adjustment module is used to adjust the first original layer of the target area image according to the element change data corresponding to the target action, so as to obtain the first target layer;
[0094] The integration module is used to integrate the first target image and the first target layer to obtain the second target image.
[0095] For specific implementation examples, please refer to the examples shown in the target image acquisition method above, which will not be repeated here.
[0096] As an optional solution, the integration module includes:
[0097] The adjustment submodule is used to adjust the transparency of the second original layer according to the first transparency of the first target layer when the second original layer of the first target image is obtained, so as to obtain the second original layer with the second transparency.
[0098] The integration submodule is used to integrate the first target layer with the first transparency and the second original layer with the second transparency to obtain the second target image.
[0099] For specific implementation examples, please refer to the examples shown in the target image acquisition method above, which will not be repeated here.
[0100] As an optional solution, it includes:
[0101] The third acquisition unit is used to respond to the image adjustment request triggered by the first target image and acquire the target mesh structure corresponding to the element type of the original target image element;
[0102] The input unit is used to input the first target image into the target mesh structure after obtaining the image adjustment request triggered by the first target image, so as to obtain the second target image output by the target mesh structure.
[0103] For specific implementation examples, please refer to the examples shown in the target image acquisition method above, which will not be repeated here.
[0104] As an optional solution, it includes:
[0105] The first processing unit is used to perform downsampling processing on the first target image before inputting the first target image into the target mesh structure to obtain a target image with target resolution;
[0106] The second processing unit is used to merge the target image at the target resolution and the element change data corresponding to the target action in the target dimension of the matrix before inputting the first target image into the target mesh structure, so as to obtain the target image data.
[0107] The third processing unit is used to upsample the target image data before inputting the first target image into the target mesh structure to obtain a target image with a resolution matching the target mesh structure, wherein the target image with a resolution matching the target mesh structure is the first target image input into the target mesh structure.
[0108] For specific implementation examples, please refer to the examples shown in the target image acquisition method above, which will not be repeated here.
[0109] As an optional solution, it also includes:
[0110] The fourth acquisition unit is used to, when the target original image elements include a first original image element and a second original element, after acquiring the image adjustment request triggered on the first target image, respond to the image adjustment request, acquire the first grid corresponding to the element type of the first original image element, and acquire the second grid corresponding to the element type of the second original image element;
[0111] The second determining unit is configured to, when the target original image elements include a first original image element and a second original element, after obtaining an image adjustment request triggered on the first target image, determine a first region image containing the first original image element from the first target image according to a first grid, and determine a second region image containing the second original image element from the first target image according to a second grid.
[0112] The second adjustment unit is used to adjust the first region image and the second region image in the first target image according to the element change data corresponding to the target action after obtaining the image adjustment request triggered on the first target image, when the target original image elements include the first original image elements and the second original elements, so as to obtain the second target image.
[0113] For specific implementation examples, please refer to the examples shown in the target image acquisition method above, which will not be repeated here.
[0114] As an optional solution, the second adjustment unit includes:
[0115] The image module is used to adjust a first region image in a first target image based on element change data corresponding to the first action and to adjust a second region image in a first target image based on element change data corresponding to the second action, when the target action includes a first action corresponding to a first original image element and a second action corresponding to a second original image element, to obtain a second target image.
[0116] For specific implementation examples, please refer to the examples shown in the target image acquisition method above, which will not be repeated here.
[0117] According to another aspect of the present invention, an electronic device for implementing the above-described method for acquiring a target image is also provided, such as... Figure 7 As shown, the electronic device includes a memory 702 and a processor 704. The memory 702 stores a computer program, and the processor 704 is configured to execute the steps in any of the above method embodiments via the computer program.
[0118] Optionally, in this embodiment, the aforementioned electronic device may be located in at least one of a plurality of network devices in a computer network.
[0119] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:
[0120] S1, Display a first target image, wherein the first target image contains at least two image elements of the target object;
[0121] S2, obtain the image adjustment request triggered on the first target image, wherein the image adjustment request is used to request that the original image elements of the target object be adjusted to the image elements exhibited by the target object when performing the target action;
[0122] S3, in response to the image adjustment request, obtain the target grid corresponding to the element type of the target original image element, wherein the target grid is used to determine the region image in the first target image that is adjusted in response to the image adjustment request;
[0123] S4, determine the target region image containing elements of the original target image from the first target image based on the target grid;
[0124] S5, adjust the target region image in the first target image according to the element change data corresponding to the target action to obtain the second target image.
[0125] Alternatively, as those skilled in the art will understand, Figure 7 The structure shown is for illustrative purposes only. Electronic devices can also be smartphones (such as Android phones, iOS phones, etc.), tablets, PDAs, mobile internet devices (MIDs), PADs, and other terminal devices. Figure 7 This does not limit the structure of the aforementioned electronic devices. For example, the electronic device may also include components that are more... Figure 7 The more or fewer components shown (such as network interfaces, etc.), or having the same Figure 7 The different configurations shown.
[0126] The memory 702 can be used to store software programs and modules, such as the program instructions / modules corresponding to the target image acquisition method and apparatus in this embodiment of the invention. The processor 704 executes various functional applications and data processing by running the software programs and modules stored in the memory 702, thereby realizing the target image acquisition method described above. The memory 702 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 702 may further include memory remotely located relative to the processor 704, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Specifically, the memory 702 may be used, but is not limited to, to store information such as a first target image, an image adjustment request, and a second target image. As an example, such as Figure 7 As shown, the memory 702 may include, but is not limited to, the display unit 602, the first acquisition unit 604, the second acquisition unit 606, the first determination unit 608, and the first adjustment unit 610 in the target image acquisition device. Furthermore, it may include, but is not limited to, other module units in the target image acquisition device, which will not be elaborated upon in this example.
[0127] Optionally, the transmission device 706 described above is used to receive or send data via a network. Specific examples of the network described above may include wired networks and wireless networks. In one example, the transmission device 706 includes a Network Interface Controller (NIC), which can be connected to other network devices and a router via a network cable to communicate with the Internet or a local area network. In another example, the transmission device 706 is a radio frequency (RF) module, used for wireless communication with the Internet.
[0128] In addition, the aforementioned electronic device also includes: a display 708 for displaying information such as the first target image, image adjustment request, and second target image; and a connection bus 710 for connecting various module components in the aforementioned electronic device.
[0129] In other embodiments, the aforementioned terminal device or server can be a node in a distributed system, wherein the distributed system can be a blockchain system, which is a distributed system formed by connecting multiple nodes through network communication. The nodes can form a peer-to-peer (P2P) network, and any form of computing device, such as a server, terminal, or other electronic device, can become a node in the blockchain system by joining this peer-to-peer network.
[0130] According to one aspect of this application, a computer program product is provided, comprising a computer program / instructions containing program code for performing the methods shown in the flowchart. In such embodiments, the computer program can be downloaded and installed from a network via a communication component, and / or installed from a removable medium. When the computer program is executed by a central processing unit, it performs various functions provided in embodiments of this application.
[0131] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0132] According to one aspect of this application, a computer-readable storage medium is provided, wherein a processor of a computer device reads computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the above-described method for acquiring a target image.
[0133] Optionally, in this embodiment, the computer-readable storage medium described above may be configured to store a computer program for performing the following steps:
[0134] S1, Display a first target image, wherein the first target image contains at least two image elements of the target object;
[0135] S2, obtain the image adjustment request triggered on the first target image, wherein the image adjustment request is used to request that the original image elements of the target object be adjusted to the image elements exhibited by the target object when performing the target action;
[0136] S3, in response to the image adjustment request, obtain the target grid corresponding to the element type of the target original image element, wherein the target grid is used to determine the region image in the first target image that is adjusted in response to the image adjustment request;
[0137] S4, determine the target region image containing elements of the original target image from the first target image based on the target grid;
[0138] S5, adjust the target region image in the first target image according to the element change data corresponding to the target action to obtain the second target image.
[0139] Optionally, in this embodiment, those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0140] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0141] If the integrated units in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in the aforementioned computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention.
[0142] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0143] In the several embodiments provided in this application, it should be understood that the disclosed client can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection between units or modules, and may be electrical or other forms.
[0144] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0145] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0146] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method of acquiring a target image, characterized by, The method comprises the following steps: displaying a first target image, wherein the first target image contains at least two image elements of a target object; obtaining an image adjustment request triggered by the first target image, wherein the image adjustment request is used to request adjusting target original image elements of the target object to image elements of the target object when a target action is performed, and the target action is a to-be-performed action determined in response to the image adjustment request triggered by the first target image; in response to the image adjustment request, obtaining a first grid corresponding to an element type of a first original image element and a second grid corresponding to an element type of a second original image element, wherein the first grid and the second grid are used to determine region images in the first target image that are adjusted in response to the image adjustment request, and the target original image elements include the first original image element and the second original image element; determining a first region image containing the first original image element from the first target image according to the first grid, and determining a second region image containing the second original image element from the first target image according to the second grid; adjusting the first region image in the first target image according to element change data corresponding to a first action, and adjusting the second region image in the first target image according to element change data corresponding to a second action, to obtain a first target layer, wherein the change data is used to represent a change intensity of an image element, and the target action includes the first action corresponding to the first original image element and the second action corresponding to the second original image element; obtaining a second original layer of the first target image, and adjusting the transparency of the second original layer according to a first transparency of the first target layer to obtain a second original layer with a second transparency; integrating the first target layer with the first transparency and the second original layer with the second transparency to obtain a second target image.
2. The method of claim 1, wherein, After the step of obtaining the image adjustment request triggered by the first target image, the method comprises the following steps: in response to the image adjustment request, obtaining a target grid structure corresponding to an element type of the target original image element; inputting the first target image into the target grid structure to obtain the second target image output by the target grid structure.
3. The method of claim 2, wherein, Before the step of inputting the first target image into the target grid structure, the method comprises the following steps: performing down-sampling processing on the first target image to obtain a target image with a target resolution; performing merging processing on the target image with the target resolution and element change data corresponding to the target action in a target dimension of a matrix to obtain target image data; performing up-sampling processing on the target image data to obtain a target image with a resolution matched with the target grid structure, wherein the target image with the resolution matched with the target grid structure is the first target image input into the target grid structure.
4. An apparatus for acquiring a target image, characterized by comprising: The method comprises the following steps: a display unit is configured to display a first target image, wherein the first target image contains at least two image elements of a target object; The first obtaining unit is configured to obtain an image adjustment request triggered by the first target image, wherein the image adjustment request is used to request adjustment of a target original image element of the target object to an image element exhibited by the target object when performing a target action, and the target action is a to-be-performed action determined in response to the image adjustment request triggered by the first target image. The second obtaining unit is configured to obtain a first grid corresponding to an element type of a first original image element and a second grid corresponding to an element type of a second original image element, wherein the first grid and the second grid are used to determine a region image in the first target image that is adjusted in response to the image adjustment request, and the target original image element includes the first original image element and the second original image element. The first determining unit is configured to determine a first region image containing the first original image element from the first target image according to the first grid and determine a second region image containing the second original image element from the first target image according to the second grid. The first adjusting unit is configured to adjust the first region image in the first target image according to element change data corresponding to a first action and adjust the second region image in the first target image according to element change data corresponding to a second action to obtain a first target layer, wherein the change data is used to represent a change intensity of an image element, the target action includes the first action corresponding to the first original image element and the second action corresponding to the second original image element; obtain a second original layer of the first target image, adjust a transparency of the second original layer according to a first transparency of the first target layer to obtain a second original layer with a second transparency; and integrate the first target layer with the first transparency and the second original layer with the second transparency to obtain a second target image.
5. A computer readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program performs the method described in any one of claims 1 to 3 when executed.
6. An electronic device comprising a memory and a processor, characterized in that The memory stores a computer program, and the processor is configured to execute the method described in any one of claims 1 to 3 by using the computer program.
Citation Information
Patent Citations
Image processing method, image processing apparatus, and mobile terminal
CN109064390A
Image enhancement method and device and storage medium
CN109919869A
Image data display method and device, image data live broadcast method and device, electronic equipment and storage medium
CN111652022A