Movatterモバイル変換


[0]ホーム

URL:


CN113157357B - A method, device, terminal and storage medium for page display - Google Patents

A method, device, terminal and storage medium for page display
Download PDF

Info

Publication number
CN113157357B
CN113157357BCN202010076679.8ACN202010076679ACN113157357BCN 113157357 BCN113157357 BCN 113157357BCN 202010076679 ACN202010076679 ACN 202010076679ACN 113157357 BCN113157357 BCN 113157357B
Authority
CN
China
Prior art keywords
target
background
foreground object
background image
page
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010076679.8A
Other languages
Chinese (zh)
Other versions
CN113157357A (en
Inventor
罗义
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co LtdfiledCriticalHuawei Technologies Co Ltd
Priority to CN202010076679.8ApriorityCriticalpatent/CN113157357B/en
Publication of CN113157357ApublicationCriticalpatent/CN113157357A/en
Application grantedgrantedCritical
Publication of CN113157357BpublicationCriticalpatent/CN113157357B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

Translated fromChinese

本申请适用于图像处理技术领域,提供了一种页面显示的方法、装置、终端以及存储介质,该方法包括:将目标页面内的原始背景图像,调整为与当前的显示模式对应的目标背景图像;识别所述目标页面内各个前景对象在所述目标背景图像内的关联背景区域;根据所述关联背景区域的背景像素值,将所述前景对象调整为与所述显示模式对应的目标对象;根据所有所述目标对象以及所述目标背景图像,生成所述目标页面。本申请提供的技术方案能够在调整前景对象时,根据关联的背景区域确定调整策略,避免了调整后的背景图像与前景对象出现颜色相同或相似,提高了页面的显示效果。

The present application is applicable to the field of image processing technology, and provides a method, device, terminal and storage medium for page display, the method comprising: adjusting the original background image in the target page to a target background image corresponding to the current display mode; identifying the associated background area of each foreground object in the target page in the target background image; adjusting the foreground object to a target object corresponding to the display mode according to the background pixel value of the associated background area; generating the target page according to all the target objects and the target background image. The technical solution provided by the present application can determine the adjustment strategy according to the associated background area when adjusting the foreground object, thereby avoiding the adjusted background image and the foreground object from having the same or similar color, and improving the display effect of the page.

Description

Translated fromChinese
一种页面显示的方法、装置、终端以及存储介质A method, device, terminal and storage medium for page display

技术领域Technical Field

本申请属于图像处理技术领域,尤其涉及一种页面显示的方法、装置、终端以及存储介质。The present application belongs to the field of image processing technology, and in particular, relates to a method, device, terminal and storage medium for page display.

背景技术Background Art

手机、平板电脑等终端设备,可以根据当前的显示模式调整页面内的各个显示对象的颜色,以使页面与显示模式相匹配,例如在深色显示模式下,可以对文字、图标等前景对象进行反色以及背景调暗,从而使得显示的页面与深色显示模式相匹配。由于页面背景与前景对象的调整过程是分别进行的,有可能会出现调整后的页面背景与前景对象之间的颜色相同或接近,降低了前景对象与背景之间的对比度,以及影响页面的显示效果。Mobile phones, tablet computers and other terminal devices can adjust the color of each display object in the page according to the current display mode to match the page with the display mode. For example, in the dark display mode, the foreground objects such as text and icons can be inverted and the background can be dimmed, so that the displayed page matches the dark display mode. Since the adjustment process of the page background and foreground objects is performed separately, it is possible that the color of the adjusted page background and foreground objects is the same or close, which reduces the contrast between the foreground objects and the background and affects the display effect of the page.

发明内容Summary of the invention

本申请实施例提供了一种页面显示的方法、装置、终端以及存储介质,可以解决现有的页面显示技术,根据显示模式对页面内图像以及前景对象进行调整后,会出现颜色相同或相似的问题。The embodiments of the present application provide a method, device, terminal and storage medium for page display, which can solve the problem of the existing page display technology that the same or similar colors may appear after the image and foreground object in the page are adjusted according to the display mode.

第一方面,本申请实施例提供了一种页面显示的方法,包括:In a first aspect, an embodiment of the present application provides a method for displaying a page, including:

将目标页面内的原始背景图像,调整为与当前的显示模式对应的目标背景图像;Adjust the original background image in the target page to a target background image corresponding to the current display mode;

识别所述目标页面内各个前景对象在所述目标背景图像内的关联背景区域;Identifying the associated background area of each foreground object in the target page in the target background image;

根据所述关联背景区域的背景像素值,将所述前景对象调整为与所述显示模式对应的目标对象;adjusting the foreground object to a target object corresponding to the display mode according to the background pixel value of the associated background area;

根据所有所述目标对象以及所述目标背景图像,生成所述目标页面。The target page is generated according to all the target objects and the target background image.

在第一方面的一种可能的实现方式中,所述识别所述目标页面内各个前景对象在所述目标背景图像内的关联背景区域,包括:In a possible implementation manner of the first aspect, identifying the associated background area of each foreground object in the target page in the target background image includes:

将所述目标背景图像划分为多个候选背景区域;Dividing the target background image into a plurality of candidate background regions;

根据所述前景对象的中心坐标以及所述目标背景图像的边界坐标,从所述候选背景区域中选取与所述前景对象对应的所述关联背景区域。The associated background area corresponding to the foreground object is selected from the candidate background areas according to the center coordinates of the foreground object and the boundary coordinates of the target background image.

在第一方面的一种可能的实现方式中,所述将所述目标背景图像划分为多个候选背景区域,包括:In a possible implementation manner of the first aspect, dividing the target background image into a plurality of candidate background areas includes:

获取最小前景尺寸,将所述最小前景尺寸作为确定分块尺寸;Obtaining a minimum foreground size, and using the minimum foreground size as a determined block size;

基于所述分块尺寸对所述目标背景图像进行划分,得到多个所述候选背景区域。The target background image is divided based on the block size to obtain a plurality of candidate background regions.

在第一方面的一种可能的实现方式中,所述根据所述前景对象的中心坐标以及所述目标背景图像的边界坐标,从所述候选背景区域中选取与所述前景对象对应的所述关联背景区域,包括:In a possible implementation manner of the first aspect, selecting the associated background area corresponding to the foreground object from the candidate background area according to the center coordinates of the foreground object and the boundary coordinates of the target background image includes:

根据各个候选背景区域的在所述目标背景图像的显示位置,为各个候选背景区域配置关联的基准行列号;According to the display position of each candidate background area in the target background image, assigning an associated reference row and column number to each candidate background area;

其中,Colunm0为所述候选背景区域的基准列序号;Row0为所述所述候选背景区域的基准行序号;(SrcX0,SrcY0)为所述候选背景区域的边界坐标;(pX,pY)为所述候选背景区域的中心坐标;(Sizex,Sizey)为所述候选背景区域的区域尺寸;Wherein, Colunm0 is the base column number of the candidate background area; Row0 is the base row number of the candidate background area; (SrcX0 , SrcY0 ) is the boundary coordinate of the candidate background area; (pX, pY) is the center coordinate of the candidate background area; (Sizex , Sizey ) is the area size of the candidate background area;

将所述前景对象中心坐标导入预设的行列转换模型,计算所述前景对象的目标行列号;所述行列转换模型具体为:The center coordinates of the foreground object are imported into a preset row-column conversion model to calculate the target row and column number of the foreground object; the row-column conversion model is specifically:

其中,Colunm1为所述目标行列号内的列序号;Row1为所述目标行列号内的行序号;(SrcX1,SrcY1)为所述前景对象的中心坐标;(Sizex,Sizey)为所述候选背景区域的区域尺寸;(Targetx,Targety)为所述前景对象的对象尺寸;Wherein, Colunm1 is the column number within the target row and column number; Row1 is the row number within the target row and column number; (SrcX1 , SrcY1 ) are the center coordinates of the foreground object; (Sizex , Sizey ) are the area size of the candidate background area; (Targetx , Targety ) are the object size of the foreground object;

选取所述基准行列号与所述目标行列号匹配的所述候选背景区域作为所述前景对象的关联背景区域。The candidate background region whose reference row and column number matches the target row and column number is selected as the associated background region of the foreground object.

在第一方面的一种可能的实现方式中,所述显示模式为深色显示模式,则所述根据所述关联背景区域的背景像素值,将所述前景对象调整为与所述显示模式对应的目标对象,包括:In a possible implementation manner of the first aspect, the display mode is a dark display mode, and adjusting the foreground object to a target object corresponding to the display mode according to the background pixel value of the associated background area includes:

获取关联背景区域的中心坐标的像素值以及透明度;Get the pixel value and transparency of the center coordinates of the associated background area;

根据所述中心坐标的所述像素值以及所述透明度,确定所述关联背景区域的背景亮度值;Determining a background brightness value of the associated background area according to the pixel value of the center coordinate and the transparency;

若所述背景亮度值大于预设的亮度阈值,则对所述前景对象进行降低亮度处理,生成所述目标对象;If the background brightness value is greater than a preset brightness threshold, the foreground object is subjected to brightness reduction processing to generate the target object;

若所述背景亮度值小于或等于所述亮度阈值,则对所述前景对象进行反色处理,生成所述目标对象。If the background brightness value is less than or equal to the brightness threshold, the foreground object is inverted to generate the target object.

在第一方面的一种可能的实现方式中,在所述根据所述中心坐标的所述像素值以及所述透明度,确定所述关联背景区域的亮度值之后,还包括:In a possible implementation manner of the first aspect, after determining the brightness value of the associated background area according to the pixel value of the center coordinate and the transparency, the method further includes:

根据所述前景对象内各个像素点的所述像素值,确定所述前景对象对应的特征亮度值;Determining a characteristic brightness value corresponding to the foreground object according to the pixel value of each pixel point in the foreground object;

若所述背景亮度值与所述特征亮度值之间的亮度差值大于预设的反色阈值,则对所述前景对象进行降低亮度处理,生成所述目标对象;If the brightness difference between the background brightness value and the characteristic brightness value is greater than a preset inversion threshold, the foreground object is subjected to brightness reduction processing to generate the target object;

若所述亮度差值小于或等于所述反色阈值,则对所述前景对象进行反色处理,生成所述目标对象。If the brightness difference is less than or equal to the inversion threshold, the foreground object is inverted to generate the target object.

在第一方面的一种可能的实现方式中,所述识别所述目标页面内各个前景对象在所述目标背景图像内的关联背景区域,包括:In a possible implementation manner of the first aspect, identifying the associated background area of each foreground object in the target page in the target background image includes:

确定所述前景对象在所述目标页面内的显示层级;Determining a display level of the foreground object within the target page;

在所述目标页面内选取与所述显示层级相邻层级的目标背景图像作为所述前景对象的关联背景图像;Selecting, in the target page, a target background image at a level adjacent to the display level as an associated background image for the foreground object;

确定所述前景对象在所述关联背景图像内的关联背景区域。An associated background region of the foreground object within the associated background image is determined.

在第一方面的一种可能的实现方式中,所述根据所述关联背景区域的背景像素值,将所述前景对象调整为与所述显示模式对应的目标对象,包括:In a possible implementation manner of the first aspect, adjusting the foreground object to a target object corresponding to the display mode according to the background pixel value of the associated background area includes:

根据所述关联背景区域的背景像素值以及所述前景对象的像素值,生成所述前景对象对应的预览对象;generating a preview object corresponding to the foreground object according to the background pixel value of the associated background area and the pixel value of the foreground object;

根据所述预览对象对应的所有关联对象的像素值以及所述预览对象的像素值,生成所述前景对象对应的所述目标对象。The target object corresponding to the foreground object is generated according to the pixel values of all associated objects corresponding to the preview object and the pixel value of the preview object.

第二方面,本申请实施例提供了一种页面显示的装置,包括:In a second aspect, an embodiment of the present application provides a device for displaying a page, including:

背景图像调整单元,用于将目标页面内的原始背景图像,调整为与当前的显示模式对应的目标背景图像;A background image adjustment unit, used to adjust the original background image in the target page to a target background image corresponding to the current display mode;

关联背景区域识别单元,用于识别所述目标页面内各个前景对象在所述目标背景图像内的关联背景区域;An associated background region identification unit, used to identify an associated background region of each foreground object in the target page in the target background image;

前景对象调整单元,用于根据所述关联背景区域的背景像素值,将所述前景对象调整为与所述显示模式对应的目标对象;a foreground object adjustment unit, configured to adjust the foreground object to a target object corresponding to the display mode according to a background pixel value of the associated background area;

目标页面生成单元,用于根据所有所述目标对象以及所述目标背景图像,生成所述目标页面。The target page generating unit is used to generate the target page according to all the target objects and the target background image.

第三方面,本申请实施例提供了一种终端设备,存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现上述第一方面中任一项所述页面显示的方法。In a third aspect, an embodiment of the present application provides a terminal device, a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that when the processor executes the computer program, the method for page display described in any one of the first aspects above is implemented.

第四方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现上述第一方面中任一项所述页面显示的方法。In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and wherein when the computer program is executed by a processor, the method for displaying a page described in any one of the first aspects above is implemented.

第五方面,本申请实施例提供了一种计算机程序产品,当计算机程序产品在终端设备上运行时,使得终端设备执行上述第一方面中任一项所述页面显示的方法。In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on a terminal device, the terminal device executes the page display method described in any one of the first aspects above.

可以理解的是,上述第二方面至第五方面的有益效果可以参见上述第一方面中的相关描述,在此不再赘述。It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here.

本申请实施例与现有技术相比存在的有益效果是:Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

本申请实施例通过对目标页面内的原始背景图像进行调整,得到目标背景图像,继而根据各个前景对象在目标背景图像内的关联背景区域的亮度值,确定前景对象的调整策略,并根据调整策略生成前景对象对应的目标对象,最后根据目标背景图像以及目标对象生成目标页面,在调整前景对象时,根据关联的背景区域确定调整策略,避免了调整后的背景图像与前景对象出现颜色相同或相似,提高了页面的显示效果。The embodiment of the present application obtains a target background image by adjusting the original background image in the target page, and then determines an adjustment strategy for the foreground object based on the brightness value of the associated background area of each foreground object in the target background image, and generates a target object corresponding to the foreground object based on the adjustment strategy. Finally, a target page is generated based on the target background image and the target object. When adjusting the foreground object, the adjustment strategy is determined based on the associated background area, which avoids the adjusted background image and the foreground object having the same or similar color, thereby improving the display effect of the page.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

为了更清楚地说明本申请实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

图1是本申请实施例提供的手机的部分结构的框图;FIG1 is a block diagram of a partial structure of a mobile phone provided in an embodiment of the present application;

图2是本申请实施例的手机的软件结构示意图;FIG2 is a schematic diagram of the software structure of a mobile phone according to an embodiment of the present application;

图3是本申请第一实施例提供的一种页面显示的方法的实现流程图;FIG3 is a flow chart of a method for displaying a page according to a first embodiment of the present invention;

图4是本申请一实施例提供的深色显示模式的示意图;FIG4 is a schematic diagram of a dark display mode provided by an embodiment of the present application;

图5是本申请一实施例提供的深色显示模式的示意图;FIG5 is a schematic diagram of a dark display mode provided by an embodiment of the present application;

图6是本申请一实施例提供的关联背景区域的识别示意图;FIG6 is a schematic diagram of identifying an associated background area provided by an embodiment of the present application;

图7是本申请另一实施例提供的关联背景区域的识别示意图;FIG7 is a schematic diagram of identifying an associated background area provided by another embodiment of the present application;

图8是本申请第二实施例提供的一种页面显示的方法S302的具体实现流程图FIG. 8 is a flowchart of a specific implementation of a method S302 for page display provided in the second embodiment of the present application.

图9是本申请一实施例提供的页面显示的过程中各处理单元的交互示意图;FIG9 is a schematic diagram of the interaction of various processing units during page display provided by an embodiment of the present application;

图10是本申请一实施例提供的基于深色显示模式的页面显示的流程示意图;FIG10 is a schematic diagram of a process of displaying a page based on a dark display mode according to an embodiment of the present application;

图11是本申请第三实施例提供的一种页面显示的方法S801的具体实现流程图;FIG. 11 is a specific implementation flow chart of a method S801 for page display provided in the third embodiment of the present application;

图12是本申请一实施例提供的候选背景区域的划分示意图;FIG12 is a schematic diagram of dividing candidate background areas provided by an embodiment of the present application;

图13是本申请第四实施例提供的一种页面显示的方法S802的具体实现流程图;FIG. 13 is a specific implementation flow chart of a method S802 for page display provided in the fourth embodiment of the present application;

图14是本申请一实施例提供的目标行列号的选取示意图;FIG14 is a schematic diagram of selecting target row and column numbers provided in one embodiment of the present application;

图15是本申请第五实施例提供的一种页面显示的方法S304的具体实现流程图;FIG. 15 is a flowchart of a specific implementation of a method S304 for page display provided in the fifth embodiment of the present application;

图16是本申请第六实施例提供的一种页面显示的方法的具体实现流程图;FIG16 is a flowchart showing a specific implementation of a method for displaying a page provided in a sixth embodiment of the present application;

图17是本申请第七实施例提供的一种页面显示的方法S302的具体实现流程图;FIG. 17 is a flowchart showing a specific implementation of a method S302 for displaying a page provided in the seventh embodiment of the present application;

图18是本申请第八实施例提供的一种页面显示的方法S303的具体实现流程图;FIG. 18 is a flowchart of a specific implementation of a method S303 for page display provided in the eighth embodiment of the present application;

图19是本申请一实施例提供的目标对象的生成示意图;FIG19 is a schematic diagram of generating a target object according to an embodiment of the present application;

图20是本申请一实施例提供的一种页面显示的设备的结构框图;FIG20 is a structural block diagram of a device for displaying a page provided by an embodiment of the present application;

图21本申请另一实施例提供的一种终端设备的示意图。FIG21 is a schematic diagram of a terminal device provided in another embodiment of the present application.

具体实施方式DETAILED DESCRIPTION

以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请的描述。In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

应当理解,当在本申请说明书和所附权利要求书中使用时,术语“包括”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and/or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and/or combinations thereof.

还应当理解,在本申请说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。It should also be understood that the term “and/or” used in the specification and appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.

如在本申请说明书和所附权利要求书中所使用的那样,术语“如果”可以依据上下文被解释为“当...时”或“一旦”或“响应于确定”或“响应于检测到”。类似地,短语“如果确定”或“如果检测到[所描述条件或事件]”可以依据上下文被解释为意指“一旦确定”或“响应于确定”或“一旦检测到[所描述条件或事件]”或“响应于检测到[所描述条件或事件]”。As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

另外,在本申请说明书和所附权利要求书的描述中,术语“第一”、“第二”、“第三”等仅用于区分描述,而不能理解为指示或暗示相对重要性。In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

在本申请说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

本申请实施例提供的页面显示的方法可以应用于手机、平板电脑、可穿戴设备、车载设备、增强现实(augmented reality,AR)/虚拟现实(virtual reality,VR)设备、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本、个人数字助理(personal digital assistant,PDA)等终端设备上,还可以应用于具有显示功能的数据库、服务器以及基于终端人工智能的服务响应系统,本申请实施例对终端设备的具体类型不作任何限制。The page display method provided in the embodiment of the present application can be applied to terminal devices such as mobile phones, tablet computers, wearable devices, vehicle-mounted devices, augmented reality (AR)/virtual reality (VR) devices, laptops, ultra-mobile personal computers (UMPC), netbooks, personal digital assistants (PDA), etc., and can also be applied to databases and servers with display functions and service response systems based on terminal artificial intelligence. The embodiment of the present application does not impose any restrictions on the specific type of terminal devices.

例如,所述终端设备可以是WLAN中的站点(STAION,ST),可以是蜂窝电话、无绳电话、会话启动协议(Session InitiationProtocol,SIP)电话、无线本地环路(WirelessLocal Loop,WLL)站、个人数字处理(Personal Digital Assistant,PDA)设备、具有无线通信功能的手持设备、计算设备或连接到无线调制解调器的其它处理设备、电脑、膝上型计算机、手持式通信设备、手持式计算设备、和/或用于在无线系统上进行通信的其它设备以及下一代通信系统,例如,5G网络中的移动终端或者未来演进的公共陆地移动网络(PublicLand Mobile Network,PLMN)网络中的移动终端等。For example, the terminal device can be a station (STAION, ST) in a WLAN, a cellular phone, a cordless phone, a Session Initiation Protocol (SIP) phone, a Wireless Local Loop (WLL) station, a Personal Digital Assistant (PDA) device, a handheld device with wireless communication function, a computing device or other processing device connected to a wireless modem, a computer, a laptop computer, a handheld communication device, a handheld computing device, and/or other devices for communicating on a wireless system and a next-generation communication system, such as a mobile terminal in a 5G network or a mobile terminal in a future evolved Public Land Mobile Network (PLMN) network, etc.

作为示例而非限定,当所述终端设备为可穿戴设备时,该可穿戴设备还可以是应用穿戴式技术对日常穿戴进行智能化设计、开发出可以穿戴的设备的总称,如具有拍摄功能的眼镜、手套、手表、服饰及鞋等。可穿戴设备即直接穿在身上,或是整合到用户的衣服或配件的一种便携式设备,通过附着与用户身上,用于记录用户行进过程中的图像或根据用户发起的拍摄指令,采集环境图像等。可穿戴设备不仅仅是一种硬件设备,更是通过软件支持以及数据交互、云端交互来实现强大的功能。广义穿戴式智能设备包括功能全、尺寸大、可不依赖智能手机实现完整或者部分的功能,如智能手表或智能眼镜等,以及只专注于某一类应用功能,需要和其它设备如智能手机配合使用,如各类进行具有显示屏的智能手表、智能手环等。As an example but not a limitation, when the terminal device is a wearable device, the wearable device can also be a general term for wearable devices that are intelligently designed and developed using wearable technology for daily wear, such as glasses, gloves, watches, clothing and shoes with shooting functions. A wearable device is a portable device that is worn directly on the body or integrated into the user's clothes or accessories. It is attached to the user and is used to record images of the user during the movement or to collect environmental images according to shooting instructions initiated by the user. Wearable devices are not only hardware devices, but also powerful functions achieved through software support, data interaction, and cloud interaction. Broadly speaking, wearable smart devices include those with full functions, large sizes, and can achieve complete or partial functions without relying on smartphones, such as smart watches or smart glasses, as well as those that only focus on a certain type of application functions and need to be used in conjunction with other devices such as smartphones, such as various types of smart watches and smart bracelets with display screens.

以所述终端设备为手机为例。图1示出的是与本申请实施例提供的手机的部分结构的框图。参考图1,手机包括:射频(Radio Frequency,RF)电路110、存储器120、输入单元130、显示单元140、传感器150、音频电路160、近场通信模块170、处理器180、以及电源190等部件。本领域技术人员可以理解,图1中示出的手机结构并不构成对手机的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。Take the terminal device as a mobile phone as an example. FIG1 shows a block diagram of a partial structure of a mobile phone provided in an embodiment of the present application. Referring to FIG1 , the mobile phone includes components such as a radio frequency (RF) circuit 110, a memory 120, an input unit 130, a display unit 140, a sensor 150, an audio circuit 160, a near field communication module 170, a processor 180, and a power supply 190. Those skilled in the art will appreciate that the mobile phone structure shown in FIG1 does not constitute a limitation on the mobile phone, and may include more or fewer components than shown, or combine certain components, or arrange the components differently.

下面结合图1对手机的各个构成部件进行具体的介绍:The following is a detailed introduction to the various components of the mobile phone in conjunction with Figure 1:

RF电路110可用于收发信息或通话过程中,信号的接收和发送,特别地,将基站的下行信息接收后,给处理器180处理;另外,将设计上行的数据发送给基站。通常,RF电路包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器(Low NoiseAmplifier,LNA)、双工器等。此外,RF电路110还可以通过无线通信与网络和其他设备通信。上述无线通信可以使用任一通信标准或协议,包括但不限于全球移动通讯系统(GlobalSystem of Mobile communication,GSM)、通用分组无线服务(General Packet RadioService,GPRS)、码分多址(Code Division Multiple Access,CDMA)、宽带码分多址(Wideband Code Division Multiple Access,WCDMA)、长期演进(Long Term Evolution,LTE))、电子邮件、短消息服务(Short Messaging Service,SMS)等,通过RF电路110接收服务器发送的关于目标页面的页面数据,并根据页面数据生成目标页面。The RF circuit 110 can be used for receiving and sending signals during information transmission or calls. In particular, after receiving the downlink information of the base station, it is sent to the processor 180 for processing; in addition, the designed uplink data is sent to the base station. Generally, the RF circuit includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (Low Noise Amplifier, LNA), a duplexer, etc. In addition, the RF circuit 110 can also communicate with the network and other devices through wireless communication. The above-mentioned wireless communication can use any communication standard or protocol, including but not limited to the Global System of Mobile communication (Global System of Mobile communication, GSM), General Packet Radio Service (General Packet Radio Service, GPRS), Code Division Multiple Access (Code Division Multiple Access, CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (Long Term Evolution, LTE)), email, Short Messaging Service (SMS), etc., receive the page data about the target page sent by the server through the RF circuit 110, and generate the target page according to the page data.

存储器120可用于存储软件程序以及模块,处理器180通过运行存储在存储器120的软件程序以及模块,从而执行手机的各种功能应用以及数据处理,例如将目标页面的页面数据存储于存储器120的缓存区域内,根据当前的显示模式对页面数据进行调整后,再生成目标页面。存储器120可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据手机的使用所创建的数据(比如音频数据、电话本等)等。此外,存储器120可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。The memory 120 can be used to store software programs and modules. The processor 180 executes various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 120, such as storing the page data of the target page in the cache area of the memory 120, adjusting the page data according to the current display mode, and then generating the target page. The memory 120 can mainly include a program storage area and a data storage area, wherein the program storage area can 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 can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 120 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

输入单元130可用于接收输入的数字或字符信息,以及产生与手机100的用户设置以及功能控制有关的键信号输入。具体地,输入单元130可包括触控面板131以及其他输入设备132。触控面板131,也称为触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板131上或在触控面板131附近的操作),并根据预先设定的程式驱动相应的连接装置。The input unit 130 may be used to receive input digital or character information, and to generate key signal inputs related to user settings and function control of the mobile phone 100. Specifically, the input unit 130 may include a touch panel 131 and other input devices 132. The touch panel 131, also known as a touch screen, may collect user touch operations on or near it (such as operations performed by the user using a finger, stylus, or any other suitable object or accessory on or near the touch panel 131), and drive corresponding connection devices according to a pre-set program.

显示单元140可用于显示由用户输入的信息或提供给用户的信息以及手机的各种菜单,例如输出调整后的校正图像。显示单元140可包括显示面板141,可选的,可以采用液晶显示器(Liquid Crystal Display,LCD)、有机发光二极管(Organic Light-EmittingDiode,OLED)等形式来配置显示面板141。进一步的,触控面板131可覆盖显示面板141,当触控面板131检测到在其上或附近的触摸操作后,传送给处理器180以确定触摸事件的类型,随后处理器180根据触摸事件的类型在显示面板141上提供相应的视觉输出。虽然在图1中,触控面板131与显示面板141是作为两个独立的部件来实现手机的输入和输入功能,但是在某些实施例中,可以将触控面板131与显示面板141集成而实现手机的输入和输出功能。The display unit 140 can be used to display information input by the user or information provided to the user and various menus of the mobile phone, such as outputting an adjusted correction image. The display unit 140 may include a display panel 141, and optionally, the display panel 141 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. Further, the touch panel 131 may cover the display panel 141, and when the touch panel 131 detects a touch operation on or near it, it is transmitted to the processor 180 to determine the type of the touch event, and then the processor 180 provides a corresponding visual output on the display panel 141 according to the type of the touch event. Although in Figure 1, the touch panel 131 and the display panel 141 are used as two independent components to realize the input and output functions of the mobile phone, in some embodiments, the touch panel 131 and the display panel 141 can be integrated to realize the input and output functions of the mobile phone.

手机100还可包括至少一种传感器150,比如光传感器、运动传感器以及其他传感器。具体地,光传感器可包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板141的亮度,接近传感器可在手机移动到耳边时,关闭显示面板141和/或背光。作为运动传感器的一种,加速计传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别手机姿态的应用(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等;至于手机还可配置的陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器,在此不再赘述。The mobile phone 100 may also include at least one sensor 150, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 141 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 141 and/or the backlight when the mobile phone is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors that can be configured in the mobile phone, such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be repeated here.

手机100还可以包括摄像头160。可选地,摄像头在手机100的上的位置可以为前置的,也可以为后置的,本申请实施例对此不作限定。The mobile phone 100 may further include a camera 160. Optionally, the camera may be located at the front or rear of the mobile phone 100, which is not limited in the embodiment of the present application.

可选地,手机100可以包括单摄像头、双摄像头或三摄像头等,本申请实施例对此不作限定。Optionally, the mobile phone 100 may include a single camera, a dual camera, or a triple camera, etc., which is not limited in the embodiments of the present application.

例如,手机100可以包括三摄像头,其中,一个为主摄像头、一个为广角摄像头、一个为长焦摄像头。For example, the mobile phone 100 may include three cameras, one of which is a main camera, one is a wide-angle camera, and one is a telephoto camera.

可选地,当手机100包括多个摄像头时,这多个摄像头可以全部前置,或者全部后置,或者一部分前置、另一部分后置,本申请实施例对此不作限定。Optionally, when the mobile phone 100 includes multiple cameras, all of the multiple cameras may be front-mounted, or all of the cameras may be rear-mounted, or some may be front-mounted and others may be rear-mounted, and this is not limited to the embodiments of the present application.

终端设备可以通过近场通信模块170可以接收其他设备发送的设备信息页面,例如该近场通信模块170集成有蓝牙通信模块,通过蓝牙通信模块与其他手机建立通信连接,并接收其他手机反馈的设备信息,生成与该其他手机对应的设备信息页面。虽然图1示出了近场通信模块170,但是可以理解的是,其并不属于手机100的必须构成,完全可以根据需要在不改变申请的本质的范围内而省略。The terminal device can receive device information pages sent by other devices through the near field communication module 170. For example, the near field communication module 170 is integrated with a Bluetooth communication module, establishes a communication connection with other mobile phones through the Bluetooth communication module, and receives device information fed back by other mobile phones, and generates a device information page corresponding to the other mobile phones. Although FIG. 1 shows the near field communication module 170, it is understandable that it is not a necessary component of the mobile phone 100 and can be omitted as needed without changing the essence of the application.

处理器180是手机的控制中心,利用各种接口和线路连接整个手机的各个部分,通过运行或执行存储在存储器120内的软件程序和/或模块,以及调用存储在存储器120内的数据,执行手机的各种功能和处理数据,从而对手机进行整体监控。可选的,处理器180可包括一个或多个处理单元;优选的,处理器180可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器180中。The processor 180 is the control center of the mobile phone. It uses various interfaces and lines to connect various parts of the entire mobile phone. By running or executing software programs and/or modules stored in the memory 120, and calling data stored in the memory 120, it executes various functions of the mobile phone and processes data, thereby monitoring the mobile phone as a whole. Optionally, the processor 180 may include one or more processing units; preferably, the processor 180 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 180.

手机100还包括给各个部件供电的电源190(比如电池),优选的,电源可以通过电源管理系统与处理器180逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。The mobile phone 100 also includes a power source 190 (such as a battery) for supplying power to various components. Preferably, the power source can be logically connected to the processor 180 through a power management system, so that the power management system can manage functions such as charging, discharging, and power consumption.

手机100还包括音频电路、扬声器,传声器可提供用户与手机之间的音频接口。音频电路可将接收到的音频数据转换后的电信号,传输到扬声器,由扬声器转换为声音信号输出;另一方面,传声器将收集的声音信号转换为电信号,由音频电路接收后转换为音频数据,再将音频数据输出处理器180处理后,经RF电路110以发送给比如另一手机,或者将音频数据输出至存储器120以便进一步处理。例如,用户可以通过音频电路采集用户的语音信号,基于语音信号设置手机的显示模式,并基于当前配置的显示模式对前台显示的目标页面进行调整,输出与当前显示模式相对应的目标页面。The mobile phone 100 also includes an audio circuit and a speaker. The microphone can provide an audio interface between the user and the mobile phone. The audio circuit can transmit the electrical signal converted from the received audio data to the speaker, which is converted into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit and converted into audio data, and then the audio data is output to the processor 180 for processing, and then sent to another mobile phone through the RF circuit 110, or the audio data is output to the memory 120 for further processing. For example, the user can collect the user's voice signal through the audio circuit, set the display mode of the mobile phone based on the voice signal, and adjust the target page displayed on the foreground based on the currently configured display mode, and output the target page corresponding to the current display mode.

图2是本申请实施例的手机100的软件结构示意图。以手机100操作系统为Android系统为例,在一些实施例中,将Android系统分为四层,分别为应用程序层、应用程序框架层(framework,FWK)、系统层以及硬件抽象层,层与层之间通过软件接口通信。Fig. 2 is a schematic diagram of the software structure of the mobile phone 100 of the embodiment of the present application. Taking the Android system as an example, in some embodiments, the Android system is divided into four layers, namely, the application layer, the application framework layer (framework, FWK), the system layer and the hardware abstraction layer, and the layers communicate with each other through software interfaces.

如图2所示,所述应用程序层可以一系列应用程序包,应用程序包可以包括短信息,日历,相机,视频,导航,图库,通话等应用程序。As shown in FIG. 2 , the application layer may be a series of application packages, and the application packages may include short message, calendar, camera, video, navigation, gallery, call and other applications.

应用程序框架层为应用程序层的应用程序提供应用编程接口(applicationprogramming interface,API)和编程框架。应用程序框架层可以包括一些预先定义的函数,例如用于接收应用程序框架层所发送的事件的函数。The application framework layer provides an application programming interface (API) and a programming framework for the application programs of the application layer. The application framework layer may include some predefined functions, such as a function for receiving events sent by the application framework layer.

如图2所示,应用程序框架层可以包括窗口管理器、资源管理器以及通知管理器等。As shown in FIG. 2 , the application framework layer may include a window manager, a resource manager, a notification manager, and the like.

窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。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. The content provider is used to store and obtain data and make the data accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。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.

应用程序框架层还可以包括:The application framework layer may also include:

视图系统,所述视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。本申请实施例可以运行与应用程序框架层中,通过文字控件对于目标页面内的文字类型的对象进行调整,并且通过显示图片的控件,对目标页面内的背景图像进行调整,并将调整后的所有页面数据进行封装,生成目标页面。A view system, wherein the view system includes visual controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying pictures. The embodiment of the present application can be run in the application framework layer, and the text type objects in the target page are adjusted through the text control, and the background image in the target page is adjusted through the control for displaying pictures, and all the adjusted page data is encapsulated to generate the target page.

电话管理器用于提供手机100的通信功能。例如通话状态的管理(包括接通,挂断等)。The phone manager is used to provide communication functions of the mobile phone 100, such as management of call status (including answering, hanging up, etc.).

系统层可以包括多个功能模块。例如:传感器服务模块,物理状态识别模块,三维图形处理库(例如:OpenGL ES)等。The system layer may include multiple functional modules, such as sensor service module, physical state recognition module, 3D graphics processing library (such as OpenGL ES), etc.

传感器服务模块,用于对硬件层各类传感器上传的传感器数据进行监测,确定手机100的物理状态;The sensor service module is used to monitor the sensor data uploaded by various sensors at the hardware layer and determine the physical state of the mobile phone 100;

物理状态识别模块,用于对用户手势、人脸等进行分析和识别;Physical state recognition module, used to analyze and recognize user gestures, faces, etc.;

三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

系统层还可以包括:The system layer may also include:

表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.

媒体库支持多种常用的静态图像文件,视频格式回放和录制,以及音频等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。The media library supports a variety of commonly used static image files, video format playback and recording, and audio, 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.

硬件抽象层是硬件和软件之间的层。硬件抽象层可以包括显示驱动、摄像头驱动、传感器驱动、麦克风驱动等,用于驱动硬件层的相关硬件,如显示屏、摄像头、传感器以及麦克风等。The hardware abstraction layer is a layer between hardware and software. The hardware abstraction layer may include display drivers, camera drivers, sensor drivers, microphone drivers, etc., which are used to drive related hardware of the hardware layer, such as display screens, cameras, sensors, and microphones.

在本申请实施例中,流程的执行主体为安装有页面显示的程序的设备。作为示例而非限定,页面显示的程序的设备具体可以为终端设备,该终端设备可以为用户使用的智能手机、平板电脑、笔记本电脑等,在接收到显示请求时,根据当前的显示模式对显示请求对应的目标页面进行调整,并使得显示的目标页面与显示模式相匹配。图3示出了本申请第一实施例提供的页面显示的方法的实现流程图,详述如下:In the embodiment of the present application, the execution subject of the process is a device with a program for page display installed. As an example but not limitation, the device of the program for page display can be a terminal device, which can be a smart phone, tablet computer, laptop computer, etc. used by the user. When receiving a display request, the target page corresponding to the display request is adjusted according to the current display mode, and the displayed target page is matched with the display mode. FIG3 shows a flow chart of the implementation method of the page display method provided in the first embodiment of the present application, which is described in detail as follows:

在S301中,将目标页面内的原始背景图像,调整为与当前的显示模式对应的目标背景图像。In S301, the original background image in the target page is adjusted to a target background image corresponding to the current display mode.

在本实施例中,终端设备配置有显示屏,可以通过显示屏响应用户发起的显示请求,例如显示应用程序内的操作界面,又或者通过相册应用显示存储于数据库内的图像等。在执行上述显示操作之前,终端设备均可以通过本实施例提供的页面显示的方法,对待显示的目标页面的内容进行调整,以使输出的目标页面与当前的显示模式相匹配,从而能够提高整体页面与显示模式之间的一致性,提高了终端设备的显示效果。In this embodiment, the terminal device is equipped with a display screen, and can respond to display requests initiated by the user through the display screen, such as displaying an operation interface in an application, or displaying images stored in a database through an album application, etc. Before performing the above display operation, the terminal device can adjust the content of the target page to be displayed through the page display method provided in this embodiment, so that the output target page matches the current display mode, thereby improving the consistency between the overall page and the display mode, and improving the display effect of the terminal device.

在一种可能的实现方式中,该显示模式可以为深色显示模式,也可以称为“夜间模式”,即在显示环境较暗的情况下或者根据用户的实际显示需求,可以将终端设备的显示界面内的控件以及图片等显示对象,设置为整体亮度值较低的显示模式。需要说明的是,该深色显示模式并非将页面内的所有对象的亮度值均调整至低亮度值,而是整个页面的整体视觉效果属于低亮度模式,即页面的平均亮度值低于预设的亮度阈值。例如,可以将页面内的背景图像设置为低亮度图像或者设置为黑色背景,此时为了使得页面内的文字以及控件等对于用户而言是可见的,可以将文字或控件等对象的颜色配置为白色或亮度较高的颜色,但由于上述对象在整个页面内的显示区域相对于背景图像而言相对较少,因此,页面整体的视觉效果依然输出低亮度的显示模式,与当前的显示效果相匹配。In a possible implementation, the display mode may be a dark display mode, also referred to as a "night mode", that is, in a dark display environment or according to the actual display needs of the user, the controls and display objects such as pictures in the display interface of the terminal device may be set to a display mode with a lower overall brightness value. It should be noted that the dark display mode does not adjust the brightness values of all objects in the page to a low brightness value, but the overall visual effect of the entire page belongs to a low brightness mode, that is, the average brightness value of the page is lower than a preset brightness threshold. For example, the background image in the page may be set to a low brightness image or a black background. At this time, in order to make the text and controls in the page visible to the user, the color of objects such as text or controls may be configured to white or a color with a higher brightness. However, since the display area of the above objects in the entire page is relatively small relative to the background image, the overall visual effect of the page still outputs a low brightness display mode, which matches the current display effect.

示例性地,图4示出了本申请一实施例提供的深色显示模式的示意图。其中,图4的(a)为调整为深色显示模式前,某一目标页面的显示效果;图4的(b)为调整为深色显示模式后,该目标页面的显示效果。参见图4所示,该目标页面的背景图像为一单色图像,其颜色为白色,属于亮度较高的颜色,此时,需要将背景图像进行反色处理,调整为黑色背景,并而由于原本页面内的其他前景对象的颜色为黑色,为了使得内容可见,需要对前景图像对应地进行反色处理,将前景对象的颜色调整为白色,从而使得整体页面的色调为暗色调。Exemplarily, FIG4 shows a schematic diagram of a dark display mode provided by an embodiment of the present application. Among them, FIG4 (a) is the display effect of a target page before adjusting to the dark display mode; FIG4 (b) is the display effect of the target page after adjusting to the dark display mode. As shown in FIG4, the background image of the target page is a monochrome image, and its color is white, which is a color with high brightness. At this time, the background image needs to be inverted and adjusted to a black background. Since the color of other foreground objects in the original page is black, in order to make the content visible, the foreground image needs to be inverted accordingly, and the color of the foreground object is adjusted to white, so that the tone of the overall page is dark.

示例性地,图5示出了本申请一实施例提供的深色显示模式的示意图。其中,图5的(a)为调整为深色显示模式前,某一目标页面的显示效果;图5的(b)为调整为深色显示模式后,该目标页面的显示效果。参见图5所示,该目标页面的背景图像为一多色混合图像,由于对于多色混合图像无法通过反色来进行深色处理(由于反色处理会影响原本图片的显示效果,甚至无法表现出该图像原本所需表达的内容,因此不会直接对多色图像进行反色处理,而是会对),该深色处理主要是降低背景图像的对比度以及亮度值。现有技术中,由于对页面内的各个显示对象进行单独处理,并不会考虑对象之间的关联性,因此,对于文字以及图标等内容,依然是采用反色的调整手段,因此会使得反色后的文字以及图像与深色处理后的背景图像之间的颜色相同或相似,使得文字以及图标等内容的可见度降低,影响整体的显示效果。由此可见,现有的页面显示技术,对各个显示对象均是单独处理,而在页面中,不同显示对象之间是相互重叠显示的,合并显示时可能会出现颜色相同或相似的情况,为了避免上述情况发生,终端设备可以在调整页面时,首先对背景图像进行处理,并根据前景图像在背景图像的关联背景区域,再确定对应的调整策略,进行与显示模式相匹配的颜色调整,保证前景对象与背景图像之间的对比度的同时,使得调整后的前景对象与当前的显示模式相匹配,避免了生成的目标页面出现部分对象因颜色相同或相似而不可见的情况。Exemplarily, FIG5 shows a schematic diagram of a dark display mode provided by an embodiment of the present application. Among them, FIG5 (a) is the display effect of a target page before adjusting to the dark display mode; FIG5 (b) is the display effect of the target page after adjusting to the dark display mode. Referring to FIG5, the background image of the target page is a multi-color mixed image. Since the multi-color mixed image cannot be processed by inverting the color to perform dark processing (since the inverting processing will affect the display effect of the original image, and even fail to express the content originally required to be expressed by the image, the multi-color image will not be directly inverted, but will be), the dark processing is mainly to reduce the contrast and brightness value of the background image. In the prior art, since each display object in the page is processed separately, the correlation between the objects is not considered. Therefore, for the contents such as text and icons, the inverting adjustment means is still adopted, so the color of the inverted text and image is the same or similar to the background image after the dark processing, so that the visibility of the contents such as text and icons is reduced, affecting the overall display effect. It can be seen that the existing page display technology processes each display object separately, and in the page, different display objects are displayed overlappingly, and the same or similar colors may appear when they are combined and displayed. In order to avoid the above situation, the terminal device can first process the background image when adjusting the page, and then determine the corresponding adjustment strategy based on the associated background area of the foreground image in the background image, and make color adjustments that match the display mode, while ensuring the contrast between the foreground object and the background image, making the adjusted foreground object match the current display mode, avoiding the situation in which some objects on the generated target page are invisible due to the same or similar colors.

在一种可能的实现方式中,该显示模式还可以包括:强对比度显示模式以及高亮度模式等,若该显示模式为强对比度模式,则要求背景图像与前景对象之间的对比度较强,终端设备在后续的操作中可以调整背景图像以及前景对象的饱和度、对比度以及锐度等参数值,以使页面的对比度较强,与显示模式相匹配;对应地,当显示模式为高亮度模式下,终端设备可以通过对背景图像以及前景对象的高光色区进行调整,提高高光色区的比例,并减少阴影色区的比例,提高整体页面的亮度值。终端设备可以根据不同的显示模式确定页面调整策略,并基于页面调整策略对页面内的各个显示对象进行调整,以使调整后的目标页面与当前的显示模式相匹配。In a possible implementation, the display mode may also include: a strong contrast display mode and a high brightness mode, etc. If the display mode is a strong contrast mode, the contrast between the background image and the foreground object is required to be strong. The terminal device may adjust the saturation, contrast, sharpness and other parameter values of the background image and the foreground object in subsequent operations to make the contrast of the page strong and match the display mode; correspondingly, when the display mode is a high brightness mode, the terminal device may adjust the highlight color area of the background image and the foreground object to increase the proportion of the highlight color area and reduce the proportion of the shadow color area to increase the brightness value of the entire page. The terminal device may determine a page adjustment strategy according to different display modes, and adjust each display object in the page based on the page adjustment strategy so that the adjusted target page matches the current display mode.

在本实施例中,终端设备可以配置有默认显示模式,各个目标页面的原始页面数据可以是基于默认显示模式生成的数据,即默认显示模式下是根据原始页面数据生成目标页面,而不对原始页面数据进行调整。该默认显示模式可以称为常规显示模式。终端设备若检测到当前的显示模式为默认显示模式,则可以将接收到的目标页面的页面数据进行输出显示,无需对页面内的显示对象的颜色或亮度等参数进行调整;反之,终端设备若检测到当前的显示模式为非默认显示模式,则获取当前的显示模式对应的页面调整策略,并通过该页面调整策略对目标页面内的显示对象进行调整,以及执行S301至S304的相关操作。In this embodiment, the terminal device may be configured with a default display mode, and the original page data of each target page may be data generated based on the default display mode, that is, in the default display mode, the target page is generated based on the original page data, and the original page data is not adjusted. The default display mode may be referred to as a normal display mode. If the terminal device detects that the current display mode is the default display mode, the received page data of the target page may be output and displayed without adjusting parameters such as the color or brightness of the display object in the page; conversely, if the terminal device detects that the current display mode is a non-default display mode, the page adjustment policy corresponding to the current display mode is obtained, and the display object in the target page is adjusted through the page adjustment policy, and related operations from S301 to S304 are performed.

在一种可能的实现方式中,终端设备在检测到用户输入显示模式变更指令时,会检测当前前台显示的页面是否与变更后的显示模式相匹配,若是,则无需对当前显示的页面进行调整;反之,若当前显示的页面与变更后的显示模式不匹配,则将当前显示的页面作为目标页面,并执行S301至S304的相关操作。In one possible implementation, when the terminal device detects that the user inputs a display mode change instruction, it will detect whether the page currently displayed in the foreground matches the changed display mode. If so, there is no need to adjust the currently displayed page; otherwise, if the currently displayed page does not match the changed display mode, the currently displayed page will be used as the target page and the relevant operations of S301 to S304 will be performed.

在一种可能的实现方式中,终端设备在检测到显示模式发生变更后,会获取当前后台运行的应用程序,并获取各个应用程序对应的操作页面。将各个操作页面与当前的显示模式进行匹配,若任一操作页面与当前的显示模式不匹配,则通过S301至S304的方式对该页面进行调整。In a possible implementation, after detecting that the display mode has changed, the terminal device obtains the applications currently running in the background and obtains the operation pages corresponding to each application, matches each operation page with the current display mode, and if any operation page does not match the current display mode, adjusts the page through S301 to S304.

在一种可能的实现方式中,终端设备还可以在本地的存储器中存储有目标页面在不同显示模式下的页面数据,或者该目标页面对应的服务器可以根据显示模式配置有对应的页面数据,终端设备可以通过从本地的存储器或页面服务器处获取与当前显示模式匹配的页面数据,并基于获取得到的页面数据输出目标页面;若本地存储器或页面服务器并没有存储有与当前的显示模式相匹配的页面数据,则通过S301至S304的操作对目标页面内的显示对象进行调整,从而生成与显示模式对应的目标页面。In one possible implementation, the terminal device may also store page data of the target page in different display modes in a local memory, or the server corresponding to the target page may be configured with corresponding page data according to the display mode. The terminal device may obtain page data matching the current display mode from the local memory or page server, and output the target page based on the obtained page data; if the local memory or page server does not store page data matching the current display mode, the display object in the target page is adjusted through operations S301 to S304 to generate a target page corresponding to the display mode.

在本实施例中,目标页面可以包含多个显示对象,分别背景图像以及前景对象。其中,背景图像的个数可以为一个,也可以为多个,即目标页面可以有多个不同的背景图像拼接得到,每个背景图像的图像尺寸也可以不同,也可以与终端设备的显示尺寸相匹配,还可以根据实际的显示内容调整显示尺寸,在此不做限定。需要说明的是,背景图像之间可以相互叠加,根据多个背景图像之间相互重叠,构成目标页面的背景。不同的背景图像可以通过配置对应的透明度,以使处于底层的背景图像与处于上层的背景图像相互叠加,构成目标页面的页面背景。在该情况下,终端设备在对原始背景图像调整至与当前实现模式相匹配的目标背景图像时,可以首先对最底层的原始背景图像进行调整,并基于最底层的目标背景图像的亮度值,确定相邻上一层级的原始背景图像的调整策略,若该最底层的目标背景图像的亮度值与相邻上一层级的原始背景图像的亮度值之间的亮度差值小于预设的调整阈值,则对该上一层级的原始背景图像采用第一调整算法进行处理(例如对相邻上一层级的原始背景图像进行反色处理);反之,若该最底层的目标背景图像的亮度值与相邻上一层级的原始背景图像的亮度值之间的亮度差值大于或等于预设的调整阈值,则对上一层级的原始背景图像采用第二调整算法进行处理(例如对相邻上一层级的原始背景图像进行降低亮度处理)。In the present embodiment, the target page can include multiple display objects, respectively background images and foreground objects. Wherein, the number of background images can be one or more, that is, the target page can be obtained by splicing multiple different background images, and the image size of each background image can also be different, or it can be matched with the display size of the terminal device, and the display size can also be adjusted according to the actual display content, which is not limited here. It should be noted that the background images can be superimposed on each other, and the background of the target page is formed according to the overlap between the multiple background images. Different background images can be configured with corresponding transparency so that the background image at the bottom and the background image at the upper layer are superimposed on each other to form the page background of the target page. In this case, when the terminal device adjusts the original background image to the target background image that matches the current implementation mode, it can first adjust the original background image of the bottom layer, and determine the adjustment strategy of the original background image of the adjacent upper layer based on the brightness value of the target background image of the bottom layer. If the brightness difference between the brightness value of the target background image of the bottom layer and the brightness value of the original background image of the adjacent upper layer is less than a preset adjustment threshold, the original background image of the upper layer is processed using the first adjustment algorithm (for example, the original background image of the adjacent upper layer is inverted); conversely, if the brightness difference between the brightness value of the target background image of the bottom layer and the brightness value of the original background image of the adjacent upper layer is greater than or equal to the preset adjustment threshold, the original background image of the upper layer is processed using the second adjustment algorithm (for example, the original background image of the adjacent upper layer is reduced in brightness).

在本实施例中,不同的显示模式对应不同的调整算法。终端设备可以根据当前的显示模式获取与之关联的调整算法。该调整算法可以根据显示对象类型的不同,配置有不同的调整模型,例如对于背景图像采用第一调整模型、对于文字对象采用第二调整模型,而对于图标对象则采用第三调整模型。当然,对于同一类型的显示对象的调整模型,还可以根据对象属性区分不同的调整模型,例如对于背景图像为单色背景图像时,则采用第一调整模型;而对于多色背景图像,则采用第二调整模型;还可以根据原始背景图像的原始颜色,确定对应的调整模型,举例性地,若检测到原始背景图像的平均像素值在(255,125)之间,则采用第一调整模型;若检测到原始背景图像的平均像素值在(125,0)之间,则采用第二调整模型,具体采用的调整方式可以根据显示模式、图像层级、对象类型以及图像的色度多个维度进行确定。In this embodiment, different display modes correspond to different adjustment algorithms. The terminal device can obtain the adjustment algorithm associated with the current display mode. The adjustment algorithm can be configured with different adjustment models according to different display object types, for example, a first adjustment model is used for background images, a second adjustment model is used for text objects, and a third adjustment model is used for icon objects. Of course, for the adjustment model of the same type of display object, different adjustment models can also be distinguished according to the object attributes. For example, when the background image is a monochrome background image, the first adjustment model is used; and for a multi-color background image, the second adjustment model is used; the corresponding adjustment model can also be determined according to the original color of the original background image. For example, if the average pixel value of the original background image is detected to be between (255, 125), the first adjustment model is used; if the average pixel value of the original background image is detected to be between (125, 0), the second adjustment model is used. The specific adjustment method used can be determined according to the display mode, image level, object type, and multiple dimensions of image chromaticity.

举例性地,当前的显示模式为深色显示模式,某一原始背景图像为一单色黑色图像。终端设备获取深色显示模式对应的页面调整策略。该页面调整策略根据背景图像与前景图像分为两个不同的调整算法,分别为第一调整算法以及第二调整算法。在检测到当前所需的调整对象为背景图像时,则采用第一调整算法对原始背景图像进行调整,该第一调整算法需要识别得到该原始背景图像为单色图像,且颜色为黑色,则不对该原始背景图像进行调整,只需降低终端设备显示屏的背光亮度。For example, the current display mode is a dark display mode, and an original background image is a monochrome black image. The terminal device obtains a page adjustment strategy corresponding to the dark display mode. The page adjustment strategy is divided into two different adjustment algorithms according to the background image and the foreground image, namely a first adjustment algorithm and a second adjustment algorithm. When it is detected that the current required adjustment object is the background image, the first adjustment algorithm is used to adjust the original background image. The first adjustment algorithm needs to recognize that the original background image is a monochrome image and the color is black. In this case, the original background image is not adjusted, and only the backlight brightness of the terminal device display needs to be reduced.

在S302中,识别所述目标页面内各个前景对象在所述目标背景图像内的关联背景区域。In S302, the associated background area of each foreground object in the target page in the target background image is identified.

在本实施例中,目标页面包含有背景图像以及前景对象。上述前景对象具体为显示于背景图像上层的显示对象,该前景对象包括但不限于:前景图标、文字、控件、触控动画以及弹窗等显示对象。In this embodiment, the target page includes a background image and a foreground object. The foreground object is specifically a display object displayed on the upper layer of the background image, and the foreground object includes but is not limited to: foreground icons, text, controls, touch animations, pop-up windows and other display objects.

在本实施例中,每个前景对象的对象信息中可以包含有在目标页面的中心坐标以及该前景对象的对象尺寸。终端设备可以根据上述两个参数,即显示位置以及对象尺寸,识别得到与该前景对象对应的关联背景区域。In this embodiment, the object information of each foreground object may include the center coordinates of the target page and the object size of the foreground object. The terminal device may identify the associated background area corresponding to the foreground object according to the above two parameters, namely, the display position and the object size.

在一种可能的实现方式中,确定关联背景区域的方式可以为:若目标页面内的背景图像的个数为多个,则终端设备根据该各个目标背景图像的背景区域,将前景对象的中心坐标所落入的背景区域所对应的目标背景图像,作为该前景对象关联的目标背景图像;终端设备根据该前景对象的对象尺寸以及中心区域,确定该前景对象在目标背景图像中的覆盖区域,并将该覆盖区域识别为该前景对象在目标背景图像内的关联背景区域。In one possible implementation, the associated background area can be determined as follows: if there are multiple background images in the target page, the terminal device uses the target background image corresponding to the background area in which the center coordinates of the foreground object fall as the target background image associated with the foreground object based on the background areas of the respective target background images; the terminal device determines the coverage area of the foreground object in the target background image based on the object size and center area of the foreground object, and identifies the coverage area as the associated background area of the foreground object in the target background image.

示例性地,图6示出了本申请一实施例提供的关联背景区域的识别示意图。参见图6所示,该目标页面内包含有3个背景图像,分别为背景图像1、背景图像2以及背景图像3,该目标页面还包含有一前景对象即为图标1,终端设备可以通过读取图标1的对象信息,确定该前景对象的中心坐标,而该中心坐标落入了背景图像1的背景区域内,则识别背景图像1为图标1的关联背景图像。终端设备并根据该图标1的对象尺寸,在关联背景图像内提取出对应的关联背景区域。Exemplarily, FIG6 shows a schematic diagram of identifying an associated background area provided by an embodiment of the present application. Referring to FIG6, the target page includes three background images, namely background image 1, background image 2 and background image 3. The target page also includes a foreground object, namely icon 1. The terminal device can determine the center coordinates of the foreground object by reading the object information of icon 1. If the center coordinates fall within the background area of background image 1, background image 1 is identified as the associated background image of icon 1. The terminal device extracts the corresponding associated background area in the associated background image according to the object size of icon 1.

在一种可能的实现方式中,目标页面内包含有多个目标背景图像,且不同的目标背景图像可以通过调整透明度,使得底层背景图像与上层背景图像相互叠加,构成目标页面的页面背景,在该情况下,某一坐标点可以同时对应两个不同的目标背景图像。在该情况下,终端设备可以对目标页面的所有目标背景图像进行可见图层合并,即根据各个目标背景图像的透明度将多个处于不同图层的目标背景图像进行合并,生成合并背景图像,继而从合并背景图像中确定前景对象对应的关联背景区域。In a possible implementation, the target page contains multiple target background images, and different target background images can be adjusted in transparency so that the bottom background image and the upper background image overlap each other to form the page background of the target page. In this case, a certain coordinate point can correspond to two different target background images at the same time. In this case, the terminal device can merge the visible layers of all target background images of the target page, that is, merge multiple target background images in different layers according to the transparency of each target background image to generate a merged background image, and then determine the associated background area corresponding to the foreground object from the merged background image.

示例性地,图7示出了本申请另一实施例提供的关联背景区域的识别示意图。参见图7所示,该目标图像包含有背景图像1以及背景图像2。并且背景图像1位于背景图像2的下一显示层级,前景对象则位于背景图像2的上一显示层级,在该情况下,前景对象对应的目标背景图像为背景图像1以及背景图像2。因此,终端设备可以将背景图像1以及背景图像2合并,得到合并背景图像,并根据前景对象的中心坐标以及对象尺寸,在合并背景图像中确定出对应的关联背景区域。Exemplarily, FIG7 shows a schematic diagram of identifying an associated background area provided by another embodiment of the present application. Referring to FIG7 , the target image includes a background image 1 and a background image 2. And the background image 1 is located at the next display level of the background image 2, and the foreground object is located at the previous display level of the background image 2. In this case, the target background images corresponding to the foreground object are the background image 1 and the background image 2. Therefore, the terminal device can merge the background image 1 and the background image 2 to obtain a merged background image, and determine the corresponding associated background area in the merged background image according to the center coordinates of the foreground object and the object size.

在S303中,根据所述关联背景区域的背景像素值,将所述前景对象调整为与所述显示模式对应的目标对象。In S303, the foreground object is adjusted to a target object corresponding to the display mode according to the background pixel value of the associated background area.

在本实施例中,终端设备在确定了关联背景区域后,可以计算该关联背景区域对应的背景像素值。该背景像素值可以为该关联背景区域的像素均值,在该情况下,终端设备可以将关联背景区域内的各个像素点的像素值进行叠加,并根据累加值计算得到关联背景区域对应的像素均值,将该像素均值作为关联背景区域的背景像素值。可选地,终端设备可以根据各个像素点与关联背景区域的中心坐标之间的距离值,确定各个像素点对应的加权权重,其中,距离中心坐标的距离越小,则对应的加权权重的数值越大,基于各个像素点的加权权重以及像素值进行加权累加,得到加权累加值,并根据加权累加值进行平均,将加权均值作为关联区域的背景像素值。In this embodiment, after determining the associated background area, the terminal device can calculate the background pixel value corresponding to the associated background area. The background pixel value can be the pixel mean of the associated background area. In this case, the terminal device can superimpose the pixel values of each pixel point in the associated background area, and calculate the pixel mean corresponding to the associated background area according to the accumulated value, and use the pixel mean as the background pixel value of the associated background area. Optionally, the terminal device can determine the weighted weight corresponding to each pixel point according to the distance value between each pixel point and the center coordinate of the associated background area, wherein the smaller the distance from the center coordinate, the larger the value of the corresponding weighted weight, and perform weighted accumulation based on the weighted weights and pixel values of each pixel point to obtain a weighted accumulated value, and average the weighted accumulated value to use the weighted mean as the background pixel value of the associated area.

在一种可能的实现方式中,终端设备可以对目标背景图像进行降采样,即通过预设网格将目标背景图像划分为多个网格区域,并根据各个网格区域的中心坐标点的像素值,作为各个网格区域的像素值,从而生成关于目标背景图像的降采样图像。终端设备根据关联背景区域在降采样图像内对应的网格区域的像素值,确定该关联背景区域的背景像素值。若该前景对象的显示区域覆盖了两个或以上的网格区域,则将覆盖的网格区域的作为前景对象的关联背景区域,又或者将前景对象的中心坐标所在的网格区域作为该前景区域对应的关联背景区域。若关联背景区域对应多个网格区域,则可以根据各个网格区域的像素值的均值,作为该关联背景区域的背景像素值。In a possible implementation, the terminal device can downsample the target background image, that is, divide the target background image into multiple grid areas through a preset grid, and use the pixel value of the central coordinate point of each grid area as the pixel value of each grid area, thereby generating a downsampled image of the target background image. The terminal device determines the background pixel value of the associated background area according to the pixel value of the grid area corresponding to the associated background area in the downsampled image. If the display area of the foreground object covers two or more grid areas, the covered grid area is used as the associated background area of the foreground object, or the grid area where the center coordinates of the foreground object are located is used as the associated background area corresponding to the foreground area. If the associated background area corresponds to multiple grid areas, the average of the pixel values of each grid area can be used as the background pixel value of the associated background area.

在本实施例中,终端设备对前景对象进行调整的方式可以为:终端设备获取前景对象的前景像素值,根据前景像素值、背景像素值以及当前的显示模式对应的颜色色调,对前景对象进行调整。In this embodiment, the terminal device may adjust the foreground object by obtaining a foreground pixel value of the foreground object and adjusting the foreground object according to the foreground pixel value, background pixel value and color tone corresponding to the current display mode.

在一种可能的实现方式中,若该显示模式的深色显示模式,即夜间显示模式,终端设备可以若检测到前景像素值与背景像素值之间的像素差值小于预设的对比阈值,则对前景对象进行反色处理;反之,若检测到前景像素值与背景像素值之间的像素差值大于或等于预设的对比阈值,则表示在调整前,前景对象叠加在目标背景图像上进行显示时,已经具有较高的可见度,此时若继续对前景对象进行反色处理,则反而会导致前景对象叠加在目标背景区域后降低可见度,因此,终端设备并不会对前景对象进行反色处理,而是降低前景对象的亮度值,以使与深色显示模式相匹配。In one possible implementation, if the display mode is a dark display mode, i.e., a night display mode, the terminal device may invert the foreground object if it is detected that the pixel difference between the foreground pixel value and the background pixel value is less than a preset contrast threshold; conversely, if it is detected that the pixel difference between the foreground pixel value and the background pixel value is greater than or equal to the preset contrast threshold, it means that before adjustment, the foreground object already had a high visibility when it was superimposed on the target background image for display. At this time, if the foreground object continues to be inverted, it will cause the foreground object to be superimposed on the target background area. Reduced visibility, therefore, the terminal device does not invert the foreground object, but reduces the brightness value of the foreground object to match the dark display mode.

在一种可能的实现方式中,若该显示模式为高对比度模式,终端设备若检测到前景像素值与背景像素值之间的像素差值小于预设的对比阈值,则对前景对象进行反色处理,并提高反色处理后的前景对象以及目标背景图像的对比度;反之,若检测到前景像素值与背景像素值之间的像素差值大于或等于预设的对比阈值,则表示前景对象与目标背景对象在调整之间已经具有较高的对比度,此时可以无需对前景对象进行反色处理,而是增加前景对象的对比度,得到目标对象。In one possible implementation, if the display mode is a high contrast mode, if the terminal device detects that the pixel difference between the foreground pixel value and the background pixel value is less than a preset contrast threshold, the foreground object is inverted and the contrast between the foreground object and the target background image after the inversion is increased; conversely, if the pixel difference between the foreground pixel value and the background pixel value is detected to be greater than or equal to the preset contrast threshold, it indicates that the foreground object and the target background object already have a high contrast between the adjustments. In this case, there is no need to invert the foreground object, but instead the contrast of the foreground object is increased to obtain the target object.

在本实施例中,目标页面内可以包含有多个前景对象,对各个前景对象执行S302以及S303的操作,生成关于各个前景对象的目标对象,若检测到各个前景对象均调整完毕,此时可以执行S304的操作。In this embodiment, the target page may include multiple foreground objects. Operations S302 and S303 are performed on each foreground object to generate target objects for each foreground object. If it is detected that each foreground object has been adjusted, operation S304 may be performed.

在S304中,根据所有所述目标对象以及所述目标背景图像,生成所述目标页面。In S304, the target page is generated according to all the target objects and the target background image.

在本实施例中,终端设备可以根据调整后各个前景对象对应的目标对象以及原始背景图像对应的目标背景图像进行封装,生成与当前显示模式相匹配的目标页面。在该情况下,终端设备记录有各个前景对象在目标页面内的显示坐标以及对象层级,同样地,终端设备也记录有各个原始背景图像在目标页面内的显示坐标以及对象层级,终端设备基于上述参数,可以确定各个显示对象(即目标对象以及目标背景图像)在目标页面内的显示区域,并进行拼接以及叠加显示,从而得到目标页面。In this embodiment, the terminal device can encapsulate the target objects corresponding to the adjusted foreground objects and the target background images corresponding to the original background images to generate a target page that matches the current display mode. In this case, the terminal device records the display coordinates and object levels of each foreground object in the target page. Similarly, the terminal device also records the display coordinates and object levels of each original background image in the target page. Based on the above parameters, the terminal device can determine the display area of each display object (i.e., the target object and the target background image) in the target page, and perform splicing and superimposition display to obtain the target page.

以上可以看出,本申请实施例提供的一种页面显示的方法通过对目标页面内的原始背景图像进行调整,得到目标背景图像,继而根据各个前景对象在目标背景图像内的关联背景区域的亮度值,确定前景对象的调整策略,并根据调整策略生成前景对象对应的目标对象,最后根据目标背景图像以及目标对象生成目标页面,在调整前景对象时,根据关联的背景区域确定调整策略,避免了调整后的背景图像与前景对象出现颜色相同或相似,提高了页面的显示效果。From the above, it can be seen that a page display method provided by an embodiment of the present application obtains a target background image by adjusting the original background image in the target page, and then determines the adjustment strategy of the foreground object according to the brightness value of the associated background area of each foreground object in the target background image, and generates the target object corresponding to the foreground object according to the adjustment strategy, and finally generates the target page according to the target background image and the target object. When adjusting the foreground object, the adjustment strategy is determined according to the associated background area, which avoids the adjusted background image and the foreground object having the same or similar color, thereby improving the display effect of the page.

图8示出了本申请第二实施例提供的一种页面显示的方法S302的具体实现流程图。参见图8,相对于图3所述实施例,本实施例提供的一种页面显示的方法中S302包括:S801~S802,具体详述如下:FIG8 shows a specific implementation flow chart of a method S302 for page display provided in the second embodiment of the present application. Referring to FIG8 , relative to the embodiment described in FIG3 , the method S302 for page display provided in this embodiment includes: S801 to S802, which are described in detail as follows:

进一步地,所述识别所述目标页面内各个前景对象在所述目标背景图像内的关联背景区域,包括:Furthermore, the identifying the associated background area of each foreground object in the target page in the target background image includes:

在S801中,将所述目标背景图像划分为多个候选背景区域。In S801, the target background image is divided into a plurality of candidate background regions.

在本实施例中,终端设备可以对目标背景图像进行区域划分,从而将一个面积较大的目标背景图像划分为多个面积较小的候选背景区域,从而能够便于后续对前景对象调整的过程中,确定关联背景区域。由于根据前景对象的对象形状,从目标背景图像中截取与对象形状相匹配的背景区域作为前景对象的关联背景区域,则运算量较大,不仅需要获取前景对象的轮廓信息,并需要根据轮廓信息从目标背景区域内进行区域框取,不仅提取得到的各个候选背景区域的区域大小不一致,并且在前景对象较多以及轮廓较为复杂的情况下,则消耗较多的运算资源进行关联背景区域的识别操作,从而降低了目标页面的生成效率,延长了页面生成的耗时,降低了用户的使用体验。因此,终端设备可以根据预先的划分规则,将目标背景图像划分为多个候选背景区域,从而在确定关联背景区域时,可以从候选背景区域中进行选取,无需根据前景对象的对象轮廓,在目标背景图像内进行截取,减少了终端设备的运算量,从而提高了目标页面的生成效率。In this embodiment, the terminal device can divide the target background image into regions, thereby dividing a target background image with a larger area into multiple candidate background regions with smaller areas, so that it is convenient to determine the associated background region in the subsequent adjustment process of the foreground object. Since the background region matching the object shape is intercepted from the target background image as the associated background region of the foreground object according to the object shape of the foreground object, the amount of calculation is large, not only the contour information of the foreground object needs to be obtained, but also the region frame needs to be taken from the target background region according to the contour information, not only the area size of each candidate background region extracted is inconsistent, but also when there are many foreground objects and the contour is more complicated, more computing resources are consumed to perform the identification operation of the associated background region, thereby reducing the generation efficiency of the target page, prolonging the time consumption of page generation, and reducing the user's use experience. Therefore, the terminal device can divide the target background image into multiple candidate background regions according to the pre-division rule, so that when determining the associated background region, it can be selected from the candidate background region, without intercepting in the target background image according to the object contour of the foreground object, reducing the amount of calculation of the terminal device, thereby improving the generation efficiency of the target page.

在一种可能的实现方式中,终端设备可以通过预设的区域形状,生成以上述区域形状为单位的网格线,基于上述的网格线对目标背景图像进行划分,从而生成得到多个候选背景区域。其中,该区域形状可以为矩形、正方形、三角形等多边形。In a possible implementation, the terminal device may generate grid lines with the preset region shape as a unit, divide the target background image based on the grid lines, and thus generate multiple candidate background regions. The region shape may be a polygon such as a rectangle, square, or triangle.

在一种可能的实现方式中,终端设备可以识别目标页面内各个前景对象的对象尺寸,选取数值最小的对象尺寸作为目标尺寸,并基于目标尺寸配置网格,并基于上述网格将目标背景图像划分为多个候选背景区域。根据前景对象的对象尺寸的最小值配置网格,能够使得每个前景对象均能够选取得到与之形状大小相匹配的候选背景区域,避免因候选背景区域过大而导致多个前景对象对应同一关联背景区域,也能够尽可能减少候选背景区域的分块数量,提高了选取的效率。由于对图像进行区域划分,实际上是一个降采样的过程,因此降采样的比例越高,对于运算速度的提升越大,而根据前景对象的尺寸最小值进行网格划分,不仅能够提高运算速率的同时,也能够保证关联背景区域与前景对象之间吻合度,提高了后续调整操作的准确性。In a possible implementation, the terminal device can identify the object size of each foreground object in the target page, select the object size with the smallest value as the target size, configure a grid based on the target size, and divide the target background image into multiple candidate background areas based on the above grid. Configuring the grid according to the minimum value of the object size of the foreground object can enable each foreground object to select a candidate background area that matches its shape and size, avoid multiple foreground objects corresponding to the same associated background area due to the candidate background area being too large, and can also reduce the number of blocks of the candidate background area as much as possible, thereby improving the selection efficiency. Since image area division is actually a downsampling process, the higher the downsampling ratio, the greater the improvement in computing speed. Grid division according to the minimum size of the foreground object can not only improve the computing speed, but also ensure the consistency between the associated background area and the foreground object, thereby improving the accuracy of subsequent adjustment operations.

在S802中,根据所述前景对象的中心坐标以及所述目标背景图像的边界坐标,从所述候选背景区域中选取与所述前景对象对应的所述关联背景区域。In S802, the associated background area corresponding to the foreground object is selected from the candidate background areas according to the center coordinates of the foreground object and the boundary coordinates of the target background image.

在本实施例中,终端设备在配置各个前景对象的显示位置时,该显示位置是前景对象相对于显示屏的位置。但由于每个目标背景图像有对应的显示区域,在需要确定前景对象在目标背景图像中的关联背景区域时,需要考虑目标背景图像内各个候选背景区域相对于显示屏的显示区域,才能够识别得到前景对象的关联背景背景区域。基于此,终端设备需要获取目标背景图像的边界坐标,根据任一边界坐标以及目标背景图像的图像尺寸,则可以确定该目标背景区域的显示区域。并根据各个候选背景区域在目标背景图像上的显示位置,则可以确定各个候选背景区域对应的显示区域,识别前景对象的中心坐标所落入的显示区域,即可以确定该前景对象在目标背景图像中的关联背景区域。In this embodiment, when the terminal device configures the display position of each foreground object, the display position is the position of the foreground object relative to the display screen. However, since each target background image has a corresponding display area, when it is necessary to determine the associated background area of the foreground object in the target background image, it is necessary to consider the display area of each candidate background area in the target background image relative to the display screen, so that the associated background area of the foreground object can be identified. Based on this, the terminal device needs to obtain the boundary coordinates of the target background image, and the display area of the target background area can be determined according to any boundary coordinate and the image size of the target background image. And according to the display position of each candidate background area on the target background image, the display area corresponding to each candidate background area can be determined, and the display area where the central coordinates of the foreground object fall can be identified, that is, the associated background area of the foreground object in the target background image can be determined.

在一种可能的实现方式中,识别关联背景区域的方式可以为:根据目标背景图像的边界坐标以及图像尺寸,确定目标背景图像的显示区域,基于各个候选背景区域的位置,确定各个候选背景区域的显示区域,基于各个候选背景区域的显示区域,确定各个候选背景区域的区域坐标,计算所述区域坐标与前景对象的中心坐标的距离值,选取该距离值小于预设的距离阈值的候选背景区域作为关联背景区域。In one possible implementation, the method for identifying the associated background area can be: determining the display area of the target background image based on the boundary coordinates and image size of the target background image, determining the display area of each candidate background area based on the position of each candidate background area, determining the area coordinates of each candidate background area based on the display area of each candidate background area, calculating the distance value between the area coordinates and the center coordinates of the foreground object, and selecting the candidate background area whose distance value is less than a preset distance threshold as the associated background area.

示例性地,图9示出了本申请一实施例提供的页面显示的过程中各处理单元的交互示意图。参见图9所示,终端设备包括有显示模式调整单元,位图处理单元、背景图像调整单元、历史图层颜色库以及前景对象处理单元。具体实现过程如下:For example, FIG9 shows a schematic diagram of the interaction of each processing unit in the process of page display provided by an embodiment of the present application. Referring to FIG9 , the terminal device includes a display mode adjustment unit, a bitmap processing unit, a background image adjustment unit, a history layer color library, and a foreground object processing unit. The specific implementation process is as follows:

1.显示模块调整单元可以用于解析目标页面内包含的显示对象,将目标页面内的原始背景图像交由位图处理单元进行处理;1. The display module adjustment unit can be used to parse the display objects contained in the target page, and hand over the original background image in the target page to the bitmap processing unit for processing;

2.显示模块调整单元可以将解析得到的前景对象导入到前景对象处理单元,其中,导入前景对象处理单元之前,显示模块调整单元可以确定各个前景对象的中心坐标以及对象颜色;需要说明的是,上述步骤1以及2可以同时执行;2. The display module adjustment unit may import the foreground objects obtained by the analysis into the foreground object processing unit, wherein before importing the foreground object processing unit, the display module adjustment unit may determine the center coordinates and object colors of each foreground object; it should be noted that the above steps 1 and 2 may be performed simultaneously;

3.位图处理模块在获取得到原始背景图像后,可以解析该原始背景图像对应的至少一个边界坐标以及图像尺寸,特别地,可以确定该背景图像的像素信息,例如可以通过平均像素值、特征像素值以及背景图像包含的颜色种类等信息。3. After obtaining the original background image, the bitmap processing module can parse at least one boundary coordinate and image size corresponding to the original background image. In particular, the pixel information of the background image can be determined, such as the average pixel value, characteristic pixel value, and color types contained in the background image.

4.将包含像素信息以及坐标信息的原始背景图像导入到背景图像调整单元,根据像素信息以及与当前的显示模式相匹配的调整算法对原始背景图像进行调整,得到目标背景图像,将目标背景图像导入到预处理单元,通过预处理单元对目标背景图像进行区域划分得到多个候选背景区域;4. Importing the original background image containing pixel information and coordinate information into the background image adjustment unit, adjusting the original background image according to the pixel information and an adjustment algorithm matching the current display mode to obtain a target background image, importing the target background image into the preprocessing unit, and dividing the target background image into regions to obtain multiple candidate background regions through the preprocessing unit;

5.历史图层颜色库在对目标背景图像进行划分操作后,可以对各个图层的颜色进行存储并记录,生成对应的数据库,具体地,该历史图层颜色库可以额识别各个目标背景区域对应的背景像素值,并将各个背景像素值返回给背景图像调整单元;5. After dividing the target background image, the historical layer color library can store and record the colors of each layer to generate a corresponding database. Specifically, the historical layer color library can identify the background pixel values corresponding to each target background area and return each background pixel value to the background image adjustment unit;

6.背景图像调整单元可以将分块后的目标背景图像以及各个候选背景区域的背景像素值发送给前景对象处理单元;6. The background image adjustment unit can send the divided target background image and the background pixel values of each candidate background area to the foreground object processing unit;

7.前景图像处理单元可以根据各个候选背景区域的像素值以及对应的显示区域,对各个前景对象进行调整,生成目标对象;7. The foreground image processing unit can adjust each foreground object according to the pixel value of each candidate background area and the corresponding display area to generate a target object;

8.前进图像处理单元见输出的目标对象返回给显示模式调整单元,通过显示模式调整单元对目标对象以及目标背景图像进行合并,生成目标页面。8. The target object output by the forward image processing unit is returned to the display mode adjustment unit, and the display mode adjustment unit merges the target object and the target background image to generate a target page.

示例性地,图10示出了本申请一实施例提供的基于深色显示模式的页面显示的流程示意图。参见图10所示,该目标页面包含有四个不同的显示对象,分别为根视图Rootview、背景图层ImageView、第一前景文本TextView1以及第二前景文本TextView2。终端设备将上述四个显示对象同时导入到预处理单元,确定对应的预处理方式,其中,预处理单元可以根据各个显示对象的显示层级的次序依次确定各个待显示对象的调整方式,由于Rootview处于最底显示层级,因此预处理单元首先确定Rootview的调整方式,该Rootview为单色图像,则在进行深色显示模式调整时,需要将单色图像进行反色处理;而ImageView为第二层级的显示对象,并且为多色背景图像,则在进行深色显示模式调整时,将ImageView的亮度值降低,而无需执行反色处理;最后,对于TextView1以及TextView2为第三层级的显示对象,且上一层级的背景图像为ImageView,执行的是亮度降低处理,此时,若对TextView1以及TextView2进行反色处理,则会导致反色后的文本对象与关联背景区域的颜色相同或相似,因此,终端设备改变原本的反色处理策略,采用亮度降低处理。终端设备通过预处理单元识别各个显示对象的调整策略,并将各个调整策略以及显示对象通过调整单元进行调整,输出目标背景图像以及目标对象,基于目标背景对象以及目标对象生成目标页面。For example, Fig. 10 shows a schematic diagram of a process of displaying a page based on a dark display mode provided by an embodiment of the present application. As shown in Fig. 10, the target page includes four different display objects, namely, a root view Rootview, a background layer ImageView, a first foreground text TextView1, and a second foreground text TextView2. The terminal device imports the above four display objects into the preprocessing unit at the same time, and determines the corresponding preprocessing method, wherein the preprocessing unit can determine the adjustment method of each object to be displayed in turn according to the order of the display levels of each display object. Since Rootview is at the bottom display level, the preprocessing unit first determines the adjustment method of Rootview. The Rootview is a monochrome image, so when adjusting the dark display mode, the monochrome image needs to be inverted; and ImageView is a second-level display object, and it is a multi-color background image, then when adjusting the dark display mode, the brightness value of ImageView is reduced without performing inversion processing; finally, for TextView1 and TextView2, which are third-level display objects, and the background image of the previous level is ImageView, a brightness reduction process is performed. At this time, if TextView1 and TextView2 are inverted, the inverted text objects will be the same or similar in color to the associated background area. Therefore, the terminal device changes the original inversion processing strategy and adopts a brightness reduction process. The terminal device identifies the adjustment strategy of each display object through the preprocessing unit, adjusts each adjustment strategy and the display object through the adjustment unit, outputs the target background image and the target object, and generates the target page based on the target background object and the target object.

在本申请实施例中,通过对目标背景图像进行分块,得到多个候选背景区域,并根据各个前景对象的中心坐标,从候选背景区域中选取关联的目标背景区域,从而能够提高关联背景区域的选取效率,继而减少了目标页面的构建时长。In an embodiment of the present application, the target background image is divided into blocks to obtain multiple candidate background areas, and the associated target background areas are selected from the candidate background areas based on the center coordinates of each foreground object, thereby improving the selection efficiency of the associated background areas and reducing the construction time of the target page.

图11示出了本申请第三实施例提供的一种页面显示的方法S801的具体实现流程图。参见图11,相对于图8所述实施例,本实施例提供的一种页面显示的方法中S801包括:S1101~S1102,具体详述如下:FIG11 shows a specific implementation flow chart of a method S801 for page display provided in the third embodiment of the present application. Referring to FIG11 , relative to the embodiment described in FIG8 , the method S801 for page display provided in this embodiment includes: S1101 to S1102, which are described in detail as follows:

进一步地,所述将所述目标背景图像划分为多个候选背景区域,包括:Furthermore, dividing the target background image into a plurality of candidate background areas comprises:

在S1101中,获取最小前景尺寸,将所述最小前景尺寸作为确定分块尺寸。In S1101, a minimum foreground size is obtained, and the minimum foreground size is used as a determined block size.

在本实施例中,终端设备在对目标背景图像进行区域划分时,需要获取基础区域的大小,即上述的分块尺寸。终端设备可以通过检测目标页面内的包含的前景对象的最小尺寸确定分块尺寸,也可以根据行业标准的最小前景尺寸,确定上述分块尺寸。In this embodiment, when the terminal device divides the target background image into regions, it needs to obtain the size of the basic region, that is, the above-mentioned block size. The terminal device can determine the block size by detecting the minimum size of the foreground object contained in the target page, or it can determine the above-mentioned block size according to the minimum foreground size of the industry standard.

在S1102中,基于所述分块尺寸对所述目标背景图像进行划分,得到多个所述候选背景区域。In S1102, the target background image is divided based on the block size to obtain a plurality of candidate background regions.

在本实施例中,在确定了每个网格对应的分块尺寸后,可以基于该分块尺寸将显示屏划分为多个区域,并根据目标背景图像在显示屏内所覆盖的网格,得到多个候选背景区域。示例性地,图12示出了本申请一实施例提供的候选背景区域的划分示意图。参见图12所示,目标页面包含有两个背景图像,分别为背景图像1以及背景图像2,其中,背景图像1的边界坐标并非与显示屏的边界重叠,终端设备在获取了分块尺寸后,可以基于分块尺寸对整个显示屏进行划分,得到多个分块,背景图像1以及背景图像2可以根据已生成的网格线,进行区域划分,得到多个候选背景区域。其中,背景图像1包含有3*2个候选背景区域,其第一个候选背景区域相对于显示屏的所有背景区域而言,其行列号为第一行,第二列,与屏幕边界之间具有一定的偏移量。In this embodiment, after determining the block size corresponding to each grid, the display screen can be divided into multiple areas based on the block size, and multiple candidate background areas can be obtained according to the grid covered by the target background image in the display screen. By way of example, FIG. 12 shows a schematic diagram of the division of candidate background areas provided by an embodiment of the present application. Referring to FIG. 12, the target page contains two background images, namely background image 1 and background image 2, wherein the boundary coordinates of background image 1 do not overlap with the boundary of the display screen. After obtaining the block size, the terminal device can divide the entire display screen based on the block size to obtain multiple blocks. Background image 1 and background image 2 can be divided into regions according to the generated grid lines to obtain multiple candidate background areas. Among them, background image 1 contains 3*2 candidate background areas, and its first candidate background area has a row and column number of the first row and the second column relative to all background areas of the display screen, and has a certain offset from the screen boundary.

在本申请实施例中,通过识别显示器的分辨率,确定分块尺寸,并基于分块尺寸对目标背景图像进行区域划分,从而得到多个候选背景区域,提高了分块的准确性,避免了前景对象的关联背景区域重叠。In an embodiment of the present application, by identifying the resolution of the display, determining the block size, and dividing the target background image into regions based on the block size, a plurality of candidate background regions are obtained, thereby improving the accuracy of the block division and avoiding overlap of the associated background regions of the foreground object.

图13示出了本申请第四实施例提供的一种页面显示的方法S802的具体实现流程图。参见图13,相对于图8所述实施例,本实施例提供的一种页面显示的方法中S802包括:S1301~S1303,具体详述如下:FIG13 shows a specific implementation flow chart of a method S802 for page display provided in the fourth embodiment of the present application. Referring to FIG13 , relative to the embodiment described in FIG8 , the method S802 for page display provided in this embodiment includes: S1301 to S1303, which are described in detail as follows:

进一步地,所述根据所述前景对象的中心坐标以及所述目标背景图像的边界坐标,从所述候选背景区域中选取与所述前景对象对应的所述关联背景区域,包括:Further, selecting the associated background area corresponding to the foreground object from the candidate background areas according to the center coordinates of the foreground object and the boundary coordinates of the target background image includes:

在S1301中,根据各个候选背景区域的在所述目标背景图像的显示位置,为各个候选背景区域配置关联的基准行列号;In S1301, according to the display position of each candidate background area in the target background image, an associated reference row and column number is configured for each candidate background area;

其中,Colunm0为所述候选背景区域的基准列序号;Row0为所述所述候选背景区域的基准行序号;(SrcX0,SrcY0)为所述候选背景区域的边界坐标;(pX,pY)为所述候选背景区域的中心坐标;(Sizex,Sizey)为所述候选背景区域的区域尺寸。Among them, Colunm0 is the reference column number of the candidate background area; Row0 is the reference row number of the candidate background area; (SrcX0 , SrcY0 ) are the boundary coordinates of the candidate background area; (pX, pY) are the center coordinates of the candidate background area; (Sizex , Sizey ) are the area size of the candidate background area.

在本实施例中,终端设备在对目标背景图像划分为多个候选背景区域后,可以根据各个候选背景区域在目标背景图像内的显示位置,配置对应的基准行列号,通过网格坐标来确定各个候选背景区域的位置,实现了对目标背景图像的降采样处理。In this embodiment, after the terminal device divides the target background image into multiple candidate background areas, it can configure the corresponding reference row and column numbers according to the display position of each candidate background area in the target background image, determine the position of each candidate background area through grid coordinates, and realize downsampling processing of the target background image.

需要说明的是,若目标页面内包含有多个前景对象,则只需执行一次S1301的操作,即确定各个候选背景区域的基准行列号即可,由于通过对目标背景区域进行网格化,在识别关联背景区域时只需确定前景对象的大致位置即可,从而减少了关联背景区域的选取时的运算量,从而能够提高关联背景区域的选取效率。It should be noted that if the target page contains multiple foreground objects, it is only necessary to perform the S1301 operation once, that is, to determine the baseline row and column numbers of each candidate background area. Since the target background area is gridded, it is only necessary to determine the approximate position of the foreground object when identifying the associated background area, thereby reducing the amount of calculation when selecting the associated background area, thereby improving the selection efficiency of the associated background area.

在S1302中,将所述前景对象中心坐标导入预设的行列转换模型,计算所述前景对象的目标行列号;所述行列转换模型具体为:In S1302, the center coordinates of the foreground object are imported into a preset row-column conversion model to calculate the target row and column number of the foreground object; the row-column conversion model is specifically:

将所述前景对象中心坐标导入预设的行列转换模型,计算所述前景对象的目标行列号;所述行列转换模型具体为:The center coordinates of the foreground object are imported into a preset row-column conversion model to calculate the target row and column number of the foreground object; the row-column conversion model is specifically:

其中,Colunm1为所述目标行列号内的列序号;Row1为所述目标行列号内的行序号;(SrcX1,SrcY1)为所述前景对象的中心坐标;(Sizex,Sizey)为所述候选背景区域的区域尺寸;(Targetx,Targety)为所述前景对象的对象尺寸。Among them, Colunm1 is the column number within the target row and column number; Row1 is the row number within the target row and column number; (SrcX1 , SrcY1 ) are the center coordinates of the foreground object; (Sizex , Sizey ) are the area size of the candidate background area; (Targetx , Targety ) are the object size of the foreground object.

在本实施例中,终端设备在计算上述行列号的过程中,可以统一采用向下取整的方式计算目标行列号以及基准行列号,在该情况下,上述的转换公式可以变更为:In this embodiment, when calculating the row and column numbers, the terminal device may uniformly use a rounding-down method to calculate the target row and column numbers and the reference row and column numbers. In this case, the above conversion formula may be changed to:

其中,为取整函数。in, is the rounding function.

举例性地,若某一前景对象的中心坐标为(25,25),而该前景对象的对象尺寸为3*3像素,上述每个候选背景区域的区域尺寸为5*5,则上述目标行编号通过上述公式计算得到的数值为:(25+3/2)/5=5.3,通过取整函数进行向下取整,则为5。For example, if the center coordinates of a foreground object are (25, 25), and the object size of the foreground object is 3*3 pixels, and the area size of each of the candidate background areas is 5*5, then the value of the target row number calculated by the above formula is: (25+3/2)/5=5.3, which is rounded down by the rounding function to 5.

在本实施例中,由于目标背景图像与显示屏之间具有一定的偏移量,为了能够确定前景对象与目标背景图像之间的相对位置,在计算前景对象在目标背景图像内对应的目标行列号时,需要考虑目标背景图像的边界坐标对应的偏移量。其中,该边界坐标具体为与显示屏对应的坐标原点距离最近的边界点。举例性地,若该显示屏的原点坐标为左上角的屏幕边界点,则上述目标背景图像的边界坐标即为目标背景图像的左上角的在显示屏的坐标系内的对应的边界坐标。In this embodiment, since there is a certain offset between the target background image and the display screen, in order to determine the relative position between the foreground object and the target background image, when calculating the target row and column number corresponding to the foreground object in the target background image, it is necessary to consider the offset corresponding to the boundary coordinates of the target background image. Among them, the boundary coordinates are specifically the boundary points closest to the coordinate origin corresponding to the display screen. For example, if the origin coordinates of the display screen are the screen boundary points in the upper left corner, then the boundary coordinates of the target background image are the corresponding boundary coordinates of the upper left corner of the target background image in the coordinate system of the display screen.

图14示出了本申请一实施例提供的目标行列号的选取示意图。参见图14所示,目标背景图像并非与终端设备的屏幕边界完全重合,具有一定的偏移量,即(SrcX0,SrcY0)。在确定该前景对象相对于目标背景区域的目标行列号时,需要考虑上述的偏移量,避免因上述偏移量而导致关联背景区域的选取错位,如图14所示,若不考虑上述的偏移量,前景对象相当于整个显示屏而言,对应的行列号为(3,1),而相对于目标背景区域的行列号为(2,1),因为目标背景图像的横坐标与显示屏的坐标原点之间具有一定的偏移量,若基于行列号为(3,1)获取关联背景区域,则会导致背景区域错位,从而影响后续的调整效果。FIG14 shows a schematic diagram of selecting the target row and column numbers provided by an embodiment of the present application. Referring to FIG14, the target background image does not completely overlap with the screen boundary of the terminal device, and has a certain offset, i.e., (SrcX0 , SrcY0 ). When determining the target row and column numbers of the foreground object relative to the target background area, it is necessary to consider the above-mentioned offset to avoid the selection dislocation of the associated background area due to the above-mentioned offset. As shown in FIG14, if the above-mentioned offset is not considered, the foreground object is equivalent to the entire display screen, and the corresponding row and column numbers are (3, 1), while the row and column numbers relative to the target background area are (2, 1), because there is a certain offset between the horizontal coordinates of the target background image and the coordinate origin of the display screen. If the associated background area is obtained based on the row and column numbers (3, 1), it will cause the background area to be dislocated, thereby affecting the subsequent adjustment effect.

在S1303中,选取所述基准行列号与所述目标行列号匹配的所述候选背景区域作为所述前景对象的关联背景区域。In S1303, the candidate background region whose reference row and column number matches the target row and column number is selected as the associated background region of the foreground object.

在本实施例中,终端设备可以从候选背景区域中,选取基准行列号与目标行列号相匹配的候选背景区域作为关联背景区域。In this embodiment, the terminal device may select, from the candidate background regions, a candidate background region whose reference row and column number matches the target row and column number as the associated background region.

在本申请实施例中,通过对候选背景区域进行行列编码,并根据行列号为每个前景对象配置对应的关联背景区域,能够提高关联背景区域的选取效率。In the embodiment of the present application, by performing row and column encoding on the candidate background areas and configuring a corresponding associated background area for each foreground object according to the row and column numbers, the efficiency of selecting the associated background areas can be improved.

图15示出了本申请第五实施例提供的一种页面显示的方法S304的具体实现流程图。参见图15,相对于图3所述实施例,本实施例提供的一种页面显示的方法中S304包括:S1501~S1504,具体详述如下:FIG15 shows a specific implementation flow chart of a method S304 for page display provided in the fifth embodiment of the present application. Referring to FIG15 , relative to the embodiment described in FIG3 , the method S304 for page display provided in this embodiment includes: S1501 to S1504, which are described in detail as follows:

进一步地,所述显示模式为深色显示模式,则所述根据所述关联背景区域的背景像素值,将所述前景对象调整为与所述显示模式对应的目标对象,包括:Furthermore, if the display mode is a dark display mode, then adjusting the foreground object to a target object corresponding to the display mode according to the background pixel value of the associated background area includes:

在S1501中,获取关联背景区域的中心坐标的像素值以及透明度。In S1501, the pixel value and transparency of the center coordinates of the associated background area are obtained.

在本实施例中,为了提高调整的效率,终端设备可以根据目标背景图像的各个候选背景区域的中心坐标的像素值,作为整个候选背景区域的特征像素值,从而在进行前景图像的调整过程中,可以将目标背景图像降采样为一网格图像,每个网格图像的像素值以及透明度可以根据中心坐标的像素值以及透明度进行确定,从而能够减少目标背景图像在缓存区域内的存储空间,并且能够提高后续操作的处理效率。In this embodiment, in order to improve the efficiency of adjustment, the terminal device can use the pixel value of the center coordinates of each candidate background area of the target background image as the characteristic pixel value of the entire candidate background area, so that in the process of adjusting the foreground image, the target background image can be downsampled into a grid image, and the pixel value and transparency of each grid image can be determined according to the pixel value and transparency of the center coordinate, thereby reducing the storage space of the target background image in the cache area and improving the processing efficiency of subsequent operations.

在S1502中,根据所述中心坐标的所述像素值以及所述透明度,确定所述关联背景区域的背景亮度值。In S1502, the background brightness value of the associated background area is determined according to the pixel value of the central coordinate and the transparency.

在本实施例中,背景亮度值除了与像素值相关外,还与目标背景图像的透明度相关,根据透明度的大小,可以确定下一层级图层对于当前目标背景图像的颜色贡献比例,例如目标背景图像的下一层级的图像为白色图像,且当前的透明度并不为0,则在原有的像素值的基础上,叠加增加白色的比重,从而提高整体图像的亮度值,基于此,为了准确确定目标背景图像的像素值,以便确定前景对象的调整策略,终端设备可以根据中心坐标的像素值以及透明度,计算得到关联背景区域的背景亮度值。In this embodiment, in addition to being related to the pixel value, the background brightness value is also related to the transparency of the target background image. According to the degree of transparency, the color contribution ratio of the next-level layer to the current target background image can be determined. For example, if the image of the next level of the target background image is a white image and the current transparency is not 0, then on the basis of the original pixel value, the proportion of white is superimposed to increase the brightness value of the overall image. Based on this, in order to accurately determine the pixel value of the target background image in order to determine the adjustment strategy of the foreground object, the terminal device can calculate the background brightness value of the associated background area according to the pixel value of the center coordinate and the transparency.

在S1503中,若所述背景亮度值大于预设的亮度阈值,则对所述前景对象进行降低亮度处理,生成所述目标对象。In S1503, if the background brightness value is greater than a preset brightness threshold, the foreground object is subjected to brightness reduction processing to generate the target object.

在本实施例中,由于当前的显示模式为深色显示模式,因此需要使得整体画面的亮度值,此时若检测到关联背景区域的亮度值大于预设的亮度阈值,则表示当前的关联背景区域的处于较高亮度,而前景对象在调整前的默认颜色往往是黑色等低亮度颜色,此时若对上述颜色进行反色,则会变更为高亮度的颜色,从而导致了调整后的关联背景图像与调整后的前景对象的颜色相同或相似,为了避免上述情况发生,终端设备则不对前景对象进行反色,而是对前景对象进行降低亮度处理,从而生成亮度较低的目标对象。In this embodiment, since the current display mode is a dark display mode, the brightness value of the entire picture needs to be adjusted. If the brightness value of the associated background area is detected to be greater than the preset brightness threshold, it means that the current associated background area is at a higher brightness, and the default color of the foreground object before adjustment is often a low-brightness color such as black. If the above color is inverted at this time, it will be changed to a high-brightness color, resulting in the adjusted associated background image being the same or similar to the color of the adjusted foreground object. In order to avoid the above situation, the terminal device does not invert the foreground object, but reduces the brightness of the foreground object, thereby generating a target object with lower brightness.

其中,进行降低亮度处理的方式可以为:终端设备将前景对象转换为HSV格式的图像,并对亮度V图层的数值进行调整,基于调整后的V图层与其余两个图像进行合并,从而实现了降低前景对象的亮度的目的。Among them, the method for reducing the brightness can be: the terminal device converts the foreground object into an image in HSV format, adjusts the value of the brightness V layer, and merges the adjusted V layer with the other two images, thereby achieving the purpose of reducing the brightness of the foreground object.

在S1504中,若所述背景亮度值小于或等于所述亮度阈值,则对所述前景对象进行反色处理,生成所述目标对象。In S1504, if the background brightness value is less than or equal to the brightness threshold, the foreground object is inverted to generate the target object.

在本实施例中,终端设备若检测到当前的关联背景区域的亮度值小于或等于亮度阈值,则可以对前景对象进行反色处理,由于前景对象在调整前的默认颜色往往是黑色等低亮度颜色,因此通过反色处理以后会变更为亮度较高的颜色,此时与关联背景之间存在较高的颜色对比度,使得前景对象清晰可见,提高了前景对象的可见度。In this embodiment, if the terminal device detects that the brightness value of the current associated background area is less than or equal to the brightness threshold, the foreground object can be inverted. Since the default color of the foreground object before adjustment is often a low-brightness color such as black, it will be changed to a higher-brightness color after the inversion process. At this time, there is a higher color contrast between the foreground object and the associated background, making the foreground object clearly visible, thereby improving the visibility of the foreground object.

在本申请实施例中,通过识别获取关联背景区域的中心坐标的像素值以及透明度,将确定关联背景区域的亮度值,基于亮度值确定前景对象的调整策略,避免背景与前景对象之间颜色相同或相似,提高了调整效果。In an embodiment of the present application, by identifying and obtaining the pixel value and transparency of the center coordinates of the associated background area, the brightness value of the associated background area is determined, and the adjustment strategy of the foreground object is determined based on the brightness value to avoid the background and foreground objects from having the same or similar colors, thereby improving the adjustment effect.

图16示出了本申请第六实施例提供的一种页面显示的方法的具体实现流程图。参见图16,相对于图15所述实施例,本实施例提供的一种页面显示的方法在所述根据所述中心坐标的所述像素值以及所述透明度,确定所述关联背景区域的亮度值之后,还包括:S1601~S1603,具体详述如下:FIG16 shows a specific implementation flow chart of a method for displaying a page provided by the sixth embodiment of the present application. Referring to FIG16 , relative to the embodiment described in FIG15 , the method for displaying a page provided by this embodiment further includes, after determining the brightness value of the associated background area according to the pixel value of the center coordinate and the transparency: S1601 to S1603, which are described in detail as follows:

进一步地,在所述根据所述中心坐标的所述像素值以及所述透明度,确定所述关联背景区域的亮度值之后,还包括:Further, after determining the brightness value of the associated background area according to the pixel value of the center coordinate and the transparency, the method further includes:

在S1601中,根据所述前景对象内各个像素点的所述像素值,确定所述前景对象对应的特征亮度值。In S1601, a characteristic brightness value corresponding to the foreground object is determined according to the pixel value of each pixel point in the foreground object.

在本实施例中,终端设备除了可以根据亮度值直接确定前景图像的调整策略外,还可以根据前景对象的实际亮度值,确定调整策略。在该情况下,终端设备可以根据前景对象内各个像素点的像素值,计算该前景对象的像素均值,并基于该像素均值确定前景对象的特征亮度值。在一种可能的实现方式中,终端设备可以选取前景对象的中心坐标的像素值,作为前景对象的特征像素值,并基于中心坐标的特征像素值计算得到前景对象的特征亮度值。In this embodiment, in addition to directly determining the adjustment strategy of the foreground image according to the brightness value, the terminal device can also determine the adjustment strategy according to the actual brightness value of the foreground object. In this case, the terminal device can calculate the pixel mean of the foreground object according to the pixel values of each pixel point in the foreground object, and determine the characteristic brightness value of the foreground object based on the pixel mean. In a possible implementation, the terminal device can select the pixel value of the center coordinate of the foreground object as the characteristic pixel value of the foreground object, and calculate the characteristic brightness value of the foreground object based on the characteristic pixel value of the center coordinate.

在S1602中,若所述背景亮度值与所述特征亮度值之间的亮度差值大于预设的反色阈值,则对所述前景对象进行降低亮度处理,生成所述目标对象。In S1602, if the brightness difference between the background brightness value and the characteristic brightness value is greater than a preset inversion threshold, the foreground object is subjected to brightness reduction processing to generate the target object.

在本实施例中,终端设备若检测到背景亮度值与前景对象在调整前的特征亮度值之间的亮度差值大于预设的反色阈值,则表示调整前的对比度已经满足显示要求,无需对前景对象进行反色处理,只需调整亮度即可。In this embodiment, if the terminal device detects that the brightness difference between the background brightness value and the characteristic brightness value of the foreground object before adjustment is greater than the preset inversion threshold, it means that the contrast before adjustment has met the display requirements, and there is no need to invert the foreground object, only the brightness needs to be adjusted.

在S1603中,若所述亮度差值小于或等于所述反色阈值,则对所述前景对象进行反色处理,生成所述目标对象。In S1603, if the brightness difference is less than or equal to the inversion threshold, the foreground object is inverted to generate the target object.

在本实施例中,终端设备若检测到背景亮度值与前景对象在调整前的特征亮度值之间的亮度差值小于或等于预设的反色阈值,则表示调整前的对比度相差较少,此时对前景对象进行反色处理,则可以提高前景对象与背景图像之间的对比度,因此进行反色处理。In this embodiment, if the terminal device detects that the brightness difference between the background brightness value and the characteristic brightness value of the foreground object before adjustment is less than or equal to the preset inversion threshold, it means that the contrast difference before adjustment is small. At this time, inversion processing is performed on the foreground object, which can improve the contrast between the foreground object and the background image, so inversion processing is performed.

在本申请实施例中,通过获取前景对象的特征亮度值,根据特征亮度值与背景亮度值之间的差值确定调整策略,能够提高调整操作的准确性。In the embodiment of the present application, by acquiring the characteristic brightness value of the foreground object and determining the adjustment strategy according to the difference between the characteristic brightness value and the background brightness value, the accuracy of the adjustment operation can be improved.

图17示出了本申请第七实施例提供的一种页面显示的方法S302的具体实现流程图。参见图17,相对于图3、图8、图11、图13、图15以及图16任一所述实施例,本实施例提供的一种页面显示的方法在S302包括:S1701~S1703,具体详述如下:FIG17 shows a specific implementation flow chart of a method S302 for displaying a page provided in the seventh embodiment of the present application. Referring to FIG17 , relative to any of the embodiments described in FIG3 , FIG8 , FIG11 , FIG13 , FIG15 and FIG16 , a method for displaying a page provided in this embodiment includes in S302: S1701 to S1703, which are described in detail as follows:

进一步地,所述识别所述目标页面内各个前景对象在所述目标背景图像内的关联背景区域,包括:Furthermore, the identifying the associated background area of each foreground object in the target page in the target background image includes:

在S1701中,确定所述前景对象在所述目标页面内的显示层级。In S1701, the display level of the foreground object in the target page is determined.

在本实施例中,目标页面内可以包含有多个图层,每个图层对应一个显示层级,前景对象往往处于较高的显示层级,而背景图像往往处于较低的显示层级,从而实现了以背景图像为底,前景对象覆盖与背景图像之上的显示效果。在该情况下,一个页面可以通过多个背景图像进行叠加构成整个页面的背景,即一个前景对象可以在不同的显示层级对应不同的背景图像,而影响前景对象的可见度以及是否会出现颜色相同或相似的情况时,往往是受相邻层级的背景图像影响。在该情况下,终端设备需要确定与前景对象处于相邻显示层级的背景图像,因此需要识别该前景对象在目标页面内的显示层级。In this embodiment, the target page may include multiple layers, each layer corresponds to a display level, the foreground object is often at a higher display level, and the background image is often at a lower display level, thereby achieving a display effect in which the background image is used as the base and the foreground object covers the background image. In this case, a page can be superimposed with multiple background images to form the background of the entire page, that is, a foreground object can correspond to different background images at different display levels, and the visibility of the foreground object and whether the color is the same or similar are often affected by the background image at the adjacent level. In this case, the terminal device needs to determine the background image at the adjacent display level to the foreground object, and therefore needs to identify the display level of the foreground object in the target page.

在S1702中,在所述目标页面内选取与所述显示层级相邻层级的目标背景图像作为所述前景对象的关联背景图像。In S1702, a target background image at a level adjacent to the display level is selected in the target page as an associated background image of the foreground object.

在本实施例中,终端设备可以获取得到各个目标背景图像的显示层级,并选取显示层级与前景对象的显示层级相邻的目标背景图像作为前景对象的关联背景图像。In this embodiment, the terminal device may obtain the display level of each target background image, and select a target background image whose display level is adjacent to the display level of the foreground object as the associated background image of the foreground object.

在S1703中,确定所述前景对象在所述关联背景图像内的关联背景区域。In S1703, an associated background area of the foreground object in the associated background image is determined.

在本实施例中,终端设备在确定了前进对象的关联背景对象后,可以根据前景对象的显示位置,从关联背景图像中确定出对应的关联背景区域。其中,确定关联背景区域的方式可以参见S302的相关描述,还可以采用第二至四实施例提供的方式进行确定,在此不再赘述。In this embodiment, after determining the associated background object of the forward object, the terminal device can determine the corresponding associated background area from the associated background image according to the display position of the foreground object. The method for determining the associated background area can refer to the relevant description of S302, and can also be determined by the methods provided in the second to fourth embodiments, which will not be repeated here.

在本申请实施例中,通过确定与前景对象层级相邻的目标背景图像作为关联背景图像,从而在多个背景图像叠加的情况下,能够准确确定关联的背景区域,提高了后续调整方式确定的准确性。In an embodiment of the present application, by determining the target background image adjacent to the foreground object level as the associated background image, the associated background area can be accurately determined when multiple background images are superimposed, thereby improving the accuracy of determining the subsequent adjustment method.

图18示出了本申请第八实施例提供的一种页面显示的方法S303的具体实现流程图。参见图18,相对于图3、图8、图11、图13、图15以及图16任一所述实施例,本实施例提供的一种页面显示的方法在S303包括:S1801~S1802,具体详述如下:FIG18 shows a specific implementation flow chart of a method S303 for displaying a page provided in the eighth embodiment of the present application. Referring to FIG18 , relative to any of the embodiments described in FIG3 , FIG8 , FIG11 , FIG13 , FIG15 and FIG16 , a method for displaying a page provided in this embodiment includes: S1801 to S1802, which are described in detail as follows:

进一步地,所述根据所述关联背景区域的背景像素值,将所述前景对象调整为与所述显示模式对应的目标对象,包括:Further, adjusting the foreground object to a target object corresponding to the display mode according to the background pixel value of the associated background area includes:

在S1801中,根据所述关联背景区域的背景像素值以及所述前景对象的像素值,生成所述前景对象对应的预览对象。In S1801, a preview object corresponding to the foreground object is generated according to the background pixel value of the associated background area and the pixel value of the foreground object.

在本实施例中,终端设备除了根据上下层级确定前景对象的调整方式外,还可以根据统一层级相邻的前景对象的调整方式,确定自身的调整方式,从而保证了整体显示效果的一致性。在该情况下,终端设备可以根据关联背景区域的背景像素值以及前景对象的像素值,生成前景对象的预览对象。对所有前景对象均执行上述方式,此时,该预览对象并非最后输出的调整后的前景对象的显示效果。In this embodiment, in addition to determining the adjustment method of the foreground object according to the upper and lower levels, the terminal device can also determine its own adjustment method according to the adjustment methods of the adjacent foreground objects at the same level, thereby ensuring the consistency of the overall display effect. In this case, the terminal device can generate a preview object of the foreground object according to the background pixel value of the associated background area and the pixel value of the foreground object. The above method is executed for all foreground objects. At this time, the preview object is not the display effect of the adjusted foreground object output at the end.

在S1802中,根据所述预览对象对应的所有关联对象的像素值以及所述预览对象的像素值,生成所述前景对象对应的所述目标对象。In S1802, the target object corresponding to the foreground object is generated according to the pixel values of all associated objects corresponding to the preview object and the pixel value of the preview object.

在本实施例中,终端设备可以根据所有预览对象生成对应的预览页面,终端设备可以根据各个预览对象的显示位置,确定每个预览对象对应的关联对象。其中,该关联对象为通过S1801处理后,与预览对象存在关联关系的其他预览对象。上述关联关系可以为两个预览对象之间的显示位置相邻;还可以两个预览对象的对象类型相同;特别地,若两个预览对象为文本对象,且上述两个预览对象位于同一语句或段落,则可以识别上述两个预览对象存在关联关系。In this embodiment, the terminal device can generate a corresponding preview page based on all preview objects, and the terminal device can determine the associated object corresponding to each preview object based on the display position of each preview object. The associated object is another preview object that has an associated relationship with the preview object after being processed by S1801. The above-mentioned association relationship can be that the display positions of the two preview objects are adjacent; the object types of the two preview objects can also be the same; in particular, if the two preview objects are text objects, and the above-mentioned two preview objects are located in the same sentence or paragraph, it can be recognized that the above-mentioned two preview objects have an associated relationship.

在本实施例中,终端设备可以识别预览对象的像素值与关联对象的像素值之间的差值是否小于预设的关联阈值,若是,则识别预览对象与关联对象之间的显示效果统一,将预览对象作为目标对象;反之,若检测到预览对象与关联对象之间的像素差值大于或等于关联阈值,则识别预览对象与关联对象之间的显示效果不统一,此时可以根据预览对象以及关联对象的像素均值,调整预览对象以及关联对象,将调整后的预览对象作为目标对象,进行显示。In this embodiment, the terminal device can identify whether the difference between the pixel value of the preview object and the pixel value of the associated object is less than a preset association threshold. If so, it is identified that the display effects between the preview object and the associated object are unified, and the preview object is used as the target object. Conversely, if it is detected that the pixel difference between the preview object and the associated object is greater than or equal to the association threshold, it is identified that the display effects between the preview object and the associated object are not unified. At this time, the preview object and the associated object can be adjusted according to the pixel mean of the preview object and the associated object, and the adjusted preview object can be used as the target object for display.

图19示出了本申请一实施例提供的目标对象的生成示意图。参见图19的(a)为基于各个预览对象生成的预览页面;而图19的(b)为基于关联对象对预览对象进行调整后的目标页面。参见图19可以确定,该预览页面内包含有四个前景对象,分别为文本“前”、“景”、“对”以及“像”,其中,根据关联背景区域进行调整后,文本“前”的预览对象调整为白色,而其他文本的预览对象调整为黑色。而由于上述四个对象之间为关联对象,因此需要统一显示效果,因此可以将文本“前”调整为与其他关联对象的调整方式一致的显示效果,即调整为黑色,从而保证关联文本显示效果的一致性。FIG19 shows a schematic diagram of generating a target object provided by an embodiment of the present application. Referring to FIG19 (a), a preview page is generated based on each preview object; and FIG19 (b) is a target page after the preview object is adjusted based on the associated object. Referring to FIG19, it can be determined that the preview page contains four foreground objects, namely the texts "front", "scene", "to", and "image", wherein, after adjustment according to the associated background area, the preview object of the text "front" is adjusted to white, while the preview objects of other texts are adjusted to black. Since the above four objects are associated objects, the display effects need to be unified, so the text "front" can be adjusted to a display effect consistent with the adjustment method of other associated objects, that is, adjusted to black, thereby ensuring the consistency of the display effects of the associated texts.

在本申请实施例中,通过各个前景对象在同一层级的关联对象,根据关联对象确定前景对象的调整策略,保证了同一层级的关联对象之间显示效果的统一性,提高了显示效果。In the embodiment of the present application, by using the associated objects at the same level of each foreground object, the adjustment strategy of the foreground object is determined according to the associated objects, thereby ensuring the uniformity of the display effects between the associated objects at the same level and improving the display effect.

应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

对应于上文实施例所述的页面显示的方法,图20示出了本申请实施例提供的页面显示的装置的结构框图,为了便于说明,仅示出了与本申请实施例相关的部分。Corresponding to the page display method described in the above embodiment, FIG20 shows a structural block diagram of the page display device provided in the embodiment of the present application. For the sake of convenience of explanation, only the part related to the embodiment of the present application is shown.

参照图20,该页面显示的装置包括:Referring to FIG. 20 , the devices displayed on the page include:

背景图像调整单元201,用于将目标页面内的原始背景图像,调整为与当前的显示模式对应的目标背景图像;The background image adjustment unit 201 is used to adjust the original background image in the target page to a target background image corresponding to the current display mode;

关联背景区域识别单元202,用于识别所述目标页面内各个前景对象在所述目标背景图像内的关联背景区域;The associated background region identifying unit 202 is used to identify the associated background region of each foreground object in the target page in the target background image;

前景对象调整单元203,用于根据所述关联背景区域的背景像素值,将所述前景对象调整为与所述显示模式对应的目标对象;a foreground object adjusting unit 203, configured to adjust the foreground object to a target object corresponding to the display mode according to the background pixel value of the associated background area;

目标页面生成单元204,用于根据所有所述目标对象以及所述目标背景图像,生成所述目标页面。The target page generating unit 204 is configured to generate the target page according to all the target objects and the target background image.

可选地,所述关联背景区域识别单元202包括:Optionally, the associated background area identification unit 202 includes:

候选背景区域划分单元,用于将所述目标背景图像划分为多个候选背景区域;A candidate background region division unit, used for dividing the target background image into a plurality of candidate background regions;

候选背景区域选取单元,用于根据所述前景对象的中心坐标以及所述目标背景图像的边界坐标,从所述候选背景区域中选取与所述前景对象对应的所述关联背景区域。The candidate background area selection unit is used to select the associated background area corresponding to the foreground object from the candidate background areas according to the center coordinates of the foreground object and the boundary coordinates of the target background image.

可选地,所述候选背景区域划分单元包括:Optionally, the candidate background area division unit includes:

分块尺寸确定单元,用于获取最小前景尺寸,将所述最小前景尺寸作为确定分块尺寸;A block size determination unit, used to obtain a minimum foreground size, and use the minimum foreground size as a determined block size;

网格划分单元,用于基于所述分块尺寸对所述目标背景图像进行划分,得到多个所述候选背景区域。A grid division unit is used to divide the target background image based on the block size to obtain a plurality of candidate background areas.

可选地,所述候选背景区域选取单元包括:Optionally, the candidate background area selection unit includes:

基准行列号获取单元,用于根据各个候选背景区域的在所述目标背景图像的显示位置,为各个候选背景区域配置关联的基准行列号;A reference row and column number acquisition unit, configured to configure an associated reference row and column number for each candidate background area according to the display position of each candidate background area in the target background image;

其中,Colunm0为所述候选背景区域的基准列序号;Row0为所述所述候选背景区域的基准行序号;(SrcX0,SrcY0)为所述候选背景区域的边界坐标;(pX,pY)为所述候选背景区域的中心坐标;(Sizex,Sizey)为所述候选背景区域的区域尺寸;Wherein, Colunm0 is the base column number of the candidate background area; Row0 is the base row number of the candidate background area; (SrcX0 , SrcY0 ) is the boundary coordinate of the candidate background area; (pX, pY) is the center coordinate of the candidate background area; (Sizex , Sizey ) is the area size of the candidate background area;

目标行列号获取单元,用于将所述前景对象中心坐标导入预设的行列转换模型,计算所述前景对象的目标行列号;所述行列转换模型具体为:The target row and column number acquisition unit is used to import the center coordinates of the foreground object into a preset row and column conversion model to calculate the target row and column number of the foreground object; the row and column conversion model is specifically:

将所述前景对象中心坐标导入预设的行列转换模型,计算所述前景对象的目标行列号;所述行列转换模型具体为:The center coordinates of the foreground object are imported into a preset row-column conversion model to calculate the target row and column number of the foreground object; the row-column conversion model is specifically:

其中,Colunm1为所述目标行列号内的列序号;Row1为所述目标行列号内的行序号;(SrcX1,SrcY1)为所述前景对象的中心坐标;(Sizex,Sizey)为所述候选背景区域的区域尺寸;(Targetx,Targety)为所述前景对象的对象尺寸;Wherein, Colunm1 is the column number within the target row and column number; Row1 is the row number within the target row and column number; (SrcX1 , SrcY1 ) are the center coordinates of the foreground object; (Sizex , Sizey ) are the area size of the candidate background area; (Targetx , Targety ) are the object size of the foreground object;

关联背景区域确定单元,用于选取所述基准行列号与所述目标行列号匹配的所述候选背景区域作为所述前景对象的关联背景区域。The associated background region determining unit is used to select the candidate background region whose reference row and column number matches the target row and column number as the associated background region of the foreground object.

可选地,所述显示模式为深色显示模式,所述前景对象调整单元203包括:Optionally, the display mode is a dark display mode, and the foreground object adjustment unit 203 includes:

中心坐标获取单元,用于获取关联背景区域的中心坐标的像素值以及透明度;A center coordinate acquisition unit, used to acquire the pixel value and transparency of the center coordinate of the associated background area;

背景亮度值确定单元,用于根据所述中心坐标的所述像素值以及所述透明度,确定所述关联背景区域的背景亮度值;A background brightness value determining unit, configured to determine a background brightness value of the associated background area according to the pixel value of the central coordinate and the transparency;

第一降低亮度处理单元,用于若所述背景亮度值大于预设的亮度阈值,则对所述前景对象进行降低亮度处理,生成所述目标对象;A first brightness reduction processing unit, configured to reduce the brightness of the foreground object to generate the target object if the background brightness value is greater than a preset brightness threshold;

第一反色处理单元,用于若所述背景亮度值小于或等于所述亮度阈值,则对所述前景对象进行反色处理,生成所述目标对象。The first color inversion processing unit is used to perform color inversion processing on the foreground object to generate the target object if the background brightness value is less than or equal to the brightness threshold.

可选地,所述页面显示单元还包括:Optionally, the page display unit further includes:

特征亮度值获取单元,用于根据所述前景对象内各个像素点的所述像素值,确定所述前景对象对应的特征亮度值;A characteristic brightness value acquisition unit, used to determine a characteristic brightness value corresponding to the foreground object according to the pixel value of each pixel point in the foreground object;

第二降低亮度处理单元,用于若所述背景亮度值与所述特征亮度值之间的亮度差值大于预设的反色阈值,则对所述前景对象进行降低亮度处理,生成所述目标对象;A second brightness reduction processing unit is used to reduce the brightness of the foreground object to generate the target object if the brightness difference between the background brightness value and the characteristic brightness value is greater than a preset inversion threshold;

第二反色处理单元,用于若所述亮度差值小于或等于所述反色阈值,则对所述前景对象进行反色处理,生成所述目标对象。The second color inversion processing unit is used to perform color inversion processing on the foreground object to generate the target object if the brightness difference is less than or equal to the color inversion threshold.

可选地,所述关联背景区域识别单元202包括:Optionally, the associated background area identification unit 202 includes:

显示层级确定单元,用于确定所述前景对象在所述目标页面内的显示层级;A display level determination unit, used to determine the display level of the foreground object in the target page;

关联背景图像确定单元,用于在所述目标页面内选取与所述显示层级相邻层级的目标背景图像作为所述前景对象的关联背景图像;An associated background image determining unit, configured to select, within the target page, a target background image at a level adjacent to the display level as an associated background image for the foreground object;

关联背景区域确定单元,用于确定所述前景对象在所述关联背景图像内的关联背景区域。The associated background area determining unit is used to determine the associated background area of the foreground object in the associated background image.

可选地,所述前景对象调整单元203包括:Optionally, the foreground object adjustment unit 203 includes:

预览对象生成单元,用于根据所述关联背景区域的背景像素值以及所述前景对象的像素值,生成所述前景对象对应的预览对象;A preview object generating unit, configured to generate a preview object corresponding to the foreground object according to the background pixel value of the associated background area and the pixel value of the foreground object;

关联对象调整单元,用于根据所述预览对象对应的所有关联对象的像素值以及所述预览对象的像素值,生成所述前景对象对应的所述目标对象。The associated object adjustment unit is used to generate the target object corresponding to the foreground object according to the pixel values of all associated objects corresponding to the preview object and the pixel value of the preview object.

因此,本申请实施例提供的页面显示的装置同样可以通过对目标页面内的原始背景图像进行调整,得到目标背景图像,继而根据各个前景对象在目标背景图像内的关联背景区域的亮度值,确定前景对象的调整策略,并根据调整策略生成前景对象对应的目标对象,最后根据目标背景图像以及目标对象生成目标页面,在调整前景对象时,根据关联的背景区域确定调整策略,避免了调整后的背景图像与前景对象出现颜色相同或相似,提高了页面的显示效果。Therefore, the page display device provided in the embodiment of the present application can also obtain the target background image by adjusting the original background image in the target page, and then determine the adjustment strategy of the foreground object according to the brightness value of the associated background area of each foreground object in the target background image, and generate the target object corresponding to the foreground object according to the adjustment strategy, and finally generate the target page according to the target background image and the target object. When adjusting the foreground object, the adjustment strategy is determined according to the associated background area, which avoids the adjusted background image and the foreground object having the same or similar color, thereby improving the display effect of the page.

图21为本申请一实施例提供的终端设备的结构示意图。如图21所示,该实施例的终端设备21包括:至少一个处理器210(图21中仅示出一个)处理器、存储器211以及存储在所述存储器211中并可在所述至少一个处理器210上运行的计算机程序212,所述处理器210执行所述计算机程序212时实现上述任意各个页面显示的方法实施例中的步骤。Figure 21 is a schematic diagram of the structure of a terminal device provided in an embodiment of the present application. As shown in Figure 21, the terminal device 21 of this embodiment includes: at least one processor 210 (only one is shown in Figure 21), a memory 211, and a computer program 212 stored in the memory 211 and executable on the at least one processor 210, and when the processor 210 executes the computer program 212, the steps in the above-mentioned method embodiment of any of the page display methods are implemented.

所述终端设备21可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。该终端设备可包括,但不仅限于,处理器210、存储器211。本领域技术人员可以理解,图21仅仅是终端设备21的举例,并不构成对终端设备21的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如还可以包括输入输出设备、网络接入设备等。The terminal device 21 may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The terminal device may include, but is not limited to, a processor 210 and a memory 211. Those skilled in the art will appreciate that FIG. 21 is merely an example of the terminal device 21 and does not constitute a limitation on the terminal device 21. The terminal device 21 may include more or fewer components than shown in the figure, or may combine certain components, or different components, and may also include, for example, input and output devices, network access devices, etc.

所称处理器210可以是中央处理单元(Central Processing Unit,CPU),该处理器210还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The processor 210 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

所述存储器211在一些实施例中可以是所述终端设备21的内部存储单元,例如终端设备21的硬盘或内存。所述存储器211在另一些实施例中也可以是所述终端设备21的外部存储设备,例如所述终端设备21上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器211还可以既包括所述终端设备21的内部存储单元也包括外部存储设备。所述存储器211用于存储操作系统、应用程序、引导装载程序(BootLoader)、数据以及其他程序等,例如所述计算机程序的程序代码等。所述存储器211还可以用于暂时地存储已经输出或者将要输出的数据。In some embodiments, the memory 211 may be an internal storage unit of the terminal device 21, such as a hard disk or memory of the terminal device 21. In other embodiments, the memory 211 may also be an external storage device of the terminal device 21, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device 21. Further, the memory 211 may also include both an internal storage unit and an external storage device of the terminal device 21. The memory 211 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program. The memory 211 may also be used to temporarily store data that has been output or is to be output.

需要说明的是,上述装置/单元之间的信息交互、执行过程等内容,由于与本申请方法实施例基于同一构思,其具体功能及带来的技术效果,具体可参见方法实施例部分,此处不再赘述。It should be noted that the information interaction, execution process, etc. between the above-mentioned devices/units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

本申请实施例还提供了一种网络设备,该网络设备包括:至少一个处理器、存储器以及存储在所述存储器中并可在所述至少一个处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现上述任意各个方法实施例中的步骤。An embodiment of the present application also provides a network device, which includes: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, wherein the processor implements the steps in any of the above-mentioned method embodiments when executing the computer program.

本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现可实现上述各个方法实施例中的步骤。An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

本申请实施例提供了一种计算机程序产品,当计算机程序产品在移动终端上运行时,使得移动终端执行时实现可实现上述各个方法实施例中的步骤。An embodiment of the present application provides a computer program product. When the computer program product runs on a mobile terminal, the mobile terminal can implement the steps in the above-mentioned method embodiments when executing the computer program product.

所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质至少可以包括:能够将计算机程序代码携带到拍照装置/终端设备的任何实体或装置、记录介质、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,RandomAccess Memory)、电载波信号、电信信号以及软件分发介质。例如U盘、移动硬盘、磁碟或者光盘等。在某些司法管辖区,根据立法和专利实践,计算机可读介质不可以是电载波信号和电信信号。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 computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the camera/terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), electric carrier signal, telecommunication signal and software distribution medium. For example, USB flash drive, mobile hard disk, disk or optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.

在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

在本申请所提供的实施例中,应该理解到,所揭露的装置/网络设备和方法,可以通过其它的方式实现。例如,以上所描述的装置/网络设备实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。In the embodiments provided in the present application, it should be understood that the disclosed devices/network equipment and methods can be implemented in other ways. For example, the device/network equipment embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, 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.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims (10)

Translated fromChinese
1.一种页面显示的方法,其特征在于,包括:1. A method for displaying a page, comprising:将目标页面内的原始背景图像,调整为与当前的显示模式对应的目标背景图像;Adjust the original background image in the target page to a target background image corresponding to the current display mode;识别所述目标页面内各个前景对象在所述目标背景图像内的关联背景区域;Identifying the associated background area of each foreground object in the target page in the target background image;根据所述关联背景区域的背景像素值,将所述前景对象调整为与所述显示模式对应的目标对象;adjusting the foreground object to a target object corresponding to the display mode according to the background pixel value of the associated background area;根据所有所述目标对象以及所述目标背景图像,生成所述目标页面;Generate the target page according to all the target objects and the target background image;所述识别所述目标页面内各个前景对象在所述目标背景图像内的关联背景区域,包括:The identifying the associated background area of each foreground object in the target page in the target background image includes:将所述目标背景图像划分为多个候选背景区域,包括:以预设的区域形状为单位对所述目标背景图像进行划分,得到多个所述候选背景区域;Dividing the target background image into a plurality of candidate background regions includes: dividing the target background image into a plurality of candidate background regions in units of preset region shapes to obtain a plurality of candidate background regions;根据所述前景对象的中心坐标以及所述目标背景图像的边界坐标,从所述候选背景区域中选取与所述前景对象对应的所述关联背景区域;Selecting the associated background area corresponding to the foreground object from the candidate background areas according to the center coordinates of the foreground object and the boundary coordinates of the target background image;所述根据所述前景对象的中心坐标以及所述目标背景图像的边界坐标,从所述候选背景区域中选取与所述前景对象对应的所述关联背景区域,包括:The selecting the associated background area corresponding to the foreground object from the candidate background areas according to the center coordinates of the foreground object and the boundary coordinates of the target background image comprises:根据各个候选背景区域的在所述目标背景图像的显示位置,为各个候选背景区域配置关联的基准行列号;所述基准行列号是通过网格坐标确定各个所述候选背景区域的位置;According to the display position of each candidate background area in the target background image, each candidate background area is assigned an associated reference row and column number; the reference row and column number is a position of each candidate background area determined by grid coordinates;将所述前景对象中心坐标导入预设的行列转换模型,计算所述前景对象的目标行列号,包括:采用向下取整的方式计算目标行列号以及基准行列号;Importing the center coordinates of the foreground object into a preset row-column conversion model to calculate the target row-column number of the foreground object, including: calculating the target row-column number and the reference row-column number by rounding down;选取所述基准行列号与所述目标行列号匹配的所述候选背景区域作为所述前景对象的关联背景区域。The candidate background region whose reference row and column number matches the target row and column number is selected as the associated background region of the foreground object.2.根据权利要求1所述的方法,其特征在于,所述将所述目标背景图像划分为多个候选背景区域,包括:2. The method according to claim 1, characterized in that the step of dividing the target background image into a plurality of candidate background regions comprises:获取最小前景尺寸,将所述最小前景尺寸作为分块尺寸;Obtaining a minimum foreground size, and using the minimum foreground size as a block size;基于所述分块尺寸对所述目标背景图像进行划分,得到多个所述候选背景区域。The target background image is divided based on the block size to obtain a plurality of candidate background regions.3.根据权利要求1所述的方法,其特征在于,所述基准行列号为:3. The method according to claim 1, characterized in that the reference row and column numbers are:其中,Colunm0为所述候选背景区域的基准列序号;Row0为所述候选背景区域的基准行序号;(SrcX0,SrcY0)为所述候选背景区域的边界坐标;(pX,pY)为所述候选背景区域的中心坐标;(Sizex,Sizey)为所述候选背景区域的区域尺寸;Wherein, Colunm0 is the base column number of the candidate background area; Row0 is the base row number of the candidate background area; (SrcX0 , SrcY0 ) is the boundary coordinate of the candidate background area; (pX, pY) is the center coordinate of the candidate background area; (Sizex , Sizey ) is the area size of the candidate background area;所述行列转换模型具体为:The row-column conversion model is specifically:其中,Colunm1为所述目标行列号内的列序号;Row1为所述目标行列号内的行序号;(SrcX1,SrcY1)为所述前景对象的中心坐标;(Sizex,Sizey)为所述候选背景区域的区域尺寸;(Targetx,Targety)为所述前景对象的对象尺寸。Among them, Colunm1 is the column number within the target row and column number; Row1 is the row number within the target row and column number; (SrcX1 , SrcY1 ) are the center coordinates of the foreground object; (Sizex , Sizey ) are the area size of the candidate background area; (Targetx , Targety ) are the object size of the foreground object.4.根据权利要求1所述的方法,其特征在于,所述显示模式为深色显示模式,则所述根据所述关联背景区域的背景像素值,将所述前景对象调整为与所述显示模式对应的目标对象,包括:4. The method according to claim 1, wherein the display mode is a dark display mode, and the adjusting the foreground object to a target object corresponding to the display mode according to the background pixel value of the associated background area comprises:获取关联背景区域的中心坐标的像素值以及透明度;Get the pixel value and transparency of the center coordinates of the associated background area;根据所述中心坐标的所述像素值以及所述透明度,确定所述关联背景区域的背景亮度值;Determining a background brightness value of the associated background area according to the pixel value of the center coordinate and the transparency;若所述背景亮度值大于预设的亮度阈值,则对所述前景对象进行降低亮度处理,生成所述目标对象;If the background brightness value is greater than a preset brightness threshold, the foreground object is subjected to brightness reduction processing to generate the target object;若所述背景亮度值小于或等于所述亮度阈值,则对所述前景对象进行反色处理,生成所述目标对象。If the background brightness value is less than or equal to the brightness threshold, the foreground object is inverted to generate the target object.5.根据权利要求4所述的方法,其特征在于,在所述根据所述中心坐标的所述像素值以及所述透明度,确定所述关联背景区域的亮度值之后,还包括:5. The method according to claim 4, characterized in that after determining the brightness value of the associated background area according to the pixel value of the central coordinate and the transparency, it also includes:根据所述前景对象内各个像素点的所述像素值,确定所述前景对象对应的特征亮度值;Determining a characteristic brightness value corresponding to the foreground object according to the pixel value of each pixel point in the foreground object;若所述背景亮度值与所述特征亮度值之间的亮度差值大于预设的反色阈值,则对所述前景对象进行降低亮度处理,生成所述目标对象;If the brightness difference between the background brightness value and the characteristic brightness value is greater than a preset inversion threshold, the foreground object is subjected to brightness reduction processing to generate the target object;若所述亮度差值小于或等于所述反色阈值,则对所述前景对象进行反色处理,生成所述目标对象。If the brightness difference is less than or equal to the inversion threshold, the foreground object is inverted to generate the target object.6.根据权利要求1-5任一所述的方法,其特征在于,所述识别所述目标页面内各个前景对象在所述目标背景图像内的关联背景区域,包括:6. The method according to any one of claims 1 to 5, characterized in that the step of identifying the associated background area of each foreground object in the target page in the target background image comprises:确定所述前景对象在所述目标页面内的显示层级;Determining a display level of the foreground object within the target page;在所述目标页面内选取与所述显示层级相邻层级的目标背景图像作为所述前景对象的关联背景图像;Selecting, in the target page, a target background image at a level adjacent to the display level as an associated background image for the foreground object;确定所述前景对象在所述关联背景图像内的关联背景区域。An associated background region of the foreground object within the associated background image is determined.7.根据权利要求1-5任一所述的方法,其特征在于,所述根据所述关联背景区域的背景像素值,将所述前景对象调整为与所述显示模式对应的目标对象,包括:7. The method according to any one of claims 1 to 5, characterized in that the step of adjusting the foreground object to a target object corresponding to the display mode according to the background pixel value of the associated background area comprises:根据所述关联背景区域的背景像素值以及所述前景对象的像素值,生成所述前景对象对应的预览对象;generating a preview object corresponding to the foreground object according to the background pixel value of the associated background area and the pixel value of the foreground object;根据所述预览对象对应的所有关联对象的像素值以及所述预览对象的像素值,生成所述前景对象对应的所述目标对象。The target object corresponding to the foreground object is generated according to the pixel values of all associated objects corresponding to the preview object and the pixel value of the preview object.8.一种页面显示的装置,其特征在于,包括:8. A device for displaying a page, comprising:背景图像调整单元,用于将目标页面内的原始背景图像,调整为与当前的显示模式对应的目标背景图像;A background image adjustment unit, used to adjust the original background image in the target page to a target background image corresponding to the current display mode;关联背景区域识别单元,用于识别所述目标页面内各个前景对象在所述目标背景图像内的关联背景区域;An associated background region identification unit, used to identify an associated background region of each foreground object in the target page in the target background image;前景对象调整单元,用于根据所述关联背景区域的背景像素值,将所述前景对象调整为与所述显示模式对应的目标对象;a foreground object adjustment unit, configured to adjust the foreground object to a target object corresponding to the display mode according to a background pixel value of the associated background area;目标页面生成单元,用于根据所有所述目标对象以及所述目标背景图像,生成所述目标页面;A target page generating unit, configured to generate the target page according to all the target objects and the target background image;所述关联背景区域识别单元包括:The associated background area recognition unit comprises:候选背景区域划分单元,用于将所述目标背景图像划分为多个候选背景区域,包括:以预设的区域形状为单位对所述目标背景图像进行划分,得到多个所述候选背景区域;The candidate background region division unit is used to divide the target background image into a plurality of candidate background regions, including: dividing the target background image into a plurality of candidate background regions in units of preset region shapes to obtain a plurality of candidate background regions;候选背景区域选取单元,用于根据所述前景对象的中心坐标以及所述目标背景图像的边界坐标,从所述候选背景区域中选取与所述前景对象对应的所述关联背景区域;A candidate background region selection unit, configured to select the associated background region corresponding to the foreground object from the candidate background regions according to the center coordinates of the foreground object and the boundary coordinates of the target background image;所述候选背景区域选取单元包括:The candidate background area selection unit comprises:基准行列号获取单元,用于根据各个候选背景区域的在所述目标背景图像的显示位置,为各个候选背景区域配置关联的基准行列号;所述基准行列号是通过网格坐标确定各个所述候选背景区域的位置;A reference row and column number acquisition unit is used to configure an associated reference row and column number for each candidate background area according to the display position of each candidate background area in the target background image; the reference row and column number is determined by the position of each candidate background area through grid coordinates;目标行列号获取单元,用于将所述前景对象中心坐标导入预设的行列转换模型,计算所述前景对象的目标行列号;所述行列转换模型具体为:The target row and column number acquisition unit is used to import the center coordinates of the foreground object into a preset row and column conversion model to calculate the target row and column number of the foreground object; the row and column conversion model is specifically:将所述前景对象中心坐标导入预设的行列转换模型,计算所述前景对象的目标行列号,包括:采用向下取整的方式计算目标行列号以及基准行列号;Importing the center coordinates of the foreground object into a preset row-column conversion model to calculate the target row-column number of the foreground object, including: calculating the target row-column number and the reference row-column number by rounding down;关联背景区域确定单元,用于选取所述基准行列号与所述目标行列号匹配的所述候选背景区域作为所述前景对象的关联背景区域。The associated background region determining unit is used to select the candidate background region whose reference row and column number matches the target row and column number as the associated background region of the foreground object.9.一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如权利要求1至7任一项所述的方法。9. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 7 when executing the computer program.10.一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至7任一项所述的方法。10. A computer-readable storage medium storing a computer program, wherein the computer program implements the method according to any one of claims 1 to 7 when executed by a processor.
CN202010076679.8A2020-01-232020-01-23 A method, device, terminal and storage medium for page displayActiveCN113157357B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202010076679.8ACN113157357B (en)2020-01-232020-01-23 A method, device, terminal and storage medium for page display

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202010076679.8ACN113157357B (en)2020-01-232020-01-23 A method, device, terminal and storage medium for page display

Publications (2)

Publication NumberPublication Date
CN113157357A CN113157357A (en)2021-07-23
CN113157357Btrue CN113157357B (en)2024-10-11

Family

ID=76881965

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202010076679.8AActiveCN113157357B (en)2020-01-232020-01-23 A method, device, terminal and storage medium for page display

Country Status (1)

CountryLink
CN (1)CN113157357B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN113486216B (en)*2021-07-272024-02-09中国银行股份有限公司Page merging method, device, server, medium and product
CN113781959B (en)*2021-09-232022-10-21Oppo广东移动通信有限公司Interface processing method and device
CN114138394A (en)*2021-12-062022-03-04北京得间科技有限公司Night display mode processing method, electronic device and computer storage medium
CN115294363A (en)*2022-08-192022-11-04腾讯科技(深圳)有限公司Picture processing method, related device, equipment and storage medium
CN116466952B (en)*2023-06-192023-09-01成都赛力斯科技有限公司Control visual effect element adjusting method and device, electronic equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN106851003A (en)*2017-02-272017-06-13努比亚技术有限公司The method and device of text color is adjusted according to wallpaper color
CN110609722A (en)*2019-08-092019-12-24华为技术有限公司 A kind of dark mode display interface processing method, electronic device and storage medium

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20120127198A1 (en)*2010-11-222012-05-24Microsoft CorporationSelection of foreground characteristics based on background
CN105005461A (en)*2015-06-232015-10-28深圳市金立通信设备有限公司Icon display method and terminal
CN105677349A (en)*2016-01-052016-06-15努比亚技术有限公司Desktop icon display method and device
CN105809645A (en)*2016-03-282016-07-27努比亚技术有限公司Word display method and device and mobile terminal
CN106126214A (en)*2016-06-172016-11-16青岛海信移动通信技术股份有限公司The determination method and device of text color on a kind of interface
US9992450B1 (en)*2017-03-242018-06-05Apple Inc.Systems and methods for background concealment in video conferencing session
CN107291334A (en)*2017-06-272017-10-24努比亚技术有限公司A kind of icon font color determines method and apparatus

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN106851003A (en)*2017-02-272017-06-13努比亚技术有限公司The method and device of text color is adjusted according to wallpaper color
CN110609722A (en)*2019-08-092019-12-24华为技术有限公司 A kind of dark mode display interface processing method, electronic device and storage medium

Also Published As

Publication numberPublication date
CN113157357A (en)2021-07-23

Similar Documents

PublicationPublication DateTitle
CN113157357B (en) A method, device, terminal and storage medium for page display
CN113132704B (en)Image processing method, device, terminal and storage medium
CN112825232B (en)Compensation method and electronic equipment
CN108363569B (en)Image frame generation method, device, equipment and storage medium in application
CN108959361B (en)Form management method and device
CN113837920B (en) Image rendering method and electronic device
US12050832B2 (en)Screenshot display method and apparatus, and terminal device
CN113360122B (en)Mobile terminal and text display method thereof
CN110889060A (en)Webpage display method and device, computer equipment and storage medium
CN111275607A (en)Interface display method and device, computer equipment and storage medium
CN114816200A (en) A display method and electronic device
CN115686700A (en) Rendering method and electronic device
CN113391743B (en) A display method and electronic device
CN111031377B (en)Mobile terminal and video production method
CN113038141A (en)Video frame processing method and electronic equipment
CN117055779B (en) Application interface display method, terminal device and storage medium
WO2024244934A1 (en)Advertisement generation method, and electronic device, network device and computer storage medium
CN116700655B (en) Interface display method and electronic device
CN115033199B (en)Mobile terminal and image display method thereof
CN116055627A (en) A screen off control method, electronic device and storage medium
WO2023040613A1 (en)Human-machine interaction method, computer-readable medium, and electronic device
CN118235108A (en)Image processing method, intelligent terminal and storage medium
CN113138815A (en)Image processing method and device and terminal
CN114257755A (en) Image processing method, device, device and storage medium
CN115334239B (en)Front camera and rear camera photographing fusion method, terminal equipment and storage medium

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp