Image display method, computer program product and electronic device
By generating keywords for the target display style and synthesizing N frames of the first image with the original image, the problems of single image display mode and insufficient storage space are solved, and rich display effects and storage space saving effects are achieved.
Patent Information
- Application Number
- CN202410281267.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-12
- Publication Date
- 2025-09-16
AI Technical Summary
The existing technology has a single image display mode, occupies a large storage space and has insufficient display effect.
By generating a target keyword of a target display style, N frames of first images are generated based on the target keyword and the original image, and the first images are synthesized with the original image to display the target image.
The image display mode is enriched, storage space is saved, and multiple images can be used for display according to the target display style to be viewed.
Smart Images

Figure CN120653794A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of images, and more particularly, to an image display method, a computer program product, and an electronic device. Background Art
[0002] Currently, methods for displaying images with multiple styles primarily involve storing multiple images and then displaying them in a carousel; processing images through movement, rotation, scaling, and transparency, then synthesizing multiple images into interpolated frames for display; or directly storing videos of multiple images and then playing them. Storing multiple images and videos for display is relatively simple and can consume significant storage space. Summary of the Invention
[0003] Embodiments of the present invention provide an image display method, a computer program product, and an electronic device to at least solve the problem of insufficient image display effect in the related art.
[0004] According to one embodiment of the present invention, an image display method is provided, comprising: reading an original image; determining a target display style of the original image; generating target keywords for the target display style; generating N frames of first images based on the target keywords and the original image, wherein N is a natural number greater than 1; synthesizing the N frames of first images with the original image to obtain a target image, and displaying the target image.
[0005] According to another embodiment of the present invention, an image display device is provided, including: a first reading module for reading an original image; a first determination module for determining a target display style of the original image; a first generation module for generating target keywords for the target display style; a second generation module for generating N frames of first images based on the target keywords and the original image, wherein N is a natural number greater than 1; and a first synthesis module for synthesizing the N frames of first images with the original image to obtain a target image, and displaying the target image.
[0006] According to yet another embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored. The computer program is configured to execute the steps of any one of the above method embodiments when run.
[0007] According to another embodiment of the present application, a computer program product is provided, including a computer program, which implements the steps of any of the above method embodiments when executed by a processor.
[0008] According to another embodiment of the present invention, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the steps in any one of the above method embodiments.
[0009] The present invention, after determining the target display style of an original image, generates target keywords for the target display style, then generates N frames of first images based on the target keywords and the original image. These N frames of first images are then synthesized with the original image, and the synthesized target image is displayed. This solution can conserve storage space to a certain extent and can also utilize multiple images to display an image based on the target display style being viewed, expanding the range of image display styles. This solves the problem of insufficient image display effects in related technologies, achieving the goal of enriching image display methods and saving image storage space. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] Figure 1 is a structural diagram of a mobile terminal according to an image display method according to an embodiment of the present invention;
[0011] Figure 2 is a schematic diagram of the process of the image display method according to an embodiment of the present invention Figure 1 ;
[0012] Figure 3 is a schematic diagram of an original image according to an embodiment of the present invention Figure 1 ;
[0013] Figure 4 is a schematic diagram of an image in oil painting style according to an embodiment of the present invention;
[0014] Figure 5 is a schematic diagram of an original image according to an embodiment of the present invention Figure 2 ;
[0015] Figure 6 is a schematic diagram of an image of grayscale transformation according to an embodiment of the present invention;
[0016] Figure 7 is a schematic diagram of a process for determining a target display style of an original image according to an embodiment of the present invention;
[0017] Figure 8 is a schematic diagram of a grid image according to an embodiment of the present invention;
[0018] Figure 9 is a schematic diagram of a process for synthesizing a target image according to an embodiment of the present invention;
[0019] Figure 10 is a structural block diagram of an image display device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0020] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings and in combination with embodiments.
[0021] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0022] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 FIG. 1 is a structural diagram of a mobile terminal according to an image display method of an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown) a processor 102 (the processor 102 may include but is not limited to a microprocessor MCU or a programmable logic device FPGA and other processing devices) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It will be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown.
[0023] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the image display method in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, implementing the above-mentioned method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely located relative to the processor 102, and these remote memories may be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0024] The transmission device 106 can be used to receive or send data via a network. Specific examples of the aforementioned network may include a wireless network provided by the mobile terminal's communications provider. In one embodiment, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In one embodiment, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0025] In this embodiment, an image display method is provided. Figure 2 FIG. 1 is a flow chart diagram of an image display method according to an embodiment of the present invention. Figure 2 As shown, the process may include, but is not limited to, the following steps:
[0026] Step S202, reading the original image;
[0027] In an exemplary embodiment, the original image may be an image captured in real time by a camera device, or may be an image read from an image library, or may be a screenshot or an image sent by another device.
[0028] Step S204, determining the target display style of the original image;
[0029] In an exemplary embodiment, the display style of an image includes, but is not limited to, a photographic style, a digital art style, an illustration style, a sketching style, a watercolor style, an oil painting style, a printmaking style, and the like. For example, by changing the processing methods such as the gender, age, skin color, hairstyle, and expression of the object in the image, images of different styles can be generated; by changing the painting methods such as printmaking, colored pencil drawing, colored chalk drawing, fine brushwork, watercolor, gouache, and oil painting of the image, images of different styles can be generated; the display style of the image can also be a style determined according to the image features or content (e.g., color, scene, texture style, etc.) of the image. For example, based on the season corresponding to the image features, it can be determined whether the style of the image belongs to one of the four seasons. The target display style includes, but is not limited to, one or more of the above display styles.
[0030] Step S206, generating target keywords of the target display style;
[0031] In an exemplary embodiment, the target keywords of the target display style are extracted from the target display style and can identify the words or phrases of the display style. For example, when the target display style of the determined original image is "relatively bright colored pencil drawing image", the target keywords that can be extracted include "relatively bright" and "colored pencil drawing". Then, when generating the first image based on the target keywords, one keyword can be used to generate one image, or multiple keywords can be combined to generate one image. For example, the target keywords include "relatively bright" and "colored pencil drawing", and the N frames of images generated include: an image with increased brightness based on the brightness displayed by the original image, an image with colored pencil drawing style, and an image with increased brightness based on the brightness displayed by the original image and in the style of colored pencil drawing.
[0032] Step S208, generating N frames of first images based on the target keyword and the original image, where N is a natural number greater than 1;
[0033] In an exemplary embodiment, the method of generating N frames of first images based on target keywords and original images is not limited, for example, N frames of first images are generated by a deep learning model. Deep learning models include but are not limited to any generative model that can generate relevant content based on artificial intelligence algorithms, for example, by inputting keywords, descriptions or samples, a model that can generate articles, images, audio, etc. that match them. For example, Figure 3 The original image and target keyword (oil painting style) shown in the figure are input into the model, and the model output is as follows: Figure 4 For example, Figure 5 The original image and target keywords (grayscale transformed image style) shown in the figure are input into the model, and the model output is as follows Figure 6 The grayscale transformed image shown in the figure. You can also input target keywords such as changing the skin color or expression of the object in the original image, or changing the original image's printmaking, colored pencil drawing, colored chalk drawing, fine brushwork, watercolor, gouache, oil painting, etc. into the model, and the model will output an image of the corresponding style.
[0034] In an exemplary embodiment, the target keyword in the target display style may include one or more. When one is included, a first image frame is generated, which may be as follows: Figure 4The image described. When the target display style includes multiple target keywords, a frame of the first image can be generated corresponding to each extracted target keyword, thereby obtaining multiple frames of first images. The multiple frames of first images are images with the same content but different styles. Different styles mean different color expressions and texture details, for example, the skin color and texture of the objects in the image. The same content means that it is still the content in the original image, for example, the objects included in the multiple frames of the first image are still the objects in the original image, and the facial features of the objects are basically in the original position and size. That is, only the details in the original image are modified, and no substantial content changes are made, for example, changing the color. In addition, this embodiment can also make substantial content changes, for example, removing objects in the original image; changing the cat in the original image into a dog.
[0035] It should be noted that the statement describing the target display style can be input by the user through the client; it can also be selected by the user from statements pre-stored in the image library; or it can be selected by the user from multiple sets of style templates pre-stored in the database. For example, the user inputs a customized style description statement for generating an image through the client, which includes "keyword 1, keyword 2, keyword 3, keyword 4". Then, multiple frames of the first image are generated according to "keyword 1, keyword 2, keyword 3, keyword 4" and the original image. For another example, the following style templates are pre-stored in the database for users to choose from:
[0036] Template 1: 6 pictures, original drawing, colored pencil drawing, fine brushwork drawing, watercolor drawing, gouache drawing, and oil painting;
[0037] Template 2: 4 images, original image, younger image, darker skin color, and older image;
[0038] Template 3: 4 pictures, spring, summer, autumn, winter;
[0039] Template 4: 2 pictures, original pictures, younger;
[0040] Each template comes with a demonstration video for users to preview the effects. Each image within each template displays a different style. For example, Template 1, "Colored Pencil Drawing," indicates to the user that the original image will be transformed into a colored pencil-style image. This doesn't involve directly inputting the original image and "watercolor painting" into the image processing model. Instead, the model inputs the original image and a text description, such as "transform to a watercolor style, brighter." This more complex description allows for more precise control over the resulting image and the transition between the previous and next images.
[0041] In an exemplary embodiment, this embodiment can generate N first images based on a single original image. Alternatively, a single first image can be generated based on multiple original images, or multiple first images with different display styles can be generated. The method for generating a single first image using multiple original images, or generating multiple first images with different display styles, is the same as described above and will not be further described here.
[0042] Step S210 , synthesizing the N frames of first image with the original image to obtain a target image, and displaying the target image.
[0043] The execution subject of the above steps may be a terminal, a server, a specific processor provided in the terminal or server, or a processor or processing device provided relatively independently from the terminal or server, but is not limited thereto.
[0044] Through the above steps, once the target display style of the original image is determined, target keywords for the target display style are generated. Then, based on the target keywords and the original image, N frames of the first image are generated. These N frames of the first image are then synthesized with the original image, and the synthesized target image is displayed. This solution can conserve storage space to a certain extent and can also utilize multiple images to display the image, depending on the target display style being viewed, expanding the image display styles. This solves the problem of insufficient image display effects in related technologies, achieving the goal of enriching image display methods and saving image storage space.
[0045] In an exemplary embodiment, this embodiment is applied to a scenario where images of various styles are displayed. For example, for photos of the same subject or the same item, multiple frames of images can be generated by changing the display style of the image, synthesized, and displayed. This function can also be applied to image processing scenarios in image galleries as one of the functions of generative artificial intelligence (AIGC), where AIGC refers to a technology based on artificial intelligence technical methods such as generative adversarial networks and large pre-trained models, which generates relevant content with appropriate generalization capabilities through learning and recognition of existing data.
[0046] In an exemplary embodiment, determining a target display style of an acquired original image includes: extracting original image features of the original image and determining an original display style of the original image from the original image features; and determining a target display style based on the original display style, wherein the target display style is a display style different from the original display style.
[0047] In an exemplary embodiment, the method of extracting the original image features of the original image is not limited. For example, the original image features of the original image can be extracted by a deep learning model such as a convolutional neural network. The original image features include but are not limited to: color features, texture features, shape features, global features, local features, and deep learning features. The display style of the original image can be accurately determined by the original image features. After determining the display style of the original image, the original image can be processed into other display styles other than the original display style. For example, when the original display style is oil painting, the target display style can be a style such as colored pencil painting, colored chalk painting, fine brushwork painting, watercolor painting, gouache painting, etc. There is no need to regenerate an image that is identical to the original image, thereby improving the efficiency of generating N frames of the first image.
[0048] In an exemplary embodiment, determining a target display style of an acquired original image includes: extracting reference image features of a reference image and determining a reference display style of the reference image from the reference image features, wherein the reference image is an image generated based on other keywords and other original images; displaying the reference display style and receiving a selection operation for selecting one or more target reference display styles included in the reference display style; and determining the target display style based on the one or more target reference display styles.
[0049] In an exemplary embodiment, the reference image may be other original images, or other images that have been style-processed. The method of extracting reference image features of the reference image is the same as the method of extracting the original image features mentioned above. The content included in the reference image features is basically the same as the content included in the original image features mentioned above, and will not be repeated here. This embodiment can also display the reference display style in the application in the terminal, mainly to confirm whether it is the image display style required by the user. When one or more target reference display styles included in the reference display style are received, the target display style is determined based on the one or more target reference display styles. There is no limit to the method of selecting the reference display style, for example, it can be selected by text description, or by clicking on the reference image style displayed on the client, or by voice. The reference display style can be one or more. When multiple reference display styles are included, some target reference display styles can be determined as the target display style through user confirmation, thereby improving the efficiency of generating N frames of the first image.
[0050] In an exemplary embodiment, Figure 7 As shown, when determining the target display style of the original image, the process may include, but is not limited to, the following steps:
[0051] S701, extracting original image features of an original image, and determining an original display style of the original image from the original image features;
[0052] S702, traversing associated images related to the first image, wherein the associated images are images stored in an image database or a cloud;
[0053] S703, confirming the display style of the associated image;
[0054] S704 : Determine the target display style based on the display style of the associated image and the original display style, wherein the target display style is different from the display style of the associated image and the original display style.
[0055] By confirming the target display style in the above manner, the missing display styles can be found based on the existing styles combined with the style record database, allowing users to experience different display styles. The style record database can compile data sets for each style based on big data. If the style of the original image and the style of the associated image both belong to a certain style data set, then the remaining part or all of the display styles in that data set are determined as the target display style. If the style of the original image and the style of the associated image belong to different style data sets, the remaining part or all of the display styles in their corresponding data sets can also be used as the target display style.
[0056] In an exemplary embodiment, the N first images may or may not include associated images. That is, the N first images may be a portion of images selected from all processed original images, or may be all processed original images. Associated images include, but are not limited to, images that are associated with the original image. For example, the original image and the associated image may have the same or similar labels, scenes, features, objects, or text.
[0057] In an exemplary embodiment, the associated images related to the first image can be traversed in the following manner: traversing the file path of the associated images; using an image processing library to read each frame of the associated image and display it; using a loop statement to traverse each frame of the associated image, and using functions in the image processing library within the loop to display the associated image; performing some processing on the associated images as needed, such as adjusting the size, rotation, and cropping of the associated images to display different image styles. For example, when the image display styles of the traversed associated images include colored pencil drawing, colored chalk drawing, fine brushwork, and watercolor painting, the ink painting style is determined as the target display style. This is to distinguish it from the display style of the associated image. This allows the accurate determination of the missing image style, thereby improving the efficiency of generating N frames of the first image.
[0058] In an exemplary embodiment, determining a target display style of an acquired original image includes: receiving image processing parameters, wherein the image processing parameters are parameters set when processing the original image; and determining the target display style from the image processing parameters.
[0059] In an exemplary embodiment, image processing parameters refer to parameters required for image processing. For example, image processing parameters include, but are not limited to, brightness adjustment parameters, contrast adjustment parameters, sharpening parameters, color saturation adjustment parameters, hue adjustment parameters, noise removal parameters, resizing parameters, rotation and flipping parameters, cropping parameters, and filter parameters. Image processing parameters can be set and adjusted using image processing software or an image processing library in a programming language to accurately perform various image processing operations and rapidly generate N frames of first images.
[0060] In an exemplary embodiment, N frames of first images are synthesized with an original image to obtain a target image, and the target image is displayed, including: receiving a first display instruction, wherein the first display instruction includes at least one of the following: the number of images, an image display parameter; in response to the first display instruction, determining thumbnails of the N frames of first images and original thumbnails of the original images, synthesizing the N thumbnails and the original thumbnails to obtain the target image, wherein the target image includes images of N+1 display areas, and one frame of image is displayed in each display area; and displaying the target image according to a first preset image format.
[0061] In an exemplary embodiment, the N first images can be a portion of images selected from all processed images of the original image, or can be all processed images of the original image. For example, four images can be selected from all processed images of the original image (the number can be adjusted by the user). The selection rules for the N first images can be based on the image display style, image parameters, etc. For example, for images generated in common display styles, some image features are known, such as the rich lines of a colored pencil drawing style, the darker images of an African American portrait style, and the whiter images of a winter style. The selection is made based on these acquired features. For another example, by selecting image display parameter values (e.g., image brightness), four images of relatively bright styles can be selected. For another example, by selecting image display parameter values (e.g., image brightness), four images of relatively different brightness styles can be selected. The method for selecting the N first images is related to the image display method desired by the user, as well as the number of images and image display parameters desired by the user.
[0062] In an exemplary embodiment, the first display instruction may be a text instruction, a voice instruction, or an action instruction (for example, a user issues an instruction by pressing a key).
[0063] In an exemplary embodiment, the size of the thumbnail is related to the size of the N frames of first images. The composite image is formed by splicing the thumbnails of the N frames of first images and the thumbnails of the original images.
[0064] In an exemplary embodiment, in response to an image display instruction, after determining thumbnails of N frames of the first image and original thumbnails of the original image, synthesizing the N thumbnails and the original thumbnails, and obtaining the target image, the method further includes: setting corresponding identification information in each display area, wherein the identification information set in each display area is used to identify the original image corresponding to the thumbnail displayed in each display area. For example, Figure 8 As shown, the thumbnails of the N frames of the first image and the thumbnails of the original image are spliced into a 6-grid grid image. The grid image includes 6 display areas, each displaying a corresponding thumbnail. After generating the target image, corresponding identification information, such as "pic1", "pic2", "pic3", "pic4", "pic5", and "pic6", is inserted into the display area of the target image, and the corresponding first image is inserted after each identification information.
[0065] In an exemplary embodiment, after synthesizing N frames of first image and original image to obtain a target image and displaying the target image, the method further includes: storing the target image, the N frames of first image, and the original image in a corresponding manner in a target file, wherein the target image is an image including N+1 display areas, each display area displaying one frame of image, to facilitate subsequent reading and display of images.
[0066] In an exemplary embodiment, after synthesizing N frames of first images with the original image to obtain a target image and displaying the target image, the above method further includes: storing the target image; or, storing the target image and the original image; or, storing the original image and keywords; or, storing the target image, the original image and keywords.
[0067] In an exemplary embodiment, a target image may be displayed in a terminal application according to a first preset image format. The application may be an application that only has image display capabilities or an application that also has video display capabilities. The application is primarily used to display the synthesized target image and the separate first image. The application's display is triggered by a display instruction.
[0068] This embodiment combines N frames of first images and the original image into a target image by splicing thumbnails, and can display the N frames of first images and the original image as a single frame. This not only enriches the image display methods, improves the user's image viewing efficiency, but also saves image storage space.
[0069] In an exemplary embodiment, Figure 9 As shown, when synthesizing N frames of first images with the original image to obtain a target image and displaying the target image, the process may include, but is not limited to, the following steps:
[0070] S901, displaying a target image in a target application according to a second preset image format, wherein the target application is an application that supports video playback;
[0071] S902, when it is determined that each display area included in the displayed target image includes identification information, acquiring N frames of first images and original images according to the identification information included in each display area, wherein the identification information correspondingly set in each display area is used to identify the original image corresponding to the thumbnail displayed in each display area;
[0072] S903, generating a target video for displaying the N frames of the first image and the original image based on a correspondence between pixel values and weight values of frame images adjacent in a predetermined direction in the N+1 display areas included in the N frames of the first image and the original image;
[0073] S904: Play the target video in the target application.
[0074] In an exemplary embodiment, this embodiment is applied to a scenario where multiple frames of images need to be displayed in the form of a video. In this scenario, first, the target image is displayed in the second application, and it is determined whether each display area in the target image includes identification information. The identification information is set when the target image is generated, and is used to identify the separate first image or original image corresponding to each display area. It should be noted that the identification information will be displayed in each display area only when the second application supports the video playback function. Secondly, the separate image corresponding to each display area (i.e., N frames of first images and original images) is read from the target file. Finally, a target video of N frames of first images and original images is generated.
[0075] Furthermore, whether the transition between images during playback of the target video is smooth is related to the display style of the N first images and the original image, as well as the corresponding relationship between the playback time interval between adjacent frames in the target video, the pixel values of the images, and the weight values. For example, if the N first images selected based on the image brightness parameter are all bright, the transition between images will be smoother when the video is synthesized. If the N first images selected are of a style with large brightness differences, the transition between images will be more layered when the video is synthesized.
[0076] In an exemplary embodiment, based on the correspondence between pixel values and weight values of frame images adjacent in a predetermined direction in N+1 display areas included in N frames of first images and original images, a target video for displaying N frames of first images and original images is generated, including: performing the following operations on any adjacent frame images included in the N frames of first images and original images to synthesize adjacent frame images: determining pixel values and weight values of corresponding pixels between the first frame image and the second frame image included in the adjacent frame images, wherein the weight value is used to represent the weight level of the pixel value in the synthesized adjacent frame images; synthesizing corresponding pixels using the pixel values and weight values of corresponding pixels to synthesize adjacent frame images, wherein the adjacent frame images include multiple frames of images whose weight levels change according to a preset gradient; and generating a target video using all the synthesized adjacent frame images.
[0077] In an exemplary embodiment, the frame images adjacent in a predetermined direction may be as follows: Figure 7 The horizontally adjacent images shown may also be vertically adjacent images, or may be images with adjacent identification information. For example, when the identification information corresponding to each image region is "pic1," "pic2," and "pic3," the images corresponding to "pic1" and "pic2" are adjacent frame images, and the images corresponding to "pic2" and "pic3" are also adjacent frame images.
[0078] In an exemplary embodiment, the N first images and the original image are images of the same size, and corresponding pixels between the first and second images are two pixels with the same coordinate position. The pixel values of corresponding pixels between the first and second images can be determined using a color model, such as the RGB color model, the CMYK color model, etc. In the RGB color model, the pixel value of a pixel is composed of the values of the three color channels: red, green, and blue. The value range of each channel is generally 0-255, which is used to represent the depth of the color (i.e., the weight level). In the CMYK color model, the pixel value of a pixel is composed of the values of the four color channels: cyan, magenta, yellow, and black. The value range of each channel is generally 0-100, which is used to represent the depth of the color. Depending on the color model and pixel depth, the pixel value of a pixel can have different representation methods and accuracy. This embodiment will be described below using the RGB color model as an example. For example, the pixel values of the i-th pixel corresponding to the first and second images are v1 and v2 respectively (for ease of description, a single channel is used as an example, i.e., a pixel has only one value), and the weights are w1 and w2 respectively. The weights range from 0, 1, 2, ... 255, for a total of 256 levels (the minimum and maximum weights can also be 0.0 to 1.0, with intervals of 0.05 or other decimals). In an exemplary embodiment, the preset gradient includes the weight w1 corresponding to the pixel value gradually decreasing from 255 to 0, and gradually increasing from 0 to 255.
[0079] In an exemplary embodiment, the corresponding pixels are synthesized using the pixel values and weight values of the corresponding pixels to synthesize adjacent frame images, including: decreasing the weight values of the corresponding pixels in the first frame image according to a preset gradient, and simultaneously increasing the weight values of the corresponding pixels in the second frame image according to a preset gradient; calculating multiple synthesized pixel values of the corresponding pixels using the pixel values and weight values of the corresponding pixels in the first frame image and the pixel values and weight values of the corresponding pixels in the second frame image in sequence; and generating a picture synthesized by multiple synthesized pixel values corresponding to multiple corresponding pixels in adjacent frame images to obtain adjacent frame images.
[0080] For example, for a single-channel image, when the pixel values of the i-th pixel corresponding to the first and second frames are v1 and v2, respectively, and the weights are w1 and w2, respectively, w1 of the first frame gradually decreases from 255 to 0, while w2 of the second frame gradually increases from 0 to 255. The pixel value of the i-th pixel in the composite image is v: v = (v1*w1+v2*w2) / (w1+w2). 256 frames are synthesized from the first and second frames (the weight increase and decrease intervals can be 2, 3, etc., in addition to 1). The second and third frames, the third and fourth frames, and so on, are then synthesized in the same way.
[0081] For a three-channel (r, g, b) image, the composite values of the r, g, and b channels can be calculated separately:
[0082] vr=(vr1*w1+vr2*w2) / (w1+w2);
[0083] vg=(vg1*w1+vg2*w2) / (w1+w2);
[0084] vb=(vb1*w1+vb2*w2) / (w1+w2).
[0085] In an exemplary embodiment, after synthesizing the target video, this embodiment plays it in the second application and does not save the target video. The next time the user needs to play the video, the video can be synthesized again, thereby saving storage space.
[0086] In an exemplary embodiment, before synthesizing N frames of first images with an original image to obtain a target image and displaying the target image, the method further includes: receiving a second display instruction, wherein the second display instruction includes at least one of the following: an instruction to display the N frames of first images and the original image in an image format, and an instruction to display the N frames of first images and the original image in a carousel display format; responding to the second display instruction, synthesizing the N frames of first images and the original image according to the second display instruction.
[0087] In an exemplary embodiment, the second display instruction is generated in any manner, and may be generated by double-clicking, or by a play instruction issued by voice, etc. This embodiment can flexibly switch the image display mode when triggered by a display instruction.
[0088] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0089] In this embodiment, an image display device is also provided, which is used to implement the above-mentioned embodiments and preferred embodiments. The details already described will not be repeated here. As used below, the term "module" can refer to a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation using hardware, or a combination of software and hardware, is also possible and contemplated.
[0090] Figure 10 is a structural block diagram of an image display device according to an embodiment of the present invention. Figure 10 As shown, the device may include: a first reading module 1002, used to read the original image; a first determining module 1004, used to determine the target display style of the above original image; a first generating module 1006, used to generate target keywords of the above target display style; a second generating module 1008, used to generate N frames of first images based on the above target keywords and the above original image, wherein the above N is a natural number greater than 1; a first synthesizing module 1010, used to synthesize the above N frames of first images with the above original image to obtain a target image, and display the above target image.
[0091] In an exemplary embodiment, the first determination module 1004 may include: a first extraction unit, used to extract the original image features of the above-mentioned original image, and determine the original display style of the above-mentioned original image from the above-mentioned original image features; a first determination unit, used to determine the above-mentioned target display style based on the above-mentioned original display style, wherein the above-mentioned target display style is a display style different from the above-mentioned original display style.
[0092] In an exemplary embodiment, the first determination module 1004 may include: a second extraction unit, used to extract reference image features of a reference image, and determine a reference display style of the reference image from the reference image features, wherein the reference image is an image generated based on other keywords and other original images; a first display unit, used to display the reference display style, and receive a selection operation for selecting one or more target reference display styles included in the reference display style; and a second determination unit, used to determine the target display style based on one or more target reference display styles.
[0093] In an exemplary embodiment, the first determination module 1004 includes: a third extraction unit, used to extract the original image features of the above-mentioned original image, and determine the original display style of the above-mentioned original image from the above-mentioned original image features; a first traversal unit, used to traverse the associated images related to the above-mentioned first image, wherein the above-mentioned associated images are images stored in an image database or in the cloud; a first confirmation unit, used to confirm the display style of the above-mentioned associated images; a second confirmation unit, used to confirm the above-mentioned target display style based on the display style of the above-mentioned associated images and the above-mentioned original display style, wherein the above-mentioned target display style is different from the display style of the above-mentioned associated images and the above-mentioned original display style.
[0094] In an exemplary embodiment, the first determination module 1004 includes: a first receiving unit for receiving image processing parameters, wherein the above-mentioned image processing parameters are parameters set when processing the above-mentioned original image; and a third determination unit for determining the above-mentioned target display style from the above-mentioned image processing parameters.
[0095] In an exemplary embodiment, the first synthesis module 1010 includes: a second receiving unit for receiving a first display instruction, wherein the first display instruction includes at least one of the following: the number of images, image display parameters; a first responding unit for responding to the first display instruction, determining the thumbnails of the N frames of the first image and the original thumbnails of the original image, synthesizing the N thumbnails and the original thumbnails to obtain the target image, wherein the target image includes images of N+1 display areas, and each display area displays a frame of image; and displaying the target image according to a first preset image format.
[0096] In an exemplary embodiment, the above-mentioned device also includes: a first setting module, which is used to respond to the above-mentioned image display instruction, determine N frames of thumbnails of the above-mentioned first image and the original thumbnails of the above-mentioned original image, synthesize the above-mentioned N thumbnails and the above-mentioned original thumbnails, and after obtaining the above-mentioned target image, set corresponding identification information in each of the above-mentioned display areas, wherein the above-mentioned identification information set correspondingly in each of the above-mentioned display areas is used to identify the original image corresponding to the thumbnail displayed in each of the above-mentioned display areas.
[0097] In an exemplary embodiment, the above-mentioned device also includes: a storage module, which is used to synthesize the above-mentioned N frames of first images with the above-mentioned original image to obtain a target image, and after displaying the above-mentioned target image, store the above-mentioned target image, the above-mentioned N frames of first images and the above-mentioned original image correspondingly in a target file, wherein the above-mentioned target image is an image including N+1 display areas, and each of the above-mentioned display areas displays a frame of image.
[0098] In an exemplary embodiment, the first synthesis module 1010 includes: a first display unit, configured to display the target image in a target application according to a second preset image format, wherein the target application is an application that supports video playback; a first acquisition unit, configured to, upon determining that each display area included in the displayed target image includes identification information, acquire the N frames of first image and the original image according to the identification information included in each of the display areas, wherein the identification information correspondingly set in each of the display areas is used to identify the original image corresponding to the thumbnail displayed in each of the display areas; a first generation unit, configured to generate a target video for displaying the N frames of first image and the original image based on the correspondence between pixel values and weight values of the frame images adjacent in a predetermined direction in the N+1 display areas included in the N frames of first image and the original image; and a first playback unit, configured to play the target video in the target application.
[0099] In an exemplary embodiment, the above-mentioned first generation unit includes: a first processing submodule, which is used to perform the following operations on any adjacent frame images included in the above-mentioned N frames of first images and the above-mentioned original images to synthesize adjacent frame images: determine the pixel values and weight values of corresponding pixels between the first frame image and the second frame image included in the above-mentioned adjacent frame images, wherein the above-mentioned weight values are used to represent the weight levels of the above-mentioned pixel values in the above-mentioned adjacent frame images after synthesis; synthesize the above-mentioned corresponding pixels using the pixel values and weight values of the above-mentioned corresponding pixels to synthesize the above-mentioned adjacent frame images, wherein the above-mentioned adjacent frame images include multiple frames of images whose weight levels change according to a preset gradient; and generate the above-mentioned target video using all the synthesized adjacent frame images.
[0100] In an exemplary embodiment, the first processing submodule synthesizes the corresponding pixels using the pixel values and weight values of the corresponding pixels in the following manner to synthesize the adjacent frame images: decreasing the weight values of the corresponding pixels in the first frame image according to the preset gradient, and increasing the weight values of the corresponding pixels in the second frame image according to the preset gradient; calculating a plurality of synthesized pixel values of the corresponding pixels using the pixel values and weight values of the corresponding pixels in the first frame image and the pixel values and weight values of the corresponding pixels in the second frame image in sequence; and generating a picture synthesized by the plurality of synthesized pixel values corresponding to the plurality of corresponding pixels in the adjacent frame images to obtain the adjacent frame images.
[0101] In an exemplary embodiment, the above-mentioned device also includes: a first receiving module, used to synthesize the above-mentioned N frames of first images with the above-mentioned original image to obtain a target image, and before displaying the above-mentioned target image, receive a second display instruction, wherein the above-mentioned second display instruction includes at least one of the following: an instruction to display the above-mentioned N frames of first images and the above-mentioned original image in the form of images, and an instruction to display the above-mentioned N frames of first images and the above-mentioned original image in a carousel display manner; a first responding module, used to respond to the above-mentioned second display instruction, and synthesize the above-mentioned N frames of first images and the above-mentioned original image according to the above-mentioned second display instruction.
[0102] It should be noted that the above modules can be implemented through software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0103] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps of any one of the above method embodiments when running.
[0104] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0105] An embodiment of the present invention further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0106] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0107] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any one of the above method embodiments are implemented.
[0108] An embodiment of the present application further provides another computer program product, comprising a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any of the above method embodiments are implemented.
[0109] An embodiment of the present application further provides a computer program, which includes computer instructions stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps of any of the above method embodiments.
[0110] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail here.
[0111] Obviously, those skilled in the art will appreciate that the various modules or steps of the present invention described above can be implemented using a general-purpose computing device, can be centralized on a single computing device, or can be distributed across a network of multiple computing devices. They can be implemented using program code executable by the computing device, and thus, can be stored in a storage device and executed by the computing device. In some cases, the steps shown or described herein can be performed in a different order than that shown, or can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.
[0112] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the principles of the present invention are intended to be within the scope of protection of the present invention.
Claims
1. An image display method, characterized in that: include: Read the original image; determining a target display style for the original image; generating target keywords for the target display style; generating N frames of first images based on the target keyword and the original image, wherein N is a natural number greater than 1; The N frames of first images are synthesized with the original image to obtain a target image, and the target image is displayed.
2. The method according to claim 1, characterized in that Determining a target display style of the original image includes: extracting original image features of the original image, and determining an original display style of the original image from the original image features; The target display style is determined based on the original display style, wherein the target display style is a display style different from the original display style.
3. The method according to claim 1, characterized in that Determining a target display style of the original image includes: extracting reference image features of a reference image, and determining a reference display style of the reference image from the reference image features, wherein the reference image is an image generated based on other keywords and other original images; displaying the reference display style, and receiving a selection operation for selecting one or more target reference display styles included in the reference display style; The target display style is determined based on one or more target reference display styles.
4. The method according to claim 1, wherein Determining a target display style of the original image includes: extracting original image features of the original image, and determining an original display style of the original image from the original image features; Traversing associated images related to the first image, wherein the associated images are images stored in an image database or a cloud; confirming a display style of the associated image; The target display style is determined based on the display style of the associated image and the original display style, wherein the target display style is different from the display style of the associated image and the original display style.
5. The method according to claim 1, characterized in that Determining a target display style of the original image includes: receiving image processing parameters, wherein the image processing parameters are parameters set when processing the original image; The target display style is determined from the image processing parameters.
6. The method according to claim 1, characterized in that Combining the N frames of first image with the original image to obtain a target image, and displaying the target image, comprising: receiving a first display instruction, wherein the first display instruction includes at least one of the following: the number of images, and image display parameters; In response to the first display instruction, the thumbnails of the N frames of the first image and the original thumbnail of the original image are determined, and the N thumbnails and the original thumbnail are synthesized to obtain the target image, wherein the target image includes images of N+1 display areas, and each display area displays a frame of image; the target image is displayed according to a first preset image format.
7. The method according to claim 6, characterized in that In response to the image display instruction, determining N thumbnails of the first image and original thumbnails of the original image, synthesizing the N thumbnails and the original thumbnails to obtain the target image, the method further includes: Identification information is correspondingly set in each of the display areas, wherein the identification information correspondingly set in each of the display areas is used to identify the original image corresponding to the thumbnail displayed in each of the display areas.
8. The method according to claim 1, characterized in that After synthesizing the N frames of first images with the original image to obtain a target image and displaying the target image, the method further includes: The target image, the N frames of first image, and the original image are correspondingly stored in a target file, wherein the target image is an image including N+1 display areas, and each display area displays a frame of image.
9. The method according to claim 1 or 8, characterized in that Combining the N frames of first image with the original image to obtain a target image, and displaying the target image, includes: Displaying the target image in a target application according to a second preset image format, wherein the target application is an application that supports video playback; When it is determined that each display area included in the displayed target image includes identification information, acquiring the N frames of first images and the original image according to the identification information included in each display area, wherein the identification information correspondingly set in each display area is used to identify the original image corresponding to the thumbnail displayed in each display area; generating a target video for displaying the N frames of first images and the original image based on a correspondence between pixel values and weight values of frame images adjacent in a predetermined direction in the N+1 display areas and included in the N frames of first images and the original image; Play the target video in the target application.
10. The method according to claim 9, characterized in that Generating a target video for displaying the N frames of first images and the original image based on a correspondence between pixel values and weight values of frame images adjacent in a predetermined direction in the N+1 display areas and included in the N frames of first images and the original image, comprising: The following operations are performed on any adjacent frame images included in the N frames of first images and the original image to synthesize the adjacent frame images: Determining pixel values and weight values of corresponding pixels between a first frame image and a second frame image included in the adjacent frame images, wherein the weight value is used to represent a weight level of the pixel value in the synthesized adjacent frame images; synthesizing the corresponding pixels using the pixel values and weight values of the corresponding pixels to synthesize the adjacent frame images, wherein the adjacent frame images include a plurality of frames of images in which the weight levels change according to a preset gradient; The target video is generated by synthesizing all the adjacent frame images.
11. The method according to claim 10, characterized in that Synthesizing the corresponding pixels using pixel values and weight values of the corresponding pixels to synthesize the adjacent frame images includes: Decreasing the weight value of the corresponding pixel in the first frame image according to the preset gradient, and increasing the weight value of the corresponding pixel in the second frame image according to the preset gradient; sequentially calculating a plurality of composite pixel values of the corresponding pixels by using the pixel values and weight values of the corresponding pixels in the first frame image and the pixel values and weight values of the corresponding pixels in the second frame image; A picture synthesized by the plurality of synthesized pixel values corresponding to the plurality of corresponding pixels in the adjacent frame images is generated to obtain the adjacent frame images.
12. The method according to claim 1, characterized in that Before synthesizing the N frames of first images with the original image to obtain a target image and displaying the target image, the method further includes: receiving a second display instruction, wherein the second display instruction includes at least one of the following: an instruction to display the N frames of first image and the original image in an image format, and an instruction to display the N frames of first image and the original image in a carousel display format; In response to the second display instruction, the N frames of first image and the original image are synthesized according to the second display instruction.
13. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 12 are implemented.
14. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 12 are implemented.