CN109901897B - Method and device for matching view colors in application - Google Patents

Method and device for matching view colors in application Download PDF

Info

Publication number
CN109901897B
CN109901897B CN201910028592.0A CN201910028592A CN109901897B CN 109901897 B CN109901897 B CN 109901897B CN 201910028592 A CN201910028592 A CN 201910028592A CN 109901897 B CN109901897 B CN 109901897B
Authority
CN
China
Prior art keywords
view
value
color
region
color 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
CN201910028592.0A
Other languages
Chinese (zh)
Other versions
CN109901897A (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.)
Zhengzhou Apas Technology Co ltd
Original Assignee
Zhuhai Tianyan 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 Zhuhai Tianyan Technology Co ltd filed Critical Zhuhai Tianyan Technology Co ltd
Priority to CN201910028592.0A priority Critical patent/CN109901897B/en
Publication of CN109901897A publication Critical patent/CN109901897A/en
Application granted granted Critical
Publication of CN109901897B publication Critical patent/CN109901897B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Processing (AREA)
  • Color Image Communication Systems (AREA)

Abstract

The embodiment of the application provides a method and a device for matching view colors in an application, wherein the method comprises the following steps: acquiring a first color value of a first view of a current service scene in an application; respectively acquiring a second view corresponding to a plurality of candidate objects and a second color value of the second view from an advertisement resource library; determining a matching view from the plurality of second views that matches the first view based on a difference between the second color value and the first color value; and selecting a corresponding alternative object according to the target view for loading, thereby recommending to the user. The method and the device for matching the view colors in the application can provide the color-coordinated view for the user.

Description

Method and device for matching view colors in application
Technical Field
The present application relates to the field of image processing technologies, and in particular, to a method and an apparatus for matching view colors in an application.
Background
In the related art, in an Application (english: Application, abbreviation: App) such as a game or a video, other views such as a view of an advertisement or an expression view, etc. may be displayed simultaneously on a current view of the App. There are also solutions in the prior art for automatically displaying a corresponding view for a user based on a user tag, user preferences, and the like.
Based on this, the inventor of the present invention finds that other complicated views such as advertisements bring visual sense of incongruity and obtrusiveness to the user, the user's click intention is affected, and the information recommendation efficiency is reduced.
The information disclosed in this background section is only for enhancement of understanding of the general background of the invention and should not be taken as an acknowledgement or any form of suggestion that this information forms the prior art already known to a person skilled in the art.
Disclosure of Invention
An object of the embodiments of the present application is to provide a method and an apparatus for matching view colors in an application, which can provide a color-coordinated view for a user.
To solve the above technical problem, embodiments of the present application are achieved by the following aspects.
In a first aspect, an embodiment of the present application provides a method for matching view colors in an application, including: acquiring a first color value of a first view of a current service scene in an application; respectively acquiring a second view corresponding to a plurality of candidate objects and a second color value of the second view from an advertisement resource library; determining a target view from the plurality of second views that matches the first view based on a difference between the second color value and the first color value; and selecting a corresponding alternative object according to the target view for loading, thereby recommending to the user.
In one possible implementation, determining, from the plurality of second views, a target view that matches the first view according to a difference between the second color value and the first color value includes: determining a second view having a smallest difference between the second color value and the first color value as the target view.
In a possible implementation manner, the obtaining a first color value of a first view of a current service scenario in an application includes: traversing first pixels in a first area in the first view, and acquiring the maximum value and the minimum value of each color of the first pixels; according to the difference value between the maximum value and the minimum value of each color of the first pixel, performing first sequencing on the first pixel; dividing the first region into at least two regions according to the first ordering, and respectively calculating first color volumes of the at least two regions of the first region; updating the first region according to the first color volume.
In a possible implementation manner, after updating the first area, the method further includes: taking a first average value of each color value of the first pixel; and determining a first color value of a first view of the current service scene in the application according to the first average value.
In a possible implementation manner, the obtaining, from the advertisement repository, the second view corresponding to the multiple candidate objects and the second color value of the second view respectively includes: traversing second pixels in a second area in the second view to obtain the maximum value and the minimum value of each color of the second pixels; performing second sorting on the second pixels according to the difference value between the maximum value and the minimum value of each color of the second pixels; dividing the second region into at least two regions according to the second ordering, and respectively calculating second color volumes of the at least two regions of the second region; updating the second region according to the second color volume.
In a possible implementation manner, after updating the second area, the method further includes: taking a second average value of all color values of the second pixel; determining a second color value of the second view according to the second average value.
In one possible implementation, determining, from the plurality of second views, a target view that matches the first view according to a difference between the second color value and the first color value includes: converting the first color value and the second color value into a hue value, a saturation value, and a lightness value; calculating a matching score according to the converted hue value, saturation value and brightness value based on the preset hue weight, saturation weight and brightness weight; and determining a target view matched with the first view from the plurality of second views according to the matching scores.
In a second aspect, an embodiment of the present application provides an apparatus for target view color in an application, including: the acquisition module is used for acquiring a first color value of a first view of a current service scene in an application, and respectively acquiring a second view corresponding to a plurality of candidate objects and a second color value of the second view from an advertisement resource library; a matching module, configured to determine, according to a difference between the second color value and the first color value, a target view that matches the first view from the plurality of second views; and the display module is used for selecting the corresponding alternative object according to the target view to load so as to recommend the alternative object to the user.
In a possible implementation manner, the matching module is configured to determine, as the target view, a second view in which a difference between the second color value and the first color value is minimum.
In a possible implementation manner, the obtaining module is configured to traverse a first pixel in a first region in the first view, and obtain a maximum value and a minimum value of each color of the first pixel; according to the difference value between the maximum value and the minimum value of each color of the first pixel, performing first sequencing on the first pixel; dividing the first region into at least two regions according to the first ordering, and respectively calculating first color volumes of the at least two regions of the first region; updating the first region according to the first color volume.
In a possible implementation manner, the obtaining module is further configured to take a first average value of color values of the first pixel after updating the first area; and determining a first color value of a first view of the current service scene in the application according to the first average value.
In a possible implementation manner, the obtaining module is configured to traverse a second pixel in a second region in the second view, and obtain a maximum value and a minimum value of each color of the second pixel; performing second sorting on the second pixels according to the difference value between the maximum value and the minimum value of each color of the second pixels; dividing the second region into at least two regions according to the second ordering, and respectively calculating second color volumes of the at least two regions of the second region; updating the second region according to the second color volume.
In a possible implementation manner, the obtaining module is further configured to take a second average value of each color value of the second pixel after updating the second area; and determining a first color value of a first view of the current service scene in the application according to the second average value.
In one possible implementation, the matching module is configured to convert the first color value and the second color value into a color value, a saturation value, and a brightness value; calculating a matching score according to the converted hue value, saturation value and brightness value based on the preset hue weight, saturation weight and brightness weight; determining a target view from the plurality of second views that matches the first view based on the match score.
In a third aspect, an embodiment of the present application provides an electronic device, including: a memory, a processor and computer executable instructions stored on the memory and executable on the processor, which when executed by the processor implement the steps of the method as described in the first aspect above.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium for storing computer-executable instructions that, when executed by a processor, implement the steps of the method according to the first aspect.
In the embodiment of the application, a first color value of a first view of a current service scene in an application is obtained; respectively acquiring a second view and a second color value of the second view corresponding to a plurality of candidate objects from an advertisement resource library; determining a target view matched with the first view from the plurality of second views according to the difference value of the second color value and the first color value; and selecting the corresponding alternative object according to the target view for loading, thereby recommending to the user, providing a view with coordinated colors for the user, enabling the advertisement view recommended to the user to be more coordinated, enabling the user to be more willing to click, and improving the information recommendation efficiency.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only some embodiments described in the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without any creative effort.
Fig. 1 is a schematic flow chart illustrating a method for matching view colors in an application according to an embodiment of the present application;
FIG. 2 is a flow chart illustrating a method for matching view colors in an application according to an embodiment of the present application;
FIG. 3 shows an example diagram of a first view;
FIG. 4 illustrates an example diagram of a first region within a first view;
FIGS. 5 a-5 c illustrate exemplary views of a second view;
fig. 6 is a schematic structural diagram illustrating an apparatus for matching view colors in an application according to an embodiment of the present application;
fig. 7 shows a hardware structure diagram of an electronic device that executes a method for matching view colors in an application according to an embodiment of the present application.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Fig. 1 is a flowchart illustrating a method for matching view colors in an application according to an embodiment of the present application, where the method may be performed by an electronic device, such as a terminal device or a server device. In other words, the method may be performed by software or hardware installed in the terminal device or the server device. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like. As shown, the method may include the following steps.
S10: a first color value of a first view of a current service scene in an application is obtained.
By taking a game class App as an example for explanation, a game scene of a current level of a game can be acquired as a first view, and a dominant hue color value of the first view acquired by an interface color acquisition method is a first color value. The first color value is a 6-bit 16-ary number.
S20: and respectively acquiring a second view corresponding to the multiple candidate objects and a second color value of the second view from the advertisement resource library.
The advertisement view is taken as an example for explanation, and a plurality of advertisement views and a second color value of the advertisement views are obtained. Likewise, the second color value is a 6-bit 16-ary number obtained by the interface color acquisition method.
S30: and determining a target view matched with the first view from the plurality of second views according to the difference value of the second color value and the first color value.
And calculating the difference value between the dominant hue color value (16-digit number with 6 bits) of the advertisement content and the dominant hue color value (16-digit number with 6 bits) of the game scene, and determining a target view matched with the game scene from a plurality of advertisement views according to a preset selection strategy. For example, a second view with a higher degree of matching is pushed to the user according to a color collocation of a classical black and white collocation.
For example, a median cut algorithm may be used to obtain the dominant hue value of the first view and the second view, which may be a color value.
In a possible implementation manner, the step may specifically include: and determining a second view with the smallest difference value between the second color value and the first color value as the target view. The second view with the smallest color difference can thus be pushed to the user.
S40: and selecting a corresponding alternative object according to the target view for loading, thereby recommending to the user.
An advertisement view matching the game scene is displayed.
Therefore, the method for targeting the color of the view in the application provided by the embodiment of the application acquires the first color value of the first view of the current business scene in the application, acquires the second color values of the second view and the second view corresponding to the multiple candidate objects from the advertisement resource library respectively, determining a target view matched with the first view from the plurality of second views according to the difference value between the second color value and the first color value, displaying the target view, automatically pushing the second view with higher color matching degree with the first view currently processed by the user to the user, the user can receive the pushed view with coordinated colors, the advertisement view recommended to the user is more coordinated, the user is more willing to click, the information recommendation efficiency is improved, and the user is prevented from being disturbed by vision when receiving the pushed view, the visual experience of the user is improved, and the eyesight of the user is protected.
Fig. 2 is a flowchart illustrating a method for target view color in an application according to an embodiment of the present application, where the method may be performed by an electronic device, such as a terminal device or a server device. In other words, the method may be performed by software or hardware installed in the terminal device or the server device. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like. As shown, the method may include the following steps.
S10: a first color value of a first view of a current service scene in an application is obtained.
By taking a game class App as an example for explanation, a game scene of a current level of a game can be acquired as a first view, and a dominant hue color value of the first view acquired by an interface color acquisition method is a first color value. The first color value is a 6-bit 16-ary number.
In one possible implementation, this step may specifically include the following steps.
S11: and traversing the first pixel in the first area in the first view to obtain the maximum value and the minimum value of each color of the first pixel.
Specifically, a specific area in the first view, for example, the middle 80% area is acquired as the first area according to the length and width of the first view. When the user operates App, the sight line is generally concentrated on a portion close to the middle, so the color of the first region can reflect the color effect of the eye shade of the user most. The pixel in the first area is a first pixel, and the maximum value and the minimum value of each color of the first pixel are obtained by traversing the first pixel. Each color includes three elements of Red (english: Red, abbreviation: R), Green (english: Green, abbreviation: G), and Blue (english: Blue, abbreviation: B). The maximum and minimum values of the colors of the first pixel refer to the maximum and minimum values of the intensities of the colors of RGB of the first pixel, and are denoted as MaxR, MinR, MaxG, MinG, MaxB, and MinB.
S12: and performing first sorting on the first pixels according to the difference value between the maximum value and the minimum value of each color of the first pixels.
Comparing the sizes of (MaxR-MinR), (MaxG-MinG) and (MaxB-MinB) aiming at the first pixel, selecting the color (R or G or B) with the largest difference, and sorting the first pixel in the first area according to the color with the largest difference, namely, first sorting.
S13: the first region is divided into at least two regions according to a first ordering and first color volumes of the at least two regions of the first region are calculated, respectively.
For example, dividing the first region into two regions according to the first ordering, and dividing the pixels of the first half and the second half into two different regions, VBox1 and VBox2 can be obtained.
The first color volume is calculated based on the product of the difference between the maximum and minimum values of the colors of the first pixel, i.e., (MaxR-MinR) (MaxG-MinG) ((MaxB-MinB)).
S14: the first region is updated according to a first color volume.
First color volumes are calculated for the two regions, respectively, and a region in which the first color volume is large is updated as a first region.
In one possible implementation, steps S11-S14 may be repeated based on the updated first region, steps S11-S14 may be repeated a plurality of times, for example 16 times, or the steps may cease to be repeated when there is only one pixel in the first region.
S15: and taking a first average value of the color values of the first pixel, and determining a first color value of a first view of the current service scene in the application according to the first average value.
In the multiple repetition steps S11-S14, the color values of the first pixels in the finally updated first region are averaged, i.e. the first average value, and the first color value of the first view of the current service scene in the application is determined according to the first average value.
S20: and respectively acquiring a second view corresponding to the multiple candidate objects and a second color value of the second view from the advertisement resource library.
The advertisement view is taken as an example for explanation, and a plurality of advertisement views and a second color value of the advertisement views are obtained. Likewise, the second color value is a 6-bit 16-ary number obtained by the interface color acquisition method.
In one possible implementation, this step may include the following steps.
S21: and traversing second pixels in a second area in the second view to obtain the maximum value and the minimum value of each color of the second pixels.
Specifically, a specific area in the second view, for example, the middle 80% area is acquired as the second area according to the length and width of the second view. When the user operates App, the sight line is generally concentrated on a part of the image close to the middle, so the color of the second area can reflect the color effect of the eye curtain of the user most. And the pixels in the second area are second pixels, and the maximum value and the minimum value of each color of the second pixels are obtained by traversing the second pixels. Each color includes three elements of Red (english: Red, abbreviation: R), Green (english: Green, abbreviation: G), and Blue (english: Blue, abbreviation: B). The maximum and minimum values of the colors of the second pixel refer to the maximum and minimum values of the intensities of the colors of RGB of the second pixel, and are denoted as MaxR, MinR, MaxG, MinG, MaxB, and MinB.
S22: and performing second sorting on the second pixels according to the difference value between the maximum value and the minimum value of each color of the second pixels.
And comparing the sizes of (MaxR-MinR), (MaxG-MinG) and (MaxB-MinB) aiming at the second pixels, selecting the color (R or G or B) with the largest difference, and sorting the second pixels in the second area according to the color with the largest difference, namely, the first sorting.
S23: the second region is divided into at least two regions according to a second ordering and second color volumes of the at least two regions of the second region are calculated, respectively.
For example, dividing the second region into two regions according to the second ordering, and dividing the pixels of the first half and the second half into two different regions, VBox1 and VBox2 can be obtained.
The second color volume is calculated based on the product of the difference between the maximum value and the minimum value of the respective colors of the second pixel, i.e., (mMaxR-mmir) ((mMaxG-mmig) (mMaxB-mmib)).
S24: the second region is updated according to the second color volume.
The second color volume is calculated for the two regions, respectively, and the region whose second color volume is large is updated as the second region.
In one possible implementation, steps S21-S24 may be repeated based on the updated second region, steps S21-S24 may be repeated a plurality of times, for example 16 times, or the repetition of steps may be stopped when there is only one pixel in the second region.
S25: and taking a second average value of the color values of the second pixel, and determining a second color value of the second view according to the second average value.
And repeating the steps S21-S24 for a plurality of times, taking a second average value of the color values of the second pixels in the finally updated second area, and determining a second color value of a second view of the current service scene in the application according to the second average value.
S30: and determining a target view matched with the first view from the plurality of second views according to the difference value of the second color value and the first color value.
And calculating the difference value between the dominant hue color value (16-digit number with 6 bits) of the advertisement content and the dominant hue color value (16-digit number with 6 bits) of the game scene, and determining a target view matched with the game scene from a plurality of advertisement views according to a preset selection strategy.
This step may include the following steps.
S31: the first color value and the second color value are converted into a hue value, a saturation value and a lightness value.
The RGB values of the first color value and the second color value are converted into a hue value, a saturation value and a lightness value.
S32: and calculating a matching score according to the converted hue value, saturation value and brightness value based on the preset hue weight, saturation weight and brightness weight.
Based on preset hue weight H, saturation weight L and lightness weight B, for example, H is 2, L is 1, and B is 0.75, the matching score matchScore is calculated from the converted hue value, saturation value and lightness value.
1/(| h (target) -h (ad) | 2+ | l (target) -l (ad) | 100 | 1.5+ | b (target) -b (ad) | 100 | 1) 100, where h (target) is the color phase value of the first view, h (ad) is the color phase value of the second view, l (target) is the saturation value of the first view, l (ad) is the saturation value of the second view, b (target) is the brightness value of the first view, and b (ad) is the brightness value of the second view.
S33: and determining a target view matched with the first view from the plurality of second views according to the matching scores.
For example, the target view is the one with the highest match score.
S40: and selecting a corresponding alternative object according to the target view for loading, thereby recommending to the user.
Displaying an advertisement view matching the game scene.
Hereinafter, the above steps will be described by taking a game as an example.
Fig. 3 shows an example view of a first view. As shown, this is the first view of the current service scene in the game application obtained in step S10. The large area of the sky scene in the figure is blue.
Fig. 4 shows an example diagram of a first region within a first view. As shown, the central 4/5 area is taken from the first view as the first area. The large area of the sky scene in the figure is blue. RGB: 83f7f4, HSB is hsl (178.4,0.88, 0.74).
Fig. 5a to 5c show exemplary views of a second view. As shown, this is a second view of the plurality of alternative advertisements obtained in step S20. Advertising one RGB: # F6F5F3 HSL: hsl (40,0.14, 0.96); advertisement two RGB: # CA1D21 HSL: hsl (358.6,0.75, 0.45); and (3) advertising: RGB: #9EDAE5 HSL: hsl (189.3,0.58, 0.76).
In step S30, difference values between the dominant hue color values of the 3 advertisement contents and the dominant hue color values of the window or the carrier are calculated, and then the advertisement content corresponding to the color value with the smallest difference value is obtained for displaying the advertisement window.
Advertisement one: 1/(|178.4-40 |. 2+ |0.88-0.14 |. 100 |. 1.5+ |0.74-0.96 |. 100 ═ 0.244
Advertisement II: 1/(|178.4-358.6 |. 2+ |0.88-0.75 |. 100.5 + |0.74-0.45 |. 100 |) 100 ═ 0.247 |, respectively
And (3) advertising: 1/(|178.4-189.3 |. 2+ |0.88-0.58 |. 100.5 + |0.74-0.76 |. 100) | 100 ═ 1.45
The score of the advertisement III is the highest, the color matching degree is the highest, and the advertisement III is used for displaying the advertisement.
Therefore, the method for matching the view color in the application provided by the embodiment of the application acquires the first color value of the first view of the current business scene in the application, acquires the second color values of the second view and the second view corresponding to the multiple candidate objects from the advertisement resource library respectively, determining a target view matching the first view from the plurality of second views according to the difference between the second color value and the first color value, displaying the target view, automatically pushing the second view having a higher color matching degree with the first view currently being processed by the user to the user, the user can receive the pushed view with coordinated colors, the advertisement view recommended to the user is more coordinated, the user is more willing to click, the information recommendation efficiency is improved, and the user is prevented from being disturbed by vision when receiving the pushed view, the visual perception of the user is improved, and the eyesight of the user is protected.
Fig. 6 shows a schematic structural diagram of an apparatus for matching view colors in an application according to an embodiment of the present application, where the apparatus 100 includes: an acquisition module 110, a matching module 120, and a display module 130.
The obtaining module 110 is configured to obtain a first color value of a first view of a current service scene in an application, and obtain a second view corresponding to a plurality of candidate objects and a second color value of the second view from an advertisement resource library, respectively. The matching module 120 is configured to determine a target view matching the first view from the plurality of second views according to a difference between the second color value and the first color value. The display module 130 is configured to select a corresponding candidate object according to the target view to load, so as to recommend the target view to the user.
In a possible implementation manner, the matching module 120 is configured to determine, as the target view, a second view with a smallest difference between the second color value and the first color value.
In a possible implementation manner, the obtaining module 110 is configured to traverse a first pixel in a first area in the first view, and obtain a maximum value and a minimum value of each color of the first pixel; according to the difference value between the maximum value and the minimum value of each color of the first pixel, performing first sequencing on the first pixel; dividing the first region into at least two regions according to the first ordering, and respectively calculating first color volumes of the at least two regions of the first region; updating the first region according to the first color volume.
In a possible implementation manner, the obtaining module 110 is further configured to, after updating the first area, take a first average value of color values of the first pixel; and determining a first color value of a first view of the current service scene in the application according to the first average value.
In a possible implementation manner, the obtaining module 110 is configured to traverse a second pixel in a second area in the second view, and obtain a maximum value and a minimum value of each color of the second pixel; performing second sorting on the second pixels according to the difference value between the maximum value and the minimum value of each color of the second pixels; dividing the second region into at least two regions according to the second ordering, and respectively calculating second color volumes of the at least two regions of the second region; updating the second region according to the second color volume.
In a possible implementation manner, the obtaining module 110 is further configured to, after updating the second area, take a second average value of color values of the second pixel; and determining a first color value of a first view of the current service scene in the application according to the second average value.
In one possible implementation, the matching module 120 is configured to convert the first color value and the second color value into a color value, a saturation value, and a brightness value; calculating a matching score according to the converted hue value, saturation value and brightness value based on the preset hue weight, saturation weight and brightness weight; and determining a target view matched with the first view from the plurality of second views according to the matching scores.
The apparatus 100 provided in this embodiment of the application can perform the methods described in the foregoing method embodiments, and implement the functions and beneficial effects of the methods described in the foregoing method embodiments, which are not described herein again.
Fig. 7 is a schematic diagram illustrating a hardware structure of an electronic device for performing a method for matching view colors in an application according to an embodiment of the present disclosure, where the electronic device may have a relatively large difference due to different configurations or performances, and may include one or more processors 701 and a memory 702, and one or more stored applications or data may be stored in the memory 702. Memory 702 may be, among other things, transient storage or persistent storage. The application program stored in memory 702 may include one or more modules (not shown), each of which may include a series of computer-executable instructions for the electronic device. Still further, the processor 701 may be configured to communicate with the memory 702, executing on the electronic device a series of computer-executable instructions in the memory 702. The electronic device may also include one or more power supplies 703, one or more wired or wireless network interfaces 704, one or more input-output interfaces 705, one or more keyboards 706, and the like.
In a particular embodiment, the electronic device includes a memory, a processor, and computer-executable instructions stored on the memory and executable on the processor, which when executed by the processor implement the following: acquiring a first color value of a first view of a current service scene in an application; respectively acquiring a second view corresponding to a plurality of candidate objects and a second color value of the second view from an advertisement resource library; determining a target view from the plurality of second views that matches the first view based on a difference between the second color value and the first color value; and selecting a corresponding alternative object according to the target view for loading, thereby recommending to the user.
In one possible implementation, determining, from the plurality of second views, a target view that matches the first view according to a difference between the second color value and the first color value includes: determining a second view having a smallest difference between the second color value and the first color value as the target view.
In a possible implementation manner, the obtaining a first color value of a first view of a current service scenario in an application includes: traversing first pixels in a first area in the first view, and acquiring the maximum value and the minimum value of each color of the first pixels; according to the difference value of the maximum value and the minimum value of each color of the first pixel, performing first sorting on the first pixel; dividing the first region into at least two regions according to the first ordering, and respectively calculating first color volumes of the at least two regions of the first region; updating the first region according to the first color volume.
In one possible implementation manner, after updating the first area, the method further includes: taking a first average value of all color values of the first pixel; and determining a first color value of a first view of the current service scene in the application according to the first average value.
In a possible implementation manner, the obtaining, from the advertisement repository, the second view corresponding to the multiple candidate objects and the second color value of the second view respectively includes: traversing second pixels in a second area in the second view to obtain the maximum value and the minimum value of each color of the second pixels; performing second sorting on the second pixels according to the difference value between the maximum value and the minimum value of each color of the second pixels; dividing the second region into at least two regions according to the second ordering, and respectively calculating second color volumes of the at least two regions of the second region; updating the second region according to the second color volume.
In a possible implementation manner, after updating the second area, the method further includes: taking a second average value of all color values of the second pixel; determining a second color value of the second view according to the second average value.
In one possible implementation, determining, from the plurality of second views, a target view that matches the first view according to a difference between the second color value and the first color value includes: converting the first color value and the second color value into a hue value, a saturation value, and a lightness value; calculating a matching score according to the converted hue value, saturation value and brightness value based on the preset hue weight, saturation weight and brightness weight; and determining a target view matched with the first view from the plurality of second views according to the matching scores.
Therefore, the electronic device executing the method for matching view colors in an application provided by the embodiment of the present application can execute the methods described in the foregoing method embodiments, and implement the functions and beneficial effects of the methods described in the foregoing method embodiments, which are not described herein again.
The electronic device of the embodiments of the present application exists in various forms, including but not limited to the following devices.
(1) Mobile communication devices, which are characterized by mobile communication capabilities and are primarily targeted at providing voice and data communications. Such terminals include smart phones (e.g., iphones), multimedia phones, functional phones, and low-end phones, among others.
(2) The ultra-mobile personal computer equipment belongs to the category of personal computers, has calculation and processing functions and generally has the characteristic of mobile internet access. Such terminals include PDA, MID, and UMPC devices, such as ipads.
(3) Portable entertainment devices such devices may display and play multimedia content. Such devices include audio and video players (e.g., ipods), handheld game consoles, electronic books, as well as smart toys and portable car navigation devices.
(4) The server is similar to a general computer architecture, but has higher requirements on processing capability, stability, reliability, safety, expandability, manageability and the like because of the need of providing highly reliable services.
(5) And other electronic devices with data interaction functions.
Further, an embodiment of the present application also provides a computer-readable storage medium for storing computer-executable instructions, which when executed by a processor implement the following process: acquiring a first color value of a first view of a current service scene in an application; respectively acquiring a second view corresponding to a plurality of candidate objects and a second color value of the second view from an advertisement resource library; determining a target view from the plurality of second views that matches the first view based on a difference between the second color value and the first color value; and selecting a corresponding alternative object according to the target view for loading, thereby recommending to the user.
In one possible implementation, determining, according to the difference between the second color value and the first color value, a target view matching the first view from the plurality of second views comprises: determining a second view having a smallest difference between the second color value and the first color value as the target view.
In a possible implementation manner, the obtaining a first color value of a first view of a current service scenario in an application includes: traversing first pixels in a first area in the first view, and acquiring the maximum value and the minimum value of each color of the first pixels; according to the difference value between the maximum value and the minimum value of each color of the first pixel, performing first sequencing on the first pixel; dividing the first region into at least two regions according to the first ordering, and respectively calculating first color volumes of the at least two regions of the first region; updating the first region according to the first color volume.
In one possible implementation manner, after updating the first area, the method further includes: taking a first average value of all color values of the first pixel; and determining a first color value of a first view of the current service scene in the application according to the first average value.
In a possible implementation manner, the obtaining, from the advertisement repository, the second view corresponding to the multiple candidate objects and the second color value of the second view respectively includes: traversing a second pixel in a second area in the second view, and acquiring the maximum value and the minimum value of each color of the second pixel; performing second sorting on the second pixels according to the difference value between the maximum value and the minimum value of each color of the second pixels; dividing the second region into at least two regions according to the second ordering, and respectively calculating second color volumes of the at least two regions of the second region; updating the second region according to the second color volume.
In a possible implementation manner, after updating the second area, the method further includes: taking a second average value of all color values of the second pixel; determining a second color value of the second view according to the second average value.
In one possible implementation, determining, from the plurality of second views, a target view that matches the first view according to a difference between the second color value and the first color value includes: converting the first color value and the second color value into a hue value, a saturation value, and a lightness value; calculating a matching score according to the converted hue value, saturation value and brightness value based on the preset hue weight, saturation weight and brightness weight; and determining a target view matched with the first view from the plurality of second views according to the matching scores.
Thus, when executed by a processor, the computer-executable instructions can perform the methods described in the foregoing method embodiments, and implement the functions and advantages of the methods described in the foregoing method embodiments, which are not described herein again.
The computer-readable storage medium includes a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
Further, embodiments of the present application also provide a computer program product, the computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions, which when executed by a computer, implement the following process: acquiring a first color value of a first view of a current service scene in an application; respectively acquiring a second view corresponding to a plurality of candidate objects and a second color value of the second view from an advertisement resource library; determining a target view from the plurality of second views that matches the first view based on a difference between the second color value and the first color value; and selecting a corresponding alternative object according to the target view for loading, thereby recommending to the user.
In one possible implementation, determining, from the plurality of second views, a target view that matches the first view according to a difference between the second color value and the first color value includes: determining a second view having a smallest difference between the second color value and the first color value as the target view.
In a possible implementation manner, the obtaining a first color value of a first view of a current service scenario in an application includes: traversing first pixels in a first area in the first view, and acquiring the maximum value and the minimum value of each color of the first pixels; according to the difference value between the maximum value and the minimum value of each color of the first pixel, performing first sequencing on the first pixel; dividing the first region into at least two regions according to the first ordering, and respectively calculating first color volumes of the at least two regions of the first region; updating the first region according to the first color volume.
In one possible implementation manner, after updating the first area, the method further includes: taking a first average value of all color values of the first pixel; and determining a first color value of a first view of the current service scene in the application according to the first average value.
In a possible implementation manner, the obtaining, from the advertisement resource library, a second view corresponding to the multiple candidate objects and a second color value of the second view respectively includes: traversing second pixels in a second area in the second view to obtain the maximum value and the minimum value of each color of the second pixels; performing second sorting on the second pixels according to the difference value between the maximum value and the minimum value of each color of the second pixels; dividing the second region into at least two regions according to the second ordering, and respectively calculating second color volumes of the at least two regions of the second region; updating the second region according to the second color volume.
In a possible implementation manner, after updating the second area, the method further includes: taking a second average value of all color values of the second pixel; determining a second color value of the second view according to the second average value.
In one possible implementation, determining, from the plurality of second views, a target view that matches the first view according to a difference between the second color value and the first color value includes: converting the first color value and the second color value into a hue value, a saturation value, and a lightness value; calculating a matching score according to the converted hue value, saturation value and brightness value based on the preset hue weight, saturation weight and brightness weight; and determining a target view matched with the first view from the plurality of second views according to the matching scores.
Therefore, the computer program product provided in the embodiment of the present application can execute the methods described in the foregoing method embodiments, and implement the functions and advantages of the methods described in the foregoing method embodiments, which are not described herein again.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art to which the present application pertains. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (10)

1. A method of matching view colors in an application, comprising:
acquiring a first color value of a first view of a current business scene in an application, wherein the first color value is determined according to color values of pixels in a first area in the first view, and the first area is positioned in the middle of the first view;
respectively acquiring a second view corresponding to a plurality of candidate objects and a second color value of the second view from an advertisement resource library, wherein the second color value is determined according to color values of pixels in a second region in the second view, and the second region is located in the middle of the second view;
determining a target view from the plurality of second views that matches the first view based on a difference between the second color value and the first color value;
selecting a corresponding candidate object according to the target view to load so as to display the target view on the first view, and recommending the target view to a user;
wherein the obtaining a first color value of a first view of a current service scene in an application comprises:
traversing first pixels in a first area in the first view, and acquiring the maximum value and the minimum value of each color of the first pixels;
according to the difference value between the maximum value and the minimum value of each color of the first pixel, performing first sequencing on the first pixel;
dividing the first region into at least two regions according to the first ordering, and respectively calculating first color volumes of the at least two regions of the first region;
updating the first region according to the first color volume;
the obtaining a second view corresponding to a plurality of candidate objects and a second color value of the second view from an advertisement repository respectively includes:
traversing second pixels in a second area in the second view to obtain the maximum value and the minimum value of each color of the second pixels;
performing second sorting on the second pixels according to the difference value between the maximum value and the minimum value of each color of the second pixels;
dividing the second region into at least two regions according to the second ordering, and respectively calculating second color volumes of the at least two regions of the second region;
updating the second region according to the second color volume.
2. The method of claim 1, wherein determining the target view from the plurality of second views that matches the first view based on the difference between the second color value and the first color value comprises:
determining a second view having a smallest difference between the second color value and the first color value as the target view.
3. The method of claim 1, further comprising, after updating the first region:
taking a first average value of all color values of the first pixel;
and determining a first color value of a first view of the current service scene in the application according to the first average value.
4. The method of claim 1, further comprising, after updating the second region:
taking a second average value of all color values of the second pixel;
determining a second color value of the second view according to the second average value.
5. The method of claim 4, wherein determining the target view from the plurality of second views that matches the first view based on the difference between the second color value and the first color value comprises:
converting the first color value and the second color value into a hue value, a saturation value, and a lightness value;
calculating a matching score according to the converted hue value, saturation value and brightness value based on the preset hue weight, saturation weight and brightness weight;
and determining a target view matched with the first view from the plurality of second views according to the matching scores.
6. An apparatus for matching view colors in an application, comprising:
an obtaining module, configured to obtain a first color value of a first view of a current business scene in an application, and obtain a second view corresponding to a plurality of candidate objects and a second color value of the second view from an advertisement resource library, where the first color value is determined according to a color value of a pixel in a first region in the first view, the first region is located in the middle of the first view, the second color value is determined according to a color value of a pixel in a second region in the second view, and the second region is located in the middle of the second view;
a matching module, configured to determine, according to a difference between the second color value and the first color value, a target view that matches the first view from the plurality of second views;
the display module is used for selecting a corresponding candidate object according to the target view to load so as to display the target view on the first view, and therefore recommendation is carried out on the target view to a user;
wherein the obtaining module is specifically configured to:
traversing first pixels in a first area in the first view, and acquiring the maximum value and the minimum value of each color of the first pixels;
according to the difference value between the maximum value and the minimum value of each color of the first pixel, performing first sequencing on the first pixel;
dividing the first region into at least two regions according to the first ordering, and respectively calculating first color volumes of the at least two regions of the first region;
updating the first region according to the first color volume;
wherein the obtaining module is further configured to:
traversing second pixels in a second area in the second view to obtain the maximum value and the minimum value of each color of the second pixels;
performing second sorting on the second pixels according to the difference value between the maximum value and the minimum value of each color of the second pixels;
dividing the second region into at least two regions according to the second ordering, and respectively calculating second color volumes of the at least two regions of the second region;
updating the second region according to the second color volume.
7. The apparatus of claim 6, wherein the matching module is configured to determine a second view with a smallest difference between the second color value and the first color value as the target view.
8. The apparatus of claim 6, wherein the obtaining module is further configured to take a first average value of the color values of the first pixel after updating the first region;
and determining a first color value of a first view of the current service scene in the application according to the first average value.
9. The apparatus of claim 6, wherein the obtaining module is further configured to take a second average of the color values of the second pixel after updating the second region;
and determining a second color value of a second view of the current service scene in the application according to the second average value.
10. The apparatus of claim 9, wherein the matching module is configured to convert the first color value and the second color value into a hue value, a saturation value, and a lightness value;
calculating a matching score according to the converted hue value, saturation value and lightness value based on the preset hue weight, saturation weight and lightness weight;
and determining a target view matched with the first view from the plurality of second views according to the matching scores.
CN201910028592.0A 2019-01-11 2019-01-11 Method and device for matching view colors in application Active CN109901897B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910028592.0A CN109901897B (en) 2019-01-11 2019-01-11 Method and device for matching view colors in application

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910028592.0A CN109901897B (en) 2019-01-11 2019-01-11 Method and device for matching view colors in application

Publications (2)

Publication Number Publication Date
CN109901897A CN109901897A (en) 2019-06-18
CN109901897B true CN109901897B (en) 2022-07-08

Family

ID=66943665

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910028592.0A Active CN109901897B (en) 2019-01-11 2019-01-11 Method and device for matching view colors in application

Country Status (1)

Country Link
CN (1) CN109901897B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110335321B (en) * 2019-07-01 2021-04-23 上海外高桥造船有限公司 Color block matching degree evaluation method and system, storage medium and electronic equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106650570A (en) * 2016-09-06 2017-05-10 深圳市金立通信设备有限公司 Article finding method and terminal
CN107122097A (en) * 2017-04-21 2017-09-01 维沃移动通信有限公司 The recommendation method and mobile terminal of a kind of mobile terminal wallpaper
CN107155100A (en) * 2017-06-20 2017-09-12 国家电网公司信息通信分公司 A kind of solid matching method and device based on image

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130271565A1 (en) * 2012-04-16 2013-10-17 Qualcomm Incorporated View synthesis based on asymmetric texture and depth resolutions
KR20170046434A (en) * 2015-10-21 2017-05-02 삼성전자주식회사 Image processing method and image processing apparatus
CN107908383B (en) * 2017-11-14 2020-07-07 维沃移动通信有限公司 Screen color adjusting method and device and mobile terminal

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106650570A (en) * 2016-09-06 2017-05-10 深圳市金立通信设备有限公司 Article finding method and terminal
CN107122097A (en) * 2017-04-21 2017-09-01 维沃移动通信有限公司 The recommendation method and mobile terminal of a kind of mobile terminal wallpaper
CN107155100A (en) * 2017-06-20 2017-09-12 国家电网公司信息通信分公司 A kind of solid matching method and device based on image

Also Published As

Publication number Publication date
CN109901897A (en) 2019-06-18

Similar Documents

Publication Publication Date Title
US10692133B2 (en) Color estimation device, color estimation method, and color estimation program
CN104767983B (en) A kind of image processing method and device
CN104778047A (en) Content display method and terminal
US11462002B2 (en) Wallpaper management method, apparatus, mobile terminal, and storage medium
US8599212B2 (en) Character display method and apparatus
CN105955754B (en) A kind of user interface character displaying method and device
CN104537021A (en) Method for setting browser background and browser client
CN109901897B (en) Method and device for matching view colors in application
US20170161875A1 (en) Video resolution method and apparatus
US8463026B2 (en) Automated identification of image outliers
US20120219219A1 (en) Image processing apparatus, storage medium storing image processing program, and image processing method
CN112053419A (en) Image superposition processing method and device, storage medium and electronic device
CN106683108A (en) Method and apparatus for determining the flat areas of video frame and electronic device
CN113923474A (en) Video frame processing method and device, electronic equipment and storage medium
CN112819691B (en) Image processing method, device, equipment and readable storage medium
US10672049B1 (en) Sample color selection for online retail items
CN111695027B (en) Information processing method and device
US11973811B2 (en) Whiteboard background customization system
CN114092359B (en) Method and device for processing screen pattern and electronic equipment
CN115953597B (en) Image processing method, device, equipment and medium
CN112801997B (en) Image enhancement quality evaluation method, device, electronic equipment and storage medium
CN114782249A (en) Super-resolution reconstruction method, device and equipment for image and storage medium
CN117389669A (en) Window display method and device, electronic equipment and storage medium
Lee et al. Gradient preserving RGB-to-gray conversion using random forest
CN112053277B (en) Method, device, equipment and storage medium for changing image skin

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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20220718

Address after: No.16 and 17, unit 1, North District, Kailin center, No.51 Jinshui East Road, Zhengzhou area (Zhengdong), Henan pilot Free Trade Zone, Zhengzhou City, Henan Province, 450000

Patentee after: Zhengzhou Apas Technology Co.,Ltd.

Address before: E301-27, building 1, No.1, hagongda Road, Tangjiawan Town, Zhuhai City, Guangdong Province

Patentee before: ZHUHAI TIANYAN TECHNOLOGY Co.,Ltd.