Image display method, apparatus and device, and electronic device and storage medium
By generating target images, the display problem caused by inconsistent resolution was solved, achieving an effect without stretching, distortion, or unclear display on display devices, thus improving the user's visual experience.
Patent Information
- Application Number
- PCT/CN2024/073329
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-01-19
- Publication Date
- 2026-02-19
AI Technical Summary
When the resolution of the original image is inconsistent with the resolution of the display device, problems such as black borders, image stretching and distortion, or unclear display may occur, resulting in a poor visual experience for users.
By acquiring the original image and the resolution of the display device, a target image is generated. The image resolution is then adjusted using an image generation model to adapt it to the resolution of the display device. This includes determining the overlap resolution and difference value, generating foreground and background images for stitching, and adjusting the resolution to generate the target image.
It enables full-screen display of target images on display devices without stretching, distortion, or unclear display, thus improving the user's visual experience.
Smart Images

Figure CN2024073329_19022026_PF_FP_ABST
Abstract
Description
Image display method, device, apparatus, electronic device, and storage medium TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of display, and in particular, to an image display method, device, apparatus, electronic device, and storage medium. BACKGROUND
[0002] In application scenarios such as commercial display or information publishing, there is a demand to display the original image such as a poster produced on different display devices. However, in the case where the resolution of the original image is inconsistent with the resolution of the display device, and the original image is put into the display device, there are problems such as black edges, image stretching and deformation, or unclear display, which brings poor visual experience to users.
[0003] SUMMARY
[0004] Therefore, the present disclosure provides an image display method, device, apparatus, electronic device, and storage medium.
[0005] According to an aspect of the present disclosure, an image display method is provided, including: obtaining an original resolution of an original image and a target resolution of a display device; generating a target image according to the original image, the original resolution, and the target resolution; and sending the target image to the display device so that the display device displays the target image.
[0006] For example, the original resolution includes an original pixel width and an original pixel height, and the target resolution includes a target pixel width and a target pixel height; the generating a target image according to the original image, the original resolution, and the target resolution includes: determining a first height ratio between the target pixel height and the original pixel height; determining a first width ratio between the target pixel width and the original pixel width; determining a coincidence resolution according to the first height ratio, the first width ratio, the original resolution, and the target resolution; determining a difference value according to a ratio between the coincidence resolution and the target resolution; and generating the target image according to the difference value, the original image, and the target resolution.
[0007] For example, the determining a coincidence resolution according to the first height ratio, the first width ratio, the original resolution, and the target resolution includes, in the case where the first height ratio is less than or equal to the first width ratio: determining the target pixel height as a height of the coincidence resolution; and determining a width of the coincidence resolution according to the height of the coincidence resolution, the original pixel height, and the original pixel width.
[0008] For example, the determining the coincidence resolution according to the first height ratio, the first width ratio, the original resolution and the target resolution further includes, in a case that the first height ratio is greater than the first width ratio: determining the target pixel width as a width of the coincidence resolution; and determining a height of the coincidence resolution according to the width of the coincidence resolution, the original pixel width and the original pixel height.
[0009] For example, the generating the target image according to the difference value, the original image and the target resolution includes, in a case that the difference value is less than a preset threshold: determining a target region in the original image, wherein the target region includes a target element; generating a foreground image according to the target region and the original image; generating a background image according to the target region, the original image and the target resolution; splicing the background image and the foreground image to obtain a rearranged image; and adjusting a resolution of the rearranged image according to the target resolution and the rearranged image to generate the target image.
[0010] For example, the generating the background image according to the target region, the original image and the target resolution includes: inputting the original image and a pixel position corresponding to the target region into an image generation model to obtain an initial background image, wherein a resolution of the initial background image is equal to the original resolution; performing downsampling on the initial background image by a first preset multiple to obtain a low-resolution background image; determining a first conversion resolution according to a width and a height of the low-resolution background image and the target resolution; and inputting the low-resolution background image and the first conversion resolution into the image generation model to generate the background image, wherein a resolution of the background image is the first conversion resolution.
[0011] For example, the determining the first conversion resolution according to the width and the height of the low-resolution background image and the target resolution includes: determining a second width ratio between the target pixel width and the width of the low-resolution background image; determining a second height ratio between the target pixel height and the height of the low-resolution background image; in a case that the second height ratio is greater than or equal to the second width ratio, determining the height of the low-resolution background image as a height of the first conversion resolution; and determining a width of the first conversion resolution according to a ratio between the target pixel width and the target pixel height and the height of the first conversion resolution.
[0012] For example, the determining the first conversion resolution according to the width and the height of the low-resolution background image and the target resolution further includes: in a case where the second height ratio is less than the second width ratio, determining the width of the low-resolution background image as the width of the first conversion resolution; and determining the height of the first conversion resolution according to a ratio between the target pixel height and the target pixel width and the width of the first conversion resolution.
[0013] For example, the generating the target image according to the original image, the original resolution and the target resolution includes: performing second preset multiple down-sampling on the original image to obtain a low-resolution image; determining a second conversion resolution according to the width and the height of the low-resolution image and the target resolution; inputting the down-sampled original image and the second conversion resolution into an image generation model to generate an intermediate conversion image, where a resolution of the intermediate conversion image is the second conversion resolution; and adjusting the resolution of the intermediate conversion image according to the target resolution and the intermediate conversion image to generate the target image.
[0014] For example, the determining the second conversion resolution according to the width and the height of the low-resolution image and the target resolution includes: determining a third width ratio between the target pixel width and the width of the low-resolution image; determining a third height ratio between the target pixel height and the height of the low-resolution image; in a case where the third height ratio is greater than or equal to the third width ratio, determining the height of the low-resolution image as the height of the second conversion resolution; and determining the width of the second conversion resolution according to a ratio between the target pixel width and the target pixel height and the height of the second conversion resolution.
[0015] For example, the determining the second conversion resolution according to the width and the height of the low-resolution image and the target resolution further includes, in a case where the third height ratio is less than the third width ratio: determining the width of the low-resolution image as the width of the second conversion resolution; and determining the height of the second conversion resolution according to a ratio between the target pixel height and the target pixel width and the width of the second conversion resolution.
[0016] For example, the inputting the low-resolution background image and the first conversion resolution into the image generation model to generate the background image includes: obtaining a first preset prompt word and a first preset model parameter; and inputting the low-resolution background image, the first preset prompt word, the first preset model parameter and the first conversion resolution into the image generation model to generate the background image.
[0017] For example, the generating the intermediate conversion image based on the down-sampled original image and the second conversion resolution input image generation model includes: obtaining a second preset prompt word and a second preset model parameter; and inputting the down-sampled original image, the second preset prompt word, the second preset model parameter, and the second conversion resolution input image generation model to generate the intermediate conversion image.
[0018] For example, the generating the foreground image based on the target region and the original image includes: inputting the original image and a pixel position corresponding to the target region into an image segmentation model to generate the foreground image.
[0019] For example, the method further includes: determining the first preset model parameter, the first preset multiple, the first preset prompt word, the second preset model parameter, the second preset multiple, and the second preset prompt word based on the original image and configuration parameters related to a generation effect and a generation speed of the image generation model from a client.
[0020] For example, the configuration parameters include at least one of a generation style, a generation speed, a generation creativity, a generation content text description, and the target resolution; and the first preset model parameter and the second preset model parameter each include at least one of an extended pixel number, a mask blur degree, an image extension direction, a decay index, a color change degree parameter, a sampling method, a sampling step, a denoising intensity, and a prompt word relevance degree.
[0021] According to another aspect of the present disclosure, there is provided an image display apparatus including: an obtaining module configured to obtain an original resolution of an original image and a target resolution of a display apparatus; a generating module configured to generate a target image based on the original image, the original resolution, and the target resolution; and a display module configured to transmit the target image to the display apparatus so that the display apparatus displays the target image.
[0022] According to another aspect of the present disclosure, there is provided an electronic device including: one or more processors; and a storage configured to store one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform any of the methods.
[0023] According to another aspect of the present disclosure, there is provided an image display apparatus including: the electronic device; and a display apparatus configured to obtain a target image from the electronic device and display the target image.
[0024] According to another aspect of the present disclosure, there is provided a computer readable storage medium having stored thereon executable instructions that, as a result of being executed by a processor, cause the processor to carry out any of the methods described above.
[0025] According to another aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, carries out any of the methods described above.
[0026] It should be understood that the matters described herein are intended to be illustrative rather than limiting. The scope of the present disclosure is to be determined by the following claims.
[0027] According to embodiments of the present disclosure, after obtaining the original resolution of the original image and the target resolution of the display device, a target image is generated according to the original image, the original resolution and the target resolution, the original image is expanded to the target resolution based on the difference between the original resolution and the target resolution to obtain a target image with the target resolution, so that when the target image is sent to the display device and the display device displays the target image, the display device can display the target image in full screen without stretching deformation or unclear display, thereby providing a better visual experience for the user. BRIEF DESCRIPTION OF DRAWINGS
[0028] The accompanying drawings are included to provide a further understanding of the present scheme and are incorporated in and constitute a part of this specification. Among other things:
[0029] FIG. 1 schematically shows a diagram of a display device directly displaying an original image;
[0030] FIG. 2 schematically shows an application scenario diagram of an image display method according to embodiments of the present disclosure;
[0031] FIG. 3 schematically shows a flowchart of an image display method according to embodiments of the present disclosure;
[0032] FIG. 4(A) schematically shows a diagram of an original image according to embodiments of the present disclosure;
[0033] FIG. 4(B) schematically shows a diagram of an original marked image according to embodiments of the present disclosure;
[0034] FIG. 4(C) schematically shows a diagram of a foreground image according to embodiments of the present disclosure;
[0035] FIG. 4(D) schematically shows a diagram of an initial background image according to embodiments of the present disclosure;
[0036] FIG. 4(E) schematically shows a diagram of a background image according to embodiments of the present disclosure;
[0037] FIG. 4(F) schematically shows a schematic diagram of rearranging images according to an embodiment of the present disclosure;
[0038] FIG. 5(A) schematically shows a schematic diagram of a display device according to an embodiment of the present disclosure;
[0039] FIG. 5(B) schematically shows a schematic diagram of a display device directly displaying original images according to an embodiment of the present disclosure;
[0040] FIG. 5(C) schematically shows a schematic diagram of a display device displaying target images after the image display method according to an embodiment of the present disclosure obtains the target images when the difference value is greater than or equal to a preset threshold value;
[0041] FIG. 6(A) schematically shows a schematic diagram of a display device displaying target images after the image display method according to an embodiment of the present disclosure obtains the target images when the difference value is greater than or equal to a preset threshold value;
[0042] FIG. 6(B) schematically shows a schematic diagram of a local enlarged original image and a target image according to an embodiment of the present disclosure;
[0043] FIG. 7(A) schematically shows a schematic diagram of an original image according to an embodiment of the present disclosure;
[0044] FIG. 7(B) schematically shows a schematic diagram of a target image obtained by the image display method according to an embodiment of the present disclosure when the difference value is greater than or equal to a preset threshold value;
[0045] FIG. 7(C) schematically shows a schematic diagram of an original image according to an embodiment of the present disclosure;
[0046] FIG. 7(D) schematically shows a schematic diagram of a target image obtained by the image display method according to an embodiment of the present disclosure when the difference value is greater than or equal to a preset threshold value;
[0047] FIG. 7(E) schematically shows a schematic diagram of an original image according to an embodiment of the present disclosure;
[0048] FIG. 7(F) schematically shows a schematic diagram of a target image obtained by the image display method according to an embodiment of the present disclosure when the difference value is greater than or equal to a preset threshold value;
[0049] FIG. 7(G) schematically shows a schematic diagram of an original image according to an embodiment of the present disclosure;
[0050] FIG. 7(H) schematically shows a schematic diagram of a target image obtained by the image display method according to an embodiment of the present disclosure when the difference value is greater than or equal to a preset threshold value;
[0051] FIG. 8 schematically illustrates a system architecture diagram of an image display method according to an embodiment of the disclosure;
[0052] FIG. 9 schematically illustrates a schematic diagram of a function interface of AI image generation according to an embodiment of the disclosure;
[0053] FIG. 10 schematically illustrates a schematic diagram of an image intelligent filling function interface according to an embodiment of the disclosure;
[0054] FIG. 11 schematically illustrates a flowchart of an image display method according to another embodiment of the disclosure;
[0055] FIG. 12 schematically illustrates a flowchart of an image display method according to yet another embodiment of the disclosure;
[0056] FIG. 13 schematically illustrates a structural block diagram of an image display apparatus according to an embodiment of the disclosure;
[0057] FIG. 14 schematically illustrates a block diagram of an electronic device suitable for implementing an image display method according to an embodiment of the disclosure; and
[0058] FIG. 15 schematically illustrates a schematic diagram of an image display device according to an embodiment of the disclosure. DETAILED DESCRIPTION
[0059] To make the objectives, technical solutions, and advantages of the embodiments of the disclosure clearer, the technical solutions in the embodiments of the disclosure will be described clearly and completely below with reference to the drawings in the embodiments of the disclosure. Obviously, the described embodiments are only a part of the embodiments of the disclosure, rather than all. Based on the described embodiments of the disclosure, all other embodiments obtained by a person of ordinary skill in the art without any inventive effort fall within the scope of protection of the disclosure. It should be noted that throughout the drawings, the same elements are denoted by the same or similar reference numerals. In the following description, some specific embodiments are used only for the purpose of description, and should not be understood as any limitation on the disclosure, but only as examples of the embodiments of the disclosure. When it is possible to cause confusion to the understanding of the disclosure, conventional structures or configurations will be omitted. It should be noted that the shapes and sizes of the components in the drawings do not reflect the true size and ratio, but only illustrate the content of the embodiments of the disclosure.
[0060] Unless otherwise defined, the technical terms or scientific terms used in the embodiments of the disclosure should be understood as the general meaning understood by a person of ordinary skill in the art. The "first", "second", and similar words used in the embodiments of the disclosure do not represent any order, number, or importance, but are only used to distinguish different components.
[0061] FIG. 1 schematically illustrates a schematic diagram of a display apparatus directly displaying an original image.
[0062] As shown in FIG. 1, in a case where the original image 101 is projected to a display device in a situation that the resolution of the original image 101 is inconsistent with the resolution of the display device, the original image 101 is displayed at a display area 103 of the display device, and black edges are displayed at a display area 102 and a display area 104 of the display device, and the visual experience is poor.
[0063] Further, in a case where the original image is projected to a display device in a situation that the resolution of the original image is inconsistent with the resolution of the display device, in addition to the problem of displaying black edges in FIG. 1, there will also be a problem of image stretching deformation or unclear display, which will bring poor visual experience to the user. If the original image is manually adjusted artificially to make the original image suitable for the display device, the cost is high and the efficiency is low. Therefore, it is urgent to find an efficient method for adjusting the original image, so that the adjusted original image can be suitable for display on a display device of any scale, and can bring better visual experience to the user.
[0064] Embodiments of the present disclosure provide an image display method, device, equipment, electronic equipment and storage medium, which can be applied to the technical field of display.
[0065] Embodiments of the present disclosure provide an image display method, which comprises: obtaining an original resolution of an original image and a target resolution of a display device; generating a target image according to the original image, the original resolution and the target resolution; and sending the target image to the display device, so that the display device displays the target image.
[0066] FIG. 2 schematically shows an application scenario diagram of an image display method according to an embodiment of the present disclosure.
[0067] As shown in FIG. 2, an application scenario 200 according to this embodiment can include a first terminal device 201, a second terminal device 202, a third terminal device 203, a network 204, a server 205 and a commercial display screen 206. The network 104 is a medium for providing a communication link between the first terminal device 201, the second terminal device 202, the third terminal device 203, the server 205 and the commercial display screen 206. The network 204 can include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0068] A user can use at least one of the first terminal device 201, the second terminal device 202 and the third terminal device 203 to interact with the server 205 through the network 204 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 201, the second terminal device 202 and the third terminal device 203, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, messaging system web management applications, etc. (only as examples).
[0069] The first terminal device 201, the second terminal device 202, and the third terminal device 203 can be various electronic devices with a display screen and supporting web browsing, including but not limited to a smart phone, a tablet computer, a laptop computer, a desktop computer, and the like.
[0070] The server 205 can be a server providing various services. For example, the server 205 can be a background management server supporting a messaging system webpage management application operated by a user using the first terminal device 201, the second terminal device 202, and the third terminal device 203. The background management server can analyze and process received user requests and the like, and feed back the processing results to the terminal device or display the processing results on the commercial display screen 206.
[0071] The commercial display screen 206 can be a single display screen, a spliced screen, or a curved screen, and the like, for displaying a target file or a target image generated after the server 205 processes received user requests and the like.
[0072] For example, the network 204 can be a communication link taking a messaging box as an intermediate medium, where the messaging box can be a hardware terminal device connectable to a kiosk, the commercial display screen 206, or other display hardware devices, and a messaging publishing terminal software can be installed in the device. A user can operate a messaging system webpage management application using the first terminal device 201, the second terminal device 202, and the third terminal device 203 to generate a file processing request or an image display request, and send the file processing request or the image display request to the server 205 through the messaging box. The server 205 can receive the file processing request or the image display request and the like sent by the user through the messaging box, analyze and process the file processing request or the image display request and the like sent by the user, feed back the processing results (for example, a target file or a target image generated according to the user request) to the terminal device, and at the same time, send the target file or the target image to the commercial display screen 206 through the messaging box, and display the target file or the target image on the commercial display screen 206.
[0073] It should be noted that the image display method provided by the embodiments of the present disclosure can be generally executed by the server 205. Accordingly, the image display apparatus provided by the embodiments of the present disclosure can be generally arranged in the server 205. The image display method provided by the embodiments of the present disclosure can also be executed by a server or a server cluster different from the server 205 and capable of communicating with the first terminal device 201, the second terminal device 202, the third terminal device 203 and / or the server 205. Accordingly, the image display apparatus provided by the embodiments of the present disclosure can also be arranged in a server or a server cluster different from the server 205 and capable of communicating with the first terminal device 201, the second terminal device 202, the third terminal device 203 and / or the server 205.
[0074] It should be understood that the number of terminal devices, networks and servers in FIG. 2 is only illustrative. According to the implementation needs, there can be any number of terminal devices, networks and servers.
[0075] FIG. 3 schematically shows a flowchart of an image display method according to an embodiment of the present disclosure.
[0076] As shown in FIG. 3, the image display method of this embodiment includes operation S310 to operation S330.
[0077] In operation S310, the original resolution of the original image and the target resolution of the display apparatus are acquired.
[0078] According to an embodiment of the present disclosure, the display apparatus can include at least one display screen.
[0079] For example, the display apparatus can be a single display screen such as a digital signage, or a tiled screen composed of four single display screens with the same resolution.
[0080] In operation S320, the target image is generated according to the original image, the original resolution and the target resolution.
[0081] According to an embodiment of the present disclosure, the difference in aspect ratio between the original image and the target image can be determined according to the original resolution and the target resolution, and then the original image can be expanded to the target resolution to obtain the target image by using different strategies according to the difference in aspect ratio, so that the target image can be better adapted to display on the display apparatus.
[0082] According to an embodiment of the present disclosure, the resolution of the target image is the target resolution.
[0083] In operation S330, the target image is sent to the display apparatus so that the display apparatus displays the target image.
[0084] According to an embodiment of the present disclosure, the resolution of the target image is the same as the resolution of the display device, both of which are target resolutions, so that the display device can display the target image in full screen without stretching deformation or unclear display.
[0085] According to an embodiment of the present disclosure, after obtaining the original resolution of the original image and the target resolution of the display device, the target image is generated according to the original image, the original resolution and the target resolution, so that the original image is expanded to the target resolution based on the difference between the original resolution and the target resolution, and the target image with the target resolution is obtained, so that when the target image is sent to the display device and the display device displays the target image, the display device can display the target image in full screen without stretching deformation or unclear display, thereby providing a better visual experience for the user.
[0086] According to an embodiment of the present disclosure, the original resolution includes an original pixel width and an original pixel height, and the target resolution includes a target pixel width and a target pixel height. For operation S320 as shown in FIG. 3, the target image is generated according to the original image, the original resolution and the target resolution, which can include the following operations: determining a first height ratio between the target pixel height and the original pixel height; determining a first width ratio between the target pixel width and the original pixel width; determining a coincidence resolution according to the first height ratio, the first width ratio, the original resolution and the target resolution; determining a difference value according to the ratio between the coincidence resolution and the target resolution; and generating the target image according to the difference value, the original image and the target resolution.
[0087] According to an embodiment of the present disclosure, the coincidence resolution represents the maximum resolution with the same aspect ratio as the original resolution and coinciding with the target resolution in the pixel width or pixel height direction. The coincidence resolution represents the maximum resolution without regenerating the content when the original image is expanded to the target resolution.
[0088] According to an embodiment of the present disclosure, the target pixel height can be divided by the original pixel height to obtain the first height ratio. The target pixel width can be divided by the original pixel width to obtain the first width ratio. The coincidence resolution can be divided by the target resolution to obtain the difference value.
[0089] For example, the first width ratio can be obtained according to formula (1), and the first height ratio can be obtained according to formula (2).
[0090] wherein, w d represents the target pixel width, w o represents the original pixel width, h d represents the target pixel height, h o represents the original pixel height.
[0091] According to embodiments of this disclosure, determining the overlapping resolution based on a first height ratio, a first width ratio, the original resolution, and the target resolution includes, when the first height ratio is less than or equal to the first width ratio: determining the target pixel height as the height of the overlapping resolution; and determining the width of the overlapping resolution based on the height of the overlapping resolution, the original pixel height, and the original pixel width.
[0092] According to embodiments of this disclosure, determining the width of the overlapping resolution based on the height of the overlapping resolution, the original pixel height, and the original pixel width includes: determining the width of the overlapping resolution based on the ratio between the height of the overlapping resolution and the original pixel height, and the original pixel width.
[0093] According to embodiments of this disclosure, the width of the overlapping resolution can be obtained by multiplying the ratio between the height of the overlapping resolution and the height of the original pixel by the width of the original pixel. Alternatively, the overlapping resolution can be obtained by multiplying its height by its width.
[0094] For example, it can be In the case of [the condition], the height of the overlapping resolution is determined according to formula (3), the width of the overlapping resolution is determined according to formula (4), and the difference value is obtained according to formula (5). h′ o =h d (3) w′ o =w o *h′ o / h o (4)
[0095] Where, h′ o The height representing the overlap resolution, w′ o The width represents the overlap resolution, and Δ represents the difference value.
[0096] According to embodiments of this disclosure, when the first height ratio is less than or equal to the first width ratio, the target pixel height is determined as the height of the overlapping resolution, and the width of the overlapping resolution is determined based on the overlapping resolution height, the original pixel height, and the original pixel width. Thus, the overlapping resolution characterizes the maximum resolution at which content does not need to be regenerated when the original image is expanded to the target resolution. Subsequently, the overlapping resolution is compared with the target resolution to determine a difference value, which characterizes the amount of data that needs to be regenerated to fill the content when the original image expanded to the overlapping resolution is further expanded to the target resolution.
[0097] According to embodiments of this disclosure, determining the overlapping resolution based on the first height ratio, the first width ratio, the original resolution, and the target resolution further includes, when the first height ratio is greater than the first width ratio: determining the target pixel width as the width of the overlapping resolution; and determining the height of the overlapping resolution based on the width of the overlapping resolution, the original pixel width, and the original pixel height.
[0098] According to embodiments of this disclosure, the height of the overlapping resolution is determined based on the width of the overlapping resolution, the width of the original pixel, and the height of the original pixel; the height of the overlapping resolution is also determined based on the ratio between the width of the overlapping resolution and the width of the original pixel, and the height of the original pixel.
[0099] According to embodiments of this disclosure, the height of the overlapping resolution can be obtained by multiplying the ratio between the width of the overlapping resolution and the width of the original pixel by the height of the original pixel.
[0100] For example, it can be In the case of [the condition], the height of the overlapping resolution is determined according to formula (6), the width of the overlapping resolution is determined according to formula (7), and the difference value is obtained according to formula (8). w′ o =w d (6) h′ o =h o *w′ o / w o (7)
[0101] According to embodiments of this disclosure, when the first height ratio is greater than the first width ratio, the target pixel width is determined as the width of the overlapping resolution, and the height of the overlapping resolution is determined based on the width of the overlapping resolution, the original pixel width, and the original pixel height. Thus, the overlapping resolution represents the maximum resolution at which content does not need to be regenerated when the original image is expanded to the target resolution. Subsequently, the overlapping resolution is compared with the target resolution to determine a difference value, which represents the amount of data that needs to be regenerated to fill the content when the original image expanded to the overlapping resolution is further expanded to the target resolution.
[0102] According to embodiments of this disclosure, when a large amount of data needs to be regenerated to fill in content, i.e., the difference value is small (e.g., expanding the aspect ratio from 9:16 to 16:9), directly expanding the background of the original image using an image generation model results in a more uncontrollable effect and a worse user visual experience. Furthermore, significant expansion is aesthetically unappealing for poster scenarios. Therefore, considering both technical implementation and product requirements, a preset threshold can be set to determine whether content needs to be rearranged for scenarios such as advertisements and posters that require large amounts of content generation.
[0103] According to an embodiment of the present disclosure, the generating the target image according to the difference value, the original image and the target resolution can comprise: determining a target region in the original image in a case that the difference value is less than a preset threshold, wherein the target region comprises the target element; generating a foreground image according to the target region and the original image; generating a background image according to the target region, the original image and the target resolution; splicing the background image and the foreground image to obtain a rearranged image; and adjusting the resolution of the rearranged image according to the target resolution and the rearranged image to generate the target image.
[0104] In a case that the difference value is less than the preset threshold, the original resolution of the original image is greatly different from the aspect ratio of the target resolution, and more filling content needs to be regenerated.
[0105] The preset threshold can be selected according to actual conditions, which is not limited herein. For example, the preset threshold can be 0.5, 0.6 or 0.7, etc.
[0106] According to an embodiment of the present disclosure, the foreground image comprises the target element, and the background image does not comprise the target element.
[0107] According to an embodiment of the present disclosure, the target element can be a target product in target promotion. For example, the target element can be a target advertising product in advertising promotion.
[0108] The resolution of the background image is the same as the aspect ratio of the target resolution, and the resolution of the background image is less than the target resolution. The number of the background image can be 1, or greater than or equal to 2.
[0109] In a case that the number of the background image is greater than or equal to 2, the multiple background images can be displayed on the client. In response to a selection operation of the client, a background image selected by the client is obtained, and then the subsequent splicing and resolution adjustment operations are performed on the background image selected by the client, so as to realize a deeper interaction with the user, and avoid that the user waits for too long in the process of generating the target image, thereby bringing a bad experience to the user. Therefore, the user satisfaction can be further improved through the interactive design.
[0110] The original mark image can be obtained in response to a mark operation of the client, and then the target region in the original image is determined according to the original mark image.
[0111] According to an embodiment of the present disclosure, the splicing of the background image and the foreground image to obtain the rearranged image comprises: superimposing the foreground image and the background image to obtain a superimposed image, in the case that the proportion of the foreground image in the superimposed image is inconsistent with the proportion of the foreground image in the original image, up-sampling or down-sampling the background image to obtain an adjusted background image, and then superimposing the adjusted background image and the foreground image to obtain the rearranged image. In the case that the proportion of the foreground image in the superimposed image is consistent with the proportion of the foreground image in the original image, the superimposed image is determined as the rearranged image.
[0112] For example, in the case that the proportion of the foreground image in the original image is greater than the proportion of the foreground image in the superimposed image, the background image can be down-sampled to obtain the adjusted background image. In the case that the proportion of the foreground image in the original image is less than the proportion of the foreground image in the superimposed image, the background image can be up-sampled to obtain the adjusted background image.
[0113] For example, the target element included in the foreground image can be a beverage, and the background image can be a beach. In the case that the proportion of the foreground image to the background image in the original image is greatly different, the difference value between the original image and the target image is less than a preset threshold, and the display device is a splicing screen, the target region in the original image can be determined first, wherein the target region includes the target element beverage. Then, the foreground image is generated according to the target region and the original image, wherein the foreground image includes the beverage. The background image is generated according to the target region, the original image and the target resolution, and the beach not including the beverage is generated.
[0114] Then, the foreground image and the background image are superimposed to obtain a superimposed image, in the case that the proportion of the beverage in the foreground image in the superimposed image is inconsistent with the proportion of the beverage in the foreground image in the original image, the background image is up-sampled or down-sampled to obtain an adjusted background image, and then the adjusted background image and the foreground image are superimposed to obtain a rearranged image. In the case that the proportion of the beverage in the foreground image in the superimposed image is consistent with the proportion of the beverage in the foreground image in the original image, the superimposed image is determined as the rearranged image. Then, the resolution of the rearranged image is adjusted according to the target resolution and the rearranged image to generate a target image. The target image is sent to the splicing screen so that the splicing screen displays the target image.
[0115] According to an embodiment of the present disclosure, in the case that the proportion of the foreground image in the superimposed image is inconsistent with the proportion of the foreground image in the original image, the background image is up-sampled or down-sampled to obtain an adjusted background image, and then the adjusted background image and the foreground image are superimposed to obtain a rearranged image, the rearranged image can be obtained without adjusting the foreground image and only adjusting the background image, so that the content details of the target element in the rearranged image can be guaranteed not to be lost or deformed.
[0116] The target resolution and the rearranged image can be input into an image super-resolution model, and the resolution of the rearranged image is adjusted to the target resolution by using the image super-resolution model to obtain a target image.
[0117] According to an embodiment of the present disclosure, the image super-resolution model can be selected according to actual conditions, which is not limited herein. For example, the image super-resolution model can be a blind image super-resolution model (Real-ESRGAN, Enhanced Super-Resolution GAN).
[0118] According to an embodiment of the present disclosure, the resolution of the rearranged image is adjusted to the target resolution by using the image super-resolution model to obtain a target image, which can quickly obtain a super-resolution target image that is closer to the original image and has higher contrast and clarity.
[0119] According to an embodiment of the present disclosure, in the case that the difference value is less than the preset threshold, it is indicated that a large amount of padding content needs to be regenerated in the case of expanding the original image to the target resolution. Therefore, the target region in the original image can be determined first, and a foreground image including the target element is generated according to the target region and the original image, so as to ensure that the target element in the foreground image is unchanged. A background image is generated according to the target region, the original image and the target resolution, so as to remove the target element in the original image and generate a background image with the same width-height ratio of resolution as the target resolution width-height ratio based on the background region in the original image. Then, the background image and the foreground image are spliced to obtain a rearranged image, so as to obtain a rearranged image including a large amount of target element details and having the same width-height ratio of resolution as the target pixel width-height ratio. Then, the resolution of the rearranged image is adjusted according to the target resolution and the rearranged image, so as to quickly improve the resolution of the rearranged image to the target resolution, and quickly generate a target image.
[0120] According to an embodiment of the present disclosure, before the foreground image is generated, a mask matrix can be generated according to the original image and the target region, so as to record the pixel position of the target region in the original image in the mask matrix, wherein the size of the mask matrix is the same as the original resolution, and 1 can be used to represent the pixel position where the target region is located, and 0 can be used to represent the pixel position where the background is located.
[0121] According to an embodiment of the present disclosure, the foreground image is generated according to the target region and the original image, including: inputting the original image and the pixel position corresponding to the target region into an image segmentation model to generate the foreground image.
[0122] According to an embodiment of the present disclosure, the foreground image is generated by inputting the original image and the pixel position corresponding to the target region into an image segmentation model, including: inputting the original image and the mask matrix into the image segmentation model to generate the foreground image.
[0123] The image segmentation model can be selected according to actual conditions, and is not limited herein. For example, the image segmentation model can be a segment anything model (SAM).
[0124] FIG. 4(A) schematically shows a schematic diagram of an original image according to an embodiment of the present disclosure. FIG. 4(B) schematically shows a schematic diagram of an original marked image according to an embodiment of the present disclosure. FIG. 4(C) schematically shows a schematic diagram of a foreground image according to an embodiment of the present disclosure.
[0125] As shown in FIG. 4(A), the original image can include a foreground region 401 and a background region 402.
[0126] According to an embodiment of the present disclosure, after a user marks the original image on the client, the original marked image shown in FIG. 4(B) can be obtained in response to the marking operation of the client. As shown in FIG. 4(B), the original marked image can include a target region 401_1 and a background region 402. The target region 401_1 in the original image can be determined according to the original marked image as shown in FIG. 4(B).
[0127] According to an embodiment of the present disclosure, after inputting the mask matrix corresponding to FIG. 4(B) and the image segmentation model of FIG. 4(A), the foreground image 401_2 corresponding to the foreground region 401 in FIG. 4(A) can be obtained.
[0128] According to an embodiment of the present disclosure, by inputting the original image and the pixel position corresponding to the target region into the image segmentation model, the foreground image is generated, and the foreground image can be quickly and accurately segmented from the original image.
[0129] According to an embodiment of the present disclosure, generating the background image according to the target region, the original image and the target resolution includes: inputting the original image and the pixel position corresponding to the target region into the image generation model to obtain an initial background image, wherein the resolution of the initial background image is equal to the original resolution; performing downsampling of the initial background image by a first preset multiple to obtain a low-resolution background image; determining a first conversion resolution according to the width and height of the low-resolution background image and the target resolution; inputting the low-resolution background image and the first conversion resolution into the image generation model to generate the background image, wherein the resolution of the background image is the first conversion resolution.
[0130] The image generation model can be selected according to actual conditions, and is not limited herein. For example, the image generation model can be a text-to-image generation model SD (stable diffusion) model.
[0131] The first preset multiple can be selected according to actual conditions, and is not limited herein. For example, the first preset multiple can be determined according to a generation speed and a generation effect of an image generation model expected by a user. The higher the expected generation speed, the greater the first preset multiple, and the worse the quality of the generated background image. The lower the expected generation speed, the smaller the first preset multiple, and the higher the quality of the generated background image.
[0132] According to an embodiment of the present disclosure, generating a background image by inputting a low-resolution background image and a first conversion resolution input image generation model comprises: obtaining a first preset prompt word and a first preset model parameter; and generating a background image by inputting the low-resolution background image, the first preset prompt word, the first preset model parameter and the first conversion resolution input image generation model.
[0133] According to an embodiment of the present disclosure, the first preset prompt word can comprise a positive prompt word and a negative prompt word. The positive prompt word represents content that the user expects to include in the background image, and the negative prompt word represents content that the user does not expect to appear in the background image.
[0134] According to an embodiment of the present disclosure, the first preset prompt word can be determined according to an original image input by the user on the client, content that the user expects to include in the expanded background image, and content that the user does not expect to appear in the expanded background image. The first preset model parameter is determined according to parameters configured by the user on the client.
[0135] For example, the positive prompt word can be generated according to the original image input by the user on the client, and the negative prompt word can be generated according to content that the user does not expect to appear in the expanded background image.
[0136] According to an embodiment of the present disclosure, the first preset prompt word is determined according to an original image input by the user on the client, content that the user expects to include in the expanded background image, and content that the user does not expect to appear in the expanded background image, thereby achieving the function of adding input prompt words on the client interface, so that the user can input the prompt words on the client interface. The prompt word intuitively represents the user's expansion requirements, so that the generated background image after inputting the low-resolution background image, the first preset prompt word, the first preset model parameter and the first conversion resolution input image generation model is more in line with the user's requirements.
[0137] According to an embodiment of the present disclosure, the preset weight can also be input into the image generation model together with the low-resolution background image, the first preset prompt word, the first preset model parameter and the first conversion resolution by presetting the weight through a program to generate the background image. For example, the weight corresponding to the prompt word included in the content input by the user can be set to 0.6, and the weight of the prompt word generated according to the original image can be set to 0.4.
[0138] The aspect ratio of the first conversion resolution is the same as the aspect ratio of the target image, and the first conversion resolution is less than the target resolution.
[0139] According to an embodiment of the present disclosure, inputting the original image and the pixel position corresponding to the target region into the image generation model to obtain the initial background image includes: inputting the original image and the mask matrix into the image generation model to obtain the initial background image. The initial background image does not include the target element.
[0140] FIG. 4(D) schematically shows a schematic diagram of an initial background image according to an embodiment of the present disclosure. FIG. 4(E) schematically shows a schematic diagram of a background image according to an embodiment of the present disclosure. FIG. 4(F) schematically shows a schematic diagram of a rearranged image according to an embodiment of the present disclosure.
[0141] In the case of configuring the image generation model into the inner expansion generation mode, after inputting the original image in FIG. 4(A), the mask matrix corresponding to FIG. 4(B), and the first preset type parameter into the image generation model, the initial background image 402_1 in FIG. 4(D) is obtained. In the inner expansion generation mode, the image generation model can generate the inner expansion content based on the background region of the original image. Wherein, the image generation model can determine the target region 401_1 and the background region 402 from the original image according to the mask matrix, and generate the inner expansion content based on the background region 402. The inner expansion content is filled in the target region 401_1 of the original image to obtain the initial background image 402_1 in FIG. 4(D).
[0142] After the initial background image 402_1 is down-sampled by the first preset multiple to obtain a low-resolution background image, and the first conversion resolution is determined according to the width and height of the low-resolution background image and the target resolution. The image generation model can be configured into the outer expansion generation mode, and the low-resolution background image, the first preset prompt word, the first preset model parameter and the first conversion resolution are input into the image generation model, and the background image 402_2 in FIG. 4(E) can be generated. In the outer expansion generation mode, the image generation model can generate the outer expansion content based on the low-resolution background image, and splice the outer expansion content with the low-resolution background image to obtain the background image 402_2 of the first conversion resolution.
[0143] Splicing the background image 402_2 in FIG. 4(E) and the foreground image 401_2 in FIG. 4(C) can obtain the rearranged image in FIG. 4(F). The rearranged image in FIG. 4(F) includes the foreground image 401_2 and the adjusted background image 402_3 obtained by down-sampling the background image in FIG. 4(E). Subsequently, the resolution of the rearranged image in FIG. 4(F) is adjusted to the target resolution by using the image super-resolution model, and the target image can be obtained.
[0144] According to an embodiment of the present disclosure, the original image and the pixel position corresponding to the target region are input into the image generation model to obtain an initial background image, and an initial background image with a resolution equal to the original resolution and not including the target element can be obtained. Then, the initial background image is down-sampled by a first preset multiple to obtain a low-resolution background image, and according to the width and height of the low-resolution background image and the target resolution, the first conversion resolution is determined. Since the resolution of the low-resolution background image is low, the first conversion resolution is less than the target resolution, and in the subsequent process of inputting the low-resolution background image and the first conversion resolution into the image generation model to generate a background image with a resolution of the first conversion resolution, the efficiency of the image generation model in processing the low-resolution background image can be improved, and the background image can be generated faster.
[0145] According to an embodiment of the present disclosure, determining the first conversion resolution according to the width and height of the low-resolution background image and the target resolution comprises:
[0146] determining a second width ratio between the target pixel width and the width of the low-resolution background image; determining a second height ratio between the target pixel height and the height of the low-resolution background image; in a case where the second height ratio is greater than or equal to the second width ratio, determining the height of the low-resolution background image as the height of the first conversion resolution; and determining the width of the first conversion resolution according to the ratio between the target pixel width and the target pixel height and the height of the first conversion resolution.
[0147] The ratio between the target pixel width and the width of the low-resolution background image can be taken as the second width ratio. The ratio between the target pixel height and the height of the low-resolution background image can be taken as the second height ratio. The width of the first conversion resolution can be obtained by multiplying the ratio between the target pixel width and the target pixel height by the height of the first conversion resolution.
[0148] For example, the second width ratio can be obtained according to formula (9), and the second height ratio can be obtained according to formula (10).
[0149] wherein w o1 denotes the width of the low-resolution background image, and h o1 denotes the height of the low-resolution background image.
[0150] For example, in a case where the height of the first conversion resolution is determined according to formula (11), and the width of the first conversion resolution is determined according to formula (12). h o2 = h o1 (11)
[0151] wherein h o2 a height of the first conversion resolution, o2 a width of the first conversion resolution.
[0152] According to an embodiment of the present disclosure, in a case where the second height ratio is greater than or equal to the second width ratio, the height of the low-resolution background image is determined as the height of the first conversion resolution, and the width of the first conversion resolution is determined according to the ratio between the target pixel width and the target pixel height and the height of the first conversion resolution, so that the first conversion resolution with a lower resolution and a same width-to-height ratio as the target resolution is determined based on the height of the low-resolution background image.
[0153] According to an embodiment of the present disclosure, determining the first conversion resolution according to the width and height of the low-resolution background image and the target resolution further includes: in a case where the second height ratio is less than the second width ratio, determining the width of the low-resolution background image as the width of the first conversion resolution; and determining the height of the first conversion resolution according to the ratio between the target pixel height and the target pixel width and the width of the first conversion resolution.
[0154] According to an embodiment of the present disclosure, the height of the first conversion resolution can be obtained by multiplying the ratio between the target pixel height and the target pixel width by the width of the first conversion resolution.
[0155] For example, in a case where the width of the first conversion resolution is determined according to formula (13) and the height of the first conversion resolution is determined according to formula (14). w 02 =w 01 (13)
[0156] According to an embodiment of the present disclosure, in a case where the second height ratio is less than the second width ratio, the width of the low-resolution background image is determined as the width of the first conversion resolution, and the height of the first conversion resolution is determined according to the ratio between the target pixel height and the target pixel width and the width of the first conversion resolution, so that the first conversion resolution with a lower resolution and a same width-to-height ratio as the target resolution is determined based on the width of the low-resolution background image.
[0157] According to an embodiment of the present disclosure, the amount of data that needs to be regenerated for filling the content is less, for example, the width-to-height ratio is expanded from 9:16 to 12:16, and the original image can be directly filled with the background by using the image generation model.
[0158] According to an embodiment of the present disclosure, the generating the target image according to the original image, the original resolution and the target resolution comprises: performing second preset multiple down-sampling on the original image to obtain a low-resolution image; determining a second conversion resolution according to a width and a height of the low-resolution image and the target resolution; inputting the down-sampled original image and the second conversion resolution into an image generation model to generate an intermediate conversion image, wherein a resolution of the intermediate conversion image is the second conversion resolution; and adjusting the resolution of the intermediate conversion image according to the target resolution and the intermediate conversion image to generate the target image.
[0159] According to an embodiment of the present disclosure, the generating the target image according to the original image, the original resolution and the target resolution comprises: performing second preset multiple down-sampling on the original image to obtain a low-resolution image; determining a second conversion resolution according to a width and a height of the low-resolution image and the target resolution; inputting the down-sampled original image and the second conversion resolution into an image generation model to generate an intermediate conversion image, wherein a resolution of the intermediate conversion image is the second conversion resolution; and adjusting the resolution of the intermediate conversion image according to the target resolution and the intermediate conversion image to generate the target image.
[0160] For example, the generating the target image according to the original image, the original resolution and the target resolution can comprise, in a case where the difference value is greater than or equal to the preset threshold: performing second preset multiple down-sampling on the original image to obtain a low-resolution image; determining a second conversion resolution according to a width and a height of the low-resolution image and the target resolution; inputting the down-sampled original image and the second conversion resolution into an image generation model to generate an intermediate conversion image, wherein a resolution of the intermediate conversion image is the second conversion resolution; and adjusting the resolution of the intermediate conversion image according to the target resolution and the intermediate conversion image to generate the target image. In the case where the difference value is greater than or equal to the preset threshold, the original resolution of the original image is less different from the aspect ratio of the target resolution, and less filling content needs to be generated.
[0161] The second preset multiple can be selected according to actual conditions, which is not limited herein. For example, the second preset multiple can be determined according to a desired generation speed and a desired generation effect of the image generation model. The higher the desired generation speed, the greater the second preset multiple, but the quality of the generated target image is poorer. The lower the desired generation speed, the smaller the second preset multiple, but the quality of the generated target image is higher.
[0162] The aspect ratio of the second conversion resolution can be the same as the aspect ratio of the target image, and the second conversion resolution is less than the target resolution.
[0163] According to an embodiment of the present disclosure, the inputting the down-sampled original image and the second conversion resolution into the image generation model to generate the intermediate conversion image comprises: obtaining a second preset prompt word and a second preset model parameter; and inputting the down-sampled original image, the second preset prompt word, the second preset model parameter and the second conversion resolution into the image generation model to generate the intermediate conversion image.
[0164] According to an embodiment of the present disclosure, the second preset prompt word can include a positive prompt word and a negative prompt word. The positive prompt word represents content that the user hopes to include in the target image, and the negative prompt word represents content that the user does not hope to appear in the target image.
[0165] According to an embodiment of the present disclosure, the generation method of the second preset prompt word is similar to the generation method of the first preset prompt word, and can achieve the same effect, and the generation method of the second preset model parameter is similar to the generation method of the first preset model parameter, and can achieve the same effect.
[0166] According to an embodiment of the present disclosure, the preset weight can also be input into the down-sampled original image, the second preset prompt word, the second preset model parameter, and the second conversion resolution input image generation model in a preset manner to generate an intermediate conversion image. For example, the weight corresponding to the prompt word included in the content input by the user can be set to 0.6, and the weight of the prompt word generated according to the original image can be set to 0.4.
[0167] According to an embodiment of the present disclosure, the generation model can be configured as an outward expansion generation mode first, and then the down-sampled original image, the second preset prompt word, the second preset model parameter, and the second conversion resolution input image generation model are input into the generation model. The generation model can generate outward expansion content based on the down-sampled original image, and the outward expansion content can be spliced with the down-sampled original image to obtain an intermediate conversion image of the second conversion resolution.
[0168] The number of intermediate conversion images can be 1 or greater than or equal to 2. In the case where the number of intermediate conversion images is greater than or equal to 2, multiple intermediate conversion images can be displayed on the client. In response to a selection operation of the client, an intermediate conversion image selected by the client is obtained, and then the intermediate conversion image selected by the client is subjected to subsequent splicing and resolution adjustment operations to achieve deeper interaction with the user, thereby avoiding too long waiting time of the user in the process of generating the target image and bringing bad experience to the user. Therefore, the user satisfaction can be further improved through this interactive design.
[0169] According to an embodiment of the present disclosure, the target resolution and the intermediate conversion image can be input into an image super-resolution model, and the resolution of the intermediate conversion image can be adjusted to the target resolution by using the image super-resolution model to obtain the target image.
[0170] According to an embodiment of the present disclosure, the resolution of the intermediate conversion image can be adjusted to the target resolution by using the image super-resolution model to obtain the target image, and a super-resolution target image that is closer to the original image and has higher contrast and clarity can be obtained simply and quickly.
[0171] According to an embodiment of the present disclosure, in a case where the difference value is greater than or equal to a preset threshold value, it is indicated that less padding content needs to be regenerated in the case of upsampling the original image to the target resolution. Therefore, the original image can be directly down-sampled by a second preset multiple to obtain a low-resolution image, taking the original image as a reference, and a second conversion resolution is determined according to the width and height of the low-resolution image and the target resolution. Since the resolution of the low-resolution image is low, the second conversion resolution is smaller than the target resolution, and in the subsequent process of inputting the down-sampled original image and the second conversion resolution into the image generation model to generate an intermediate conversion image with a resolution of the second conversion resolution, the efficiency of the image generation model in processing the low-resolution image can be improved, and the intermediate conversion image can be generated faster. Then, the resolution of the intermediate conversion image is adjusted according to the target resolution and the intermediate conversion image to generate a target image with a resolution of the target resolution, and a target image with higher contrast and clarity is obtained.
[0172] According to an embodiment of the present disclosure, determining the second conversion resolution according to the width and height of the low-resolution image and the target resolution comprises: determining a third width ratio between the target pixel width and the width of the low-resolution image; determining a third height ratio between the target pixel height and the height of the low-resolution image; in a case where the third height ratio is greater than or equal to the third width ratio, determining the height of the low-resolution image as the height of the second conversion resolution; and determining the width of the second conversion resolution according to the ratio between the target pixel width and the target pixel height and the height of the second conversion resolution.
[0173] According to an embodiment of the present disclosure, the target pixel width can be divided by the width of the low-resolution image to obtain the third width ratio. The target pixel height can be divided by the height of the low-resolution image to obtain the third height ratio. The ratio between the target pixel width and the target pixel height can be multiplied by the height of the second conversion resolution to obtain the width of the second conversion resolution.
[0174] For example, the third width ratio can be obtained according to formula (15), and the third height ratio can be obtained according to formula (16).
[0175] wherein w o3 denotes the width of the low-resolution image, and h o3 denotes the height of the low-resolution image.
[0176] For example, in a case where the height of the second conversion resolution is determined according to formula (17), and the width of the second conversion resolution is determined according to formula (18). h o4 = h o3 (17)
[0177] wherein h o4 a height of the second conversion resolution, w o4 a width of the second conversion resolution.
[0178] According to an embodiment of the present disclosure, in a case where the third height ratio is greater than or equal to the third width ratio, the height of the low resolution image is determined as the height of the second conversion resolution, and the width of the second conversion resolution is determined according to the ratio between the target pixel width and the target pixel height and the height of the second conversion resolution, so that the second conversion resolution with a lower resolution and a same width-to-height ratio as the target resolution is determined based on the height of the low resolution image.
[0179] According to an embodiment of the present disclosure, determining the second conversion resolution according to the width and the height of the low resolution image and the target resolution further includes, in a case where the third height ratio is less than the third width ratio:
[0180] the width of the low resolution image is determined as the width of the second conversion resolution, and the height of the second conversion resolution is determined according to the ratio between the target pixel height and the target pixel width and the width of the second conversion resolution.
[0181] According to an embodiment of the present disclosure, the height of the second conversion resolution can be obtained by multiplying the ratio between the target pixel height and the target pixel width by the width of the second conversion resolution.
[0182] For example, in a case where the width of the second conversion resolution is determined according to formula (19), and the height of the second conversion resolution is determined according to formula (20). w 04 =w 03 (19)
[0183] According to an embodiment of the present disclosure, in a case where the third height ratio is less than the third width ratio, the width of the low resolution image is determined as the width of the second conversion resolution, and the height of the second conversion resolution is determined according to the ratio between the target pixel height and the target pixel width and the width of the second conversion resolution, so that the second conversion resolution with a lower resolution and a same width-to-height ratio as the target resolution is determined based on the width of the low resolution image.
[0184] FIG. 5(A) schematically shows a schematic diagram of a display device according to an embodiment of the present disclosure. FIG. 5(B) schematically shows a schematic diagram in which the display device directly displays an original image according to an embodiment of the present disclosure. FIG. 5(C) schematically shows a schematic diagram in which the display device displays a target image after the image display method according to an embodiment of the present disclosure obtains the target image in a case where a difference value is greater than or equal to a preset threshold.
[0185] As shown in FIG. 5(A), the display device includes a display screen 501, a display screen 502, a display screen 503, and a display screen 504. The display screen 502 is located on the right side of the display screen 501 and on the upper side of the display screen 504. The display screen 503 is located on the lower side of the display screen 501 and on the left side of the display screen 504.
[0186] As shown in FIG. 5(B), in a case where an original image is directly displayed in the display device shown in FIG. 5(A), the original image is displayed in the middle region of the display device, and black edges are displayed in the display region 505 and the display region 506 of the display device, and the visual experience is poor.
[0187] As shown in FIG. 5(C), in a case where a difference value is greater than or equal to a preset threshold, after the original image in FIG. 5(B) is processed by the image display method according to an embodiment of the present disclosure to obtain a target image, the target image can be displayed on the display device shown in FIG. 5(A) in full screen, the black edge display effect is eliminated, and the contrast and the clarity of the display are improved, so that the best display effect is achieved. According to FIG. 5(C), in a case where a difference value is greater than or equal to a preset threshold, in the process of obtaining the target image by the image display method according to an embodiment of the present disclosure, the image display method according to an embodiment of the present disclosure expands the target image displayed on the display screen 501 and the target image displayed on the display screen 502.
[0188] FIG. 6(A) schematically shows a schematic diagram in which a display device displays a target image after the image display method according to an embodiment of the present disclosure obtains the target image in a case where a difference value is greater than or equal to a preset threshold. FIG. 6(B) schematically shows a schematic diagram of a locally enlarged original image and a target image according to an embodiment of the present disclosure.
[0189] As shown in FIG. 6(A), in a case where a difference value is greater than or equal to a preset threshold, after the original image in FIG. 5(B) is processed by the image display method according to an embodiment of the present disclosure to obtain a target image, the target image can be displayed on the display device in full screen, the black edge display effect is eliminated. After the target image displayed in the display region 601 in FIG. 6(A) is locally enlarged, the image 601_2 shown in FIG. 6(B) is obtained. After the original image part corresponding to the target image displayed in the display region 601 is locally enlarged, the image 601_1 shown in FIG. 6(B) is obtained.
[0190] Since the target image displayed in the display region 601 in FIG. 6(A) is obtained by performing super-resolution enhancement on the image by using the image super-resolution model, it can be known from the image 601_1 and the image 601_2 displayed in FIG. 6(B) that the contrast and the definition of the image 601_2 are higher than those of the image 601_1, which indicates that after the original image is processed by using the image display method provided in the embodiments of the present disclosure, the target image with higher contrast and definition can be obtained, and better visual experience can be brought to the user.
[0191] FIG. 7(A) schematically shows a schematic diagram of an original image according to an embodiment of the present disclosure. FIG. 7(B) schematically shows a schematic diagram of a target image obtained by using the image display method provided in the embodiments of the present disclosure in a case where the difference value is greater than or equal to the preset threshold. FIG. 7(C) schematically shows a schematic diagram of an original image according to an embodiment of the present disclosure. FIG. 7(D) schematically shows a schematic diagram of a target image obtained by using the image display method provided in the embodiments of the present disclosure in a case where the difference value is greater than or equal to the preset threshold. FIG. 7(E) schematically shows a schematic diagram of an original image according to an embodiment of the present disclosure. FIG. 7(F) schematically shows a schematic diagram of a target image obtained by using the image display method provided in the embodiments of the present disclosure in a case where the difference value is greater than or equal to the preset threshold. FIG. 7(G) schematically shows a schematic diagram of an original image according to an embodiment of the present disclosure. FIG. 7(H) schematically shows a schematic diagram of a target image obtained by using the image display method provided in the embodiments of the present disclosure in a case where the difference value is greater than or equal to the preset threshold.
[0192] According to an embodiment of the present disclosure, in a case where the difference value is greater than or equal to the preset threshold, the original image in FIG. 7(A) can be processed by using the image display method provided in the embodiments of the present disclosure to obtain the target image in FIG. 7(B). As shown in FIG. 7(B), the image display method provided in the embodiments of the present disclosure mainly performs background filling on the target image part corresponding to the display region 701 and the display region 702 of the display device.
[0193] According to an embodiment of the present disclosure, in a case where the difference value is greater than or equal to the preset threshold, the original image in FIG. 7(C) can be processed by using the image display method provided in the embodiments of the present disclosure to obtain the target image in FIG. 7(D). As shown in FIG. 7(D), the image display method provided in the embodiments of the present disclosure mainly performs background filling on the target image part corresponding to the display region 703 and the display region 704 of the display device.
[0194] According to an embodiment of the present disclosure, in the case that the difference value is greater than or equal to the preset threshold, the original image in FIG. 7(E) can be processed according to the image display method provided by the embodiment of the present disclosure to obtain the target image in FIG. 7(F). As shown in FIG. 7(F), the image display method provided by the embodiment of the present disclosure mainly performs background filling on the target image part corresponding to the display area 705 and the display area 706 of the display device.
[0195] According to an embodiment of the present disclosure, in the case that the difference value is greater than or equal to the preset threshold, the original image in FIG. 7(G) can be processed according to the image display method provided by the embodiment of the present disclosure to obtain the target image in FIG. 7(H). As shown in FIG. 7(H), the image display method provided by the embodiment of the present disclosure mainly performs background filling on the target image part corresponding to the display area 707 and the display area 708 of the display device.
[0196] As can be seen from FIGS. 7(A) to (H), in the case that the difference value corresponding to each original image is greater than or equal to the preset threshold, the original image content is different for different application scenarios, and the original resolution and the target resolution aspect ratio of the original image are different, but the image display method provided by the embodiment of the present disclosure can obtain a target image with high contrast and clarity after processing the original image, which indicates that the image display method provided by the embodiment of the present disclosure has high applicability and practicability.
[0197] According to an embodiment of the present disclosure, the image display method as shown in FIG. 3 can further include the following operations:
[0198] According to the original image and the configuration parameters related to the generation effect and generation speed of the image generation model from the client, the first preset model parameter, the first preset multiple, the first preset prompt word, the second preset model parameter, the second preset multiple and the second preset prompt word are determined.
[0199] According to an embodiment of the present disclosure, the configuration parameters can include at least one of the following:
[0200] Generation style, generation speed, generation creativity, generation content text description, target resolution;
[0201] The first preset model parameter and the second preset model parameter each include at least one of the following:
[0202] The number of expanded pixels, the mask blur degree, the image extension direction, the decay index, the color change degree parameter, the sampling method, the sampling step and the denoising intensity and the prompt word relevance degree.
[0203] According to an embodiment of the present disclosure, in addition to the target resolution, the configuration parameters can further include a single-screen resolution, a horizontal device quantity and a vertical device quantity in the case that the display device includes at least one display screen. The horizontal device quantity represents the number of display screens arranged horizontally in the display device, and the vertical device quantity represents the number of display screens arranged vertically in the display device.
[0204] According to an embodiment of the present disclosure, in the case that the display device includes one display screen, the extended pixel quantity is equal to the target resolution. In the case that the display device includes at least two display screens, the extended pixel quantity is equal to the product of the horizontal device quantity and the single-screen resolution multiplied by the vertical device quantity.
[0205] The image extension direction can be determined according to the horizontal device quantity and the vertical device quantity configured by the user. For example, the image extension direction can include left-right horizontal extension in the case that the horizontal device quantity is greater than or equal to 2, and the image extension direction can include up-down vertical extension in the case that the vertical device quantity is greater than or equal to 2. The image extension direction can also include left-right horizontal extension and up-down vertical extension, which are determined according to the original resolution and the target resolution of the original image.
[0206] The smaller the value of the attenuation index, the higher the richness of the generated target image. The color variation degree parameter represents a parameter for adjusting the variation degree of the color. The greater the value of the color variation degree parameter, the richer the variation degree. The more the sampling steps are set, the higher the quality of the generated target image but the slower the generation speed. The sampling step can be determined according to the generation speed and the generation creativity configured by the user. The denoising intensity represents the influence degree of the original image on the target image. The smaller the value of the denoising intensity, the greater the influence. The higher the value of the prompt word relevance degree, the higher the relevance of the content in the generated target image to the prompt word, and the lower the creativity of the generated target image. The prompt word relevance degree can be determined according to the generation creativity configured by the user.
[0207] In the first preset model parameter and the second preset model parameter, the extended pixel quantity, the image extension direction, the sampling step, the prompt word relevance degree and other parameters are determined by the user configuration parameter, and other parameters can be preset by the system.
[0208] For common scenes such as landscape, figure, building and other application scenes, a plurality of representative original images can be selected for each scene, and model parameter testing can be performed respectively, so as to select other system preset configurations in addition to the configuration parameters configured by the user through the interactive interface. Finally, each application scene corresponds to one configuration parameter file. When the user selects the style corresponding to the specified application scene through the client, the corresponding model configuration parameter is loaded and the model is input.
[0209] According to an embodiment of the present disclosure, the first preset prompt word and the second preset prompt word both include positive prompt words and reverse prompt words.
[0210] According to an embodiment of the present disclosure, the positive prompt word generation method includes:
[0211] 1) input the original image into a CLIP model (Contrastive Language-Image Pre-Training, a multi-modal model based on contrastive learning), identify the textual description of the original image, that is, convert the image to text. For example, input an original image including a dog, and the CLIP model can output “A photo of a dog.”
[0212] 2) according to the user's configured generation style, for example, the generation style is the poster background image generation style commonly used in known businesses, obtain the preset passed positive prompt word. For example, three styles of “landscape, person, and building” are preset, and the corresponding prompt words of the three styles can be: landscape: “best quality, ultra high res, poster, projected inset, gradient, gradient background, oekaki, vector trace, masterpiece, illustration, widescreen”, person: “best quality, ultra high res, (photorealistic: 1.4), photo_(medium), realistic, 8k uhd, dslr, soft lighting, high quality, film grain”, and building: “dynamic posture, 8k uhd, dslr, soft lighting, high quality, film grain” and the like.
[0213] 3) combine the image text description prompt word generated by the CLIP in 1) and the general style description prompt word in 2) as the model positive prompt word. The model then extends the image content and style background according to the positive prompt word to maintain consistency with the content and style of the original image.
[0214] According to an embodiment of the present disclosure, the reverse prompt word generation method comprises: obtaining a preset reverse prompt word corresponding to content to be avoided in the target image according to the content text description generated by the user. For example, the content such as text content, watermark, etc. is not expected to appear, and the preset reverse prompt word can be: "lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry, parody".
[0215] FIG. 8 schematically shows a system architecture diagram of an image display method according to an embodiment of the present disclosure.
[0216] As shown in FIG. 8, the sending system 810 includes a service server 811 and an AI server 812. Among them, the service server 811 and the AI server 812 in the sending system 810 can replace the server 205 in FIG. 2 to be applied to the application scenario in FIG. 2.
[0217] The service server 811 includes program production management, program review module, play plan management and production module, data statistics and data board module, equipment management module, system user management module, etc. The service server 811 is used to respond to the arrangement operation of the client, and the original image or the target image, such as poster advertisement, etc. The play material is arranged after the program and issued to the sending box.
[0218] The AI server 812 includes a material management module and an intelligent image processing module. The material management unit is used to store the original image uploaded by the client and the target image generated according to the image display method provided by the present disclosure. The intelligent image processing module is used to realize the image display method provided by the present disclosure. Among them, the intelligent image processing module includes a prompt word generation unit, a model parameter generation unit, a filling method selection unit and a model processing unit. The model processing unit includes an image segmentation model, an image generation model and an image super-resolution model. The image segmentation model is used to segment the original image to generate a foreground image. The image generation model is used to expand the picture to generate the original image input by the client. The image super-resolution model is used to further improve the display quality of the image generated by the image generation model, improve the resolution of the image, etc.
[0219] For example, the user can transmit the existing and prepared original image into the material management module in the AI server 812 through the transmission box, where the material management module has no limitation on the resolution and aspect ratio of the original image. The AI server 812 can display the functional interface of AI image generation in the client in response to the user's request for processing the original image of the poster.
[0220] FIG. 9 schematically shows a schematic diagram of the functional interface of AI image generation according to an embodiment of the present disclosure.
[0221] As shown in FIG. 9, the functional interface of AI image generation includes a selection box AI image generation 901, and in response to the user clicking the selection box AI image generation 901, the client displays each original image transmitted by the user into the material management module. In response to the user's clicking operation on any original image, the original image is determined as the original image to be processed by the image display method provided in the embodiments of the present disclosure, and at the same time, the AI server 812 generates an image intelligent filling functional interface and sends the image intelligent filling functional interface to the client for display through the transmission box.
[0222] FIG. 10 schematically shows a schematic diagram of the image intelligent filling functional interface according to an embodiment of the present disclosure.
[0223] As shown in FIG. 10, in the image intelligent filling functional interface, the original image selected by the user is displayed, and at the same time, the user can configure the parameter generation style 1001, the generation speed 1002, the generation creativity 1003, the single-screen resolution 1004, the number of horizontal devices 1005 and the number of vertical devices 1006 in the image intelligent filling interface.
[0224] For example, in FIG. 10, the generation style 1001 can select a poster, milk tea, a coconut tree or the sea, etc., the generation speed 1002 can be selected as low, medium or high, the generation creativity 1003 can be selected as low, medium or high, the single-screen resolution 1004 can be set as width 960px and width 540px, the number of horizontal devices 1005 can be set as 2 and the number of vertical devices 1006 can be set as 2.
[0225] According to the embodiments of the present disclosure, the generation style 1001 for configuration can be determined as a positive prompt word.
[0226] In the case of a single screen display device, the number of horizontal devices 1005 and the number of vertical devices 1006 are defaulted as 1.
[0227] According to an embodiment of the present disclosure, when the generation speed 1002 is configured, the lower the generation speed 1002, the higher the quality and the more details of the target image generated by the model, the higher the generation speed 1002, the lower the quality and the more rough details of the generated image. When the generation creativity 1003 is configured, the lower the generation creativity 1003, the simpler the background content generated by the model, the higher the generation creativity 1003, the richer the background content generated by the model. When the generation style 1001 is configured, the generation style preset in the signal sending system 810 can be selected, such as a poster, a landscape, a person, etc.
[0228] According to an embodiment of the present disclosure, in FIG. 10, the parameter generation content text description can also be included, so that the AI server can determine the content that the user wants to appear in the target image and the content that the user does not want to appear according to the generation content text description, and determine the positive prompt word and the negative prompt word according to the generation content text description.
[0229] In response to the operation of the user clicking the key, the client sends the user configuration parameters to the AI server 812 through the signal sending box, and then the AI server 812 processes the original image according to the image display method provided by an embodiment of the present disclosure based on the original image and the configuration parameters related to the generation effect and generation speed of the image generation model from the client, to obtain the target image.
[0230] FIG. 11 schematically shows a flowchart of an image display method according to another embodiment of the present disclosure.
[0231] In FIG. 11, the material management module 1110 sends the stored original image from the client to the intelligent image processing module 1120. The intelligent image processing module 1120 includes a prompt word generation unit 1121, a model parameter generation unit 1122, a filling method selection unit 1123, an image generation model 1124, an image segmentation model 1125, and an image super-resolution model 1126. The prompt word generation unit 1121 determines the positive prompt word in the first preset prompt word and the second preset prompt word according to the original image.
[0232] The intelligent image processing module 1120 receives the configuration parameters 1130 related to the generation effect and generation speed of the image generation model from the client, and the intelligent image processing module 1120 determines the positive prompt word and the negative prompt word in the first preset prompt word and the second preset prompt word, the first preset multiple and the second preset multiple according to the configuration parameters 1130, and sends the positive prompt word and the negative prompt word in the first preset prompt word and the second preset prompt word, the first preset multiple and the second preset multiple to the image generation model 1124.
[0233] The model parameter generation unit 1122 determines the first preset model parameter and the second preset model parameter according to the configuration parameter 1130, and sends the first preset model parameter and the second preset model parameter to the image generation model 1124.
[0234] The filling method selection unit 1123 obtains the original resolution and the target resolution according to the configuration parameter 1130, determines the difference value according to the original resolution and the target resolution, and in the case that the difference value is greater than or equal to a preset threshold, determines to directly expand the original image by using the image generation model 1124, and then adjusts the resolution of the image expanded by the image generation model 1124 by using the image super-resolution model 1126 to generate the target image, and stores the target image in the material management module 1110.
[0235] The filling method selection unit 1123, in the case that the difference value is less than the preset threshold, determines to first segment the original image by using the image segmentation model 1125 to obtain a foreground image, expand the background in the original image by using the image generation model 1124 to obtain a background image, and splice the background image and the foreground image by using the intelligent image processing module 1120 to obtain a rearranged image, and then adjust the resolution of the rearranged image by using the image super-resolution model 1126 to generate the target image, and store the target image in the material management module 1110.
[0236] As shown in FIGS. 8 to 11, the image display method provided by the embodiment of the present disclosure can obtain the difference value representing the aspect ratio difference between the original resolution and the target resolution after determining the difference value according to the original resolution and the target resolution. Then, different strategies are adopted to expand the original image to the target resolution when the difference value takes different values, so that the display device can display the target image in full screen when the target image is sent to the display device, and the problem of stretching deformation or unclear display does not occur, thereby bringing better visual experience for the user.
[0237] FIG. 12 schematically shows a flowchart of an image display method according to yet another embodiment of the present disclosure.
[0238] According to the embodiment of the present disclosure, the specific implementation method of each module and each unit in FIG. 11 can refer to FIG. 12.
[0239] As shown in FIG. 12, the image display method in this embodiment includes operations S1210 to S1270, wherein operation S1250 includes sub-operations S1251 to S1257, and operation S1260 includes sub-operations S1261 to S1264.
[0240] In operation S1210, an original image and configuration parameters related to the generation effect and generation speed of an image generation model from a client are obtained.
[0241] Then, according to the original image and the configuration parameters related to the generation effect and generation speed of the image generation model from the client, the original resolution of the original image and the target resolution of the display device are obtained in operation S1220, and the first preset model parameter, the first preset multiple, the first preset prompt word, the second preset model parameter, the second preset multiple, and the second preset prompt word are determined in operation S1270.
[0242] In operation S1230, the difference value is determined according to the original resolution and the target resolution.
[0243] In operation S1240, it is determined whether the difference value is less than a preset threshold.
[0244] If yes, operation S1250 is performed; if no, operation S1260 is performed.
[0245] In operation S1250, in sub-operation S1251, a foreground image is generated according to the target region and the original image.
[0246] In sub-operation S1252, the original image, the pixel position corresponding to the target region, and the first preset model parameter are input into the image generation model to obtain an initial background image.
[0247] In sub-operation S1253, the initial background image is down-sampled by the first preset multiple to obtain a low-resolution background image.
[0248] In sub-operation S1254, a first conversion resolution is determined according to the width and height of the low-resolution background image and the target resolution.
[0249] In sub-operation S1255, the low-resolution background image, the first preset prompt word, the first preset model parameter, and the first conversion resolution are input into the image generation model to generate a background image.
[0250] In sub-operation S1256, the background image and the foreground image are spliced to obtain a rearranged image.
[0251] In sub-operation S1257, the resolution of the rearranged image is adjusted according to the target resolution and the rearranged image to generate a target image.
[0252] In operation S1260, in sub-operation S1261, the original image is down-sampled by a second preset multiple to obtain a low-resolution image.
[0253] In sub-operation S1262, a second conversion resolution is determined according to the width and height of the low-resolution image and the target resolution.
[0254] In sub-operation S1263, the down-sampled original image, the second preset prompt word, the second preset model parameter, and the second conversion resolution are input into the image generation model to generate an intermediate conversion image.
[0255] In sub-operation S1264, the resolution of the intermediate conversion image is adjusted according to the target resolution and the intermediate conversion image to generate a target image.
[0256] As shown in FIG. 12, the image display method provided by the embodiments of the present disclosure can obtain the difference value representing the aspect ratio difference between the original resolution and the target resolution after determining the difference value according to the original resolution and the target resolution. Then, different strategies are adopted to expand the original image to the target resolution when the difference value takes different values, so that the display device can display the target image in full screen when the target image is sent to the display device, and the problem of stretching deformation or unclear display does not occur, thereby bringing better visual experience for the user.
[0257] According to the embodiments of the present disclosure, it can be known from FIG. 12 that the difference value between the original resolution and the target resolution represents different product requirements, that is, in the case that the difference value is greater than or equal to the preset threshold, the product requirement is to directly perform background expansion on the original image, and in the case that the difference value is less than the preset threshold, the product requirement is to expand the background image and then perform content rearrangement on the expanded background image and the foreground image.
[0258] Based on the above image display method, the present disclosure further provides an image display device. The device will be described in detail below in combination with FIG. 13.
[0259] FIG. 13 schematically shows a structural block diagram of an image display device according to an embodiment of the present disclosure.
[0260] As shown in FIG. 13, the image display device 1300 includes an acquisition module 1310, a generation module 1320, and a display module 1330.
[0261] The acquisition module 1310 is configured to acquire an original resolution of an original image and a target resolution of a display device. In an embodiment, the acquisition module 1310 can be configured to perform the operation S310 described above, and details are not described herein again.
[0262] The generation module 1320 is configured to generate a target image according to the original image, the original resolution, and the target resolution. In an embodiment, the generation module 1320 can be configured to perform the operation S320 described above, and details are not described herein again.
[0263] The display module 1330 is configured to send the target image to the display device so that the display device displays the target image. In an embodiment, the display module 1330 can be configured to perform the operation S330 described above, and details are not described herein again.
[0264] According to an embodiment of the present disclosure, any of the modules of the acquiring module 1310, the generating module 1320 and the displaying module 1330 can be combined in one module, or any of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of the modules can be combined with at least part of the functions of the other modules, and implemented in one module. According to an embodiment of the present disclosure, at least one of the acquiring module 1310, the generating module 1320 and the displaying module 1330 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on chip, a system on board, a system in package, an application specific integrated circuit (ASIC), or any other reasonable manner of integrating or packaging a circuit, etc. or implemented by hardware or firmware, or implemented in any one of software, hardware and firmware or in a proper combination of any of these. Alternatively, at least one of the acquiring module 1310, the generating module 1320 and the displaying module 1330 can be at least partially implemented as a computer program module which can perform the corresponding functions when the computer program module is run.
[0265] FIG. 14 schematically shows a block diagram of an electronic device suitable for implementing the image display method according to an embodiment of the present disclosure.
[0266] As shown in FIG. 14, the electronic device 1400 according to an embodiment of the present disclosure includes a processor 1401 which can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 1402 or loaded from a storage portion 1408 into a random access memory (RAM) 1403. The processor 1401 can include, for example, a general-purpose microprocessor (such as a CPU), an instruction set processor and / or a related chipset, and / or a special-purpose microprocessor (such as an application specific integrated circuit (ASIC)), etc. The processor 1401 can also include an on-board memory for cache use. The processor 1401 can include a single processing unit or a plurality of processing units for performing different actions of the method processes according to embodiments of the present disclosure.
[0267] In the RAM 1403, various programs and data required for the operation of the electronic device 1400 are stored. The processor 1401, the ROM 1402, and the RAM 1403 are connected to each other via the bus 1404. The processor 1401 performs various operations of the method flow according to the embodiments of the present disclosure by executing the programs in the ROM 1402 and / or the RAM 1403. It should be noted that the programs can also be stored in one or more memories other than the ROM 1402 and the RAM 1403. The processor 1401 can also perform various operations of the method flow according to the embodiments of the present disclosure by executing the programs stored in the one or more memories.
[0268] According to an embodiment of the present disclosure, the electronic device 1400 can further include an input / output (I / O) interface 1405, which is also connected to the bus 1404. The electronic device 1400 can further include one or more of the following components connected to the I / O interface 1405: an input part 1406 including a keyboard, a mouse, etc.; an output part 1407 including a display such as a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage part 1408 including a hard disk, etc.; and a communication part 1409 including a network interface card such as a LAN card, a modem, etc. The communication part 1409 performs communication processing via a network such as the Internet. A drive 1410 is also connected to the I / O interface 1405 as necessary. A removable recording medium 1411 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc. is attached to the drive 1410 as necessary, so that a computer program read out therefrom is installed in the storage part 1408 as necessary.
[0269] The present disclosure also provides a non-transitory computer readable storage medium, which can be included in the device / apparatus / system described in the above embodiments, or can exist separately without being assembled into the device / apparatus / system. The above computer readable storage medium carries one or more programs, which, when executed, implement the method according to the embodiments of the present disclosure.
[0270] According to an embodiment of the present disclosure, the computer readable storage medium can be a nonvolatile computer readable storage medium, for example, can include, but is not limited to, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any appropriate combination thereof. In the present disclosure, the computer readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus, or device. For example, according to an embodiment of the present disclosure, the computer readable storage medium can include one or more memories such as the ROM 1402 and / or the RAM 1403 described above and / or one or more memory other than the ROM 1402 and the RAM 1403.
[0271] Embodiments of the present disclosure also include a computer program product, which includes a computer program containing program codes for executing the methods shown in the flowcharts. When the computer program product is run in a computer system, the program codes are used to make the computer system implement the image display method provided by the embodiments of the present disclosure.
[0272] The above-described functions defined in the system / apparatus / module / unit of the embodiments of the present disclosure are performed when the computer program is executed by the processor 1401. According to an embodiment of the present disclosure, the above-described system, apparatus, module, unit, etc. can be implemented by the computer program modules.
[0273] In one embodiment, the computer program can rely on a tangible storage medium such as an optical storage device, a magnetic storage device, etc. In another embodiment, the computer program can also be transmitted, distributed, and downloaded in the form of a signal over a network medium, and be installed and executed through the communication part 1409, and / or be installed from the detachable medium 1411. The program codes contained in the computer program can be transmitted by any appropriate network medium, including but not limited to wireless, wired, etc., or any appropriate combination thereof.
[0274] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1409, and / or be installed from the detachable medium 1411. When the computer program is executed by the processor 1401, the above-described functions defined in the system of the embodiments of the present disclosure are performed. According to an embodiment of the present disclosure, the above-described system, apparatus, device, module, unit, etc. can be implemented by the computer program modules.
[0275] According to embodiments of the present disclosure, program code for execution of the computer programs provided by embodiments of the present disclosure can be written in any combination of one or more programming languages, specifically, the computer programs can be implemented using a high-level procedural and / or object-oriented programming language, and / or an assembly / machine language. The programming languages include, but are not limited to, such as Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on a user computing device, partially on a user device, partially on a remote computing device, or entirely on a remote computing device or server. In the case involving a remote computing device, the remote computing device can be connected to the user computing device through any kind of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, connected through the Internet by using an Internet service provider).
[0276] FIG. 15 schematically shows a schematic diagram of an image display device according to an embodiment of the present disclosure.
[0277] As shown in FIG. 15, the image display device 1500 includes an electronic device 1501 and a display apparatus 1502. Among them, the display apparatus 1502 is configured to acquire a target image from the electronic device 1501 and display the target image.
[0278] In FIG. 15, the electronic device 1501 and the display apparatus 1502 communicate through a network 1503. The network 1503 is a medium for providing a communication link between the electronic device 1501 and the display apparatus 1502. The network 1503 can include various connection types, such as wired, wireless communication links, or fiber optic cables, and the like.
[0279] According to embodiments of the present disclosure, the electronic device 1501 can be the electronic device 1400 in FIG. 14. The display apparatus 1502 can include at least one display screen. For example, the display apparatus 1502 can be a single display screen, or can be a display screen composed of four single display screens with the same resolution.
[0280] It should be noted that the original images involved in FIGS. 1 to 15 are all from a public gallery, which is a free public resource
[0281] The computer program product of the first aspect can include one or more non-transitory computer-readable media storing instructions that, when executed, cause one or more processors to perform the operations of the first aspect. The one or more non-transitory computer-readable media can include, for example, magnetic media such as one or more magnetic disks, magnetic tapes or cassettes; optical media such as one or more compact discs (CD), optical discs or discs (for example, DVD, Blu-ray Disc®, digital video disc, ultra density disc, ultra-compact disc, any optical media, etc.); semiconductor media such as solid state hard drives (for example, flash memory, solid state USB drives, etc.); any other suitable medium; or any suitable combination of media.
[0282] Those skilled in the art will understand that features of the various embodiments and / or claims of the present disclosure can be combined or / and integrated with one another, even though such a combination or integration is not expressly disclosed in the present disclosure. In particular, the features of the various embodiments and / or claims of the present disclosure can be combined and / or integrated with one another in any number of ways, without departing from the spirit and scope of the present disclosure. All such combinations and / or integrations are within the scope of the present disclosure.
[0283] The above describes embodiments of the present disclosure. However, these embodiments are merely for illustrative purposes, and are not intended to limit the scope of the present disclosure. Although the above describes each embodiment separately, this does not mean that the measures in each embodiment cannot be used advantageously in combination. The scope of the present disclosure is defined by the appended claims and their equivalents. Those skilled in the art can make various substitutions and modifications without departing from the scope of the present disclosure, and all such substitutions and modifications shall fall within the scope of the present disclosure.
Claims
1. An image display method comprising: obtaining an original resolution of an original image and a target resolution of a display device; generating a target image according to the original image, the original resolution and the target resolution; and sending the target image to the display device so that the display device displays the target image. The original resolution comprises an original pixel width and an original pixel height, and the target resolution comprises a target pixel width and a target pixel height; 2. The method of claim 1, wherein, The generating a target image according to the original image, the original resolution and the target resolution comprises: determining a first height ratio between the target pixel height and the original pixel height; determining a first width ratio between the target pixel width and the original pixel width; determining a coincidence resolution according to the first height ratio, the first width ratio, the original resolution and the target resolution; determining a difference value according to a ratio between the coincidence resolution and the target resolution; generating the target image according to the difference value, the original image and the target resolution. The determining a coincidence resolution according to the first height ratio, the first width ratio, the original resolution and the target resolution comprises, in a case that the first height ratio is less than or equal to the first width ratio:
3. The method of claim 2, wherein, determining the target pixel height as a height of the coincidence resolution; and determining a width of the coincidence resolution according to the height of the coincidence resolution, the original pixel height and the original pixel width. The determining a coincidence resolution according to the first height ratio, the first width ratio, the original resolution and the target resolution further comprises, in a case that the first height ratio is greater than the first width ratio:
4. The method of claim 2 or 3, wherein, determining the target pixel width as a width of the coincidence resolution; and determining a height of the coincidence resolution according to the width of the coincidence resolution, the original pixel width and the original pixel height. The generating the target image according to the difference value, the original image and the target resolution comprises, in a case that the difference value is less than a preset threshold:
5. The method of claim 2 or 3, wherein, determining a target region in the original image, wherein the target region comprises a target element; generating a foreground image according to the target region and the original image; generating a background image according to the target region, the original image and the target resolution; stitching the background image and the foreground image to obtain a rearranged image; and adjusting a resolution of the rearranged image according to the target resolution and the rearranged image to generate the target image. The generating a background image according to the target region, the original image and the target resolution comprises:
6. The method of claim 5, wherein, inputting the original image and a pixel position corresponding to the target region into an image generation model to obtain an initial background image, wherein a resolution of the initial background image is equal to the original resolution; performing downsampling on the initial background image by a first preset multiple to obtain a low-resolution background image; and performing upsampling on the low-resolution background image by a second preset multiple to obtain the background image. determine a first conversion resolution according to the width and height of the low-resolution background image and the target resolution; input the low-resolution background image and the first conversion resolution into the image generation model to generate the background image, wherein a resolution of the background image is the first conversion resolution.
7. The method of claim 6, wherein, The determining a first conversion resolution according to the width and height of the low-resolution background image and the target resolution comprises: determining a second width ratio between the target pixel width and the width of the low-resolution background image; determining a second height ratio between the target pixel height and the height of the low-resolution background image; in a case where the second height ratio is greater than or equal to the second width ratio, determining the height of the low-resolution background image as a height of the first conversion resolution; determining a width of the first conversion resolution according to a ratio between the target pixel width and the target pixel height and the height of the first conversion resolution.
8. The method of claim 7, wherein, The determining a first conversion resolution according to the width and height of the low-resolution background image and the target resolution further comprises: in a case where the second height ratio is less than the second width ratio, determining the width of the low-resolution background image as a width of the first conversion resolution; determining a height of the first conversion resolution according to a ratio between the target pixel height and the target pixel width and the width of the first conversion resolution.
9. The method of claim 1, wherein, The generating a target image according to the original image, the original resolution and the target resolution comprises: performing second pre-set multiple down-sampling on the original image to obtain a low-resolution image; determining a second conversion resolution according to the width and height of the low-resolution image and the target resolution; inputting the down-sampled original image and the second conversion resolution into the image generation model to generate an intermediate conversion image, wherein a resolution of the intermediate conversion image is the second conversion resolution; adjusting the resolution of the intermediate conversion image according to the target resolution and the intermediate conversion image to generate the target image.
10. The method of claim 9, wherein, The determining a second conversion resolution according to the width and height of the low-resolution image and the target resolution comprises: determining a third width ratio between the target pixel width and the width of the low-resolution image; determining a third height ratio between the target pixel height and the height of the low-resolution image; in a case where the third height ratio is greater than or equal to the third width ratio, determining the height of the low-resolution image as a height of the second conversion resolution; and determining a width of the second conversion resolution according to a ratio between the target pixel width and the target pixel height and the height of the second conversion resolution.
11. The method of claim 10, wherein, The determining a second conversion resolution according to the width and height of the low-resolution image and the target resolution further comprises, in a case where the third height ratio is less than the third width ratio: determining the width of the low-resolution image as a width of the second conversion resolution; A height of the second conversion resolution is determined according to a ratio between a height of the target pixel and a width of the target pixel and a width of the second conversion resolution.
12. The method of claim 6, wherein, The generating the background image by inputting the low-resolution background image and the first conversion resolution into the image generation model includes: obtaining a first preset prompt word and a first preset model parameter; inputting the low-resolution background image, the first preset prompt word, the first preset model parameter and the first conversion resolution into the image generation model to generate the background image.
13. The method of claim 9, wherein, The generating the intermediate conversion image by inputting the down-sampled original image and the second conversion resolution into the image generation model includes: obtaining a second preset prompt word and a second preset model parameter; inputting the down-sampled original image, the second preset prompt word, the second preset model parameter and the second conversion resolution into the image generation model to generate the intermediate conversion image.
14. The method of claim 5, wherein, The generating the foreground image according to the target region and the original image includes: inputting the original image and a pixel position corresponding to the target region into an image segmentation model to generate the foreground image.
15. The method of any one of claims 6 to 8, 10 to 14, wherein, Further comprising: determining the first preset model parameter, the first preset multiple, the first preset prompt word, the second preset model parameter, the second preset multiple and the second preset prompt word according to the original image and configuration parameters related to a generation effect and a generation speed of the image generation model from a client.
16. The method of claim 15, wherein, The configuration parameters include at least one of: a generation style, a generation speed, a generation creativity, a generation content text description and the target resolution; The first preset model parameter and the second preset model parameter each include at least one of: an extended pixel number, a mask blur degree, an image extension direction, a decay index, a color change degree parameter, a sampling method, a sampling step and a denoising intensity and a prompt word correlation degree. 17.An image display apparatus, comprising: an obtaining module configured to obtain an original resolution of an original image and a target resolution of a display apparatus; a generating module configured to generate a target image according to the original image, the original resolution and the target resolution; and a display module configured to send the target image to the display apparatus so that the display apparatus displays the target image. 18.An electronic device, comprising: one or more processors; a storage device configured to store one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method according to any one of claims 1-16. 19.An image display apparatus, comprising: the electronic device according to claim 18; and a display device configured to obtain a target image from the electronic device and display the target image. 20.A computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to perform the method according to any one of claims 1-16. 21. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 16.