Display mode switching method, device, electronic device and medium
By identifying and handling icons that do not match dark mode on electronic devices and adapting their colors to dark mode, the problem of inconsistent icon display style and background in dark mode is solved, and the user experience is improved.
Patent Information
- Application Number
- CN202110209962.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-24
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2041-02-24
AI Technical Summary
When switching to dark mode on electronic devices, the display style of some icons is not uniform with the background, affecting the user's viewing and user experience.
By identifying the icon to be displayed in the display interface, the target icon that does not match the dark mode display style is identified, and image processing is performed to make its color suitable for the dark mode display style.
Ensure that all icons match the display style in dark mode to improve the user's dark mode experience.
Smart Images

Figure CN114968009B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal display technology, and in particular to a display mode switching method, device, electronic device and medium. Background Art
[0002] With the development of science and technology, electronic devices are used more and more widely, and their function settings are getting closer to people's needs. The "dark mode" is proposed to meet the deep demand for reading comfort and readability during use. The graphical user interface in the "dark mode" usually presents a dark (such as black) background and a bright (such as white) foreground. Currently, mainstream operating systems such as the Android open source operating system, the mobile operating system developed by Apple (iOS) and the operating system developed by Microsoft (Windows) all provide support for the "dark mode".
[0003] like Figure 1 As shown, when the user needs to select the "dark mode" on the mobile phone 100, the user can enter the relevant setting interface and switch the display mode by clicking the dark mode on switch shown on the screen of the mobile phone 100: It can be seen that when the "dark mode" is turned on, the display background is replaced with a dark color (such as black) and the text foreground is presented with a light color (such as white) through the switching of internal theme resources; but when the display interface is switched to the main interface, as shown Figure 2 As shown, it can be found that due to the lack of corresponding adaptation subject resources, icons 001 to 006 still maintain the original display form in the non-dark mode when displayed, resulting in the fragmentation of the overall display style; Figure 3 As shown, even if some of the system's built-in applications and third-party applications are adapted through preset resources, such as the clock icon 002, browser icon 005, and search icon 006, which are displayed in reverse color to match the entire display environment following the conversion of the system's "dark mode", there are still third-party applications that do not support adaptation and affect the user experience, such as the shopping icon 001, the movie icon 003, and the home network icon 004. Therefore, it can be seen that when the "dark mode" is switched on an electronic device such as a mobile phone 100, there is a problem that the display style of some icons is inconsistent with the background. Summary of the invention
[0004] The purpose of the present application is to provide an electronic device and a display mode switching method and medium thereof. Through the method of the present application, the electronic device can switch the display interface to the dark mode display style according to the switching instruction of the user to switch the display mode of the electronic device to the dark mode, and at the same time identify the icons to be displayed in the display interface, identify the display icons that are not compatible with the dark mode display style and perform image processing on them, so that the icons to be displayed can all match the dark mode display style.
[0005] A first aspect of the present application provides a display mode switching method, which is applied to an electronic device, and the method includes: the electronic device receives a switching instruction from a user to switch the display mode of the electronic device to a dark mode; the electronic device identifies an icon to be identified in a display interface of the electronic device to identify a target icon, wherein the target icon is an icon that is not compatible with the dark mode display style; the electronic device performs color processing on the target icon so that the color of the target icon is compatible with the dark mode display style; and the electronic device displays the color-processed target icon on the display interface.
[0006] That is, in an embodiment of the present application, the icons displayed on the display interface of the electronic device can match the display style of the display interface of the electronic device in the dark mode.
[0007] For example, the electronic device may be a mobile phone, and the electronic device display interface may be the display interface of the mobile phone, which display interface includes: desktop background, weather icon, weather forecast text content, shopping icon, clock icon, home network icon, etc., among which the weather icon, shopping icon, clock icon and home network icon are the icons to be displayed.
[0008] When the mobile phone receives a switching instruction from the user to switch the display mode of the mobile phone to the dark mode, the display interface is switched from the normal mode to the dark mode. Among them, the desktop background in the display interface can be switched from a light color (such as white) to a dark color (such as black or dark gray), and the text content in the display interface (such as the weather forecast text content) can be switched from a dark color (such as black) to a light color (such as white or light gray). At the same time, the mobile phone identifies the weather icon, shopping icon, clock icon and other display icons to identify the target icon, wherein the target icon is an icon that does not match the dark mode display style. For example, the shopping icon is a rounded rectangular icon, which is composed of a shopping cart pattern and a rounded rectangular white background base. When the display mode of the mobile phone is switched to the dark mode, there is a huge brightness contrast between the white background base of the shopping icon and the dark (such as black or dark gray) desktop background, which causes the shopping icon to be inconsistent with the overall display style of the mobile phone display interface in the dark mode, affecting the user's viewing and use experience. In this case, the shopping icon can be identified as the target icon.
[0009] After completing the recognition process of the target icon, the mobile phone performs color processing on the target icon (such as a shopping icon) so that the color of the target icon adapts to the dark mode display style. For example, the color of the white background base of the shopping icon is changed from white to dark gray, and the shopping cart pattern of the shopping icon is changed from black to light gray. The shopping icon after the above color processing is consistent with the dark mode display style, avoiding the situation where the brightness of some icon areas in the display interface of the mobile phone is too high. The mobile phone displays the color-processed target icon on the display interface, which can enable users to obtain a better dark mode usage experience.
[0010] In a possible implementation of the first aspect above, the electronic device determines whether the icon to be identified is the target icon by comparing the icon outline, transparent pixel distribution, color distribution, and multiple items of color types of the icon to be identified with the icon outline, transparent pixel distribution, color distribution, and multiple items of color types of the preset target icon. It can be understood that the electronic device identifies whether the icon to be identified is the target icon by performing feature comparison between the icon to be identified and the preset target icon, wherein the comparison features include multiple items of icon outline, transparent pixel distribution, color distribution, and color types, and the reasons for selecting the comparison features will be explained later.
[0011] In a possible implementation of the first aspect above, a method for determining whether an icon to be identified is a target icon includes: the electronic device determines that the icon to be identified is a target icon when multiple of the icon outline, transparent pixel distribution, color distribution, and color type of the icon to be identified and a preset target icon meet corresponding comparison conditions.
[0012] That is, in the embodiment of the present application, the electronic device determines that the icon to be identified is the target icon only when all the selected multiple comparison conditions are met. If the icon to be identified does not match the preset target icon in any of the selected comparison conditions, it is determined that the icon to be identified is not the target icon and the identification process is exited, thereby shortening the execution speed required for the display mode switching method.
[0013] In a possible implementation of the first aspect above, a method for determining whether an icon to be identified is a target icon includes: the electronic device assigns weight parameters to the comparison results of the icon outline, transparent pixel distribution, color distribution and color type of the icon to be identified and the preset target icon, and based on the weight parameters, performs a weighted summation on the values of the comparison results of the icon outline, transparent pixel distribution, color distribution and color type; when the value of the weighted sum is greater than a first preset threshold, the electronic device determines that the icon to be identified is a target icon.
[0014] That is, in an embodiment of the present application, the electronic device performs a comparison operation on all the selected multiple comparison conditions, and assigns a weight parameter to each comparison result, and determines whether the icon to be identified is the target icon according to the value of the comparison result and the weighted sum of the weight parameters. The above-mentioned recognition method can further improve the precision of the target icon recognition, and has a better recognition effect for some target icons with special designs, thereby reducing the recognition omission rate of the target icon. At the same time, the user can adjust the emphasis in the target icon recognition process by adjusting the weight parameters of different comparison items, so that the electronic device can recognize the target icon more targeted.
[0015] In a possible implementation of the first aspect, the target icon is a circular icon or a rounded rectangular icon. It is understandable that in the display interface of an electronic device, the outer contour of a display icon is often circular or rounded rectangular, and such display icons are called circular icons or rounded rectangular icons.
[0016] In a possible implementation of the first aspect, a method for comparing the icon outlines of an icon to be identified and a preset target icon includes: the electronic device determines, when the icon outline of the icon to be identified is a circle or a rounded rectangle, that the icon outline of the icon to be identified is consistent with the icon outline of the preset target icon. It can be understood that, when the target icon is a circle or a rounded rectangle, if the icon outline of the icon to be identified meets the geometric features of a circle or a rounded rectangle, it means that the icon outline of the icon to be identified is consistent with the icon outline of the preset target icon.
[0017] In a possible implementation of the first aspect above, the electronic device identifies an icon to be identified in a display interface of the electronic device to identify a target icon, including: the electronic device obtains icon material of the icon to be identified, wherein the icon material to be identified includes the icon to be identified and a peripheral part located outside the icon to be identified; according to the distribution of non-transparent pixels in the icon material of the icon to be identified, determines a to-be-identified area of the icon to be identified, wherein the icon material of the icon to be identified includes the to-be-identified area, and the to-be-identified area includes the icon to be identified.
[0018] It can be understood that the icon material of the icon to be identified can be a vector image, which includes a portion representing the icon to be identified and a transparent pixel background portion, wherein the icon portion to be identified is composed of non-transparent pixels, is located on the upper layer of the transparent pixel background portion, and the area of the transparent pixel background portion is larger than the area of the icon portion to be identified. When the electronic device identifies the icon to be identified, the comparison object that can be obtained can be the icon material of the icon to be identified. Considering that the comparison features of the icon to be identified and the preset target icon are both present in the icon portion to be identified, the electronic device can determine the area to be identified based on the distribution of non-transparent pixels in the icon material. The area to be identified can be a regular simple geometric shape (such as a circle, rectangle, etc.), including all areas occupied by non-transparent pixels and as few areas occupied by transparent pixels as possible, so that the area occupied by transparent pixels located in the outer part of the icon to be identified can be removed from the icon material. For example, the area to be identified can be a circumscribed rectangle of the area occupied by non-transparent pixels.
[0019] In a possible implementation of the first aspect above, a method for comparing the distribution of transparent pixels of an icon to be identified and a preset target icon includes: when the proportion of the area occupied by transparent pixels in a partial area of the electronic device in the area to be identified is lower than a second preset threshold, determining that the distribution of transparent pixels of the icon to be identified is consistent with the distribution of transparent pixels of the preset target icon, wherein the partial area includes the center point of the area to be identified. It can be understood that if there is a large area of transparent pixels distributed in the area near the center point of the area to be identified, when the icon to be identified is placed on the desktop background for display, the area occupied by these transparent pixels will change with the color change of the desktop background, thereby achieving automatic adaptation to the dark mode display style, and there is no need to perform subsequent color processing as a target icon. When the proportion of the area occupied by transparent pixels in the partial area near the center point of the icon to be identified is lower than the preset threshold, it means that most of the area in the icon to be identified cannot change color with the desktop background, and subsequent color processing is required to adapt to the dark mode display style.
[0020] Furthermore, the electronic device can set a plurality of evenly distributed sampling points in a partial area near the center point of the area to be identified, and determine the number of sampling points with transparent pixels by identifying the color of each sampling point, and use the ratio of the number of sampling points with transparent pixels to the total number of sampling points as the proportion of the area occupied by transparent pixels in the partial area near the center point of the area to be identified, thereby further simplifying the steps of obtaining the distribution of transparent pixels of the icon to be identified and shortening the execution speed required for the display mode switching method.
[0021] In a possible implementation of the first aspect above, a method for comparing the color distribution of an icon to be identified and a preset target icon includes: when the proportion of the main color area in the area to be identified of the electronic device is higher than a third preset threshold, determining that the color distribution of the icon to be identified is consistent with the color distribution of the preset target icon. Among them, the main color area is the area occupied by the color that appears most frequently in the area to be identified. It can be understood that the preset target icon can have a solid color background board, which can set off the icon pattern and distinguish it from the background of the display interface, and occupies most of the area of the icon as a whole. When the proportion of the main color area of the icon to be identified is higher than the preset threshold, it means that the icon to be identified has a solid color background board, which is consistent with the color distribution of the preset target icon.
[0022] Furthermore, the electronic device can set a plurality of evenly distributed sampling points in the area to be identified, and by identifying the color of each sampling point, confirm the color that appears most frequently among the colors of each sampling point as the color with the highest frequency of occurrence, and use the ratio of the number of sampling points corresponding to the color that appears most frequently to the number of all sampling points as the proportion of the main color area in the area to be identified, thereby further simplifying the steps of obtaining the color distribution of the icon to be identified and shortening the execution speed required for the display mode switching method.
[0023] In a possible implementation of the first aspect above, a method for comparing the color types of the icon to be identified and the preset target icon includes: the electronic device counts the color types in the area to be identified, and when the color types are less than a preset number threshold, determines that the color type of the icon to be identified is consistent with the color type of the preset target icon. It can be understood that in the display interface of the electronic device, in order to attract the user's attention and indicate the main functions of the corresponding application, the design language of the display icon is often relatively concise, and the colors used are relatively single. For example, a shopping icon composed of a shopping cart pattern and a white background substrate uses only the white color used by the white background substrate and the black color used by the shopping cart pattern. When the color types of the icon to be identified are less than the preset number threshold, it means that the icon to be identified uses a relatively single color, which is consistent with the color distribution of the preset target icon.
[0024] Furthermore, for icons with too many colors to be displayed, it is easy for the icons to be displayed after color processing to have hue deviation due to the overly complex colors, resulting in a large deviation between the icon pattern presented on the display interface of the electronic device and the original design concept of the icon. In the embodiment of the present application, such icons with too many colors to be displayed are not suitable for color processing, and the display brightness of the icons to be displayed can be adjusted to adapt to the dark mode display style.
[0025] Furthermore, the electronic device can set a plurality of evenly distributed sampling points in the area to be identified, and count the types of colors existing in the area to be identified by identifying the color of each sampling point, thereby further simplifying the steps of acquiring the color types in the icon to be identified and shortening the execution speed required for the display mode switching method.
[0026] In a possible implementation of the first aspect above, when the electronic device counts the color types of the area to be identified, the color information of each pixel in the area to be identified is collected to obtain the pixel color of each pixel, and color clustering is performed on each pixel color, and the pixel colors that meet the clustering conditions are identified as the same color. It can be understood that the color types used by the icon to be identified should be based on the user's human eye cognition as the standard, but there may be subtle differences between the actual pixel colors that the human eye cannot recognize. For example, for two pixel colors with slight differences in brightness (such as light gray with a brightness value of 250 and light gray with a brightness value of 245), the human eye cannot distinguish these two pixel colors, but the electronic device will identify them as two different colors, which leads to too many color types when counting the color types of the area to be identified. Therefore, through the color clustering operation, the pixel colors that meet the clustering conditions can be identified as the same color, so that the color type statistics of the area to be identified are consistent with the cognitive habits of the human eye.
[0027] In a possible implementation of the first aspect above, the clustering condition includes at least one of the following: the saturation difference of the pixel color is less than the saturation threshold; the brightness difference of the pixel color is less than the brightness threshold; the hue difference of the pixel color is less than the hue threshold. It can be understood that the saturation, hue and brightness of the pixel colors that are identified as the same color after color clustering are close, and the electronic device can determine whether the pixel colors belong to the same color by presetting at least one of the saturation threshold, hue threshold and brightness threshold. For example, for two pixel colors with slight differences in brightness, when the brightness difference of the two pixel colors is less than the pre-set brightness threshold, it can be determined that the two pixel colors belong to the same color.
[0028] In a possible implementation of the first aspect above, the specific process of the electronic device performing color processing on the color of the target icon so that the color of the target icon adapts to the dark display style includes: when the icon brightness value of the target icon is greater than a preset brightness threshold, the electronic device performs inversion processing on the target icon to adapt to the dark mode display style. It can be understood that when the icon brightness value of the target icon is greater than the preset brightness threshold, it means that the overall brightness of the target icon is in a bright state. At this time, the corresponding color processing operation is to adjust the overall brightness of the target icon from a bright state to a dark state through inversion processing, so as to adapt to the dark mode display style.
[0029] In a possible implementation of the first aspect above, the inversion processing of the target icon includes: selecting a flip center value between the minimum and maximum values of the brightness value, and taking the brightness value of each pixel in the target icon as the center of the flip center value, and taking the brightness value symmetrical to the current brightness value of the pixel as the brightness value of the pixel after the inversion processing. For example, when the minimum and maximum values of the brightness value are set to 0 and 255 respectively, and the flip center value is set to 127.5, the brightness value of the white pixel (brightness value is 255) changes from 255 to 0 after the inversion processing, and the color of the white pixel changes from white (brightness value is 255) to black (brightness value is 0). For another example, when the minimum and maximum values of the brightness value are set to 0 and 255 respectively, and the flip center value is set to 155, the brightness value of the white pixel (brightness value is 255) changes from 255 to 55 after the inversion processing, and the color of the white pixel changes from white (brightness value is 255) to dark gray (brightness value is 55). The inversion process can reduce the brightness of the highlighted background area in the target icon to match the dark mode display style.
[0030] In a possible implementation of the first aspect, the icon brightness value of the target icon may be the brightness value corresponding to each pixel in the target icon. By traversing the brightness value of each pixel in the target icon and performing the aforementioned inversion processing on the pixel whose brightness value is greater than a preset brightness threshold, the target icon can be adapted to the dark mode display style.
[0031] In a possible implementation of the first aspect above, the icon brightness value of the target icon may also be the average value of the brightness value of each pixel in the target icon. It can be understood that the average value of the brightness value of each pixel in the target icon reflects the overall brightness of the target icon. Furthermore, the electronic device may set a plurality of evenly distributed sampling points in the target icon, and calculate the average value of the brightness value of each sampling point as the average value of the brightness value of each pixel in the target icon, thereby further simplifying the steps of obtaining the icon brightness value of the target icon and shortening the execution speed required for the display mode switching method.
[0032] In a possible implementation of the first aspect, the icon brightness value of the target icon may also be the brightness value of the color that appears most frequently in the target icon. It is understandable that the area occupied by the color that appears most frequently in the target icon is the largest among the areas occupied by a single color that appears in the target icon, and the brightness value of the color that appears most frequently in the target icon may reflect the overall brightness of the target icon.
[0033] The second aspect of the present application provides an electronic device, comprising: a memory, the memory is used to store a processing program; and a processor, when the processor executes the processing program, implements the display mode switching method provided in the first aspect.
[0034] A third aspect of the present application provides a computer-readable storage medium, on which a processing program is stored. When the processing program is executed by a processor, the display mode switching method provided in the first aspect is implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 An example of switching a mobile phone 100 from a normal display mode to a dark display mode in the prior art is shown;
[0036] Figure 2 An example of switching the desktop display interface of the mobile phone 100 from a normal display mode to a dark display mode in the prior art is shown;
[0037] Figure 3 Another example of switching the desktop display interface of the mobile phone 100 from the normal display mode to the dark display mode in the prior art is shown;
[0038] Figure 4 According to an embodiment of the present application, an example of switching the desktop display interface of the mobile phone 100 from a normal display mode to a dark display mode is shown;
[0039] Figure 5 According to an embodiment of the present application, a display mode switching device is shown;
[0040] Figure 6 According to an embodiment of the present application, a display mode switching method is shown;
[0041] Figure 7 According to an embodiment of the present application, a method for identifying whether an icon material is a target icon is shown;
[0042] Figure 8a According to an embodiment of the present application, a special-shaped icon that does not belong to the target icon is shown;
[0043] Figure 8bAccording to an embodiment of the present application, another special-shaped icon that is not a target icon is shown;
[0044] Fig. 9 According to an embodiment of the present application, a method for determining an area to be identified during the icon material identification process is shown;
[0045] Fig.10 According to an embodiment of the present application, an example of a region to be identified in an icon material is shown;
[0046] Fig.11 According to an embodiment of the present application, another method for determining the area to be identified during the icon material identification process is shown;
[0047] Fig.12 According to an embodiment of the present application, another example of a region to be identified in an icon material is shown;
[0048] Fig.13 According to an embodiment of the present application, a recognition method for recognizing an icon outline during an icon material recognition process is shown;
[0049] Fig.14a According to an embodiment of the present application, an example of identifying an icon outline is shown;
[0050] Fig.14b According to an embodiment of the present application, another example of identifying an icon outline is shown;
[0051] Fig.15 According to an embodiment of the present application, another recognition method for recognizing an icon outline during the icon material recognition process is shown;
[0052] Fig.16 According to an embodiment of the present application, another example of identifying an icon outline is shown;
[0053] Fig.17a According to an embodiment of the present application, an example of identifying the distribution of transparent pixels in an icon material during the icon material identification process is shown;
[0054] Fig.17b According to an embodiment of the present application, another example of identifying the distribution of transparent pixels in an icon material during the icon material identification process is shown;
[0055] Fig.18 According to an embodiment of the present application, a recognition method for identifying the color distribution in an icon material during the icon material recognition process is shown;
[0056] Fig.19According to an embodiment of the present application, a method for identifying color types in icon materials during the icon material recognition process is shown.
[0057] Fig. 20 According to an embodiment of the present application, an example of identifying color types in icon materials is shown.
[0058] Fig.21 According to an embodiment of the present application, another method for identifying whether an icon material is a target icon is shown;
[0059] Fig. 22 According to an embodiment of the present application, a method for performing image processing on a target icon to adapt to the overall display style of a dark mode is shown;
[0060] Fig.23 According to an embodiment of the present application, another example of switching the desktop display interface of the mobile phone 100 from a normal display mode to a dark display mode is shown;
[0061] Fig.24 According to an embodiment of the present application, a structural schematic diagram of an electronic device is shown;
[0062] Fig.25 According to an embodiment of the present application, a software structure block diagram of an electronic device is shown. DETAILED DESCRIPTION
[0063] The embodiments of the present application will be described in further detail below in conjunction with the accompanying drawings.
[0064] In order to solve the problem of inconsistent display styles of some icons during the dark mode activation process, the present application provides a display mode switching solution. In the display mode switching solution of the embodiment of the present application, the electronic device will pre-identify the icon material to be displayed according to the activation of the dark mode, determine whether it belongs to the target icon that causes the display style to be split, and perform targeted image processing on the identified target icon to match the overall display style of the mobile phone 100 in the dark mode.
[0065] For example, Figure 4 As shown, for the above Figures 1 to 3In the dark mode switching scene shown, after adopting the display mode switching solution of the present application, shopping icon 001, clock icon 002, movie icon 003, home network icon 004, browser icon 005 and search icon 006 can all make corresponding display adjustments following the conversion of the system "dark mode": the color of the original white background board area in these rounded rectangular icons is replaced with dark gray, and the color of the original black icon pattern area is replaced with light gray. By performing the above image processing on icons 001 to 006, it can match the overall display style of mobile phone 100 in dark mode, fit the user's viewing habits, and enhance the user's experience.
[0066] It can be understood that the electronic devices applicable to the technical solution of the present application can be various electronic devices with dark mode, such as smart phones, tablet computers, laptop computers, wearable devices, head-mounted displays, mobile email devices, portable game consoles, portable music players, reader devices, and smart home devices with touch screens such as smart TVs and smart speakers, etc. For ease of description, the following description takes the mobile phone 100 as an example.
[0067] Figure 5 FIG. 1 shows a schematic diagram of a structure related to a dark mode display switching management technology in a mobile phone 100. Specifically, Figure 5 As shown, the mobile phone 100 includes a storage module 501, an identification module 502, an icon processing module 503, an image fusion module 504 and a human-computer interaction module 500, wherein:
[0068] The human-computer interaction module 500 is used to provide a human-computer interaction interface for the user. In the application scenario of dark mode display switching, the human-computer interaction interface can accept the switching request input by the user and transmit the switching request to the identification module 501. The switching request includes switching the display mode of the mobile phone 100 from the normal mode (or the bright / light mode) to the dark mode and switching the display mode of the mobile phone 100 from the dark mode to the normal mode.
[0069] For example, in some embodiments of the present application, the human-computer interaction module 500 may include a touch display screen of the mobile phone 100 and its touch sensing system, such as Figure 4As shown, when the user needs to select the "dark mode" on the mobile phone 100, the user can first enter the relevant setting interface and switch the display mode by clicking the dark mode on switch shown on the screen of the mobile phone 100. In other embodiments of the present application, the user's switching request can also be input by pressing a physical button, air gestures, or voice commands. The corresponding human-computer interaction module 500 can also include hardware structures such as physical buttons, front cameras, optical scanners, and microphones, and their supporting input recognition programs to support the reception of user switching requests, which will not be elaborated here.
[0070] The storage module 501 is used to store various display materials required for the mobile phone 100 to display, wherein the display materials may include icon materials (such as Figures 2 to 4 001 to 007 shown in the figure), image materials (such as the desktop background image when the mobile phone 100 is in the desktop state), text materials (such as Figure 1 When the mobile phone 100 is in the screen-on state, the image fusion module 504 extracts the display material to be displayed from the storage module 501 and performs display fusion processing: for example, Figure 2 As shown, on the display screen of the mobile phone 100, the display content includes a white desktop background, icons 001 to 007 and text content corresponding to the icons. These display contents are all stored independently in the storage module 501 and need to be fused into a display screen by the image fusion module 504 through layer overlay, image stitching and other means and presented by the display screen of the mobile phone 100.
[0071] The identification module 502 is used to pre-extract the icon materials to be displayed from the storage module 501 and identify them one by one when the switching request is "switching the display mode of the mobile phone 100 from the normal mode to the dark mode", and determine whether they are target icons that are easily inconsistent with the display mode of the desktop background in the dark mode and need to be subjected to targeted image processing (such as Figure 3 The shopping icon 001 in the figure is identified, and the identified target icon is sent to the icon processing module 503.
[0072] For example, the target icon may include a circular icon and a rounded rectangular icon which are most common in the mobile phone 100: Figure 2Icons 001 to 006 shown in the figure, as rounded rectangular icons, often have a solid color background plate of bright color (such as white) to highlight the pattern in the icon. When the mobile phone 100 switches to the dark mode, these solid color background plate areas will produce a display effect of separation from the desktop background and other display content (such as icon 007), thereby causing the display style to be inconsistent; similarly, circular icons, as common icons in the mobile phone graphical user interface, will also have the above problems when the mobile phone 100 switches to the dark mode. Therefore, it is necessary to have an identification module 502 to perform pre-targeted identification of such circular icons and rounded rectangular icons so that the icon processing module 503 can perform targeted processing on these icons. It can be understood that the target icon is not limited to circular icons and rounded rectangular icons, but can also be icons of other shapes. As long as the icon will produce a display effect of separation from the desktop background and other display content in the dark mode, thereby causing the display style to be inconsistent, it can be targetedly identified and processed by the present technology.
[0073] Specifically, the recognition module 103 may be pre-set with a plurality of recognition specifications for different types of target icons, and each recognition specification may also include a plurality of recognition judgment criteria. The determination of the recognition specifications and recognition judgment criteria will be explained and illustrated in detail below.
[0074] The icon processing module 503 is used to perform image processing on the received target icon according to the recognition result of the recognition module 502 to adapt to the overall display style of the dark mode, and transmit the processed target icon to the image fusion module 504 .
[0075] For example, Figure 4 As shown, the icon processing module 503 can replace the background area of icons 001 to 006 from white to dark gray, and replace the pattern area of icons 001 to 006 from black to light gray. After the above image processing, icons 001 to 006 are adapted to the desktop background in the dark mode, and will not appear as Figure 2 or Figure 3 The icon background shown is too bright, which unifies the overall display style of the mobile phone 100.
[0076] The image fusion module 504 is used to extract the display material to be displayed from the storage module 501, and perform display fusion processing together with the received target icon after image processing.
[0077] For example, Figure 4As shown, when in normal mode, on the display screen of mobile phone 100, display materials include a white desktop background, icons 001 to 007 and text content corresponding to each icon. These display materials are stored independently in storage module 501 and need to be fused into a display screen by image fusion module 504 through layer overlay, image stitching and other means and presented by the display screen of mobile phone 100.
[0078] For example, Figure 4 As shown, when in dark mode, on the display screen of the mobile phone 100, display materials include a black desktop background, icons 001 to 006 obtained after processing by the icon processing module 503, icon 007 in dark mode, and text contents corresponding to each icon in dark mode, wherein the black desktop background, icon 007 in dark mode, and text contents corresponding to each icon in dark mode may be pre-stored in the storage module 501, and correspond to the aforementioned display materials in the normal mode respectively. The image fusion module 504 can perform targeted selection and extraction according to the current display mode (dark mode) of the mobile phone 100. For target icons such as icons 001 to 006, since the storage module 501 does not pre-store icon materials compatible with the dark mode, they need to be pre-processed by the recognition module 502 and target recognition and the image processing by the icon processing module 503, and then fused with the preset display materials such as the black desktop background through layer overlay, image stitching, etc. to form the final display screen and presented by the display screen of the mobile phone 100.
[0079] In some embodiments of the present application, the specific process of the user switching the display mode of the mobile phone 100 from the normal mode to the dark mode is shown as follows: Figure 6 As shown, specifically including:
[0080] Step S600: receiving a switching request input by a user.
[0081] The switching request indicates that the user needs to switch the display mode of the mobile phone 100 from the current normal mode to the dark mode, and the reception of the switching request can be implemented by the human-computer interaction module 500 .
[0082] Step S601: Identify one by one whether there are target icons that need to be processed in dark mode in the icon materials to be displayed. If yes, go to step S602; if not, go to step S604.
[0083] It can be understood that, based on the above description, Figure 2 or Figure 3As shown, when the mobile phone 100 switches to the dark mode, some icons are inconsistent with the overall display style, which affects the user experience, and needs to be identified and further processed. In step S601, the icon material to be displayed refers to all icons that need to be displayed on the display screen of the mobile phone 100. The target icons can include circular icons and rounded rectangular icons, such as icons 001 to 006. Such icons often have a bright (such as white) solid color background to highlight the pattern in the icon, resulting in a display effect that is easily separated from the dark (such as black) desktop background in the dark mode.
[0084] The recognition of this type of target icon can be implemented by the recognition module 502. The specific technical solution for the recognition module 502 to recognize the target icon will be explained and illustrated below.
[0085] Step S602: performing image processing on the target icon to adapt to the overall display style of the dark mode.
[0086] It is understandable that when the aforementioned target icon exists, it is necessary to perform targeted image processing on it, so as to solve the problem of inconsistent display styles by making the processed target icon adaptable to the dark mode. Figure 4 As shown, after the above targeted image processing, the background area of the target icons such as icons 001 to 006 is changed from white to dark gray, and the pattern area is replaced from black to light gray, which can better adapt to the desktop background in the dark mode, and no longer appear as Figure 2 or Figure 3 The icon background shown is too bright.
[0087] The processing of the target icon can be implemented by the icon processing module 503, such as Figure 4 As shown, an asymmetric color inversion processing method is used for the image processing of the target icon, and the relevant specific technical solutions will be explained and illustrated below.
[0088] Step S603: extracting the display material to be displayed and performing display fusion processing together with the target icon after image processing to obtain a display picture.
[0089] It is understandable that when the mobile phone 100 is on screen, the display screen presented to the user through the display screen includes not only icons, but also other contents such as text, images, animations, videos, etc. The display material to be displayed here can be other contents that need to be displayed in addition to the target icon, such as Figure 4The black desktop background, various text contents and the special-shaped icon 007 that is not a target icon in the dark mode of the mobile phone 100 are all the above-mentioned display materials. These display materials are usually pre-stored in the mobile phone 100 and extracted by the view system of the mobile phone 100 when needed, and are displayed together with the target icon after image processing. Display fusion processing here refers to integrating various display materials and target icons into a display screen that can be displayed on the display screen of the mobile phone 100 through conventional image processing methods such as moving, scaling, arranging, rotating, layer superposition, and image splicing. For example, Figure 4 As shown, the processed target icons 001 to 006 may be arranged in a 3*2 manner in the lower area of the black desktop background and placed in the top layer, and the "8°C" and sunny weather icon 007 and their associated texts may be arranged in parallel in the upper area of the black desktop background and placed in the top layer, thereby forming a desktop display image of the mobile phone 100 in the dark mode. The above display fusion processing process may be implemented by the image fusion module 504.
[0090] Step S604: extracting display materials to be displayed and performing display fusion processing to obtain a display picture.
[0091] It can be understood that in step S601, if there is no target icon that requires targeted image processing in the icon materials to be displayed, it is possible to directly jump to step S604 to extract various display contents required for the display screen and directly perform display fusion processing to generate a display screen; this step can also be implemented by the image fusion module 504, which will not be repeated here.
[0092] It can be seen from the above embodiments that the image processing and display image fusion of the target icon by the icon processing module 503 and the image fusion module 504 are based on the prior recognition of the target icon by the recognition module 502. Considering the display smoothness after switching to the dark mode, the recognition module 502 needs to be able to quickly and accurately recognize the target icon, that is, the icon recognition method adopted by the recognition module 502 is required to be able to specifically and quickly determine the image features of the target icon. In some embodiments of the present application, an icon recognition method is provided for the recognition module 502, specifically circular icons and rounded rectangular icons are used as target icons for targeted recognition. It can be understood that the target icon used as the recognition object can also be an icon of other shapes, not limited to circular icons and rounded rectangular icons.
[0093] For example, in Figure 7In the illustrated embodiment, it is possible to determine whether the icon to be identified is a target icon that requires color processing in dark mode by comparing the icon outline, transparent pixel distribution, color distribution, and multiple color types of the icon material with the icon outline, transparent pixel distribution, color distribution, and multiple color types of a preset target icon.
[0094] like Figure 7 As shown, the icon recognition method specifically includes:
[0095] Step S700: Obtain icon material to be identified.
[0096] Step S701: Traverse the icon material, obtain the area occupied by the non-transparent pixels in the icon material and determine an area to be identified. Fig.10 or Fig.12 As shown, the area to be identified 1005 or 1205 may be a circumscribed rectangle of the area occupied by non-transparent pixels.
[0097] It is understandable that the icon materials stored in the mobile phone 100 are often vector images in a standard format. Such vector images include a transparent pixel background (i.e., the background part) and an icon foreground (i.e., the foreground part). The transparent pixel background can be set around the icon foreground to meet the requirements of the length and width of the icon material in the standard format. The icon foreground is drawn using a vector graph to support infinite scaling. Since the recognition features of the icon material need to be targeted at the icon foreground area, the area occupied by transparent pixels that serve as the background part needs to be pre-eliminated before the specific recognition process: each pixel in the icon material can be traversed to obtain the area occupied by non-transparent pixels, and then a to-be-recognized area can be determined accordingly; considering that the icon material not only includes rounded rectangular icons such as those shown in icons 001 to 007, but also includes icons such as icons 007 or Figure 8b For the special-shaped icon shown in the middle icon 008b, it is difficult to identify the special-shaped icon directly based on the area occupied by non-transparent pixels, so it is necessary to define an area to be identified according to the distribution of the area occupied by non-transparent pixels to facilitate the formulation of identification rules; the determination of the area to be identified needs to meet the following conditions at the same time: including the area occupied by all non-transparent pixels, circumscribing the area occupied by all non-transparent pixels as much as possible (that is, including the area occupied by as few transparent pixels as possible), and having a regular simple geometric shape (such as a rectangle, circle, etc.). In some embodiments of the present application, such as Fig.10 or Fig.12 As shown, the area to be identified 1005 or 1205 may be a rectangular area. The specific method for determining the area to be identified will be explained and illustrated below.
[0098] Step S702: Determine whether the outer contour of the area occupied by the non-transparent pixels in the area to be identified is the contour of the target icon.
[0099] If so, it means that the outline of the area occupied by the non-transparent pixels is consistent with the outline of the target icon, and then the process goes to step S703 to further determine whether other features in the area to be identified meet the requirements of the target image; if not, it means that the outline of the area occupied by the non-transparent pixels is different from the outline of the target icon, and the icon material does not belong to the target icon, and then the process goes to step S707.
[0100] It is understandable that the area occupied by the non-transparent pixels in the area to be identified represents the icon part in the icon material, so the outer contour of the area occupied by the non-transparent pixels is also the outer contour of the icon part. For example, the target icon usually has a circular or rounded rectangular outline with obvious geometric features, so it can be identified by the outer contour of the area occupied by the non-transparent pixels. Therefore, in some embodiments, it is possible to quickly eliminate special-shaped icons (such as icon 007) that do not meet the outer contour characteristics of the target icon by judging whether the area to be identified is a circular or rounded rectangle, thereby improving the overall speed of icon recognition. The specific steps for judging the outer contour of the area occupied by non-transparent pixels will be further described below.
[0101] In addition, it can be understood that the outline of the target icon can also be other shapes besides a circle or a rounded rectangle, for example, an ellipse, a hexagon, etc. The method for judging the outline of the area to be identified is not limited to the judgment of icons with circular and rounded rectangular outlines described below. Other existing technologies are also applicable to the technical solution of the present application and are not limited here.
[0102] Step S703: Determine whether the area occupied by non-transparent pixels in the central area of the area to be identified meets a preset condition.
[0103] If so, it means that the pixel distribution of the area to be identified in the icon material is relatively close to the pixel distribution of the target icon, and then go to step S704; if not, it means that the central area of the area to be identified has a large area of transparent pixels, which is inconsistent with the pixel distribution of the target icon, and then go to step 707.
[0104] It is understandable that for Figure 2 The target icons shown in icons 001 to 006 have a complete solid-color background. Even if the central area of the icon has hollow patterns due to special pattern design, the color of the area occupied by these hollow patterns will not change with the change of the desktop background because of the coverage of the solid-color background. It is necessary to use the technical solution proposed in this application to perform image processing to adapt to the overall display style of the dark mode, and finally achieve the following. Figure 4 The display effect shown. Figure 8aAs shown in the icon 008a (the white area in the icon 008a represents the area occupied by transparent pixels, and the black area represents the area occupied by non-transparent pixels), there are a large number of transparent pixels in the central area of the icon, and the area occupied by these transparent pixels can change with the change of the desktop background. When the display mode of the mobile phone 100 is switched from the normal mode to the dark mode, the icon 008a can maintain a consistent display style with the desktop background in the dark mode without image processing, and naturally does not belong to the target icon. Therefore, in some embodiments, whether the area occupied by non-transparent pixels in the central area of the area to be identified reaches a certain proportion can be used as an identification judgment criterion. The specific method for determining the central area will be further described below.
[0105] Step S704: determining whether the area occupied by the main color portion in the area to be identified reaches a preset proportion.
[0106] If so, it means that the color distribution of the area to be identified in the icon material is relatively close to that of the target icon, and the process goes to step S705 ; if not, it means that the color distribution of the area to be identified is not centralized and does not match the color distribution of the target icon, and the process goes to step 707 .
[0107] It can be understood that the main color part refers to the coverage area corresponding to the single color with the highest proportion in the area to be identified; for example, Figure 4 The target icons shown in icons 001 to 006 include, in addition to the pattern part, a large area of solid color background board. These solid color background boards occupy most of the overall area of the icon. Therefore, the main color part representing the solid color background board reaching a certain proportion can be used as an identification judgment standard.
[0108] Step S705: Determine whether the color type in the to-be-identified area is less than a preset threshold.
[0109] If so, it means that the color types of the area to be identified in the icon material are relatively close to the color types of the target icon, and then go to step 706; if not, it means that there are too many color types in the area to be identified, which are inconsistent with the color types commonly possessed by the target icon, and then go to step 707.
[0110] It is understandable that for Figure 4 The target icons shown in icons 001 to 006 are usually simple and clear in structure and use a single color except for the solid color background. As shown in icons 001 to 006, except for the white background, the icon patterns are all represented in black, and the icons use only two colors. Therefore, in some embodiments, the color type of the icon can be less than a preset threshold as a recognition criterion.
[0111] Furthermore, if there are too many types of colors in the area to be identified, it means that although such icons meet some identification features of circular icons or rounded rectangular icons, when the icon processing module 503 performs subsequent image processing, it is easy for the processed icons to have hue deviation due to the excessive complexity of the colors, resulting in a large deviation between the icon pattern presented on the display screen of the mobile phone 100 and the original design concept of the icon. For such icons, in other embodiments of the present application, the display brightness of the icon material can be adjusted by the view system of the mobile phone 100 to adapt to the dark mode of the mobile phone 100.
[0112] Step S706: Determine whether the image material belongs to the target icon.
[0113] Step S707: Determine that the image material does not belong to the target icon.
[0114] It is understandable that after the mobile phone 100 switches to the dark mode, in order to ensure the user experience, the recognition process for the target icon needs to be as fast and efficient as possible, which can not only make up for the defects of inconsistent display styles, but also maintain the stability of the displayed content. Therefore, in steps S702 to S705 of the above icon recognition process, when a judgment result contrary to the target icon appears in any step, it is judged that the icon material does not belong to the target icon and the entire recognition process is directly exited, which can effectively ensure the smoothness of the overall display of the mobile phone 100.
[0115] For example, when for Figure 8b When the icon material 008b shown in the figure (the white area in the icon 008b represents the area occupied by transparent pixels, and the black area represents the area occupied by non-transparent pixels) is used for target icon recognition, it can be concluded according to the judgment rule that the outer contour of the area occupied by non-transparent pixels in the icon material 008b is obviously not a circle or a rounded rectangle. Figure 7 In the icon recognition method shown, the icon recognition process is exited at step S702, and there is no need to execute subsequent recognition processes, thereby improving the recognition and determination efficiency of icon materials.
[0116] The specific implementation of the aforementioned steps S701 to S705 will be further explained and illustrated below.
[0117] In some embodiments of the present application, in order to reduce the traversal of the original image and speed up the confirmation process of the area to be identified, the following method can be used in the specific implementation of step S701: Fig. 9 The method shown; combined with Fig.10 The schematic diagram of the division of the area to be identified is shown in FIG. 1 , and the method specifically includes:
[0118] Step S901 , dividing the icon material 1000 into a plurality of blocks 1001 .
[0119] Step S902 , setting one or more sampling points 1002 in each block 1001 .
[0120] Step S903 , completing the traversal of the icon material 1000 by traversing all sampling points 1002 to obtain the non-transparent area 1003 .
[0121] The non-transparent area 1003 is the area occupied by non-transparent pixels, and the confirmation of the non-transparent area 1003 is based on the sampling result of the sampling point 1002: each sampling point 1002 may include one pixel point or multiple pixel points. If a sampling point 1002 includes at least one non-transparent pixel point, it is considered to be a non-transparent sampling point; Fig.10 As shown, the non-transparent area 1003 may be a minimum continuous area including all non-transparent sampling points.
[0122] Step S904, according to the minimum circumscribed rectangle 1004 of the non-transparent area 1003, obtain the corresponding area to be identified 1005 based on the maximum inclusion rule; wherein, according to the maximum inclusion rule, if any part of a block 1001 is in the minimum circumscribed rectangle 1004, then the block 1001 is included in the area to be identified 1005.
[0123] In the above embodiment, by using blocks 1001 and setting sampling points 1002 in each block 1001 instead of performing traversal on each pixel in the icon material 1000 to determine the area occupied by non-transparent pixels, the traversal process can be optimized and the traversal time can be shortened on the basis of ensuring the credibility of the traversal. It is understandable that each block 1001 can be set to a square of the same size; the number of sampling points 1002 set in each block 1001 can be the same or random, and the distribution state of the sampling points 1002 can be regularly arranged or randomly distributed; each sampling point 1002 can include one pixel or multiple pixels, which is not limited here.
[0124] In the above embodiment, the to-be-identified area 1005 is confirmed based on the identified non-transparent area 1003: Fig.10As shown, firstly, a minimum bounding rectangle 1004 is obtained according to the non-transparent area 1003, and the length and width of the minimum bounding rectangle 1004 are respectively parallel to the dividing line of the block 1001; and then all the blocks 1001 involved in the minimum bounding rectangle 304 are divided into the area to be identified 1005. In this way, the area to be identified 1005 includes all the non-transparent areas 1003 and the area occupied by as few transparent pixels as possible, and the area to be identified 305 is a regular rectangle, composed of an integer number of blocks 1001. This confirmation method of the area to be identified 1005 is conducive to the confirmation of the standardized judgment standard in the subsequent identification process.
[0125] In some embodiments of the present application, in order to reduce the traversal of the original image and speed up the confirmation process of the area to be identified, the following method can be used in the specific implementation of step S701: Fig.11 The method shown; combined with Fig.12 The schematic diagram of the division of the area to be identified is shown in FIG. 1 , and the method specifically includes:
[0126] Steps S1101 to S1102 are the same as the aforementioned steps S901 to S902 and are not described in detail here.
[0127] Step S1103, complete the traversal of the icon material 1200 by traversing all sampling points 1202 to obtain all non-transparent sampling points. Each sampling point 1202 may include one pixel point or multiple pixel points. If a sampling point 1202 includes at least one non-transparent pixel point, it is considered to be a non-transparent sampling point.
[0128] Step S1104, based on the maximum inclusion rule, a block group 1204 including all non-transparent sampling points is obtained, and the minimum circumscribed rectangle of the block group 1204 is used as the corresponding area to be identified 1205; wherein, according to the maximum inclusion rule, if there is at least one non-transparent sampling point in a block 1201, then the block 1201 is included in the block group 1204.
[0129] like Fig.12 As shown, different from the above embodiment, in the above embodiment, it is not necessary to strictly identify and confirm the non-transparent area 1203: Based on the above embodiment, if a block 1201 contains non-transparent sampling points, it will be directly classified into the block group 1204 (such as Fig.12In the figure (shown as the oblique line shaded portion), since the block group 1204 is composed of an integer number of blocks 1201 arranged in order, the minimum circumscribed rectangle based on the block group 1204 is also easy to obtain. In this way, the area to be identified 1205 is also a regular rectangle and includes all the non-transparent areas 1203. At the same time, there is no need to identify and obtain the non-transparent area 1203 based on the distribution of non-transparent sampling points, which further simplifies the acquisition process of the area to be identified from the computer processing level.
[0130] Furthermore, based on the block division of the icon material as a whole and the confirmation of the area to be identified in the aforementioned embodiment, the judgment standard of whether the outer contour of the icon is a circle or a rounded rectangle can be simplified by relying on the feature that the area to be identified is a regular rectangle composed of multiple blocks: In some embodiments of the present application, in the specific implementation of step S702, the following can be adopted: Fig.13 The identification method shown; combined with Fig.14a and 14b The identification schematic diagram shown in the figure, the method specifically includes:
[0131] In step S1301 , a right triangle 1402 is selected from four vertex regions of the to-be-recognized region 1400 .
[0132] Step S1302 , taking the block through which the hypotenuse of each right triangle 1402 passes as the sampling block 1403 .
[0133] Step S1303, determining whether the sampled colors in each sampling block 1403 are close.
[0134] If yes, it means that the colors on the oblique lines of the top corners of the to-be-recognized area 1400 are similar, and the process goes to step S1304 ; if no, it means that the colors on the oblique lines of the top corners of the to-be-recognized area 1400 are not consistent, and the process goes to step S1305 .
[0135] Among them, the sampling color of the sampling block 1403 is the color that can represent the most important color feature in the sampling block 1403. It can be the center point color in the sampling block 1403, or it can be the RGB color average value obtained after random multi-point sampling in the sampling block 1403. There is no limitation here.
[0136] Step S1304, determining whether the outer contour of the area occupied by the non-transparent pixels in the icon material is a circle or a rounded rectangle.
[0137] Step S1305: determine that the icon material does not belong to the target icon.
[0138] Based on the above embodiments, it can be understood that Fig.14a and 14bAs shown, the area to be identified 1400 is similar to the circumscribed rectangle of the area 1401 occupied by non-transparent pixels. On this basis, the judgment and identification of the outer contour of the icon can be simplified to whether the area 1401 occupied by non-transparent pixels meets the explicit shape characteristics of a circular icon or a rounded rectangular icon: Fig.14a and 14b As shown, the hypotenuse of the right triangle 1402 can be regarded as the vertex angle slash line 1404 of the area to be identified 1400. If the area 1400 occupied by non-transparent pixels is a circular icon or a rounded rectangular icon, the area passed by the vertex angle slash line 1404 is the solid color background area of the icon, that is, the color of the block passed by the vertex angle slash line 1404 is often consistent. By judging whether the sampled colors on the vertex angle slash line 1404 are close to each other instead of obtaining and identifying the outer contour of the icon, the identification content and judgment steps performed by the identification module 502 are greatly simplified.
[0139] like Fig.14a and Fig.14b As shown, it can be understood that the selection of the tangent line 1404 of the vertex angle, that is, the selection of the right triangle 1402 area has certain limiting conditions: if the selection of the right triangle 1402 is too small, the tangent line corresponding to its hypotenuse may be located outside the area occupied by non-transparent pixels, thereby causing all points on the tangent line to be transparent pixels; if the selection of the right triangle 502 is too large, the tangent line corresponding to its hypotenuse may not only pass through the solid color background area, but also pass through the pattern part area, thereby causing a variety of non-similar colors to appear on the tangent line, resulting in misidentification. Therefore, in some embodiments of the present application, the selection of the right triangle 1402 is limited to: when the area to be identified 1400 is composed of M*N blocks 501 (M and N are both positive integers), the length of the right angle side of each right triangle 502 is set to the length of L1 and L2 blocks, respectively, where L1 belongs to the value interval of [M / 3, M / 2], and L2 belongs to the value interval of [N / 3, N / 2].
[0140] According to the aforementioned limiting rules, it can be understood that the selection of the right triangle 1402 is related to the size of the area to be identified 1400. For example, Fig.14a As shown, when the area to be identified 1400 includes 8*8 blocks, the side lengths of the right triangle 1402 can be selected to be the lengths of the 14 blocks 501; for example, Fig.14b As shown, when the to-be-identified area 1400 includes 4*4 blocks, the side lengths of the right triangle 1402 can be selected to be the lengths of 2 blocks.
[0141] In some embodiments of the present application, determining whether the sampled colors in each sampling block 1403 are close can be performed by determining whether the color distance between the sampled colors of any two adjacent sampling blocks 1403 is less than a preset threshold, or by obtaining the sampled colors of all sampling blocks 1403 and calculating the average value, and then comparing the color distances between each sampled color and the average value one by one to see whether they are all less than a preset threshold. This is not limited here. Specifically, the color distance can be obtained by calculating the Euclidean distance between the two colors to be determined in the RGB space.
[0142] In some embodiments of the present application, the specific implementation of step S702 may also be as follows: Fig.15 The identification method shown; combined with Fig.16 The identification schematic diagram shown in the figure, the method specifically includes:
[0143] Step S1501 , determining whether there are transparent pixels in the four corner areas 1603 of the area to be identified 1602 .
[0144] If so, it means that the four corner regions 1603 are not completely covered by non-transparent pixels, and the process goes to step S1502 ; if not, it means that the four corner regions 1603 are completely covered by non-transparent pixels, and the process goes to step S1504 .
[0145] Step S1502 , determining whether the area occupied by the transparent pixels reaches a preset proportion relative to the top corner area 1603 .
[0146] If so, it means that the transparent areas in the four vertex areas 1603 occupy a larger area, and the process goes to step S1503; if not, it means that the transparent areas in the four vertex areas 1603 occupy a smaller area, and the process goes to step S1504.
[0147] Step S1503, determining whether the outer contour of the area occupied by the non-transparent pixels in the icon material is a circle or a rounded rectangle.
[0148] Step S1504: determine that the icon material does not belong to the target icon.
[0149] Based on the above embodiments, it can be understood that, as shown, the area to be identified 1602 is similar to the circumscribed rectangle of the area 1601 occupied by the non-transparent pixels. On this basis, the judgment and identification of the outer contour of the icon can be simplified to whether the area 1601 occupied by the non-transparent pixels meets the explicit shape characteristics of a circular icon or a rounded rectangular icon: Fig.16As shown, if the area occupied by non-transparent pixels 1601 is a circular icon or a rounded rectangular icon, then a certain proportion of the area occupied by transparent pixels should exist in the top corner area 1603 of the area to be identified 1602. By determining whether the area occupied by transparent pixels reaches a preset proportion relative to the top corner area 1603 instead of obtaining and identifying the outer contour of the icon, the identification content and determination steps performed by the identification module 502 are also greatly simplified.
[0150] like Fig.16 As shown, in some embodiments of the present application, the vertex area 1603 may be a block corresponding to the four vertex corners in the area to be identified 1602; the proportion of the area occupied by transparent pixels relative to the vertex area 1603 may be obtained by traversing each pixel point or sampling point in the vertex area 1603, and the proportion of the area occupied by transparent pixels relative to the vertex area 1603 may be the ratio of the number of transparent pixels to the number of all pixels, or may be the ratio of the number of transparent sampling points to the number of all sampling points.
[0151] Understandably, Fig.13 The identification method shown is similar to Fig.15 The recognition methods shown are both for identifying whether the area occupied by non-transparent pixels in the area to be identified meets the shape characteristics that a circular icon or a rounded rectangular icon should have, and the judgment criteria of the two recognition methods are different; in the specific implementation process of step S702, any one of the recognition methods can be selected, or both recognition methods can be selected at the same time for recognition and judgment in turn, which can further improve the recognition accuracy of the target icon.
[0152] In some embodiments of the present application, based on the block division of the entire icon material and the confirmation of the area to be identified in the above embodiments, in the specific implementation of step S703, the determination of the central area of the area to be identified can be specifically referred to. Fig.17a and Fig.17b The specific embodiment shown, wherein:
[0153] For example, Fig.17aAs shown, when the area to be identified 1700 includes 8*8 blocks, a 2*2 block close to the center of the area to be identified 1700 can be selected as the central area 1701; since the central area 1701 selected at this time has a smaller proportion than the overall area to be identified 1700, and considering that some circular icons or rounded rectangular icons may have a special design of transparent pixel patterns in the central area, the preset proportion setting can be 90% or 95%; in the specific determination process, the 2*2 blocks in the central area can also be determined by sampling points. If 5 random sampling points are set in each block, at least 17 to 19 sampling points need to have sampling results that are non-transparent sampling points to be able to determine that the area occupied by non-transparent pixels in the central area 1701 of the area to be identified reaches the above preset proportion.
[0154] For example, Fig.17b As shown, when the area to be identified 1700 includes 8*8 blocks, a 4*4 block close to the center of the area to be identified 1700 can also be selected as the central area 1702. Since the central area 1702 selected at this time accounts for a larger proportion than the overall area to be identified, and considering that some circular icons or rounded rectangular icons may have a special design of transparent pixel patterns in the central area, the preset proportion can be set to 80% or 85%. In the specific determination process, the 4*4 blocks in the central area can also be determined by sampling points. If 5 random sampling points are set in each block, at least 64 to 68 sampling points need to have sampling results that are non-transparent sampling points to be able to determine that the area occupied by non-transparent pixels in the central area 1702 of the area to be identified reaches the above preset proportion.
[0155] In some embodiments of the present application, in the specific implementation of step S704, as Fig.18 As shown, the specific steps for identifying the proportion of the main color part may include:
[0156] Step S1801: Obtain the color corresponding to the pixel point in each sampling point in the area to be identified, and store all colors and their corresponding pixel numbers in a color bucket space.
[0157] Step S1802: Count the color with the largest number of corresponding pixels in the color bucket space and use it as the main color in the area to be identified.
[0158] Step S1803: Determine whether the ratio of the number of pixels corresponding to the main color to the total number of sampled pixels reaches a preset threshold.
[0159] If so, it means that the area occupied by the pixels corresponding to the main color is larger, and the process goes to step S1804; if not, it means that the area occupied by the pixels corresponding to the main color is smaller, and the process goes to step S1805.
[0160] Step S1804: Determine whether the area occupied by the main color portion in the area to be identified reaches a preset proportion.
[0161] Step S1805: Determine that the icon material does not belong to the target icon.
[0162] It can be understood that the main color part of the area to be identified can be the area corresponding to the color that appears most times in the area to be identified: for example, if the number of red pixels in the area to be identified is N1, the number of pixels of other different colors is N2 and N1 is greater than N2, then the area corresponding to the red pixels is the main color part of the area to be identified.
[0163] In the above embodiment, based on the block division of the icon material as a whole and the confirmation of the area to be identified in the above embodiment, the proportion of the main color part relative to the area to be identified can be converted into the proportion of the number of sampling pixels corresponding to the main color relative to the total number of sampling pixels. In this way, the proportion of the main color part can be obtained by traversing the sampling points, which simplifies the identification of the area occupied by the main color part and the judgment process of the proportion, thereby further improving the overall efficiency of target icon recognition.
[0164] In some embodiments of the present application, in the specific implementation of step S705, as shown in FIG. Fig.19 and Fig. 20 As shown, the statistical method for the color types in the area to be identified specifically includes:
[0165] Step S1901: obtaining the color corresponding to the pixel point in each sampling point in the area to be identified, and storing all colors and their corresponding pixel numbers in a color bucket space 2001.
[0166] Step S1902: traverse the color bucket space 2001, extract each color therein in turn as a color to be clustered, and perform a color clustering operation.
[0167] It is understandable that in some embodiments of the present application, before the color types in the area to be identified are counted, color clustering processing needs to be performed in advance: for example, two pixels belonging to the same black color area may have RGB values (0, 0, 1) and (0, 2, 3) respectively obtained during the color sampling process. It is difficult for the human eye to distinguish these subtle differences, but in the statistics of the color bucket space 2001, the colors corresponding to these two pixels will be identified as two different colors, which will lead to excessive deviations in the statistics of the color types in the area to be identified. Therefore, it is necessary to perform color clustering on the colors in the color bucket space 2001 for this situation: color clustering refers to aggregating some similar colors and treating them as the same type of color. For example, the two pixels in the above example can be considered to be the same type of color (black) after color clustering processing. By introducing color clustering processing, the statistics of the color types in the area to be identified are more in line with the cognitive laws of the human eye. The specific steps of color clustering processing are shown in the following steps S1903 to S1907.
[0168] Step S1903: Obtain the hue, saturation and brightness corresponding to the color to be clustered.
[0169] It is understandable that the colors in the color bucket space 2001 are often stored in RGB color mode, and when judging whether the colors are similar during the color clustering process, it is often necessary to base it on intuitive characteristics such as hue, saturation and brightness of the colors to be clustered. Fig. 20 As shown, the way to obtain the hue, saturation and brightness of the color to be clustered can be to convert the color to be clustered in the RGB color mode to the HSV color mode through the HSV space 2002, wherein the HSV space 2002 is a color space constructed according to the intuitive characteristics of the color, and its model is in the shape of an inverted cone, and the parameters used to represent the color are hue (H), saturation (S), and brightness (V). The conversion formula of the color in the RGB mode and the HSV mode belongs to the common knowledge of those skilled in the art, and will not be repeated here.
[0170] Step S1904: Determine whether the saturation of the color to be clustered belongs to a low saturation interval. If yes, it means that the saturation of the color to be clustered is low, and go to step S1905; if no, it means that the saturation of the color to be clustered is high, and go to step S1906.
[0171] Step S1905: Place the colors to be clustered into a redundant space 2003, and then return to step S1902.
[0172] It is understandable that when the saturation of the color to be clustered is too low, there is no need to participate in color clustering. This is because the hue of such low-saturation color is not obvious. It can be seen from the schematic diagram of the inverted cone model of the HSV space 2002 that such low-saturation color is in the gray area close to the central axis of the inverted cone. The human eye does not have a high recognition of such color and is easily ignored. There is no need to confirm such color as a color type. Therefore, placing such low-saturation color in the redundant space 2003 for direct elimination is beneficial to improving the overall execution efficiency of color clustering.
[0173] In some embodiments of the present invention, the low saturation interval may be:
[0174]
[0175] Where s is the saturation of the color to be clustered, v is the brightness of the color to be clustered, ε is a preset value and the preset value ε is less than the maximum value of the saturation s; when the above formula is satisfied, it means that the saturation of the color to be clustered belongs to the low saturation interval. It can be understood that the low saturation interval can be a dynamic interval, and the low saturation colors to be removed can be adjusted by adjusting the preset value ε.
[0176] Step S1906: Determine whether there is a cluster color similar to the color to be clustered in the cluster space 2004: if yes, go to step S1907; if no, go to step S1908. The cluster space 2004 is used to store the cluster colors that have been clustered at the current moment, and stores the RGB value of the cluster color at the current moment and the number of pixels corresponding to the cluster color; how to determine whether there is a cluster color similar to the color to be clustered in the cluster space 2004 will be described in detail below.
[0177] Step S1907: perform cluster update according to the to-be-clustered color and the similar cluster color, and place the updated cluster color obtained after the cluster update into the cluster space 2004, and then turn to step S1909. The specific steps of cluster update will be described below.
[0178] Step S1908: directly place the color to be clustered into the clustering space 2004, and then turn to step S1909.
[0179] Step S1909: Determine whether all colors in the color bucket space 2001 have been processed through the above steps S1903 to S1907.
[0180] If so, it means that all the colors in the color bucket space 2001 have been processed by the color clustering, and the process goes to step S1910; if not, it means that all the colors in the color bucket space 2001 have not been processed by the color clustering, and the process goes back to step S1902.
[0181] Step S1910: Obtain the number of cluster colors in the cluster space 2004, where the number of cluster colors is the number of color types in the area to be identified.
[0182] It is understandable that when judging whether there is a clustering color similar to the color to be clustered in the clustering space 2004, it is necessary to compare the color to be clustered with all the existing clustering colors in the clustering space 2004 one by one: if there is no similar clustering color, it means that the color to be clustered and other clustering colors do not belong to the same color category, and can be directly placed in the clustering space 2004 as a new clustering color type; if there is a similar clustering color, it means that the color to be clustered and the similar clustering color belong to the same color category, and at this time, it is necessary to perform a clustering based on the color to be clustered and the similar clustering color. Update: For example, the color A to be clustered is similar to the cluster color B already existing in the cluster space 2004 and belongs to the same color category. At this time, the color A to be clustered cannot be directly attributed to the cluster color B and the number of pixels corresponding to the color A to be clustered cannot be directly merged into the cluster color B. This is because color clustering requires some similar colors to be clustered and regarded as the same color category. In actual application scenarios, there may be a new color a to be clustered, which is similar to the color A and belongs to the same color category, but due to the more stringent similarity judgment standard, it is not similar to the color B, resulting in an unsatisfactory clustering effect. Therefore, it is necessary to perform a cluster update based on the color A and the color B to generate a new color C, which can represent the color types of the color A and the color B at the same time. The specific implementation of the cluster update will be described below.
[0183] In some embodiments of the present application, it is possible to determine whether there is a clustering color similar to the color to be clustered in the clustering space 2004 by:
[0184] Δh<k1
[0185] Δs+Δv<k2
[0186] Among them, Δh is the absolute value of the hue difference between the color to be clustered and the cluster color, Δs is the absolute value of the saturation difference between the color to be clustered and the cluster color, Δv is the absolute value of the brightness difference between the color to be clustered and the cluster color, and k1 and k2 are both preset values. It can be understood that if the hue difference, saturation difference and brightness difference of two colors are small, it means that the two colors are similar and belong to the same color category; similarly, the judgment standard of similar colors can be adjusted by adjusting the preset values k1 and k2. The larger the values of k1 and k2, the more relaxed the judgment of similar colors. For example, dark red and light red with a large brightness difference can be identified as the same color; the smaller the values of k1 and k2, the more strict the judgment of similar colors. For example, dark red and light red with a large brightness difference may be identified as two different colors. The two preset values of k1 and k2 can be adjusted according to actual needs.
[0187] In some embodiments of the present application, cluster updating can be achieved in the following ways:
[0188] a=(y*Ny+c*Nc) / (Ny+Nc)
[0189] Na=Ny+Nc
[0190] Among them, y is the RGB value of the color to be clustered, c is the RGB value of the cluster color, a is the RGB value of the updated cluster color after the cluster update, Ny is the number of pixels corresponding to the color to be clustered, Nc is the number of pixels corresponding to the cluster color, and Na is the number of pixels of the updated cluster color after the cluster update.
[0191] It can be understood that the above-mentioned weighted averaging method may require regenerating a new updated cluster color a based on the RGB values and pixel quantity information of the color to be clustered y and the cluster color c. The updated cluster color a has the color characteristics of both the color to be clustered y and the cluster color c, and the number of pixels corresponding to the updated cluster color a is equal to the sum of the number of pixels of the color to be clustered y and the cluster color c.
[0192] Accordingly, the recognition module 503 can realize targeted recognition of the circular icon and the rounded rectangular icon as the target icon according to the icon recognition method of the aforementioned steps S700 to S705. In other embodiments of the present application, another icon recognition method is provided for the recognition module 502, such as Fig.21 As shown, specifically including:
[0193] Steps S2100 to S2101 are the same as the aforementioned steps S700 to S701 and are not described in detail here.
[0194] Step S2102: determine whether the outer contour of the area occupied by the non-transparent pixels in the area to be identified is the contour of the target icon, and record the corresponding first determination result, wherein the first determination result includes two cases: "yes" and "no".
[0195] Step S2103: Determine whether the area occupied by non-transparent pixels in the central area of the area to be identified reaches a preset proportion, and record the corresponding second determination result. Similarly, the second determination result also includes two cases of "yes" and "no".
[0196] Step S2104: determine whether the area occupied by the main color part in the area to be identified reaches a preset proportion, and record the corresponding third determination result. Similarly, the second determination result also includes two cases of "yes" and "no".
[0197] Step S2105: Determine whether the color types in the to-be-identified area are less than a preset threshold, and record the corresponding fourth determination result. Similarly, the second determination result also includes two cases of "yes" and "no".
[0198] Step S2106: Based on the first to fourth judgment results, a recognition score is calculated: if the recognition score is greater than or equal to a preset threshold, the icon material is judged to belong to the target icon; if the recognition score is less than the preset threshold, the icon material is judged not to belong to the target icon and the process is exited. The steps for obtaining the recognition score will be described in detail below.
[0199] Different from the aforementioned icon recognition method, in the above steps S2102 to S2105, when the judgment result of any item is "No", it will not immediately determine that the icon material does not belong to the target icon and exit. Instead, it is necessary to go through all the judgment steps in sequence and then calculate a recognition score. The recognition score is calculated to determine whether the icon material belongs to the target icon by whether it reaches a preset threshold.
[0200] It is understandable that as processor performance continues to improve, the speed of image recognition processing is also increasing; when the processor performance configuration is high, it is possible to execute all the judgment steps in sequence and ensure that the display fluency is not affected. After all the judgment steps are executed in sequence, judging whether the icon material belongs to the icon material can further improve the precision of target icon recognition, and have a better recognition effect for some target icons with special designs, thereby reducing the recognition omission rate of target icons.
[0201] The following will be combined Fig.21 , the specific acquisition of the recognition score in step S2106 is further explained and illustrated:
[0202] In some embodiments of the present application, the recognition score is obtained based on the first to fourth judgment results: when any judgment result is "yes", it can be recorded as 1 point; when any judgment result is "no", it can be recorded as 0 point; the recognition score is the sum of the scores of the first to fourth judgment results. Fig.21 The icon 010 ( Fig.21 The white area in the image represents the area occupied by transparent pixels, and the black area represents the area occupied by non-transparent pixels, and the color type in the area occupied by the non-transparent pixels is a single color). Based on the above judgment process, it can be obviously obtained that the first, third and fourth judgment results are all "yes", and the second judgment result is "no", and the recognition score can be obtained as 3 points; if the preset threshold is set to 3 points, it can be determined that the icon 010 belongs to the target icon.
[0203] It is understandable that icon 010 is a rounded rectangular icon, but it has a special design with a hollow center, so it is easy to be missed and misjudged as not belonging to the target icon according to the icon recognition method shown in steps S700 to S705. However, it can be successfully recognized by the icon recognition method shown in steps S2100 to S2106.
[0204] It can be understood that the icon recognition method shown in steps S2100 to S2106 relaxes some of the judgment criteria for target icon recognition, and at the same time facilitates system operation and maintenance personnel to flexibly adjust the icon recognition criteria. For example, if it is found during use that the recognition module 503 also recognizes some special-shaped icons as target icons, the recognition criteria can be tightened by appropriately raising the preset threshold corresponding to the recognition score without having to adjust each judgment process in the recognition method one by one.
[0205] Furthermore, in the above embodiment, different weight values may be added to the first to fourth judgment results during the calculation of the recognition score. Fig.21 The icon 010 shown in FIG. 1 is identified, and the weighted parameter of the first judgment result is set to 30%, the weighted parameter of the second judgment result is set to 10%, the weighted parameter of the third judgment result is set to 20%, and the weighted parameter of the fourth judgment result is set to 40%. Then, the recognition score can be calculated to be 0.9; if the preset threshold is set to 0.8 points, it can also be determined that the icon 010 belongs to the target icon. Adding different weight values to the first to fourth judgment results can increase the emphasis in the recognition process, making the recognition more targeted.
[0206] Through the icon recognition method proposed in the above-mentioned embodiment of the present application, the recognition module 502 can realize effective, fast and accurate recognition of target icons including circular icons and rounded rectangular icons. However, these target icons obtained by the recognition module 502 need to be processed by the image fusion module 504 before they can match the dark display mode of the mobile phone 100. Fig. 22 As shown, in some embodiments of the present application, an image processing method is provided for the image processing module 503, which can make the target icon match the dark display mode of the mobile phone 100, specifically including:
[0207] Step S2201: Determine whether the brightness of the target icon is greater than a preset threshold.
[0208] If so, it means that the brightness of the target icon is relatively high, which is inconsistent with the overall display effect of the mobile phone 100 in the dark mode, and go to step S2202; if not, it means that the brightness of the target icon is relatively low, which is consistent with the overall display effect of the mobile phone 100 in the dark mode, and go to step S2203.
[0209] Step S2202: Perform color inversion processing on each pixel in the target image based on the asymmetric color inversion rule, and then output the target icon. The specific explanation of the asymmetric color inversion rule will be described below.
[0210] Step S2203: directly output the target icon.
[0211] In the above image processing method, when there is a target icon that meets the recognition conditions, the brightness of the target icon needs to be pre-determined before the subsequent image processing steps are performed. It is understandable that when the mobile phone 100 is in dark mode, it has an overall visual perception that is darker than the normal mode; in this case, if the brightness of the target icon is lower than a preset threshold, it means that even without the subsequent image processing steps, the target icon still has a relatively uniform display effect in the dark display environment of the dark mode of the mobile phone 100, and can be directly presented and displayed.
[0212] In some embodiments of the present application, the icon brightness value of the target icon may be the brightness value corresponding to each pixel in the target icon. By traversing the brightness value of each pixel in the target icon and performing the aforementioned inversion processing on the pixel whose brightness value is greater than the preset brightness threshold, the target icon can be adapted to the dark mode display style.
[0213] In some embodiments of the present application, the brightness of the target icon can be the average brightness value of each pixel in the target icon, or the brightness value corresponding to the color with the largest number of pixels in the target icon. Considering that the target icon has undergone rapid clustering statistics of color types in the aforementioned icon recognition process, in the above embodiments, the statistical results of the icon recognition process can be directly called to obtain the brightness value corresponding to the color with the largest number of pixels in the target icon as the brightness of the target icon to participate in the determination, which can further improve the smoothness of the display mode switching process.
[0214] In some embodiments of the present application, conventional color inversion rules are directly used to process the target icon in step S2202. It is understandable that color inversion processing based on conventional color inversion rules refers to an image processing method for inverting the colors of each pixel in a color image, wherein the inversion refers to the color corresponding to the RGB value obtained by subtracting the RGB value of the current color from the RGB value of white. For example, in the color inversion processing, black with an RGB value of (0, 0, 0) will be converted to white with an RGB value of (255, 255, 255). For another example, the presentation effect of processing the target pattern using conventional color inversion rules in the mobile phone 100 is as follows. Fig.23 As shown: It can be seen that the white background of icons 001 to 006 is directly converted to black and consistent with the background color, while the black icon pattern area in icons 001 to 006 is converted to bright white. The target icon is processed according to the conventional inversion rule. Although it can be seen that the overall display style of mobile phone 100 is consistent, the boundaries of icons 001 to 006 become difficult to identify. Similarly, the bright white color presented in the icon pattern area will also cause the user's human eye to experience more dazzling, and there is room for further improving the user experience.
[0215] In other embodiments of the present application, an asymmetric color inversion rule is used to process the target icon in step S2202. The asymmetric color inversion rule refers to a brightness inversion for each pixel in the color image based on a preset brightness as the inversion center, and the preset brightness is required to deviate from the center value of the complete brightness range. For example, if the complete brightness range is set to [0,100], the brightness value of the preset brightness can be any brightness value except 50; if the preset brightness value γ is set to 45, and the brightness value β of the current pixel is set to 60, then the brightness value δ of the pixel after asymmetric color inversion processing is |2*γ-β|, which is 30. For another example, the presentation effect of the target pattern after being processed by the asymmetric color inversion rule in the mobile phone 100 is as follows. Figure 4As shown: It can be seen that the background area of icons 001 to 006 changes from white to dark gray, and the pattern area is replaced by black to light gray, which can not only better adapt to the desktop background in dark mode, but also ensure the recognizability of the icons, while avoiding the appearance of highlight colors, greatly optimizing the display viewing experience of mobile phone 100.
[0216] It is understandable that the brightness value of a pixel point in the RGB space cannot be directly obtained. In some embodiments of the present application, the pixel point can be converted from the RGB space to the YUV space (brightness-chrominance space) in advance, and then the brightness transformation is performed. Those skilled in the art understand that there is a conversion coefficient matrix between the RGB space and the YUV space, so the asymmetric inverse color transformation can also be expressed in the form of a conversion coefficient matrix, and the conversion coefficient matrix depends on the determination of the brightness flip center value.
[0217] For example, in a specific embodiment of the present application, the asymmetric color inversion transformation for the target icon can be specifically performed as follows:
[0218] R'=0.605420R-0.77494G-0.15038B+199
[0219] G'=-0.395077R+0.225241G-0.150164B+199
[0220] B'=-0.394384R-0.775088G+0.849472B+199
[0221] Among them, R, G, and B are the RGB values of the target icon before conversion, and R', G', and B' are the RGB values of the target icon after asymmetric color inversion conversion.
[0222] In some embodiments of the present application, the brightness flip center value in the asymmetric color inversion rule can also be changed and adjusted according to the requirements of the dark mode: when the dark mode is turned on for the mobile phone 100, the color of the desktop background is not limited to pure black. In some embodiments of the present application, the desktop background color of the mobile phone 100 when the dark mode is turned on can also be dark gray or dark blue. In order to avoid the situation in which the icon background color converges with the desktop background color or the icon pattern has a high contrast compared to the desktop background color in this application scenario, the asymmetric color inversion rule can be adaptively corrected by adjusting the brightness flip center value.
[0223] Fig.24 A schematic structural diagram of an electronic device (such as the mobile phone 100 mentioned above) is shown.
[0224] The electronic device may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 160, a speaker 160A, a receiver 160B, a microphone 160C, an earphone interface 160D, a sensor module 170, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 170 may include a pressure sensor 170A, a gyroscope sensor 170B, an air pressure sensor 170C, a magnetic sensor 170D, an acceleration sensor 170E, a distance sensor 170F, a proximity light sensor 170G, a fingerprint sensor 170H, a temperature sensor 170J, a touch sensor 170K, an ambient light sensor 170L, a bone conduction sensor 170M, and the like.
[0225] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0226] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0227] The controller 110 can generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0228] A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or circulated. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. Repeated access is avoided, and the waiting time of the processor 110 is reduced, thereby improving the efficiency of the system. For example, instructions for executing a display mode switching method may be stored in the processor 110, such as instructions for obtaining a first display mode of the operating system, instructions for switching a second display mode of an application being displayed on the screen to a dark mode, instructions for determining whether an icon material has a target icon, and instructions for performing asymmetric inverted color rendering on an icon material having a target icon.
[0229] It is understandable that the interface connection relationship between the modules illustrated in the embodiments of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device. In other embodiments of the present application, the electronic device may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0230] The wireless communication function of the electronic device can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor.
[0231] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0232] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to electronic devices. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110. For example, the mobile phone 100 can report error information or warning information that occurs during the display mode switching process to the remote server.
[0233] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to electronic devices. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering processing, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of the signal, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2. For example, the mobile phone 100 can report error information or warning information of the display mode switching process to the remote server.
[0234] The electronic device implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which is connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change display information, for example, when the first display mode of the operating system of the mobile phone 100 is a dark mode, the second display mode of the application being displayed on the screen is switched to a dark mode.
[0235] The internal memory 121 can be used to store computer executable program codes, and the executable program codes include instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the electronic device by running instructions stored in the internal memory 121 and / or instructions stored in a memory provided in the processor.
[0236] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key. It may also be a touch key, such as a key of a virtual keyboard of a first input method displayed by the electronic device. The electronic device may receive key input and generate key signal input related to user settings and function control of the electronic device.
[0237] The software system of the electronic device may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present invention takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device.
[0238] FIG. 17 is a block diagram of the software structure of an electronic device in some embodiments of the present application.
[0239] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system applied to the electronic device can be divided into four layers, from top to bottom, namely, the application layer, the application framework layer, the Android runtime (Android runtime) and the system library, and the kernel layer.
[0240] The application layer can include a series of application packages.
[0241] like Fig.25 As shown, the application package may include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and other applications.
[0242] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0243] like Fig.25 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.
[0244] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.
[0245] Content providers are used to store and retrieve data and make it accessible to applications. The data can include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0246] The view system may be a display system of an electronic device, capable of managing and modifying the display style of an application to be displayed by the electronic device. The view system may obtain a display function corresponding to the dark mode according to the display style parameters included in the display parameters stored in the electronic device.
[0247] The phone manager is used to provide communication functions to the electronic device, such as the management of call status (including answering, hanging up, etc.).
[0248] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0249] In an embodiment of the present invention, the resource manager may also be used to store an Overlay configuration file.
[0250] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.
[0251] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.
[0252] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.
[0253] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0254] The system library may include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
[0255] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.
[0256] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0257] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0258] A 2D graphics engine is a drawing engine for 2D drawings.
[0259] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
[0260] In the following, in conjunction with the dark mode switching scenario, the workflow of the relevant software and hardware when the electronic device is a mobile phone 100 is exemplified: when the touch sensor receives a touch operation, the corresponding hardware interrupt is sent to the kernel layer; the kernel layer processes the touch operation into an original input event (including touch coordinates, timestamp of the touch operation and other information); the original input time is stored in the kernel layer; the application framework layer obtains the original input event from the kernel layer and identifies the control corresponding to the input event. For example, if the touch operation is a single-click operation and the control corresponding to the single-click operation is the control that calls the dark mode in the mobile phone 100, the mobile phone 100 calls the interface of the application framework layer to start the dark mode switching program (i.e., the dark mode startup application), and then displays the display material corresponding to the dark mode by calling the display driver.
[0261] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0262] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0263] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0264] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0265] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0266] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A display mode switching method, applied to an electronic device, It is characterized in that include: The electronic device receives a switching instruction from a user to switch a display mode of the electronic device to a dark mode; The electronic device identifies an icon to be identified in a display interface of the electronic device to identify a target icon, wherein the target icon is an icon that is not compatible with a dark mode display style; The electronic device performs color processing on the color of the target icon; The electronic device displays the color-processed target icon on a display interface, wherein the color of the color-processed target icon is adapted to the dark mode display style; The electronic device identifies the icon to be identified in the display interface of the electronic device and determines that the icon to be identified is a target icon that needs to be color processed in the dark mode, including: The electronic device compares multiple items of the icon outline, transparent pixel distribution, color distribution, and color type of the icon to be identified with multiple items of the icon outline, transparent pixel distribution, color distribution, and color type of the preset target icon; When multiple of the icon outline, the distribution of transparent pixels, the color distribution, and the color type of the icon to be identified and the preset target icon meet corresponding comparison conditions, determining that the icon to be identified is the target icon; Among them, the icon outline, transparent pixel distribution, color distribution and color type of the icon to be identified and the preset target icon satisfy corresponding comparison conditions, including: Acquire the area occupied by the non-transparent pixels included in the icon to be identified and determine the area to be identified, wherein the area to be identified is the circumscribed rectangle of the area occupied by the non-transparent pixels; The step of obtaining the area occupied by the non-transparent pixels of the icon to be identified and determining the area to be identified includes: Dividing the icon to be identified into a plurality of blocks; Setting one or more sampling points in each of the blocks; The icon to be identified is traversed by traversing all the sampling points to obtain the area occupied by the non-transparent pixels, wherein the sampling points including at least one non-transparent pixel point are used as non-transparent sampling points, and the area occupied by the non-transparent pixels is a continuous area including all the non-transparent sampling points; According to the minimum bounding rectangle of the area occupied by the non-transparent pixels, the to-be-identified area is obtained based on a maximum inclusion rule, wherein the maximum inclusion rule is: if any part of one of the blocks is within the minimum bounding rectangle, the block is included in the to-be-identified area; If the outer contour of the area occupied by the non-transparent pixels in the area to be identified is the contour of the target icon, and The proportion of the area occupied by the non-transparent pixels in the central area of the area to be identified corresponding to the central area reaches a first preset proportion, and The area occupied by the main color part in the to-be-identified area corresponds to a proportion of the to-be-identified area that reaches a second preset proportion, and The color type in the to-be-recognized area is less than a first preset threshold, and the to-be-recognized icon is determined to be the target icon; Wherein, if the outer contour of the area occupied by the non-transparent pixels in the area to be identified is the contour of the target icon, it includes: If transparent pixels exist in the four corner regions of the area to be identified, and the area occupied by the transparent pixels reaches a third preset proportion relative to the corner regions, then the outer contour of the area occupied by the non-transparent pixels in the area to be identified is determined to be the contour of the target icon; The electronic device performs color processing on the color of the target icon; comprising: The electronic device performs color processing on the background base color and pattern color corresponding to the target icon.
2. The display mode switching method according to claim 1, It is characterized in that The target icon is a circular icon or a rounded rectangular icon.
3. The display mode switching method according to claim 1, It is characterized in that The outline of the icon to be identified is a circle or a rounded rectangle.
4. The display mode switching method according to claim 1, It is characterized in that The electronic device identifies an icon to be identified in a display interface of the electronic device to identify a target icon, including: The electronic device acquires the icon material of the icon to be identified, wherein the icon material of the icon to be identified includes the icon to be identified and a peripheral portion located outside the icon to be identified; According to the distribution of non-transparent pixels in the icon material of the icon to be identified, the area to be identified of the icon to be identified is determined, wherein the icon material of the icon to be identified includes the area to be identified, and the area to be identified includes the icon to be identified.
5. The display mode switching method according to claim 1, It is characterized in that The area occupied by non-transparent pixels in the central area of the area to be identified reaches a first preset proportion, including: The electronic device determines that a proportion of an area occupied by transparent pixels in a partial area of the area to be identified is lower than a second preset threshold, wherein the partial area includes a center point of the area to be identified.
6. The display mode switching method according to claim 1, It is characterized in that The area occupied by the main color part in the area to be identified reaches a second preset proportion, including: The electronic device determines that the proportion of the main color area in the to-be-identified area is higher than a third preset threshold, The main color area is the area occupied by the color that appears most frequently in the area to be identified.
7. The display mode switching method according to claim 1, It is characterized in that The color type in the area to be identified is less than a first preset threshold, including: The electronic device counts the types of colors in the area to be identified, and determines that the number of color types is less than a preset threshold.
8. The display mode switching method according to claim 7, It is characterized in that Also includes: When the electronic device counts the color types of the area to be identified, the electronic device collects the color information of each pixel in the area to be identified to obtain the pixel color of each pixel, and performs color clustering on each pixel color, and identifies the pixel colors that meet the clustering conditions as the same color; The clustering condition includes at least one of the following: The saturation differences of the pixel colors are all less than a preset saturation threshold; The brightness difference of the pixel colors is less than a preset brightness threshold; The hue differences of the pixel colors are all smaller than a preset hue threshold.
9. The display mode switching method according to claim 1, It is characterized in that The electronic device performs color processing on the target icon so that the color of the target icon is adapted to the dark mode display style, including: when the icon brightness value of the target icon is greater than a preset brightness threshold, the electronic device performs inverted color processing on the target icon to adapt to the dark mode display style; Wherein, the color inversion processing includes: A flip center value is selected between the minimum and maximum brightness values, and the brightness value of each pixel in the target icon is centered on the flip center value, and a brightness value symmetrical to the current brightness value of the pixel is used as the brightness value of the pixel after inversion processing.
10. An electronic device, It is characterized in that include: A memory, the memory being used to store a processing program; A processor, wherein when executing the processing program, the processor implements the display mode switching method as described in any one of claims 1 to 9.
11. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a processing program, and when the processing program is executed by a processor, the display mode switching method according to any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Icon display processing method and electronic equipment
CN107390976A
Interface display method and device, terminal equipment and storage medium
CN110908765A