Disclosure of Invention
In view of the foregoing problems in the prior art, the present application provides a display method, a display device, and an electronic device, and the technical solution adopted in the embodiments of the present application is as follows:
in one aspect, an embodiment of the present application provides a display method, including:
determining a current data image according to the image data based on a preset time interval;
selecting a corresponding theme scheme from a preset theme data set according to the data image; wherein the preset theme data set is generated based on the preset time interval through the image data;
judging whether the current theme scheme of the first display content needs to be switched or not based on the selected theme scheme;
and if necessary, switching the current theme scheme of the first display content into the selected theme scheme.
In some embodiments, the generating of the preset theme data set includes:
slicing the image data based on the preset time interval to obtain slice images;
and generating the preset theme data set according to the slice image and the first display content.
In some embodiments, the generating the preset theme data set according to the slice image and the first display content includes:
identifying the slice image, acquiring a corresponding color gamut parameter, and generating a theme scheme corresponding to the slice image based on the first display content according to the color gamut parameter;
and arranging the theme scheme according to the time sequence to generate the preset theme data set.
In some embodiments, the generating a theme scheme corresponding to the slice image based on the first display content according to the color gamut parameter includes:
and at least determining the background color and the font color of the first display content according to the color gamut parameters, and configuring a theme scheme corresponding to the slice image according to the background color and the font color.
In some embodiments, the selecting a corresponding theme scheme from a preset theme data set according to the data image includes:
acquiring a time scale of the data image based on the preset time interval;
and determining a theme scheme from the same time scale in the preset theme data set based on the time scale so as to select the corresponding theme scheme.
In some embodiments, the determining whether the current theme scheme of the first display content needs to be switched based on the selected theme scheme includes:
acquiring color parameters of the selected theme scheme;
and comparing the color parameters with the color parameters of the current theme scheme, and if the comparison result meets the switching condition, switching.
In some embodiments, switching the current theme scheme of the first display content to the selected theme scheme includes:
and transforming the current theme scheme of the first display content through front-end control rendering by using the selected theme scheme so as to enable the color presented by the first display content to be matched with the data image.
On the other hand, an embodiment of the present application provides a display device, including:
the determining module is used for determining a current data image according to the image data based on a preset time interval;
the selecting module selects a corresponding theme scheme from a preset theme data set according to the data image; wherein the preset theme data set is generated based on the preset time interval for the image data;
the judging module is used for judging whether the current theme scheme of the first display content needs to be switched or not;
and the switching module is used for switching the current theme scheme of the first display content into the selected theme scheme if necessary.
In some embodiments, the determining module comprises:
the acquisition unit is used for acquiring the color parameters of the current theme scheme;
and the comparison unit is used for comparing the color parameter with the color parameter of the historical theme scheme of the previous historical data image, and if the comparison result is different, switching is required.
In another aspect, an embodiment of the present application provides an electronic device, which includes at least a memory, a processor, and a bus, where the memory stores machine-readable instructions executable by the processor, and when the electronic device runs, the processor and the memory communicate with each other through the bus, and the machine-readable instructions, when executed by the processor, perform the steps of the method provided in any embodiment of the present application.
Compared with the prior art, the beneficial effects of the embodiment of the application lie in that: in the display method provided by the embodiment of the application, a data image currently being played is determined based on image data, and a corresponding theme scheme is selected from a preset theme data set according to the data image, wherein the preset theme data set is generated based on the image data at the preset time interval, so that the selected theme scheme corresponds to the data image. And then judging whether the theme scheme currently displayed by the theme content needs to be switched or not according to the selected theme scheme, and if so, replacing the theme scheme currently displayed by the theme content with the selected theme scheme so as to enable the color displayed by the theme content to be coordinated with the data image currently played by the image data. The display method provided by the embodiment of the application is convenient and quick in theme switching, and the interactive switching of the theme scheme can be formed according to the data image played by the image data in real time, so that the first display content is coordinately displayed on the data image played in real time, and the experience of a user in watching is improved.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the drawings of the embodiments of the present application. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the described embodiments of the application without any inventive step, are within the scope of protection of the application.
Unless defined otherwise, technical or scientific terms used herein shall have the ordinary meaning as understood by one of ordinary skill in the art to which this application belongs. As used in this application, the terms "first," "second," and the like do not denote any order, quantity, or importance, but rather are used to distinguish one element from another. The word "comprising" or "comprises", and the like, means that the element or item listed before the word covers the element or item listed after the word and its equivalents, but does not exclude other elements or items. The terms "connected" or "coupled" and the like are not restricted to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "upper", "lower", "left", "right", and the like are used merely to indicate relative positional relationships, and when the absolute position of the object being described is changed, the relative positional relationships may also be changed accordingly.
Detailed descriptions of known functions and known components are omitted in the present application in order to keep the following description of the embodiments of the present application clear and concise.
At present, a visual large-screen system can display the content of image data, and simultaneously, the subject content of the image data is displayed at the front end of the image data in a transparent shielding manner, so that in the playing process of the image data, a user can view the subject to which the image data aims through the subject content. Because the theme scheme of the theme content is usually one or more preset theme schemes, the background color or font color and the like of the theme content can be configured according to the theme scheme, so that the theme content is correspondingly displayed. In the process of playing the video data, the playing content usually changes with the playing time, which may cause the display mode of the video data playing to be inconsistent with the display mode of the theme content, or cause the user to be unable to clearly see the characters to be presented on the theme content. In the display method provided by the embodiment of the application, a data image currently being played is determined based on image data, and a corresponding theme scheme is selected from a preset theme data set according to the data image, wherein the preset theme data set is generated based on the image data at the preset time interval, so that the selected theme scheme corresponds to the data image. And judging whether the theme scheme currently displayed by the theme content needs to be switched or not according to the selected theme scheme, and if the theme scheme needs to be switched, replacing the theme scheme currently displayed by the theme content with the selected theme scheme so as to enable the display mode of the theme content to be coordinated with the data image currently played by the image data.
Fig. 1 is a flowchart of a display method according to an embodiment of the present application. As shown in fig. 1, the display method of the embodiment of the present application includes the following steps S100 to S400.
And S100, determining the current data image according to the image data based on the preset time interval.
In the present application, the image data may be a moving picture, video data, or the like, but is not limited thereto. In this step, when determining the data image, the time interval used may be appropriately selected according to experience of a technician or actual needs, for example, 1 minute or 2 minutes, so as to avoid that the time is too short to increase power consumption required for display, and the time is too long, the display method of the present application may not play a role in coordinating display, and the time interval is not specifically limited in this embodiment of the present application. The current data image is determined from the video data based on the preset time interval, and the current data image is determined from the display picture of the currently played video data based on the set proper time interval in the playing process of the video data such as the dynamic picture or the video data. For example, in the playing process of the video data, the preset time interval may be 1 minute, and based on the time interval of 1 minute, the content played at the 61 st second may be determined to be the current data image; correspondingly, after 1 minute, determining the content played at the 121 th second as the current data image; and sequentially determining the current data image in the playing process of the image data according to the time interval of 1 minute until the playing of the image data is finished.
S200, selecting a corresponding theme scheme from a preset theme data set according to the data image; the preset theme data set is generated through the image data based on the preset time interval.
This step is intended to select a corresponding theme scheme from the preset theme data set according to the current data image determined in step S200.
The preset theme data set is generated according to the playing content of the image data based on the preset time interval, and the theme scheme contained in the theme data set corresponds to the playing content of the preset time interval. In some embodiments, the generation of the preset theme data set may be implemented as the following steps:
s211, slicing the image data based on the preset time interval to obtain slice images;
s212, generating the preset theme data set according to the slice image and the first display content.
The present embodiment is directed to acquiring a slice image from the photographic data, thereby generating the preset subject data set from the slice image and the first display content. First, slice images are acquired based on a predetermined time interval according to image data. For example, the image data may be analyzed to obtain a playing time of the image data, and then all playing times of the slicing operation may be determined based on the preset time interval according to the playing time of the image data. Then, slicing operation can be performed on the video data according to all the playing times, and slice images corresponding to all the playing times of the video data are obtained. If the playing time of the image data cannot be obtained, for example, the playing time cannot be determined for the real-time video data stream played online, at this time, the next playing time at which the slicing operation needs to be performed may be determined based on the preset time interval according to the current playing time. Then, when the next playing time comes, the slicing operation is performed on the video data to acquire the corresponding slice image, and therefore, the operation is performed once until the playing of the video data is finished, so that all slice images of the video data based on the preset time interval are acquired. For example, fig. 2 shows that when the preset time interval can be set to 1 minute, the image data is sliced one frame per minute, so that each slice image is acquired.
After the slice image is obtained, the slice image can be identified, the color information of the slice image can be obtained, the color information of the corresponding position of the slice image can be identified in a targeted manner according to the display position of the first display content, and accordingly, color parameters such as background color, font color and the like of the first display content are configured correspondingly according to the color information, so that a theme scheme corresponding to the slice image is generated. Accordingly, according to the color information of all the slice images and the color parameter information of the background, the font color and the like of the first display content, theme schemes corresponding to all the slice images can be generated, and then the preset theme data set of the application can be generated according to all the theme schemes.
In some embodiments, the step S212 may be implemented as the following steps:
s2121, identifying the slice image, acquiring a corresponding color gamut parameter, and generating a theme scheme corresponding to the slice image based on the first display content according to the color gamut parameter;
and S2122, arranging the theme schemes according to a time sequence to generate the preset theme data set.
The embodiment is directed to identifying the slice images, generating corresponding topic solutions, and generating the preset topic data set according to the topic solutions corresponding to all slice images. In this embodiment, slice images are first identified. In the present application, in consideration of avoiding blocking the main playing frame of the image data as much as possible, the first display content is usually set in the peripheral edge region of the playing frame, or when the subtitles are displayed at the bottom of the playing frame, the first display content may be set in the left and right edge regions or the upper edge region of the playing frame. For example, in the case where the first display content is provided in the left and right edges or the upper edge region of the playback screen, when the slice image is recognized, a region having a width corresponding to the size of the first display content may be defined as the recognition region in the left and right edges or the upper edge region of the slice image, or a region having a width of 30 pixels may be defined as the recognition region in the left and right edges or the upper edge region of the slice image according to the experience of a technician. And then identifying the color of the slice image in the identification area to acquire the corresponding color gamut parameters. Fig. 3 and 4 are examples of embodiments of the present application. As shown in fig. 3, aregion 1, aregion 2, and aregion 3 are distributed in the upper edge region and the left and right edge regions of the slice image as identification regions. And then, identifying the image colors of thearea 1, thearea 2 and thearea 3 to obtain the color gamut parameters corresponding to the areas. The gamut parameters for each region are identified and listed as RGB values, R for Red, G for Green and B for Blue, as shown in fig. 4. The different RGB values combine to present the corresponding color.
And after the identified color gamut parameters are identified from the slice image, determining color parameters such as background color, font color and the like of the first display content according to the color gamut parameters. For example, the background color of the first display content is set to be within a proper color gamut range according to the color gamut parameters, so that when the background color is displayed at the front end of the image data, certain distinction can be made in visual sense, but the background color cannot be too dazzling or even dazzling. Thus, all theme schemes corresponding to all slice images may be generated accordingly based on the first display content according to the corresponding gamut parameters.
The slice images are generated according to the playing time of the image data, so that the theme schemes corresponding to the slice images also have time sequence correspondingly, and the preset theme data set can be generated by arranging the theme schemes according to the time sequence.
In some embodiments, the generating a theme scheme corresponding to the slice image based on the first display content according to the color gamut parameter includes:
and at least determining the background color and the font color of the first display content according to the color gamut parameters, and configuring a theme scheme corresponding to the slice image according to the background color and the font color.
The embodiment is directed to determining the background color and the font color of the first display content according to the color gamut parameter of the slice image, so as to configure the theme scheme corresponding to the slice image. The color gamut parameters at least comprise corresponding colors of the slice images, and then background colors and font colors of the first display content are determined according to the corresponding colors. For example, the color of the background color may be set by finding a color combination near the color gamut parameter through the color circle, so that the background color forms a complementary color effect with respect to the color gamut parameter, so that the background color of the first display content visually appears to be changed with respect to the picture of the image data, for example, may be slightly reddish or slightly bluish, so that the first display content forms a shading effect of the background at the front end of the image data. Correspondingly, the font color of the first display content is set by finding the color combination which is obviously compared with the color gamut parameter through the opposite side of the color ring, so that the character part of the first display content can be obviously displayed, and the user can conveniently check the character part. The colors around each gamut parameter can be determined accordingly according to the color circle as background colors forregions 1, 2 and 3; the color combinations with the gamut parameters on opposite sides of the color circle are determined as the font colors onregions 1, 2 and 3. Therefore, the background ground colors of theareas 1, 2 and 3 are distinguished from the image data to a certain extent, and the font colors are obviously contrasted, so that the first display content is more cooperated with the image data in vision, the text part is clear and visible, and the user experience is good.
In some embodiments, the selecting the corresponding theme scheme from the preset theme data set according to the data image may be implemented as the following steps:
s221, acquiring a time scale of the data image based on the preset time interval;
s222, determining a theme scheme from the same time scale in the preset theme data set based on the time scale so as to select the corresponding theme scheme.
The embodiment aims to select a corresponding theme scheme based on a picture played by image data in real time. In this embodiment, after the data image is acquired, the data image is analyzed, and the time scale of playing the data image in the video data is determined. The data images are determined based on a preset time interval, and thus, the time scales of the data images are also spaced based on the preset time interval.
The preset theme data set corresponds to a slice image generated based on a preset time interval process, that is, the playing time of the slice image is the same as the time scale of the data image, so that the theme scheme corresponding to the slice image corresponds to the data image. Therefore, after the time scale of the data image is determined, the theme scheme under the same time scale can be found from the preset theme data set according to the time scale, and the corresponding theme scheme is selected for the data image.
S300, judging whether the current theme scheme of the first display content needs to be switched or not based on the selected theme scheme.
This step is intended to determine whether a theme scheme currently used by the first display content needs to be switched. In the application, in the playing process of the image data, different data images can be obtained when the playing contents are different. In order to enable the display mode of the first display content to be consistent with different data images, after the current data image and the theme scheme corresponding to the current data image are acquired, in the step, whether the current theme scheme of the first display content needs to be switched or not is judged by comparing the selected theme scheme with the current theme scheme of the first display content.
In some embodiments, the step S300 may be implemented as the following steps:
s310, obtaining the color parameters of the selected theme scheme;
s320, comparing the color parameters with the color parameters of the current theme scheme, and if the comparison result meets the switching condition, switching is required.
In this embodiment, whether the current theme scheme of the first display content needs to be switched is determined according to the switching condition by comparing the color parameter of the selected theme scheme with the color parameter of the current theme scheme of the first display content. The color parameters include at least color parameters of a background color and a font color of the first display content. The switching condition may be that the color parameter of the selected theme scheme is different from the color parameter of the current theme scheme of the first display content. In some specific embodiments, the color of the background color and the font color in the selected theme scheme may be obtained first, and then the color or the font color of the current background color of the first display content may be compared with the color or the font color of the background color of the selected theme scheme. When the color or font color of the current background ground color of the first display content is different from the color or font color of the background ground color of the selected theme scheme, or when the color combination to which the color of the current background ground color of the first display content belongs is different from the color combination to which the color of the background ground color of the selected theme scheme belongs; or if the color combination to which the font color of the first display content belongs is different from the color combination to which the font color of the selected theme scheme belongs, the comparison result is considered to meet the switching condition, and the current theme scheme of the first display content needs to be switched.
S400, if necessary, switching the current theme scheme of the first display content into the selected theme scheme.
In this step, when it is determined that the current theme scheme of the first display content needs to be switched, the current theme scheme of the first display content is switched to the selected theme scheme, so that the display mode of the first display content is coordinated with the current data image.
For example, fig. 5 shows an effect diagram of some embodiments of the present application, as shown in fig. 5, by the display method of the present application, in the playing process of the image data, the theme scheme of the first display content can be switched as needed, so that the background color displayed by the first display content and the playing image of the image data are visually consistent through the switched theme scheme, and are not too obtrusive or even glaring, and meanwhile, the text portion is clearly readable. Therefore, the display method provided by the embodiment of the application is convenient and quick in theme switching, and the interactive switching of the theme scheme can be formed according to the data image played by the image data in real time, so that the first display content is coordinately displayed on the data image played in real time, and the experience of a user in watching is improved.
In some embodiments, switching the current theme scheme of the first display content to the selected theme scheme includes:
and transforming the current theme scheme of the first display content through front-end control rendering by using the selected theme scheme so as to enable the color presented by the first display content to be matched with the data image.
In this embodiment, the front-end page may set an execution event according to a preset time interval, and when the event is executed each time, if a request for switching a theme scheme of the first display content is received, a color parameter, for example, an RGB value, in the selected theme scheme is used to replace a current color parameter in the CSS file, so that after the front-end page is rendered, a color presented by the first display content matches the data image, and the first display content is visually coordinated with the data image, so that text content therein can be presented clearly, and at the same time, the viewing of the image data is not affected by eye-grabbing.
Illustratively, fig. 6 shows a flow diagram of front-end page rendering as implemented by the present application. As shown in fig. 6, the preset time interval is set to 1 minute, i.e., 60 seconds, and the front page also defines a 1 minute execution event. In some specific applications, in the process of rendering the front-end page, the first 55 seconds in one minute are used for executing events such as modification of data in the rendering process, and the last 5 seconds are pause periods used for executing a rendering gradient process according to updated data. Illustratively, the first display content may be displayed using the color parameters of the default theme scheme just after the video data is played, i.e., from the 1 st second. Meanwhile, the front-end page executes the 1-minute event from the 6 th second, and at this time, the theme scheme of the first display content adopts the default theme scheme, so that the corresponding theme scheme needs to be selected to switch the default theme scheme. And replacing the color parameters in the CSS file by the front-end page by using the color parameters of the selected theme scheme, such as RGB values, calling a new data packet to render the front-end page in 60-65 seconds, and enabling the first display content to gradually change from the color of the default theme scheme to the color corresponding to the selected theme scheme in 60-65 seconds. Thereafter, the front page executes the next one minute event from the 66 th second, and so on, to match the color of the first display content presentation with the current data image.
When the event is executed in the first minute, the first 5 seconds are pause periods when the event is executed every minute, and the pause periods are not used for rendering the event and are used for confirming whether a request for switching the theme scheme exists. After determining that the request for switching the theme scheme of the first display content is received, the process of rendering the event is performed from the 6 th second to the 60 th second, and the page successfully rendered according to the color parameters of the selected theme scheme is output. And then entering a next execution event, and sequentially executing the rendering process, so that in the playing process of the video data, the theme scheme of the first display content can be switched according to the current data image when needed so as to keep matching with the current data image.
Based on the same inventive concept, the present application further provides a display device, and fig. 7 is a block diagram of the display device according to the embodiment of the present application. As shown in fig. 7, the display device includes:
a determiningmodule 10, configured to determine a current data image according to the image data based on a preset time interval;
a selectingmodule 20, selecting a corresponding theme scheme from a preset theme data set according to the data image; wherein the preset theme data set is generated based on the preset time interval for the image data;
a judgingmodule 30, configured to judge whether a current theme scheme of the first display content needs to be switched;
aswitching module 40, configured to switch the current theme scheme of the first display content to the selected theme scheme if needed.
The display device in the embodiment of the present application can implement the display method provided in any embodiment of the present application through the configured functional module of the display device.
In some embodiments, the determiningmodule 30 includes:
the acquisition unit is used for acquiring the color parameters of the current theme scheme;
and the comparison unit is used for comparing the color parameter with the color parameter of the historical theme scheme of the previous historical data image, and if the comparison result is different, switching is required.
The embodiment of the present application further provides an electronic device, which at least includes amemory 901, aprocessor 902, and a bus (not shown), where a schematic structural diagram of the electronic device may be as shown in fig. 8, thememory 901 stores machine-readable instructions executable by theprocessor 902, when the electronic device runs, theprocessor 902 and thememory 901 communicate through the bus, and the machine-readable instructions, when executed by the processor, perform the steps of the display method provided in any embodiment of the present application.
Since the electronic device described in the embodiment of the present application is an electronic device provided with a memory for implementing the display method disclosed in the embodiment of the present application, based on the display method described in the embodiment of the present application, a person skilled in the art can understand the structure and the variation of the electronic device described in the embodiment of the present application, and thus details are not described herein.
Moreover, although exemplary embodiments have been described herein, the scope thereof includes any and all embodiments based on the present application with equivalent elements, modifications, omissions, combinations (e.g., of various embodiments across), adaptations or alterations. The elements of the claims are to be interpreted broadly based on the language employed in the claims and not limited to examples described in the present specification or during the prosecution of the application, which examples are to be construed as non-exclusive. It is intended, therefore, that the specification and examples be considered as exemplary only, with a true scope and spirit being indicated by the following claims and their full scope of equivalents.
The above description is intended to be illustrative and not restrictive. For example, the above-described examples (or one or more versions thereof) may be used in combination with each other. For example, other embodiments may be used by those of ordinary skill in the art upon reading the above description. In addition, in the above detailed description, various features may be grouped together to streamline the application. This should not be interpreted as an intention that a disclosed feature not claimed is essential to any claim. Rather, subject matter of the present application can lie in less than all features of a particular disclosed embodiment. Thus, the following claims are hereby incorporated into the detailed description as examples or embodiments, with each claim standing on its own as a separate embodiment, and it is contemplated that these embodiments may be combined with each other in various combinations or permutations. The scope of the application should be determined with reference to the appended claims, along with the full scope of equivalents to which such claims are entitled.
The embodiments of the present application have been described in detail, but the present application is not limited to these specific embodiments, and those skilled in the art can make various modifications and modified embodiments based on the concept of the present application, and these modifications and modified embodiments should fall within the scope of the present application.