CN111679877B - Method and device for changing background of terminal equipment and electronic equipment - Google Patents

Method and device for changing background of terminal equipment and electronic equipment Download PDF

Info

Publication number
CN111679877B
CN111679877B CN202010460972.4A CN202010460972A CN111679877B CN 111679877 B CN111679877 B CN 111679877B CN 202010460972 A CN202010460972 A CN 202010460972A CN 111679877 B CN111679877 B CN 111679877B
Authority
CN
China
Prior art keywords
picture
frame image
color
background
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010460972.4A
Other languages
Chinese (zh)
Other versions
CN111679877A (en
Inventor
钱恒杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN202010460972.4A priority Critical patent/CN111679877B/en
Publication of CN111679877A publication Critical patent/CN111679877A/en
Application granted granted Critical
Publication of CN111679877B publication Critical patent/CN111679877B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Abstract

The application relates to a method and a device for changing a background of terminal equipment and electronic equipment, wherein the method for changing the background of the terminal equipment comprises the following steps: compared with the related art, the method for changing the background of the terminal equipment provided by the embodiment of the application has the advantages that the current frame image and the previous frame image of the video image are obtained, the color deviation ratio of the current frame image and the previous frame image is calculated, whether the color deviation ratio is larger than the first preset threshold value is judged, the current frame image is extracted and when a first picture is generated, the background of the application is generated according to the first picture, the problem that the matching degree of the preset background is low when the current application of the terminal equipment is matched is solved, and the matching degree of the application background of the terminal equipment is improved.

Description

Method and device for changing background of terminal equipment and electronic equipment
Technical Field
The present application relates to the field of mobile communication terminals, and in particular, to a method, an apparatus, and an electronic device for changing a background of a terminal device.
Background
The functions of terminal devices such as mobile phones are more and more, and besides the most basic functions such as calling, short messages and the like, a plurality of additional functions such as internet browsing, downloading, playing audio and video and the like are added. Currently, new functional requirements of users on terminal devices are continuously increasing, such as user-defined topics, backgrounds and the like.
In the related art, a function of switching the background of the terminal device generally exists in the setting function of the terminal device. The terminal equipment is internally provided with a plurality of backgrounds for user selection, when a certain background is selected by the user, the background in the application is changed accordingly, and the preset mode can only match the existing background for the terminal equipment, so that the preset background is matched with the current application of the terminal equipment under the conditions of poor matching effect and low matching degree.
At present, aiming at the current application of preset background matching terminal equipment in the related technology, the problem of low matching degree exists, and an effective solution is not proposed yet.
Disclosure of Invention
The embodiment of the application provides a method, a device and electronic equipment for changing the background of terminal equipment, which at least solve the problem that the matching degree is low when the preset background is matched with the current application of the terminal equipment in the related technology.
In a first aspect, an embodiment of the present application provides a method for changing a background of a terminal device, where the method includes:
acquiring a current frame image and a previous frame image of a video image;
calculating the color deviation ratio of the current frame image and the previous frame image;
judging whether the color deviation ratio is larger than a first preset threshold value, and extracting the current frame image and generating a first picture under the condition that the color deviation ratio is larger than the first preset threshold value;
and generating the background of the application according to the first picture.
In some of these embodiments, the generating the context of the application from the first picture includes:
blurring the first picture by a blurring model to generate a second picture;
and generating an interface background of the application according to the second picture.
In some of these embodiments, the generating the context of the application from the first picture includes:
extracting a color value of each pixel point in the first picture;
calculating an average value of the color values;
and calculating a counter value of the average value, and generating an applied button background by the counter value.
In some of these embodiments, the generating the context of the application from the first picture includes:
extracting a color value of each pixel point in the first picture;
calculating the number of pixel points corresponding to each color value;
sorting according to the number of the pixel points corresponding to the color values, and obtaining the color value with the maximum number of the pixel points;
and calculating the color value of the color value with the largest pixel number, and generating the applied button background by using the color value.
In some embodiments, before the calculating the number of pixels corresponding to each color value, the method further includes:
acquiring the category number of the color value;
judging whether the number of the categories is larger than a second preset threshold value, gathering the colors with similar color values under the condition that the number of the categories is larger than the second preset threshold value, and taking the average color value as the color value of the category;
and calculating the number of pixels corresponding to each color value under the condition that the number of categories is smaller than or equal to the second preset threshold value.
In some of these embodiments, the calculating the color deviation ratio of the current frame image to the previous frame image includes:
acquiring color values of N points with the same coordinate pixels from the current frame image and the previous frame image, wherein the N points are distributed in different areas of the current frame image;
counting the number of the color values to be changed;
a duty cycle of the number is calculated, the duty cycle being indicative of a color deviation ratio of the current frame image to the previous frame image.
In some embodiments, before the generating the background of the application according to the first picture, the method further includes:
judging whether the size of the first picture is matched with the display size of the terminal equipment or not;
and scaling the first picture to the display size if the first picture does not match the display size.
In a second aspect, an embodiment of the present application provides a system for changing a background of a terminal device, where the system includes: a central processing unit;
the central processing unit acquires a current frame image and a previous frame image of a video image, and calculates the color deviation ratio of the current frame image and the previous frame image;
the central processing unit judges whether the color deviation ratio is larger than a first preset threshold value, and extracts the current frame image and generates a first picture when the color deviation ratio is larger than the first preset threshold value;
and the central processing unit generates the background of the application of the terminal equipment according to the first picture.
In some embodiments, the central processing unit is further configured to implement the step of changing the background method of the terminal device according to the first aspect when executing the method.
In a third aspect, an embodiment of the present application provides an apparatus for changing a background of a terminal device, where the apparatus includes an information acquisition module, an information processing module, and a background generation module;
the information acquisition module is used for acquiring a current frame image and a previous frame image of the video image;
the information processing module is used for calculating the color deviation ratio of the current frame image and the previous frame image, judging whether the color deviation ratio is larger than a first preset threshold value, and extracting the current frame image and generating a first picture under the condition that the color deviation ratio is larger than the first preset threshold value;
and the background generation module is used for generating the background of the application according to the first picture.
In some embodiments, the information processing module and the context generating module are further configured to implement the step of changing the context method of the terminal device according to the first aspect.
In a fourth aspect, an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the steps of the method for changing a background of a terminal device according to the first aspect.
In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, implements the steps of the method for changing the background of a terminal device as described in the first aspect above.
Compared with the related art, the method for changing the background of the terminal equipment provided by the embodiment of the application has the advantages that the current frame image and the previous frame image of the video image are obtained, the color deviation ratio of the current frame image and the previous frame image is calculated, whether the color deviation ratio is larger than the first preset threshold value is judged, the current frame image is extracted and when a first picture is generated, the background of the application is generated according to the first picture, the problem that the matching degree of the preset background is low when the current application of the terminal equipment is matched is solved, and the matching degree of the application background of the terminal equipment is improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute a limitation on the application. In the drawings:
fig. 1 is a flowchart of a method for changing a background of a terminal device according to an embodiment of the present application;
FIG. 2 is a flow chart of a method of generating an interface background of an application from a first picture according to an embodiment of the application;
FIG. 3 is a flow chart of a method of generating a button background of an application from a first picture according to an embodiment of the application;
FIG. 4 is a flowchart of another method of generating a button background of an application from a first picture according to an embodiment of the application;
fig. 5 is a flowchart two of a method for changing the background of a terminal device according to an embodiment of the present application;
FIG. 6 is a flow chart of a method of calculating a color deviation ratio of a current frame image to a previous frame image in accordance with an embodiment of the present application;
fig. 7 is a flowchart III of a method of changing the background of a terminal device according to an embodiment of the present application;
fig. 8 is a block diagram showing the structure of an apparatus for changing the background of a terminal device according to an embodiment of the present application;
fig. 9 is a schematic diagram of an internal structure of an electronic device according to an embodiment of the present application.
Detailed Description
The present application will be described and illustrated with reference to the accompanying drawings and examples in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application. All other embodiments, which can be made by a person of ordinary skill in the art based on the embodiments provided by the present application without making any inventive effort, are intended to fall within the scope of the present application.
It is apparent that the drawings in the following description are only some examples or embodiments of the present application, and it is possible for those of ordinary skill in the art to apply the present application to other similar situations according to these drawings without inventive effort. Moreover, it should be appreciated that while such a development effort might be complex and lengthy, it would nevertheless be a routine undertaking of design, fabrication, or manufacture for those of ordinary skill having the benefit of this disclosure, and thus should not be construed as having the benefit of this disclosure.
Reference in the specification to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is to be expressly and implicitly understood by those of ordinary skill in the art that the described embodiments of the application can be combined with other embodiments without conflict.
Unless defined otherwise, technical or scientific terms used herein should be given the ordinary meaning as understood by one of ordinary skill in the art to which this application belongs. The terms "a," "an," "the," and similar referents in the context of the application are not to be construed as limiting the quantity, but rather as singular or plural. The terms "comprising," "including," "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, article, or apparatus that comprises a list of steps or modules (elements) is not limited to only those steps or elements but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus. The terms "connected," "coupled," and the like in connection with the present application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The term "plurality" as used herein means two or more. The terms "first," "second," "third," and the like, as used herein, are merely distinguishing between similar objects and not representing a particular ordering of objects.
The method for changing the background of the terminal equipment is applied to the terminal equipment with the graphical user interface, such as a mobile phone, a computer and the like, which finally realize information interaction with people, wherein the application background of the terminal equipment can be automatically changed according to the current preview picture of the user. The method comprises the steps that a terminal device calculates the color deviation ratio of a current frame image and a previous frame image of a video image by acquiring the current frame image and the previous frame image of the video image, judges whether the color deviation ratio is larger than a first preset threshold value, extracts the current frame image and generates a first picture as a background of an application under the condition that the color deviation ratio is larger than the first preset threshold value; and under the condition that the color deviation ratio is smaller than or equal to a first preset threshold value, the application background is not changed. The video image may be a video image stored by the terminal device itself or a video image of another place monitored by the current terminal device in real time, and it should be noted that the video image in the present application includes a still image and a moving image.
The present embodiment provides a method for changing the background of a terminal device, fig. 1 is a flowchart of a method for changing the background of a terminal device according to an embodiment of the present application, as shown in fig. 1, and the method includes the following steps:
step S101, acquiring a current frame image and a previous frame image of a video image;
for the user operation, the current frame image and the previous frame image of the video image may be acquired under the condition that any video image in the terminal device is opened, and it is noted that the current frame image and the previous frame image of the video image may be two adjacent frame images.
Step S102, calculating the color deviation ratio of the current frame image and the previous frame image;
note that, the colors of the current frame image and the previous frame image are recorded and expressed by RGB values. All colors in a video image are mixed by the three colors of red, green and blue according to different proportions, and the so-called "how much" of RGB refers to brightness and is expressed by integers. Typically, RGB has 256 levels of brightness each, indicated by numerals from 0, 1, 2. Note that although the number is 255 at the highest, 0 is also one of the values, thus 256 stages in total; as calculated, 256 levels of RGB colors can combine a total of about 1678 tens of thousands of colors, i.e., 256×256×256=16777216, also commonly referred to as 1600 tens of thousands of colors or tens of millions of colors for short.
Step S103, judging whether the color deviation ratio is larger than a first preset threshold value, and extracting a current frame image and generating a first picture under the condition that the color deviation ratio is larger than the first preset threshold value;
when the color deviation ratio is larger than a first preset threshold, the current frame image can be triggered to be intercepted, the intercepted current frame image is a first picture, and when the color deviation ratio is smaller than or equal to the first preset threshold, the terminal equipment can not be triggered.
Step S104, generating the background of the application according to the first picture.
Through steps S101 to S104, under the condition that any video image in the terminal device is opened, the current frame image and the previous frame image of the video image can be obtained, the color deviation ratio of the current frame image and the previous frame image is calculated based on the RGB value mode, under the condition that the color deviation ratio is greater than a first preset threshold value, the current frame image can be triggered to be intercepted, a first picture is generated by the intercepted current frame image, and then the first picture is set as the background of the application of the terminal device, so that the application background of the terminal device can be automatically changed according to the picture currently previewed by the user, the problem that the preset background matches the current application of the terminal device and the matching degree is low is solved, and the matching degree of the application background of the terminal device is improved.
In some of these embodiments, fig. 2 is a flowchart of a method for generating an interface background of an application from a first picture according to an embodiment of the present application, as shown in fig. 2, the method comprising the steps of:
step S201, blurring the first picture through a blurring model to generate a second picture;
the blurring model is a process of resetting each pixel value in the first picture, which is to set each pixel to be an average value of surrounding pixels. It should be noted that, for each pixel being processed, the RGB values of the surrounding pixels are taken and averaged, and then this average value is the blurred processed pixel, and if all pixels in the first picture are so processed, the processed picture becomes blurred.
However, if the first picture color changes frequently and the color contrast per unit area is large and the blur radius is large, the result is: the weights of the pixels at the outermost layer of the blurring range and the pixels around the central pixel are the same, so that the first picture processed has the problem that the transition is not very smooth. Therefore, a gaussian blur algorithm is required to calculate weights for these pixels in the blur range separately, so that the lower the pixel weight at the periphery of the blur radius, the less impact is caused, and the more inside pixels get the highest weight, because the inside pixels are more important, the color of the inside pixels is closer to the first picture center pixel, and more closely.
Step S202, generating an interface background of the application according to the second picture;
and setting the second picture subjected to blurring processing as an interface background of the application.
Through steps S201 to S202, the second picture obtained after the first picture is subjected to blurring processing, and the second picture is generated into an applied interface background, in which case the applied interface background can be automatically changed according to the picture currently previewed by the user, and the interface background finally presented by the second picture after the blurring effect can be contrasted with the picture currently browsed by the user, so that the picture currently browsed by the user can be highlighted.
In some of these embodiments, fig. 3 is a flowchart of a method for generating a button background of an application from a first picture according to an embodiment of the present application, as shown in fig. 3, the method comprising the steps of:
step S301, extracting a color value of each pixel point in the first picture;
pixels are defined as being made up of tiles of the image, each of which has a definite position and assigned color value. The 256-level RGB colors can be combined to form about 1678 ten thousand colors, and the color value of each pixel point in the first picture is the specific color of 1678 ten thousand colors corresponding to each pixel point in the first picture, and it should be noted that the specific size of the color value corresponding to each pixel point can represent the color corresponding to each pixel point.
In step S302, an average value of the color values is calculated.
Step S303, calculating a counter value of the average value, and generating an applied button background by the counter value;
and averaging the color values corresponding to the pixel points in the first picture to obtain an average value related to the color values of the first picture, calculating the counter value of the average value, and finally generating the counter value into the button background for application, for example, the color represented by the average value is black, so that the color represented by the counter value of the average value is white, and finally generating the white into the button background for application.
Through steps S301 to S303, the color value of each pixel point in the first picture is extracted, and then the color corresponding to the final color value is generated to be applied to the button background, in this case, the applied button background can be automatically changed according to the picture currently previewed by the user, and the finally generated button background can form contrast with the currently browsed picture, so that the button background is more prominent in the browsed picture.
In some embodiments, the method flowchart of generating the background of the application according to the first picture may also include a combination of the generating interface background of step S201 to step S202 and the generating button background of step S301 to step S303.
In some of these embodiments, fig. 4 is a flowchart of another method of generating a button background of an application from a first picture according to an embodiment of the present application, as shown in fig. 4, the method comprising the steps of:
step S401, extracting a color value of each pixel point in the first picture;
the step S401 and the step S301 are the same operations, and are not described herein.
Step S402, calculating the number of pixels corresponding to each color value;
and calculating the number of pixel points corresponding to each color value in the first picture, for example, the color value of blue is 255 in RGB color values, and statistically obtaining 1000 pixels of blue 255 in the first picture.
Step S403, sorting according to the number of pixels corresponding to the color values, and obtaining the color value with the maximum number of pixels;
according to the number of pixels corresponding to each color value, the color values with the largest number of pixels can be obtained by sorting from small to large or from large to small, and it is further required to explain that the color value with the largest number of pixels can represent the dominant color value in the first picture.
Step S404, calculating the inverse value of the color value with the largest number of pixel points, and generating the inverse value into the applied button background;
the color represented by the color value of the dominant color in the first picture is black, so that the color represented by the color value of the dominant color in the first picture is white, and finally the white is generated into the button background of the application.
Through steps S401 to S404, the number of pixels corresponding to the color values is ordered, the color value with the largest number of pixels is obtained, the color value which can represent the dominant color value in the first picture is obtained, the inverse value of the dominant color value is calculated, the inverse value of the dominant color value in the first picture is finally set as the button background of the application, and the generated button background forms larger contrast with the currently browsed picture under the condition that the button background of the application can be automatically changed according to the picture currently previewed by the user, so that the button background is more prominent in the browsed picture.
In some embodiments, the method flowchart of generating the background of the application according to the first picture may also include a combination of the generating interface background of step S201 to step S202 and the generating button background of step S401 to step S404.
In some embodiments, fig. 5 is a second flowchart of a method for changing a background of a terminal device according to an embodiment of the present application, as shown in fig. 5, before calculating the number of pixels corresponding to each color value, the method further includes the following steps:
step S501, obtaining the category number of the color values;
before calculating the number of pixels corresponding to each color value, the number of categories of the color value in the first picture is counted, and it is to be noted that the number of categories represents how many colors are in the first picture, for example, 10000 colors are in the first picture.
Step S502, judging whether the number of categories is larger than a second preset threshold, gathering the colors with similar color values under the condition that the number of categories is larger than the second preset threshold, taking the average color value as the color value of the category, and calculating the number of pixel points corresponding to each color value under the condition that the number of categories is smaller than or equal to the second preset threshold;
counting the number of categories of the colors in the first picture, gathering or combining the colors with similar colors under the condition that the number of categories of the colors in the first picture is larger than a second preset threshold value, averaging the sizes of the color values, and taking the average color value as the color value of the category, wherein the description is needed. For example, the color values 233, 234, 235, 236, 237, 238 and 239 are similar, and the average value is calculated to obtain 236, so that the categories 233, 234, 235, 236, 237, 238 and 239 are classified into the category of the color values represented by 236, and the number of the color categories in the first picture is reduced.
Through step S501 to step S502, it is determined whether the color values in the first picture are scattered, if the color values are scattered, and the color value category exceeds the set threshold, the average color value is taken as the color value of the category through similar color grouping, so that the problem of missed main tone calculation deviation caused by too much scattering of the color is avoided, and further, the matching precision of the button background is improved.
Fig. 6 is a flowchart of a method of calculating a color deviation ratio of a current frame image to a previous frame image according to an embodiment of the present application, as shown in fig. 6, the method comprising the steps of:
step S601, obtaining color values of N points with the same coordinates from a current frame image and a previous frame image, wherein the N points are distributed in different areas of the current frame image;
it should be noted that, the specific size of N needs to be valued according to the number of pixels in the adjacent frame image, for example, the current frame image is 10000 pixels, N is 2000, the current frame image is 100 ten thousand pixels, N is 20 ten thousand, and optionally, the value of N may be 5% -30% of the number of pixels in the current frame image or the previous frame image.
In step S602, the number of color value changes is counted.
Step S603, calculating the number of duty ratios, wherein the duty ratio indicates the color deviation ratio of the current frame image and the previous frame image;
the calculated number of the duty ratio refers to the calculated number of the color value change which is the percentage of N, and it should be noted that the first preset threshold may be 20%, or a deviation of points exceeding a specific percentage may be set according to actual requirements, so that the application background may be considered to be replaced.
Through steps S601 to S603, the number of pixels in a certain proportion is selected according to the number of pixels in the current frame image or the previous frame image, so as to determine the duty ratio of the change of the color values of the number of pixels in the current frame image and the previous frame image, where the duty ratio is used to indicate the color deviation ratio of the current frame image and the previous frame image, so as to improve the calculation accuracy of the color deviation ratio.
In some embodiments, fig. 7 is a flowchart III of a method for changing the background of a terminal device according to an embodiment of the present application, and before generating the background of an application according to a first picture, as shown in fig. 7, the method further includes the following steps:
step S701, judging whether the size of the first picture is matched with the display size of the terminal equipment;
alternatively, the size of the first picture may be a width value and a height value of the first picture, and the display size of the same terminal device may be a width value and a height value of the display.
Step S702, scaling the first picture to the display size if the first picture does not match the display size;
when the width value and the height value of the first picture do not match the width value and the height value of the display size, the first picture may be scaled equally until it matches the display width value and the height value of the terminal device.
Through step S701 and step S702, before the first picture generates the background of the application, the first picture is scaled to a width value and a height value that match the display size, where it should be noted that, a manner of scaling the first picture may be, but is not limited to, a manner of clipping, for example, clipping the first picture to a size displayed by the terminal device, so that the pixel density of the image may be reduced, the calculation speed may be increased, and the size matching degree of the first picture as the application background may be improved.
It should be noted that the steps illustrated in the above-described flow or flow diagrams of the figures may be performed in a computer system, such as a set of computer-executable instructions, and that, although a logical order is illustrated in the flow diagrams, in some cases, the steps illustrated or described may be performed in an order other than that illustrated herein.
The embodiment also provides a device for changing the background of the terminal device, which is used for implementing the above embodiment and the preferred embodiment, and is not described in detail. As used below, the terms "module," "unit," "sub-unit," and the like may be a combination of software and/or hardware that implements a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
In some embodiments, fig. 8 is a block diagram of an apparatus for changing a background of a terminal device according to an embodiment of the present application, as shown in fig. 8, the apparatus includes: an information acquisition module 81, an information processing module 82, and a background generation module 83.
An information acquisition module 81 for acquiring a current frame image and a previous frame image of a video image;
the information processing module 82 is configured to calculate a color deviation ratio of the current frame image and the previous frame image, determine whether the color deviation ratio is greater than a first preset threshold, extract the current frame image and generate a first picture when the color deviation ratio is greater than the first preset threshold;
the background generating module 83 is configured to generate the background of the application according to the first picture.
By the device, when a user opens any video image in the terminal device, the information acquisition module 81 acquires the current frame image and the previous frame image of the video image, the information processing module 82 calculates the color deviation ratio of the current frame image and the previous frame image based on the RGB value mode, under the condition that the color deviation ratio is larger than the first preset threshold value, the current frame image can be triggered to be intercepted, the intercepted current frame image is generated into a first picture, the background generation module 83 sets the first picture as the background of the application of the terminal device, so that the application background of the terminal device can be automatically changed according to the picture currently previewed by the user, the problem that the preset background matches the current application of the terminal device, the matching degree is low is solved, and the matching degree of the application background of the terminal device is improved.
In some embodiments, the information processing module 82 and the background generating module 83 are further configured to implement the steps in the method for changing the background of the terminal device provided in the foregoing embodiments, which is not described herein.
The above-described respective modules may be functional modules or program modules, and may be implemented by software or hardware. For modules implemented in hardware, the various modules described above may be located in the same processor; or the above modules may be located in different processors in any combination.
In one embodiment, an electronic device, which may be a terminal, is provided. The electronic device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the electronic device is configured to provide computing and control capabilities. The memory of the electronic device includes a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface of the electronic device is used for communicating with an external terminal through a network connection. The computer program, when executed by a processor, implements a method of altering the context of a terminal device. The display screen of the electronic equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic equipment can be a touch layer covered on the display screen, can also be keys, a track ball or a touch pad arranged on the shell of the electronic equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
In one embodiment, fig. 9 is a schematic diagram of an internal structure of an electronic device according to an embodiment of the present application, and as shown in fig. 9, there is provided an electronic device, which may be a server, and an internal structure diagram of which may be shown in fig. 9. The electronic device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the electronic device is configured to provide computing and control capabilities. The memory of the electronic device includes a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the electronic device is for storing data. The network interface of the electronic device is used for communicating with an external terminal through a network connection. The computer program, when executed by a processor, implements a method of altering the context of a terminal device.
It will be appreciated by those skilled in the art that the structure shown in fig. 9 is merely a block diagram of a portion of the structure associated with the present application and is not limiting of the electronic device to which the present application is applied, and that a particular electronic device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, an electronic device is provided, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor executes the computer program to implement the steps in the method for changing the background of the terminal device provided in the foregoing embodiments.
In an embodiment, a computer readable storage medium is provided, on which a computer program is stored, which when being executed by a processor implements the steps in the method of changing the background of a terminal device provided in the above embodiments.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
The technical features of the above-described embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above-described embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples illustrate only a few embodiments of the application, which are described in detail and are not to be construed as limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of protection of the present application is to be determined by the appended claims.

Claims (10)

1. A method for changing a context of a terminal device, comprising:
acquiring a current frame image and a previous frame image of a video image;
determining color values of N-point same coordinate pixels from the current frame image and the previous frame image, and calculating a color deviation ratio of the current frame image and the previous frame image according to the color values of the N-point same coordinate pixels; wherein the N points are distributed in different areas of the current frame image;
judging whether the color deviation ratio is larger than a first preset threshold value, and extracting the current frame image and generating a first picture under the condition that the color deviation ratio is larger than the first preset threshold value;
generating an application background according to the first picture; the application background comprises an interface background and a button background, and the generation mode of the button background comprises the following steps:
extracting a color value of each pixel point in the first picture;
acquiring the category number of the color value;
under the condition that the number of the categories is larger than a second preset threshold value, gathering the colors with similar color values, and taking the average color value as the color value of each category;
calculating the number of pixel points corresponding to each color value;
sorting according to the number of the pixel points corresponding to the color values, and obtaining the color value with the maximum number of the pixel points;
and calculating the color value of the color value with the largest pixel number, and generating the applied button background by using the color value.
2. The method of claim 1, wherein generating the context of the application from the first picture comprises:
blurring the first picture by a blurring model to generate a second picture;
and generating an interface background of the application according to the second picture.
3. The method according to claim 1 or 2, wherein the generating the context of the application from the first picture comprises:
extracting a color value of each pixel point in the first picture;
calculating an average value of the color values;
and calculating a counter value of the average value, and generating an applied button background by the counter value.
4. The method according to claim 1, wherein the method further comprises:
and calculating the number of pixels corresponding to each color value under the condition that the number of categories is smaller than or equal to the second preset threshold value.
5. The method of claim 1, wherein said calculating a color deviation ratio of the current frame image to the previous frame image from the color values of the N-point coordinate pixels comprises:
counting the number of the changes in the color value of the N-point coordinate pixels;
a duty cycle of the number is calculated, the duty cycle being indicative of a color deviation ratio of the current frame image to the previous frame image.
6. The method of claim 1, wherein prior to generating the context of the application from the first picture, the method further comprises:
judging whether the size of the first picture is matched with the display size of the terminal equipment or not;
and scaling the first picture to the display size if the first picture does not match the display size.
7. The device for changing the background of the terminal equipment is characterized by comprising an information acquisition module, an information processing module and a background generation module;
the information acquisition module is used for acquiring a current frame image and a previous frame image of the video image;
the information processing module is used for determining color values of N-point identical coordinate pixels from the current frame image and the previous frame image, calculating a color deviation ratio of the current frame image and the previous frame image according to the color values of the N-point identical coordinate pixels, judging whether the color deviation ratio is larger than a first preset threshold value, and extracting the current frame image and generating a first picture under the condition that the color deviation ratio is larger than the first preset threshold value; wherein the N points are distributed in different areas of the current frame image;
the background generation module is used for generating an application background according to the first picture; the application background comprises an interface background and a button background, and the generation mode of the button background comprises the following steps:
extracting a color value of each pixel point in the first picture;
acquiring the category number of the color value;
under the condition that the number of the categories is larger than a second preset threshold value, gathering the colors with similar color values, and taking the average color value as the color value of each category;
calculating the number of pixel points corresponding to each color value;
sorting according to the number of the pixel points corresponding to the color values, and obtaining the color value with the maximum number of the pixel points;
and calculating the color value of the color value with the largest pixel number, and generating the applied button background by using the color value.
8. The apparatus of claim 7, wherein the background generation module is further configured to blur the first picture by a blur processing model to generate a second picture from which an applied interface background is generated.
9. The apparatus of claim 7 or 8, wherein the background generation module is further configured to extract a color value of each pixel in the first picture, calculate an average value of the color values, calculate a counter value of the average value, and generate the counter value into the applied button background.
10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1 to 6 when the computer program is executed.
CN202010460972.4A 2020-05-27 2020-05-27 Method and device for changing background of terminal equipment and electronic equipment Active CN111679877B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010460972.4A CN111679877B (en) 2020-05-27 2020-05-27 Method and device for changing background of terminal equipment and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010460972.4A CN111679877B (en) 2020-05-27 2020-05-27 Method and device for changing background of terminal equipment and electronic equipment

Publications (2)

Publication Number Publication Date
CN111679877A CN111679877A (en) 2020-09-18
CN111679877B true CN111679877B (en) 2023-08-29

Family

ID=72434440

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010460972.4A Active CN111679877B (en) 2020-05-27 2020-05-27 Method and device for changing background of terminal equipment and electronic equipment

Country Status (1)

Country Link
CN (1) CN111679877B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113259745B (en) * 2021-05-13 2022-11-15 北京百度网讯科技有限公司 Video playing page processing method and device, electronic equipment and storage medium
CN113486271A (en) * 2021-07-06 2021-10-08 网易(杭州)网络有限公司 Method and device for determining dominant hue of image and electronic terminal
CN114066753A (en) * 2021-11-09 2022-02-18 深圳市酷开网络科技股份有限公司 Method and device for extracting background color, terminal equipment and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002204453A (en) * 2000-10-27 2002-07-19 Matsushita Electric Ind Co Ltd Image object content generator and padding device
US6757428B1 (en) * 1999-08-17 2004-06-29 National Instruments Corporation System and method for color characterization with applications in color measurement and color matching
JP2004186994A (en) * 2002-12-03 2004-07-02 Toshiba Corp Method, device, and program for compositing object image
WO2005050557A2 (en) * 2003-11-19 2005-06-02 Lucid Information Technology Ltd. Method and system for multiple 3-d graphic pipeline over a pc bus
CN106485666A (en) * 2015-08-31 2017-03-08 中国航天科工集团第四研究院指挥自动化技术研发与应用中心 A kind of information indicating method and apparatus
CN109218697A (en) * 2018-09-20 2019-01-15 太平洋未来科技(深圳)有限公司 Rendering method, device and the electronic equipment at a kind of video content association interface
JP2019028991A (en) * 2017-07-26 2019-02-21 富士通株式会社 Target detection method, target detection apparatus, and image processing apparatus
CN109426522A (en) * 2017-08-22 2019-03-05 阿里巴巴集团控股有限公司 Interface processing method, device, equipment, medium and the operating system of mobile device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7742059B2 (en) * 2006-06-29 2010-06-22 Scientific-Atlanta, Llc Filling blank spaces of a display screen
US20150026718A1 (en) * 2013-07-19 2015-01-22 United Video Properties, Inc. Systems and methods for displaying a selectable advertisement when video has a background advertisement
US20170278286A1 (en) * 2016-03-22 2017-09-28 Le Holdings (Beijing) Co., Ltd. Method and electronic device for creating title background in video frame

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6757428B1 (en) * 1999-08-17 2004-06-29 National Instruments Corporation System and method for color characterization with applications in color measurement and color matching
JP2002204453A (en) * 2000-10-27 2002-07-19 Matsushita Electric Ind Co Ltd Image object content generator and padding device
JP2004186994A (en) * 2002-12-03 2004-07-02 Toshiba Corp Method, device, and program for compositing object image
WO2005050557A2 (en) * 2003-11-19 2005-06-02 Lucid Information Technology Ltd. Method and system for multiple 3-d graphic pipeline over a pc bus
CN106485666A (en) * 2015-08-31 2017-03-08 中国航天科工集团第四研究院指挥自动化技术研发与应用中心 A kind of information indicating method and apparatus
JP2019028991A (en) * 2017-07-26 2019-02-21 富士通株式会社 Target detection method, target detection apparatus, and image processing apparatus
CN109426522A (en) * 2017-08-22 2019-03-05 阿里巴巴集团控股有限公司 Interface processing method, device, equipment, medium and the operating system of mobile device
CN109218697A (en) * 2018-09-20 2019-01-15 太平洋未来科技(深圳)有限公司 Rendering method, device and the electronic equipment at a kind of video content association interface

Also Published As

Publication number Publication date
CN111679877A (en) 2020-09-18

Similar Documents

Publication Publication Date Title
CN111679877B (en) Method and device for changing background of terminal equipment and electronic equipment
CN110100251B (en) Apparatus, method, and computer-readable storage medium for processing document
KR101620933B1 (en) Method and apparatus for providing a mechanism for gesture recognition
CN108961183B (en) Image processing method, terminal device and computer-readable storage medium
CN103164231A (en) Input method virtual keyboard skin management method and device
CN112055244B (en) Image acquisition method and device, server and electronic equipment
CN108932703B (en) Picture processing method, picture processing device and terminal equipment
CN112464301A (en) Image display method and device
CN112419218A (en) Image processing method and device and electronic equipment
CN117112090A (en) Business page theme generation method, device, computer equipment, medium and product
CN108763491B (en) Picture processing method and device and terminal equipment
CN113393391B (en) Image enhancement method, image enhancement device, electronic apparatus, and storage medium
CN113596354B (en) Image processing method, image processing device, computer equipment and storage medium
CN114416089A (en) Page display method and device, mobile terminal and storage medium
CN110941413B (en) Display screen generation method and related device
CN113114930B (en) Information display method, device, equipment and medium
CN111968605A (en) Exposure adjusting method and device
CN110377626A (en) Information displaying method, device, equipment and storage medium
CN111722823A (en) Method and device for self-adapting screen resolution, storage medium and electronic equipment
US20110074804A1 (en) Selection of a region
CN111405345B (en) Image processing method, image processing device, display device and readable storage medium
CN115408552B (en) Display adjustment method, device, equipment and storage medium
CN108376218B (en) Image verification code generation method and device, and verification method, device and system
CN114143447A (en) Image processing method and device and electronic equipment
CN115686249A (en) Image processing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant