CN111679877A - 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
CN111679877A
CN111679877A CN202010460972.4A CN202010460972A CN111679877A CN 111679877 A CN111679877 A CN 111679877A CN 202010460972 A CN202010460972 A CN 202010460972A CN 111679877 A CN111679877 A CN 111679877A
Authority
CN
China
Prior art keywords
picture
frame image
background
color
generating
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.)
Granted
Application number
CN202010460972.4A
Other languages
Chinese (zh)
Other versions
CN111679877B (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

Images

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 device, provided by the embodiment of the application, includes the steps of obtaining a current frame image and a previous frame image of a video image, calculating a 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, extracting the current frame image and generating a first picture when the color deviation ratio is larger than the first preset threshold value, and generating the application background according to the first picture, so that the problem that the matching degree of a preset background to the current application of the terminal device is low is solved, and the matching degree of the application background of the terminal device 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 and an apparatus for changing a background of a terminal device, and an electronic device.
Background
The functions of terminal devices such as mobile phones are more and more, and besides the most basic functions such as conversation and short messages, a plurality of additional functions such as internet browsing and downloading, audio and video playing and the like are added. At present, the demand of users for new functions of terminal devices is continuously increasing, such as user-defined themes, backgrounds, and the like.
In the related art, a function of switching the background of the terminal device generally exists in a setting function of the terminal device. The terminal equipment is internally provided with various backgrounds for a user to select, when the user selects a certain background, the background in the application will be changed, 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, and the conditions of poor matching effect and low matching degree exist.
At present, aiming at the problem that the preset background is matched with the current application of the terminal equipment in the related technology, the matching degree is low, and an effective solution is not provided yet.
Disclosure of Invention
The embodiment of the application provides a method and a device for changing a background of a terminal device and an electronic device, so as to solve the problem that the matching degree is low when a preset background is matched with the current application of the terminal device 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 a color deviation ratio of the current frame image to the previous frame image;
judging whether the color deviation ratio is greater than a first preset threshold value or not, and extracting the current frame image and generating a first picture under the condition that the color deviation ratio is greater than the first preset threshold value;
and generating an application background according to the first picture.
In some of these embodiments, the generating a background of an application from the first picture comprises:
blurring the first picture through 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 a background of an application from the first picture comprises:
extracting the color value of each pixel point in the first picture;
calculating an average of the color values;
and calculating a reverse color value of the average value, and generating the reverse color value into a button background of an application.
In some of these embodiments, the generating a background of an application from the first picture comprises:
extracting the 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 to obtain the color value with the maximum number of the pixel points;
and calculating the reverse color value of the color value with the maximum number of the pixel points, and generating the reverse color value into an applied button background.
In some embodiments, before calculating the number of pixels corresponding to each color value, the method further includes:
acquiring the category number of the color values;
judging whether the number of the categories is larger than a second preset threshold, gathering colors with similar color values under the condition that the number of the categories is larger than the second preset threshold, and taking the average color value as the color value of the category;
and under the condition that the category number is less than or equal to the second preset threshold, calculating the number of pixel points corresponding to each color value.
In some of these embodiments, said calculating a color deviation ratio of said current frame image to said previous frame image comprises:
acquiring color values of N points of 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 value changes;
calculating a ratio of the number, the ratio indicating a color deviation ratio of the current frame image to the previous frame image.
In some embodiments, before generating the background 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;
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 or not, 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, when executed, is further configured to implement the step of changing the background of the terminal device according to the first aspect.
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 obtaining module, an information processing module, and a background generating 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 a color deviation ratio of the current frame image and the previous frame image, judging whether the color deviation ratio is greater than a first preset threshold value or not, and extracting the current frame image and generating a first picture when the color deviation ratio is greater than the first preset threshold value;
and the background generating module is used for generating an application background 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 of the terminal device according to the first aspect.
In a fourth aspect, an embodiment of the present application provides an electronic device, which includes 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 of the method for changing the background of the terminal device according to the first aspect.
In a fifth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the method for changing the background of a terminal device as described in the first aspect.
Compared with the related art, the method for changing the background of the terminal device, provided by the embodiment of the application, includes the steps of obtaining a current frame image and a previous frame image of a video image, calculating a 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, extracting the current frame image and generating a first picture when the color deviation ratio is larger than the first preset threshold value, and generating the application background according to the first picture, so that the problem that the matching degree of a preset background to the current application of the terminal device is low is solved, and the matching degree of the application background of the terminal device 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 application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a first flowchart of a method for changing a background of a terminal device according to an embodiment of the present application;
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;
FIG. 3 is a flowchart of a method for generating a button background for an application from a first picture according to an embodiment of the present application;
FIG. 4 is a flow diagram of another method for generating a button background for an application from a first picture according to an embodiment of the present application;
fig. 5 is a flowchart ii of a method for changing a background of a terminal device according to an embodiment of the present application;
FIG. 6 is a flowchart of a method for calculating a color deviation ratio of a current frame image to a previous frame image according to an embodiment of the present application;
fig. 7 is a flowchart three of a method for changing a background of a terminal device according to an embodiment of the present application;
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;
fig. 9 is an internal structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be described and illustrated below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments provided in the present application without any inventive step are within the scope of protection of the present application.
It is obvious that the drawings in the following description are only examples or embodiments of the present application, and that it is also possible for a person skilled in the art to apply the present application to other similar contexts on the basis of these drawings without inventive effort. Moreover, it should be appreciated that in the development of any such actual implementation, as in any engineering or design project, numerous implementation-specific decisions must be made to achieve the developers' specific goals, such as compliance with system-related and business-related constraints, which may vary from one implementation to another.
Reference in the specification to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the specification. The appearances of the phrase 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. Those of ordinary skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments without conflict.
Unless defined otherwise, technical or scientific terms referred to herein shall have the ordinary meaning as understood by those of ordinary skill in the art to which this application belongs. Reference to "a," "an," "the," and similar words throughout this application are not to be construed as limiting in number, and may refer to the singular or the plural. The present application is directed to the use of the terms "including," "comprising," "having," and any variations thereof, which are intended to cover non-exclusive inclusions; for example, a process, method, system, article, or apparatus that comprises a list of steps or modules (elements) is not limited to the listed steps or elements, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus. Reference to "connected," "coupled," and the like in this application is not intended to be limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The term "plurality" as referred to herein means two or more. Reference herein to the terms "first," "second," "third," and the like, are merely to distinguish similar objects and do not denote a particular ordering for the 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 realizes information interaction with people, wherein the application background of the terminal equipment can be automatically changed along with the current preview picture of a user. The method comprises the steps that the terminal equipment calculates the color deviation ratio of a current frame image and a previous frame image of a video image by obtaining the current frame image and the previous frame image, judges whether the color deviation ratio is larger than a first preset threshold value or not, extracts the current frame image and generates an application background when a first picture is generated under the condition that the color deviation ratio is larger than the first preset threshold value; in the case where the color deviation ratio is less than or equal to the first preset threshold, the application background does not change. The video image may be stored in the terminal device itself, or may be 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.
Fig. 1 is a first flowchart of a method for changing a background of a terminal device according to an embodiment of the present application, and as shown in fig. 1, 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 in the case of opening any video image in the terminal device, and it should be 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;
it should be noted that the colors of the current frame image and the previous frame image are recorded and expressed by RGB values. All colors in the video image are mixed by the three colors of red, green and blue according to different proportions, and what is called "what" of RGB means brightness and is expressed by using an integer. Typically, RGB each has 256 levels of brightness, numerically represented as from 0, 1, 2. Note that although the number is 255 at the highest, 0 is also one of the numbers, thus having 256 levels; by calculation, a total of about 1678 ten thousand colors can be combined from 256 levels of RGB colors, i.e., 256 × 256 ═ 16777216, also commonly referred to simply as 1600 ten thousand or ten million colors.
Step S103, judging whether the color deviation ratio is greater 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 greater than the first preset threshold value;
when the color deviation ratio is greater than a first preset threshold, capturing a current frame image may be triggered, where the captured current frame image is a first picture, and when the color deviation ratio is less than or equal to the first preset threshold, the terminal device may not be triggered.
And step S104, generating the background of the application according to the first picture.
Through the steps from S101 to S104, a current frame image and a previous frame image of a video image can be obtained under the condition that any video image in the terminal device is opened, the color deviation ratio of the current frame image and the previous frame image is calculated based on an RGB value mode, the current frame image can be triggered to be intercepted under the condition that the color deviation ratio is larger than a first preset threshold value, the intercepted current frame image is generated into a first image, and then the first image is set as the background applied to the terminal device, so that the application background of the terminal device can be automatically changed according to the current previewed image of a user, the problem that the preset background is matched with 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, fig. 2 is a flowchart of a method for generating an interface background of an application according to an embodiment of the present application, and as shown in fig. 2, the method includes the following steps:
step S201, blurring the first picture through a blurring processing model to generate a second picture;
the blurring model is a process of resetting each pixel value in the first picture, and this process is to set each pixel as an average value of the peripheral pixels. It should be noted that, for each pixel being processed, the RGB values of several 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.
But if the first picture changes color frequently and the color contrast per unit area is large and the blur radius is large, the result is: the outermost pixels of the blur range and the surrounding pixels of the central pixel are weighted equally, so that the first picture processed in this way has the problem that the transition is not very smooth. Therefore, a gaussian blur algorithm is needed to calculate weights for these pixels in the blur range separately, such that the lower the weight of the pixels at the periphery of the blur radius, the less the impact, and the more inside pixels get the highest weight, because the inside pixels are more important and the color of the inside pixels is closer and more intimate to the center pixel of the first picture.
Step S202, generating an interface background of the application according to the second picture;
and setting the second picture subjected to the fuzzy processing as an interface background of the application.
Through steps S201 to S202, the second picture obtained after the first picture is blurred, and the second picture is generated into the interface background of the application, in which case the interface background of the application can be automatically changed according to the currently previewed picture of the user, and the interface background finally presented by the second picture after blurring effect can generate contrast with the currently browsed picture of the user, so as to highlight the currently browsed picture of the user.
In some embodiments, fig. 3 is a flowchart of a method for generating a button background of an application according to an embodiment of the present application, and as shown in fig. 3, the method includes the following steps:
step S301, extracting a color value of each pixel point in a first picture;
pixels are defined by tiles of the image that have a well-defined position and assigned color values. 256-level RGB colors can be combined to form about 1678 ten thousand colors, the color value of each pixel point in the first picture is extracted, namely the color value of each pixel point in the first picture is extracted, the color value corresponds to which specific color of 1678 ten thousand colors, and it needs to be explained that the specific size of the color value corresponding to each pixel point can represent the color corresponding to each pixel point.
Step S302, an average value of the color values is calculated.
Step S303, calculating a reverse color value of the average value, and generating an applied button background from the reverse color value;
the color values corresponding to the pixel points in the first picture are averaged to obtain an average value of the color values of the first picture, then a color reversal value of the average value is calculated, and finally the color reversal value is used for generating an applied button background.
Through steps S301 to S303, the color value of each pixel point in the first picture is extracted, average re-inversion is performed, and the color corresponding to the final inversion value is generated into the applied button background.
In some embodiments, the method for generating the background of the application according to the first picture may also include a combination of the generation interface background of step S201 to step S202 and the generation button background of step S301 to step S303.
In some embodiments, fig. 4 is a flowchart of another method for generating a button background of an application according to an embodiment of the present application from a first picture, as shown in fig. 4, the method includes the following steps:
step S401, extracting a color value of each pixel point in a first picture;
step S401 is the same as step S301, and is not described herein again.
Step S402, calculating the number of pixel points corresponding to each color value;
calculating the number of pixels corresponding to each color value in the first picture, for example, in RGB color values, for example, the color value of blue is 255, and the number of pixels of blue 255 statistically obtained from the first picture is 1000.
Step S403, sorting according to the number of pixels corresponding to the color value, and acquiring the color value with the largest number of pixels;
according to the number of the pixels corresponding to each color value, the pixels can be sorted from small to large or from large to small, and the color value with the largest number of the pixels is taken.
Step S404, calculating a reverse color value of the color value with the largest number of pixel points, and generating the reverse color value into an applied button background;
the reverse value of the dominant hue color value in the first picture is set as the applied button background, for example, the color represented by the dominant color value in the first picture is black, so the color represented by the reverse value of the dominant hue color value in the first picture is white, and finally the white is generated into the applied button background.
Through step S401 to step S404, the pixel number corresponding to the color value is sequenced, the color value with the largest pixel number is obtained, then the dominant hue color value in the first picture can be represented, then the reversed value of the dominant hue color value is calculated, finally the reversed value of the dominant hue color value in the first picture is set as the applied button background, under the condition that the applied button background can automatically change along with the current previewed picture of the user, the generated button background can form a larger contrast with the currently browsed picture, and the button background is convenient to be more prominent in the browsed picture.
In some embodiments, the method for generating the background of the application according to the first picture may also include a combination of the generation interface background of step S201 to step S202 and the generation button background of step S401 to step S404.
In some embodiments, fig. 5 is a flowchart of a second method for changing a background of a terminal device according to an embodiment of the present application, where 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, acquiring the number of types of color values;
before calculating the number of pixels corresponding to each color value, the number of categories of the color values in the first picture is counted, and it should 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 greater than a second preset threshold, gathering colors with similar color values under the condition that the number of categories is greater 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 less than or equal to the second preset threshold;
counting the number of the types of the colors in the first picture, gathering or merging the colors with similar colors under the condition that the number of the types 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 type, wherein the description is needed. For example, the color values are similar to the colors represented by 233, 234, 235, 236, 237, 238, and 239, and then the average value of the colors is obtained to obtain 236, and the categories represented by 233, 234, 235, 236, 237, 238, and 239 are classified into a category of color values represented by 236, so as to reduce the number of color categories in the first picture.
Through steps S501 to S502, it is determined whether the color values in the first picture are dispersed, and if the color values are dispersed and the color value categories exceed the set threshold, the average color value is taken as the color value of the category through similar color grouping, so as to avoid the problem of mismatching of the dominant hue calculation caused by too-dispersed colors, and further improve the matching accuracy of the button background.
Fig. 6 is a flowchart of a method for calculating a color deviation ratio of a current frame image and a previous frame image according to an embodiment of the present application, as shown in fig. 6, the method includes the following steps:
step S601, obtaining color values of N points of same coordinate pixels 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 obtained according to the number of pixels in the adjacent frame image, for example, the current frame image itself is 10000 pixels, and the value of N is 2000, and the current frame image itself has 100 ten thousand pixels, and that of N is 20 ten thousand, and optionally, the value of N may account for 5% -30% of the number of pixels in the current frame image or the previous frame image.
Step S602, counts the number of changes in color values.
Step S603, calculating a ratio of the quantity, the ratio indicating a color deviation ratio of the current frame image to the previous frame image;
the ratio of the calculated quantity is the percentage of the quantity of the changed calculated color values in N, and it should be noted that the first preset threshold may be 20%, or a point exceeding a specific percentage may be set to have a deviation according to an actual requirement, and it is considered that the application background may be changed.
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, and then the ratio of the color values of the pixels in the current frame image to the color values of the pixels in the previous frame image that change is determined, where the ratio is used to indicate the color deviation ratio of the current frame image to the previous frame image, thereby improving the calculation accuracy of the color deviation ratio.
In some embodiments, fig. 7 is a flowchart three of a method for changing a background of a terminal device according to an embodiment of the present application, where as shown in fig. 7, before generating a background of an application according to a first picture, 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;
optionally, 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 the displayed width value and the displayed height value.
Step S702, under the condition that the first picture does not match the display size, zooming the first picture to the display size;
when the width value and the height value of the first picture are not matched with the width value and the height value of the display size, the first picture can be scaled by the same proportion until the first picture is matched with the display width value and the display height value of the terminal equipment.
Through step S701 and step S702, before the first picture generates the application background, the first picture is scaled to the width value and the height value that match the display size, and it should be noted that the manner of scaling the first picture may be, but is not limited to, a manner of cropping, for example, cropping the first picture to the size displayed by the terminal device may reduce the image pixel density, accelerate the calculation speed, and improve the size matching degree of the first picture as the application background.
It should be noted that the steps illustrated in the above-described flow diagrams or in the 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 different than here.
The present embodiment further provides a device for changing a background of a terminal device, where the device is used to implement the foregoing embodiment and preferred embodiments, and details of the foregoing description are omitted. As used hereinafter, the terms "module," "unit," "subunit," and the like may implement a combination of software and/or hardware for a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an 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, and 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 obtaining module 81, configured to obtain 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 between 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 when the color deviation ratio is greater than the first preset threshold, and generate a first picture;
and a background generating module 83, configured to generate a background of the application according to the first picture.
By the device, when a user opens any video image in the terminal equipment, the current frame image and the previous frame image of the video image can be acquired through the information acquisition module 81, based on an RGB value mode, the information processing module 82 calculates the color deviation ratio of the current frame image and the previous frame image, when the color deviation ratio is larger than a 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, and the background generation module 83 sets the first picture as the background applied by the terminal equipment, so that the application background of the terminal equipment can be automatically changed according to the current previewed picture of the user, the problem that the preset background is matched with the current application of the terminal equipment, the matching degree is low is solved, and the matching degree of the application background of the terminal equipment is improved.
In some embodiments, the information processing module 82 and the background generating module 83 are further configured to implement steps in the method for changing the background of the terminal device provided in the foregoing embodiments, and are not described herein again.
The above modules may be functional modules or program modules, and may be implemented by software or hardware. For a module implemented by hardware, the modules may be located in the same processor; or the modules can be respectively positioned in different processors in any combination.
In one embodiment, an electronic device is provided, which may be a terminal. The electronic device comprises a processor, a memory, a network interface, a display screen and an input device which are connected through a system bus. Wherein the processor of the electronic device is configured to provide computing and control capabilities. The memory of the electronic equipment comprises 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 an operating system and computer programs in the non-volatile storage medium. The network interface of the electronic device is used for connecting and communicating with an external terminal through a network. The computer program is executed by a processor to implement a method of changing a 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, a key, a track ball or a touch pad arranged on the shell of the electronic equipment, an external keyboard, a touch pad or a mouse and the like.
In an embodiment, fig. 9 is a schematic internal structure diagram 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 its internal structure diagram may be as 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 equipment comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the electronic device is used for storing data. The network interface of the electronic device is used for connecting and communicating with an external terminal through a network. The computer program is executed by a processor to implement a method of changing a context of a terminal device.
Those skilled in the art will appreciate that the configuration shown in fig. 9 is a block diagram of only a portion of the configuration relevant to the present application, and does not constitute a limitation on the electronic device to which the present application is applied, and a particular electronic device may include more or less components than those shown in the drawings, or combine certain components, or have a different arrangement of components.
In one embodiment, an electronic device is provided, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the steps in the method for changing the background of a terminal device provided in the foregoing embodiments are implemented.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and the computer program, when executed by a processor, implements the steps in the method for changing the background of a terminal device provided in the above embodiments.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile 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), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method for changing background of a terminal device is characterized by comprising the following steps:
acquiring a current frame image and a previous frame image of a video image;
calculating a color deviation ratio of the current frame image to the previous frame image;
judging whether the color deviation ratio is greater than a first preset threshold value or not, and extracting the current frame image and generating a first picture under the condition that the color deviation ratio is greater than the first preset threshold value;
and generating an application background according to the first picture.
2. The method of claim 1, wherein generating the context of the application from the first picture comprises:
blurring the first picture through 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 a context of an application from the first picture comprises:
extracting the color value of each pixel point in the first picture;
calculating an average of the color values;
and calculating a reverse color value of the average value, and generating the reverse color value into a button background of an application.
4. The method according to claim 1 or 2, wherein the generating a context of an application from the first picture comprises:
extracting the 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 to obtain the color value with the maximum number of the pixel points;
and calculating the reverse color value of the color value with the maximum number of the pixel points, and generating the reverse color value into an applied button background.
5. The method of claim 4, wherein before calculating the number of pixels corresponding to each of the color values, the method further comprises:
acquiring the category number of the color values;
judging whether the number of the categories is larger than a second preset threshold, gathering colors with similar color values under the condition that the number of the categories is larger than the second preset threshold, and taking the average color value as the color value of the category;
and under the condition that the category number is less than or equal to the second preset threshold, calculating the number of pixel points corresponding to each color value.
6. The method of claim 1, wherein the calculating the color deviation ratio of the current frame image to the previous frame image comprises:
acquiring color values of N points of 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 value changes;
calculating a ratio of the number, the ratio indicating a color deviation ratio of the current frame image to the previous frame image.
7. The method of claim 1, wherein prior to generating the background for 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;
scaling the first picture to the display size if the first picture does not match the display size.
8. A device for changing the background of 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 calculating a color deviation ratio of the current frame image and the previous frame image, judging whether the color deviation ratio is greater than a first preset threshold value or not, and extracting the current frame image and generating a first picture when the color deviation ratio is greater than the first preset threshold value;
and the background generating module is used for generating an application background according to the first picture.
9. The apparatus according to claim 8, wherein the information processing module and the context generating module are further configured to implement the steps of the method according to any one of claims 2 to 7.
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 7 when executing the computer program.
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 true CN111679877A (en) 2020-09-18
CN111679877B 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)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113259745A (en) * 2021-05-13 2021-08-13 北京百度网讯科技有限公司 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 (11)

* 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
US20080001971A1 (en) * 2006-06-29 2008-01-03 Scientific-Atlanta, Inc. 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
CN106485666A (en) * 2015-08-31 2017-03-08 中国航天科工集团第四研究院指挥自动化技术研发与应用中心 A kind of information indicating method and apparatus
US20170278286A1 (en) * 2016-03-22 2017-09-28 Le Holdings (Beijing) Co., Ltd. Method and electronic device for creating title background in video frame
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

Patent Citations (11)

* 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
US20080001971A1 (en) * 2006-06-29 2008-01-03 Scientific-Atlanta, Inc. 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
CN106485666A (en) * 2015-08-31 2017-03-08 中国航天科工集团第四研究院指挥自动化技术研发与应用中心 A kind of information indicating method and apparatus
US20170278286A1 (en) * 2016-03-22 2017-09-28 Le Holdings (Beijing) Co., Ltd. Method and electronic device for creating title background in video frame
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

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113259745A (en) * 2021-05-13 2021-08-13 北京百度网讯科技有限公司 Video playing page processing method and device, electronic equipment and storage medium
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

Also Published As

Publication number Publication date
CN111679877B (en) 2023-08-29

Similar Documents

Publication Publication Date Title
CN111679877A (en) Method and device for changing background of terminal equipment and electronic equipment
CN100512420C (en) Method and apparatus for composing images during video communications
CN109670427B (en) Image information processing method and device and storage medium
CN109639982A (en) A kind of image denoising method, device, storage medium and terminal
KR101620933B1 (en) Method and apparatus for providing a mechanism for gesture recognition
KR101998531B1 (en) Real-time video enhancement methods, terminals, and non-transitory computer readable storage media
CN105574839B (en) Image processing method and device
CN112383830A (en) Video cover determining method and device and storage medium
CN108961209B (en) Pedestrian image quality evaluation method, electronic device and computer readable medium
CN112116551A (en) Camera shielding detection method and device, electronic equipment and storage medium
CN106815803A (en) The processing method and processing device of picture
CN110288560A (en) A kind of image fuzzy detection method and device
US8265383B2 (en) Method and communication terminal for searching phone book for desired contacts
CN106357978B (en) Image output method, device and terminal
CN109003272B (en) Image processing method, device and system
CN111968605A (en) Exposure adjusting method and device
CN112419218A (en) Image processing method and device and electronic equipment
CN112598016A (en) Image classification method and device, communication equipment and storage medium
CN113393391B (en) Image enhancement method, image enhancement device, electronic apparatus, and storage medium
CN109672829A (en) Method of adjustment, device, storage medium and the terminal of brightness of image
CN107105167B (en) Method and device for shooting picture during scanning question and terminal equipment
WO2022121893A1 (en) Image processing method and apparatus, and computer device and storage medium
CN114998961A (en) Virtual three-dimensional face generation method, and training method and device of face generation model
CN110941413B (en) Display screen generation method and related device
CN114816619A (en) Information processing method and electronic equipment

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