[go: up one dir, main page]

CN118505830A - Display processing method, device, electronic device and storage medium - Google Patents

Display processing method, device, electronic device and storage medium Download PDF

Info

Publication number
CN118505830A
CN118505830A CN202310180283.1A CN202310180283A CN118505830A CN 118505830 A CN118505830 A CN 118505830A CN 202310180283 A CN202310180283 A CN 202310180283A CN 118505830 A CN118505830 A CN 118505830A
Authority
CN
China
Prior art keywords
determining
target image
partial derivative
sampling points
pixel
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.)
Pending
Application number
CN202310180283.1A
Other languages
Chinese (zh)
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.)
Beijing Zitiao Network Technology Co Ltd
Original Assignee
Beijing Zitiao Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Zitiao Network Technology Co Ltd filed Critical Beijing Zitiao Network Technology Co Ltd
Priority to CN202310180283.1A priority Critical patent/CN118505830A/en
Publication of CN118505830A publication Critical patent/CN118505830A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/001Texturing; Colouring; Generation of texture or colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/14Digital output to display device ; Cooperation and interconnection of the display device with other functional units
    • G06F3/147Digital output to display device ; Cooperation and interconnection of the display device with other functional units using display panels
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/10Geometric effects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/50Lighting effects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T19/00Manipulating 3D models or images for computer graphics
    • G06T19/20Editing of 3D images, e.g. changing shapes or colours, aligning objects or positioning parts

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Graphics (AREA)
  • General Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Geometry (AREA)
  • Architecture (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • Image Generation (AREA)
  • Controls And Circuits For Display Device (AREA)
  • Image Processing (AREA)

Abstract

本公开提供一种显示处理方法、装置、电子设备和存储介质。一种显示处理方法,包括:确定显示设备的目标像素在目标图像上对应位置的像素坐标;确定像素坐标在屏幕坐标系的方向上的偏导数;根据像素坐标和偏导数确定目标图像上的n个采样点,n不小于2;根据目标图像上n个采样点的颜色,确定目标像素的显示颜色。本公开提出的方法对于高于显示设备的屏幕分辨率的图像的渲染,其渲染的清晰度明显得到提升,锯齿基本消失,闪伪影的问题也得到很大的改善。

The present disclosure provides a display processing method, device, electronic device and storage medium. A display processing method, comprising: determining the pixel coordinates of the target pixel of the display device at the corresponding position on the target image; determining the partial derivative of the pixel coordinates in the direction of the screen coordinate system; determining n sampling points on the target image according to the pixel coordinates and the partial derivatives, where n is not less than 2; determining the display color of the target pixel according to the colors of the n sampling points on the target image. The method proposed in the present disclosure can significantly improve the clarity of the rendering of images with a resolution higher than the screen resolution of the display device, and the aliasing is basically eliminated, and the problem of flickering artifacts is also greatly improved.

Description

显示处理方法、装置、电子设备和存储介质Display processing method, device, electronic device and storage medium

技术领域Technical Field

本公开涉及计算机技术领域,尤其涉及一种显示处理方法、装置、电子设备和存储介质。The present disclosure relates to the field of computer technology, and in particular to a display processing method, device, electronic device and storage medium.

背景技术Background Art

图像具有分辨率,显示图像的显示设备也具有分辨率(屏幕分辨率),显示图像的显示设备的一个像素只能显示一个颜色,而图像的分辨率可能会高于显示设备的分辨率,这就导致显示设备的像素不能与图像的像素一一对应。因此,渲染时需要进行处理。The image has a resolution, and the display device that displays the image also has a resolution (screen resolution). One pixel of the display device that displays the image can only display one color, and the image resolution may be higher than the resolution of the display device, which results in the pixels of the display device not corresponding one-to-one with the pixels of the image. Therefore, processing is required during rendering.

发明内容Summary of the invention

本公开提供一种显示处理方法、装置、电子设备和存储介质。The present disclosure provides a display processing method, device, electronic device and storage medium.

本公开采用以下的技术方案。The present disclosure adopts the following technical solutions.

在一些实施例中,本公开提供一种显示处理方法,包括:In some embodiments, the present disclosure provides a display processing method, including:

确定显示设备的目标像素在目标图像上对应位置的像素坐标;Determine the pixel coordinates of the target pixel of the display device at the corresponding position on the target image;

确定像素坐标在屏幕坐标系的方向上的偏导数;Determine the partial derivative of the pixel coordinate in the direction of the screen coordinate system;

根据像素坐标和偏导数确定所述目标图像上的n个采样点,n不小于2;Determine n sampling points on the target image according to pixel coordinates and partial derivatives, where n is not less than 2;

根据所述目标图像上n个所述采样点的颜色,确定所述目标像素的显示颜色。The display color of the target pixel is determined according to the colors of the n sampling points on the target image.

在一些实施例中,本公开提供一种显示处理装置,包括:In some embodiments, the present disclosure provides a display processing device, including:

确定单元,用于确定显示设备的目标像素在目标图像上对应位置的像素坐标;A determination unit, used to determine the pixel coordinates of a target pixel of a display device at a corresponding position on a target image;

计算单元,用于确定所述像素坐标在屏幕坐标系的方向上的偏导数;A calculation unit, used to determine the partial derivative of the pixel coordinate in the direction of the screen coordinate system;

所述计算单元,还用于根据像素坐标和偏导数确定所述目标图像上的n个采样点,n不小于2;The calculation unit is further used to determine n sampling points on the target image according to pixel coordinates and partial derivatives, where n is not less than 2;

所述计算单元,用于根据所述目标图像上n个所述采样点的颜色,确定所述目标像素的显示颜色。The calculation unit is used to determine the display color of the target pixel according to the colors of the n sampling points on the target image.

在一些实施例中,本公开提供一种电子设备,包括:至少一个存储器和至少一个处理器;In some embodiments, the present disclosure provides an electronic device, comprising: at least one memory and at least one processor;

其中,存储器用于存储程序代码,处理器用于调用所述存储器所存储的程序代码执行上述的方法。The memory is used to store program codes, and the processor is used to call the program codes stored in the memory to execute the above method.

在一些实施例中,本公开提供一种计算机可读存储介质,所述计算机可读存储介质用于存储程序代码,所述程序代码在被处理器运行时,促使所述处理器执行上述方法。In some embodiments, the present disclosure provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store program code, and when the program code is executed by a processor, the processor is prompted to perform the above method.

本公开实施例提供的显示处理方法,考虑到显示的畸变因素,针对像素坐标的畸变情况,根据第一偏导数dFdx和第二偏导数dFdy确定目标图像上的n个采样点的位置,从而根据采样点的颜色确定目标像素的显示颜色,对于高于屏幕分辨率的图像的渲染,其渲染的清晰度明显得到提升,锯齿基本消失,闪伪影的问题也得到很大的改善。The display processing method provided by the embodiment of the present disclosure takes into account the distortion factors of the display and determines the positions of n sampling points on the target image according to the first partial derivative dFdx and the second partial derivative dFdy for the distortion of pixel coordinates, thereby determining the display color of the target pixel according to the color of the sampling points. For the rendering of images higher than the screen resolution, the clarity of the rendering is significantly improved, the jagged edges are basically eliminated, and the problem of flickering artifacts is also greatly improved.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

结合附图并参考以下具体实施方式,本公开各实施例的上述和其他特征、优点及方面将变得更加明显。贯穿附图中,相同或相似的附图标记表示相同或相似的元素。应当理解附图是示意性的,元件和元素不一定按照比例绘制。The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that components and elements are not necessarily drawn to scale.

图1是本公开实施例的一种图形渲染管线的流程图。FIG. 1 is a flow chart of a graphics rendering pipeline according to an embodiment of the present disclosure.

图2是本公开实施例的一种显示有三角形的图像示意图。FIG. 2 is a schematic diagram of an image displaying a triangle according to an embodiment of the present disclosure.

图3是本公开实施例的一种显示设备像素的显示状态示意图。FIG. 3 is a schematic diagram of a display state of a pixel of a display device according to an embodiment of the present disclosure.

图4是本公开实施例的一种图像采样点的示意图。FIG. 4 is a schematic diagram of an image sampling point according to an embodiment of the present disclosure.

图5是本公开实施例的一种图像的畸变示意图。FIG. 5 is a schematic diagram of image distortion according to an embodiment of the present disclosure.

图6是本公开实施例的一种畸变图像、凸透镜和显示图像的示意图。FIG. 6 is a schematic diagram of a distorted image, a convex lens, and a displayed image according to an embodiment of the present disclosure.

图7是本公开实施例的一种显示处理方法的流程图。FIG. 7 is a flow chart of a display processing method according to an embodiment of the present disclosure.

图8是本公开实施例的一种采样点的位置示意图。FIG. 8 is a schematic diagram of the locations of sampling points according to an embodiment of the present disclosure.

图9是本公开实施例的电子设备的结构示意图。FIG. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.

具体实施方式DETAILED DESCRIPTION

下面将参照附图更详细地描述本公开的实施例。虽然附图中显示了本公开的某些实施例,然而应当理解的是,本公开可以通过各种形式来实现,而且不应该被解释为限于这里阐述的实施例,相反提供这些实施例是为了更加透彻和完整地理解本公开。应当理解的是,本公开的附图及实施例仅用于示例性作用,并非用于限制本公开的保护范围。Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

应当理解,本公开的方法实施方式中记载的各个步骤可以按和/或并行执行。此外,方法实施方式可以包括附加的步骤和/或省略执行示出的步骤。本公开的范围在此方面不受限制。It should be understood that the various steps described in the method embodiments of the present disclosure can be performed in sequence and/or in parallel. In addition, the method embodiments may include additional steps and/or omit the steps shown. The scope of the present disclosure is not limited in this respect.

本文使用的术语“包括”及其变形是开放性包括,即“包括但不限于”。术语“基于”是“至少部分地基于”。术语“一个实施例”表示“至少一个实施例”;术语“另一实施例”表示“至少一个另外的实施例”;术语“一些实施例”表示“至少一些实施例”。其他术语的相关定义将在下文描述中给出。The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

需要注意,本公开中提及的“第一”、“第二”等概念仅用于对不同的装置、模块或单元进行区分,并非用于限定这些装置、模块或单元所执行的功能的顺序或者相互依存关系。It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

需要注意,本公开中提及的“一个”的修饰是示意性而非限制性的,本领域技术人员应当理解,除非在上下文另有明确指出,否则应该理解为“一个或多个”。It should be noted that the modification of “one” mentioned in the present disclosure is illustrative rather than restrictive, and those skilled in the art should understand that it should be understood as “one or more” unless otherwise clearly indicated in the context.

本公开实施方式中的多个装置之间所交互的消息或者信息的名称仅用于说明性的目的,而并不是用于对这些消息或信息的范围进行限制。The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

以下将结合附图,对本公开实施例提供的方案进行详细描述。The solution provided by the embodiment of the present disclosure will be described in detail below with reference to the accompanying drawings.

相关技术中,对图像的渲染,例如虚拟现实图像的渲染,会使用OpenGL的图形渲染管线,其主要流程如图1所示。在开始绘制图形之前,需要先给OpenGL输入顶点数据,例如希望渲染三角形时,需要输入三个顶点的坐标,每个顶点都有一个3D位置,用数组表示3D坐标,该数组为顶点数据。顶点着色器阶段把一个单独的顶点作为输入。顶点着色器作用是把3D坐标转换为另一种3D坐标,同时对顶点属性进行一些处理。图元装配阶段将顶点着色器输出的所有顶点作为输入,并所有的点装配成指定图元的形状。图元装配阶段的输出将传递给几何着色器。几何着色器把图元形式的一系列顶点的集合作为输入。几何着色器的输出会被传入光栅化阶段,把图元映射为最终屏幕上相应的像素,生成供片段着色器使用的片段。在片段着色器运行之前会执行裁切。裁切会丢弃超出视图以外的所有像素。片段着色器的主要作用是计算一个像素的最终颜色。在所有对应颜色值确定以后,最终的对象将会被传到测试和混合阶段。这个阶段检测片段的对应的深度值,用它们来判断这个像素和其它物体前后关系,并判断是否丢弃。然后将进入FrameBuffer阶段,在显示缓存中存储,之后进行显示。In the related art, the rendering of images, such as the rendering of virtual reality images, uses the graphics rendering pipeline of OpenGL, and its main process is shown in Figure 1. Before starting to draw graphics, you need to input vertex data to OpenGL. For example, when you want to render a triangle, you need to input the coordinates of three vertices. Each vertex has a 3D position, and the 3D coordinates are represented by an array, which is the vertex data. The vertex shader stage takes a single vertex as input. The function of the vertex shader is to convert the 3D coordinates into another 3D coordinate and perform some processing on the vertex attributes. The primitive assembly stage takes all the vertices output by the vertex shader as input, and assembles all the points into the shape of the specified primitive. The output of the primitive assembly stage will be passed to the geometry shader. The geometry shader takes a collection of a series of vertices in the form of primitives as input. The output of the geometry shader will be passed to the rasterization stage, which maps the primitives to the corresponding pixels on the final screen and generates fragments for the fragment shader. Clipping is performed before the fragment shader runs. Clipping discards all pixels outside the view. The main function of the fragment shader is to calculate the final color of a pixel. After all the corresponding color values are determined, the final object will be passed to the test and blend stage. This stage detects the corresponding depth values of the fragments, uses them to determine the relationship between this pixel and other objects, and determines whether to discard it. Then it will enter the FrameBuffer stage, store it in the display buffer, and then display it.

显示设备具有分辨率,需要显示的目标图像也具有分辨率,当目标图像的分辨率大于显示设备的分辨率时,显示设备的一个像素与目标图像的像素不能一一对应。一些实施例中,用特定的方法将目标图像映射为最终显示设备上的像素,以GPU渲染光栅为例,这一操作是在光栅化阶段完成,并生成供片段着色器使用的片段,片段着色器从该片段采样的颜色作为显示设备的像素所显示的颜色,如果需要显示的目标图像的分辨率大于显示设备的分辨率,片段着色器只采样片段中的一个点可能会导致图像出现锯齿等问题,以如图2所示的三角形为例,图2中显示了目标图像的一种示意图,网格为显示设备的像素在目标图像上的映射后的片段(片元),每个片段中心包含一个采样点,每一个被三角形遮住的采样点所在的像素的颜色被采样成该像素的颜色,通过采集像素在目标图像上对应位置中心的颜色,作为显示设备上的像素的颜色,结果如图3所示,其展示了显示设备上的像素的状态,可以看到,实际显示的三角形具有锯齿,一个方格为一个像素,显示的颜色容易走样。一些实施例中,采用了多采样算法,即在每个像素的颜色中不再只是由一个片段内的中心的采样点的颜色来决定,而是由多个采样点的颜色共同决定,例如如图4所示,在一个片段中设定了四个采样点,最终像素的颜色为四个采样点的颜色所确定,从而能够更真实的还原图像,解决锯齿走样的问题。The display device has a resolution, and the target image to be displayed also has a resolution. When the resolution of the target image is greater than the resolution of the display device, a pixel of the display device cannot correspond to a pixel of the target image one-to-one. In some embodiments, a specific method is used to map the target image to a pixel on the final display device. Taking GPU rendering of the raster as an example, this operation is completed in the rasterization stage, and a fragment for the fragment shader is generated. The color sampled by the fragment shader from the fragment is used as the color displayed by the pixel of the display device. If the resolution of the target image to be displayed is greater than the resolution of the display device, the fragment shader only samples one point in the fragment, which may cause the image to have jagged problems. Taking the triangle shown in Figure 2 as an example, Figure 2 shows a schematic diagram of the target image. The grid is a fragment (fragment) after the pixel of the display device is mapped on the target image. Each fragment center contains a sampling point. The color of each pixel at the sampling point covered by the triangle is sampled as the color of the pixel. By collecting the color of the center of the corresponding position of the pixel on the target image, it is used as the color of the pixel on the display device. The result is shown in Figure 3, which shows the state of the pixel on the display device. It can be seen that the triangle actually displayed has jagged edges, one square is one pixel, and the displayed color is easily distorted. In some embodiments, a multi-sampling algorithm is used, that is, the color of each pixel is no longer determined solely by the color of the sampling point at the center of a segment, but is jointly determined by the colors of multiple sampling points. For example, as shown in FIG. 4 , four sampling points are set in a segment, and the final color of the pixel is determined by the colors of the four sampling points, thereby being able to restore the image more realistically and solve the problem of aliasing.

然而,在一些显示设备中,采用的是凸透镜或凹透镜等非平面透镜,因为折射的原因,图像经过透镜显示是会产生畸变,例如用凸透镜时,会产生如图5所示的桶形畸变,原本的直线变成了曲线,为了纠正这种畸变,一般会对需要显示的目标图像提前做畸变,例如如图6所示,图6中左侧为畸变的目标图像,显示设备的透镜为凸透镜,最终呈现的效果如图6右侧所示,由于预先进行了畸变,因此通过凸透镜后就能够正常显示为图6右侧所示的图像,人眼显示的图像就是正常的。因为先对目标图像进行了畸变,因此片段着色器采样所用的片段对应的原来的图元大小是不一样的,其每个像素采样的uv坐标(像素坐标)并不是线性变化的,对于透镜为平面透镜不需要畸变的情况,每个像素的采样点的位置可以是相同的,但对于凸透镜或凹透镜的情况下,每个像素使用距离中心点相同距离的采样点的采样效果也是不一样的,如果选取距离中心点相同的采样点,对于中心位置的像素可能差异不大,但对于边缘区域的像素将不再合适,所以,对于畸变的图像进行采样时,需要选取合适的采样点以保证采样效果。However, in some display devices, non-planar lenses such as convex lenses or concave lenses are used. Due to refraction, the image will be distorted when displayed through the lens. For example, when a convex lens is used, a barrel distortion as shown in Figure 5 will be generated, and the original straight line will become a curve. In order to correct this distortion, the target image to be displayed is generally distorted in advance. For example, as shown in Figure 6, the left side of Figure 6 is a distorted target image, and the lens of the display device is a convex lens. The final effect is shown on the right side of Figure 6. Since the distortion was performed in advance, it can be normally displayed as the image shown on the right side of Figure 6 after passing through the convex lens, and the image displayed by the human eye is normal. Because the target image is distorted first, the original primitive size corresponding to the fragment used for fragment shader sampling is different, and the UV coordinate (pixel coordinate) of each pixel sampled does not change linearly. For the case where the lens is a plane lens and no distortion is required, the position of the sampling point of each pixel can be the same, but for the case of a convex lens or a concave lens, the sampling effect of each pixel using the sampling point at the same distance from the center point is also different. If the sampling point with the same distance from the center point is selected, the pixel at the center position may not be much different, but it will no longer be suitable for the pixels in the edge area. Therefore, when sampling a distorted image, it is necessary to select appropriate sampling points to ensure the sampling effect.

如图7所示,图7是本公开实施例的显示处理方法的流程图,本公开提出的方法可以用于片段着色器(如图1中所示)所执行的处理阶段中,具体可以包括如下步骤。As shown in FIG. 7 , FIG. 7 is a flowchart of a display processing method according to an embodiment of the present disclosure. The method proposed in the present disclosure may be used in the processing stage executed by a fragment shader (as shown in FIG. 1 ), and may specifically include the following steps.

S11、确定显示设备的目标像素在目标图像上对应位置的像素坐标。S11. Determine the pixel coordinates of the target pixel of the display device at the corresponding position on the target image.

一些实施例中,本公开提出的方法可以用于显示设备,显示设备例如可以是虚拟现实设备、扩展现实设备、增强现实设备等,对此不作限定。显示设备可以是具有凸透镜或凹透镜的设备。一些实施例中,目标图像为需要在显示设备上进行显示的图像。显示设备具有分辨率,根据显示设备的分辨率可以在例如图1所示的光栅化阶段生成片段,显示设备的目标像素可以是任意一个像素,目标像素对应的像素坐标(u,v)可以是其对应的片段的中心点的坐标(可参考图2),像素坐标是纹理坐标,也就是图像本身的坐标,一个片段对应显示设备的一个像素,一个片段中可以覆盖目标图像本身的多个像素。目标像素(可记为F)可以是显示设备上当前正在处理的像素。In some embodiments, the method proposed in the present disclosure can be used for a display device, and the display device can be, for example, a virtual reality device, an extended reality device, an augmented reality device, etc., without limitation. The display device can be a device with a convex lens or a concave lens. In some embodiments, the target image is an image that needs to be displayed on the display device. The display device has a resolution, and fragments can be generated at the rasterization stage shown in Figure 1 according to the resolution of the display device. The target pixel of the display device can be any pixel, and the pixel coordinates (u, v) corresponding to the target pixel can be the coordinates of the center point of the corresponding fragment (see Figure 2). The pixel coordinates are texture coordinates, that is, the coordinates of the image itself. One fragment corresponds to one pixel of the display device, and one fragment can cover multiple pixels of the target image itself. The target pixel (which can be denoted as F) can be the pixel currently being processed on the display device.

S12、确定像素坐标在屏幕坐标系上的偏导数。S12. Determine the partial derivative of the pixel coordinate in the screen coordinate system.

一些实施例中,像素坐标(u,v)是纹理坐标系的坐标,纹理坐标系与屏幕坐标系是不同的坐标系。屏幕坐标系的方向可以包括第一方向x和第二方向y,第一方向x和第二方向y交叉。可以是确定像素坐标(u,v)在屏幕坐标系的第一方向x和第二方向y上的偏导数,得到第一偏导数dFdx和第二偏导数dFdy。具体的,第一方向x可以是目标图像中的横向,第二方向y可以是目标图像中的纵向,两者相互垂直。像素坐标可以表示为(u,v)第一偏导数dFdx和第二偏导数dFdy可以通过dFdxFine来计算,或者通过dFdxCoarse来计算,或者通过使用dFdx()来计算。偏导数通过像素坐标在第一方向x和第二方向y的变化率而计算出来的。In some embodiments, the pixel coordinates (u, v) are coordinates of a texture coordinate system, and the texture coordinate system is a different coordinate system from the screen coordinate system. The direction of the screen coordinate system may include a first direction x and a second direction y, and the first direction x and the second direction y intersect. The partial derivatives of the pixel coordinates (u, v) in the first direction x and the second direction y of the screen coordinate system may be determined to obtain a first partial derivative dFdx and a second partial derivative dFdy. Specifically, the first direction x may be the horizontal direction in the target image, and the second direction y may be the vertical direction in the target image, and the two are perpendicular to each other. The pixel coordinates may be expressed as (u, v). The first partial derivative dFdx and the second partial derivative dFdy may be calculated by dFdxFine, or by dFdxCoarse, or by using dFdx(). The partial derivatives are calculated by the rate of change of the pixel coordinates in the first direction x and the second direction y.

S13、根据像素坐标和偏导数确定目标图像上的n个采样点,n不小于2。S13. Determine n sampling points on the target image according to pixel coordinates and partial derivatives, where n is not less than 2.

一些实施例中,目标图像本身的分辨率与显示设备的分辨率不同,因此通过n个采样点能够更好的表征颜色。更重要的是,本实施例中采样点的设置位置需要考虑到了像素坐标在屏幕坐标系的方向上的偏导数。可以是根据所述像素坐标(u,v)、所述第一偏导数dFdx和所述第二偏导数dFdy确定所述目标图像上的n个采样点,偏导数包括第一偏导数dFdx和第二偏导数dFdy。这是因为对于显示设备的透镜为凸透镜或凹透镜时会产生畸变(参考图6),片段着色器采样所用的片段对应原来的图像的图元大小是不一样的,每个像素采样点的坐标并不是线性变化的,所以本公开中根据偏导数来确定目标图像上的n个采样点的位置,偏导数反应了畸变程度,从而根据偏导数确定采样点来适配畸变的图像。此外,本公开实施例中提出的方法也可以适配未畸变的图像。In some embodiments, the resolution of the target image itself is different from the resolution of the display device, so the color can be better represented by n sampling points. More importantly, the setting position of the sampling points in this embodiment needs to take into account the partial derivatives of the pixel coordinates in the direction of the screen coordinate system. The n sampling points on the target image can be determined according to the pixel coordinates (u, v), the first partial derivative dFdx and the second partial derivative dFdy, and the partial derivatives include the first partial derivative dFdx and the second partial derivative dFdy. This is because when the lens of the display device is a convex lens or a concave lens, distortion will occur (refer to Figure 6), and the fragments used for fragment shader sampling correspond to the original image primitive size. The coordinates of each pixel sampling point do not change linearly, so the positions of the n sampling points on the target image are determined according to the partial derivatives in the present disclosure. The partial derivatives reflect the degree of distortion, so that the sampling points are determined according to the partial derivatives to adapt the distorted image. In addition, the method proposed in the embodiment of the present disclosure can also adapt to undistorted images.

S14、根据目标图像上n个采样点的颜色,确定目标像素的显示颜色。S14. Determine the display color of the target pixel according to the colors of the n sampling points on the target image.

一些实施例中,通过n个采样点的颜色综合确定最终显示设备目标像素所显示的颜色,显示设备上的一个像素显示一个颜色,目标像素所对应的片段可以覆盖目标图像上的不止一个像素,因此目标像素不能直接使用片段的中心点的颜色,需要根据至少两个采样点的颜色确定目标像素的显示颜色。In some embodiments, the color displayed by the target pixel of the final display device is determined by the color synthesis of n sampling points. One pixel on the display device displays one color. The fragment corresponding to the target pixel can cover more than one pixel on the target image. Therefore, the target pixel cannot directly use the color of the center point of the fragment. The display color of the target pixel needs to be determined based on the colors of at least two sampling points.

在本公开的一些实施例中,确定像素坐标(u,v)在屏幕坐标系的第一方向x和第二方向y上的偏导数,得到第一偏导数dFdx和第二偏导数dFdy;根据所述像素坐标(u,v)、第一偏导数dFdx和第二偏导数dFdy确定目标图像的n个采样点的位置,从而使得采样点的位置的选择会随着像素坐标的偏导数的变化而变化,第一偏导数dFdx和第二偏导数dFdy能够反应畸变程度,对于显示设备上不同的像素,对应采样点的位置可以是不同的,而并非是固定的,使得采样点的位置的选取更加合理,从而提高了显示所呈现的显示颜色的显示效果,能够适用于畸变的图像,对于高于屏幕分辨率的图像的渲染,其渲染的清晰度明显得到提升,锯齿基本消失,闪伪影的问题也得到很大的改善。In some embodiments of the present disclosure, partial derivatives of pixel coordinates (u, v) in a first direction x and a second direction y of a screen coordinate system are determined to obtain a first partial derivative dFdx and a second partial derivative dFdy; positions of n sampling points of a target image are determined according to the pixel coordinates (u, v), the first partial derivative dFdx and the second partial derivative dFdy, so that the selection of the positions of the sampling points changes with the change of the partial derivatives of the pixel coordinates. The first partial derivative dFdx and the second partial derivative dFdy can reflect the degree of distortion. For different pixels on a display device, the positions of corresponding sampling points may be different rather than fixed, so that the selection of the positions of the sampling points is more reasonable, thereby improving the display effect of the display color presented by the display, and being applicable to distorted images. For rendering of images with a resolution higher than the screen resolution, the clarity of the rendering is significantly improved, the jagged edges are basically eliminated, and the problem of flickering artifacts is also greatly improved.

在本公开的一些实施例中,根据所述像素坐标和所述偏导数确定所述目标图像上的n个采样点,包括:根据所述偏导数确定在所述屏幕坐标系的方向上的采样距离;根所述像素坐标和所述屏幕坐标系的方向上的采样距离确定所述目标图像上n个采样点。In some embodiments of the present disclosure, determining n sampling points on the target image based on the pixel coordinates and the partial derivatives includes: determining a sampling distance in the direction of the screen coordinate system based on the partial derivatives; and determining the n sampling points on the target image based on the sampling distance in the direction of the pixel coordinates and the screen coordinate system.

一些实施例中,偏导数反应了目标图像的畸变程度,因此通过偏导数来确定采样距离,采样距离可以是距离像素坐标的距离,或者,采样距离可以是用于确定距离像素坐标的距离的参照。根据采样距离,从而确定出采样点与像素坐标的间隔或者差值,从而确定出采样点的位置。一些实施例中,采样点的数量不同时,采样点的位置可以不同,可以是根据采样距离和采样点的数量n来确定距离的采样点相对于像素坐标的位置。In some embodiments, the partial derivative reflects the degree of distortion of the target image, so the sampling distance is determined by the partial derivative, and the sampling distance may be the distance from the pixel coordinates, or the sampling distance may be a reference for determining the distance from the pixel coordinates. According to the sampling distance, the interval or difference between the sampling point and the pixel coordinates is determined, thereby determining the position of the sampling point. In some embodiments, when the number of sampling points is different, the position of the sampling point may be different, and the position of the sampling point relative to the pixel coordinates may be determined according to the sampling distance and the number of sampling points n.

在本公开的一些实施例中,根据所述像素坐标(u,v)、第一偏导数dFdx和第二偏导数dFdy确定所述目标图像上的n个采样点,包括:根据所述第一偏导数dFdx确定在所述第一方向x上的第一距离dx;根据所述第二偏导数dFdy确定在所述第二方向y上的第二距离dy;根据所述像素坐标(u,v)、所述第一距离dx和第二距离dy确定所述目标图像上的n个采样点。In some embodiments of the present disclosure, n sampling points on the target image are determined according to the pixel coordinates (u, v), the first partial derivative dFdx and the second partial derivative dFdy, including: determining a first distance dx in the first direction x according to the first partial derivative dFdx; determining a second distance dy in the second direction y according to the second partial derivative dFdy; and determining n sampling points on the target image according to the pixel coordinates (u, v), the first distance dx and the second distance dy.

一些实施例中,当确定采样点的位置时,需要考虑到变化率的大小,第一偏导数dFdx表示了像素坐标在第一方向x上的变化率,第二偏导数dFdy表示了像素坐标在第二方向y上的变化率,这两个变化率也就影响了采样点在第一方向x和第二方向y上的间隔。第一距离dx和第二距离dy为采样距离,其分别表征了在第一方向x和第二方向y上需要参考的距离像素坐标的距离。In some embodiments, when determining the position of the sampling point, the magnitude of the rate of change needs to be considered. The first partial derivative dFdx represents the rate of change of the pixel coordinates in the first direction x, and the second partial derivative dFdy represents the rate of change of the pixel coordinates in the second direction y. These two rates of change also affect the intervals of the sampling points in the first direction x and the second direction y. The first distance dx and the second distance dy are sampling distances, which respectively represent the distances from the pixel coordinates that need to be referenced in the first direction x and the second direction y.

在本公开的一些实施例中,根据所述像素坐标(u,v)、所述第一距离dx和第二距离dy确定所述目标图像上的n个采样点,包括:所述像素坐标(u,v)在屏幕坐标系中的坐标为(x0,y0);所述采样点的个数为4个,在以第一方向和第二方向为轴的坐标系中分别为(x0+dx,y0)、(x0-dx,y0)、(x0,y0+dy)和(x0,y0-dy),或者,所述采样点的个数为4个,在以第一方向和第二方向为轴的坐标系中分别为(x0+dx,y0+dy)、(x0+dx,y0-dy)、(x0-dx,y0+dy)和(x0-dx,y0-dy)。In some embodiments of the present disclosure, n sampling points on the target image are determined according to the pixel coordinates (u, v), the first distance dx and the second distance dy, including: the coordinates of the pixel coordinates (u, v) in the screen coordinate system are (x 0 , y 0 ); the number of the sampling points is 4, which are (x 0 +dx, y 0 ), (x 0 -dx, y 0 ), (x 0 , y 0 +dy) and (x 0 , y 0 -dy) in the coordinate system with the first direction and the second direction as axes, respectively; or, the number of the sampling points is 4, which are (x 0 +dx, y 0 +dy), (x 0 +dx, y 0 -dy), (x 0 -dx, y 0 +dy) and (x 0 -dx, y 0 -dy) in the coordinate system with the first direction and the second direction as axes , respectively .

一些实施例中,如图8所示,图8中的方框为目标像素对应的片段,目标片段中心的坐标为(x0,y0),其展示了从中心点向四周延伸第一距离dx、第二距离dy后得到的四个采样点。另一些实施例中,可以是以2倍dx和2倍dy为长和宽做矩形,矩形中心与片段中心点重合,矩形的四个顶点为采样点。In some embodiments, as shown in FIG8 , the box in FIG8 is a fragment corresponding to the target pixel, and the coordinates of the center of the target fragment are (x 0 , y 0 ), which shows four sampling points obtained by extending the first distance dx and the second distance dy from the center point to the surrounding areas. In other embodiments, a rectangle may be made with 2 times dx and 2 times dy as the length and width, the center of the rectangle coincides with the center point of the fragment, and the four vertices of the rectangle are sampling points.

在本公开的一些实施例中,根据所述第二偏导数dFdy确定在所述第二方向y上的第二距离,包括:设定所述第二距离dy等于所述第二偏导数dFdy的四分之一。一些实施例中,根据所述第一偏导数dFdx确定在所述第一方向x上的第一距离dx,包括:设定所述第一距离dx等于所述第一偏导数dFdx的四分之一。In some embodiments of the present disclosure, determining the second distance in the second direction y according to the second partial derivative dFdy includes: setting the second distance dy equal to one quarter of the second partial derivative dFdy. In some embodiments, determining the first distance dx in the first direction x according to the first partial derivative dFdx includes: setting the first distance dx equal to one quarter of the first partial derivative dFdx.

一些实施例中,第一偏导数dFdx表征从像素坐标沿第一方向x的变化率,因此第一偏导数dFdx的一半靠近从当前的片段沿第一方向到相邻的片段的边界,而第一偏导数dFdx的四分之一,靠近当前的片段从中心点到边界的一半,但也可能不重合。第二偏导数dFdx类似表征了从像素坐标沿第二方向y的变化率,因此第二偏导数dFdy的一半靠近从当前的片段沿第二方向到相邻的片段的边界,而第二偏导数dFdy的四分之一,靠近当前的片段从中心点到边界的一半,但也可能不重合。In some embodiments, the first partial derivative dFdx represents the rate of change from the pixel coordinates along the first direction x, so half of the first partial derivative dFdx is close to the boundary from the current segment along the first direction to the adjacent segment, and a quarter of the first partial derivative dFdx is close to the half of the current segment from the center point to the boundary, but they may not coincide. The second partial derivative dFdx similarly represents the rate of change from the pixel coordinates along the second direction y, so half of the second partial derivative dFdy is close to the boundary from the current segment along the second direction to the adjacent segment, and a quarter of the second partial derivative dFdy is close to the half of the current segment from the center point to the boundary, but they may not coincide.

在本公开的一些实施例中,根据所述目标图像上n个所述采样点的颜色,确定所述目标像素的显示颜色,包括:用n个所述采样点的颜色的平均值,作为目标像素的显示颜色。一些实施例中,通过n个采样点的颜色的平均值作为显示颜色,相比于直接用片段中心点的颜色的方式更加准确合理。In some embodiments of the present disclosure, determining the display color of the target pixel according to the colors of the n sampling points on the target image includes: using the average value of the colors of the n sampling points as the display color of the target pixel. In some embodiments, using the average value of the colors of the n sampling points as the display color is more accurate and reasonable than directly using the color of the center point of the fragment.

在本公开的一些实施例中,所述目标图像为畸变图像。一些实施例中,显示设备的透镜为凸透镜或凹透镜,为了保证用户所查看的图像正确显示,因此目标图像为畸变图像,例如为如图6所示的与凸透镜适配的四边内凹的枕形图像,目标图像上与显示设备的像素对应的片段可以是非矩形的区域,可以是如图6中所示的畸变的四边形。In some embodiments of the present disclosure, the target image is a distorted image. In some embodiments, the lens of the display device is a convex lens or a concave lens. In order to ensure that the image viewed by the user is displayed correctly, the target image is a distorted image, for example, a four-sided concave pillow-shaped image adapted to the convex lens as shown in FIG6 , and the fragment on the target image corresponding to the pixel of the display device may be a non-rectangular area, and may be a distorted quadrilateral as shown in FIG6 .

一些实施例中,所述目标图像的分辨率,大于显示所述目标图像的显示设备的分辨率。因此,目标图像中的像素大于显示设备所能显示的像素,所以一个片段可以覆盖目标图像本身的一个以上的像素。In some embodiments, the resolution of the target image is greater than the resolution of the display device displaying the target image. Therefore, the pixels in the target image are larger than the pixels that can be displayed by the display device, so a fragment can cover more than one pixel of the target image itself.

为了更好的说明本公开提出的方法,以下提出一个具体的实施例,本实施例中为了实现自动选取合适的采样点。需要做到显示设备不同位置的像素对应的采样点采样的效果是等效的。由于glsl(GL Shader Language)提供了计算偏导数的函数dFdx()/dFdy(),用这些函数可以分别计算(u,v)(像素坐标)在第一方向x和第二方向y方向上的偏导数,如果两个像素之间的u/v差别比较大/小,所计算的偏导数也会比较大/小,这样就可以根据u/v的变化率得到与之对应的数值,可以基于这个数值来计算采样点距离中心点的位置,比如采用(u,v)分别在第一方向x和第二方向y方向上的偏导数的1/4作为采样点分别在第一方向x和第二方向y方向上距离中心点的距离,也就是在当前的目标像素在目标图像上对应的片段的中心,取其左上、右上、右下、左下四个点为子采样点。其中dx和dy可以看成是相邻两个像素坐标值在第一方向和第二方向的差值的1/4。In order to better illustrate the method proposed in the present disclosure, a specific embodiment is proposed below. In this embodiment, in order to realize the automatic selection of appropriate sampling points. It is necessary to achieve that the sampling effects of the sampling points corresponding to the pixels at different positions of the display device are equivalent. Since glsl (GL Shader Language) provides the functions dFdx()/dFdy() for calculating partial derivatives, these functions can be used to calculate the partial derivatives of (u, v) (pixel coordinates) in the first direction x and the second direction y respectively. If the difference between u/v between two pixels is relatively large/small, the calculated partial derivatives will also be relatively large/small, so that the corresponding value can be obtained according to the rate of change of u/v, and the position of the sampling point from the center point can be calculated based on this value. For example, 1/4 of the partial derivatives of (u, v) in the first direction x and the second direction y are used as the distance of the sampling point from the center point in the first direction x and the second direction y, that is, at the center of the fragment corresponding to the current target pixel on the target image, the four points of the upper left, upper right, lower right and lower left are taken as sub-sampling points. Among them, dx and dy can be regarded as 1/4 of the difference between the coordinate values of two adjacent pixels in the first direction and the second direction.

本公开还提出一种显示处理装置,该显示处理装置可以是显示设备,例如可以是虚拟现实设备、增强现实设备或扩展现实设备,其包括:The present disclosure further provides a display processing device, which may be a display device, such as a virtual reality device, an augmented reality device, or an extended reality device, and includes:

确定单元,用于确定显示设备的目标像素在目标图像上对应位置的像素坐标;A determination unit, used to determine the pixel coordinates of a target pixel of a display device at a corresponding position on a target image;

计算单元,用于确定所述像素坐标在屏幕坐标系的方向上的偏导数;A calculation unit, used to determine the partial derivative of the pixel coordinate in the direction of the screen coordinate system;

所述计算单元,还用于根据所述像素坐标和所述偏导数确定所述目标图像上的n个采样点,n不小于2;The calculation unit is further used to determine n sampling points on the target image according to the pixel coordinates and the partial derivatives, where n is not less than 2;

所述计算单元,用于根据所述目标图像上n个所述采样点的颜色,确定所述目标像素的显示颜色。The calculation unit is used to determine the display color of the target pixel according to the colors of the n sampling points on the target image.

一些实施例中,根据所述像素坐标和所述偏导数确定所述目标图像上的n个采样点,包括:In some embodiments, determining n sampling points on the target image according to the pixel coordinates and the partial derivatives includes:

根据所述偏导数确定在所述屏幕坐标系的方向上的采样距离;Determine a sampling distance in the direction of the screen coordinate system according to the partial derivative;

根所述像素坐标和所述屏幕坐标系的方向上的采样距离确定所述目标图像上n个采样点。n sampling points on the target image are determined based on the pixel coordinates and the sampling distance in the direction of the screen coordinate system.

一些实施例中,确定所述像素坐标在屏幕坐标系的方向上的偏导数,包括:确定像素坐标(u,v)在屏幕坐标系的第一方向x和第二方向y上的偏导数,得到第一偏导数dFdx和第二偏导数dFdy;In some embodiments, determining the partial derivatives of the pixel coordinates in the direction of the screen coordinate system includes: determining the partial derivatives of the pixel coordinates (u, v) in the first direction x and the second direction y of the screen coordinate system to obtain a first partial derivative dFdx and a second partial derivative dFdy;

根据所述像素坐标和所述偏导数确定所述目标图像上的n个采样点,包括:根据所述像素坐标(u,v)、所述第一偏导数dFdx和所述第二偏导数dFdy确定所述目标图像上的n个采样点。Determining n sampling points on the target image according to the pixel coordinates and the partial derivatives includes: determining n sampling points on the target image according to the pixel coordinates (u, v), the first partial derivative dFdx and the second partial derivative dFdy.

一些实施例中,根据所述像素坐标(u,v)、所述第一偏导数dFdx和所述第二偏导数dFdy确定所述目标图像上的n个采样点,包括:In some embodiments, determining n sampling points on the target image according to the pixel coordinates (u, v), the first partial derivative dFdx and the second partial derivative dFdy comprises:

根据所述第一偏导数dFdx确定在所述第一方向x上的第一距离dx;Determine a first distance dx in the first direction x according to the first partial derivative dFdx;

根据所述第二偏导数dFdy确定在所述第二方向y上的第二距离dy;Determine a second distance dy in the second direction y according to the second partial derivative dFdy;

根据所述像素坐标(u,v)、所述第一距离dx和第二距离dy确定所述目标图像上的n个采样点。Determine n sampling points on the target image according to the pixel coordinates (u, v), the first distance dx and the second distance dy.

一些实施例中,根据所述像素坐标(u,v)、所述第一距离dx和第二距离dy确定所述目标图像上的n个采样点,包括:In some embodiments, determining n sampling points on the target image according to the pixel coordinates (u, v), the first distance dx and the second distance dy includes:

所述像素坐标(u,v)在所述屏幕坐标系中的坐标为(x0,y0);The coordinates of the pixel coordinate (u, v) in the screen coordinate system are (x 0 , y 0 );

所述采样点的个数为4个,分别为(x0+dx,y0)、(x0-dx,y0)、(x0,y0+dy)和(x0,y0-dy),或者,The number of the sampling points is 4, namely (x 0 +dx, y 0 ), (x 0 -dx, y 0 ), (x 0 , y 0 +dy) and (x 0 , y 0 -dy), or,

所述采样点的个数为4个,分别为(x0+dx,y0+dy)、(x0+dx,y0-dy)、(x0-dx,y0+dy)和(x0-dx,y0-dy)。The number of the sampling points is 4, namely (x 0 +dx, y 0 +dy), (x 0 +dx, y 0 -dy), (x 0 -dx, y 0 +dy) and (x 0 -dx, y 0 -dy).

一些实施例中,根据所述第一偏导数dFdx确定在所述第一方向x上的第一距离dx,包括:设定所述第一距离dx等于所述第一偏导数dFdx的四分之一;和/或,In some embodiments, determining the first distance dx in the first direction x according to the first partial derivative dFdx includes: setting the first distance dx equal to one quarter of the first partial derivative dFdx; and/or,

根据所述第二偏导数dFdy确定在所述第二方向y上的第二距离,包括:设定所述第二距离dy等于所述第二偏导数dFdy的四分之一。Determining the second distance in the second direction y according to the second partial derivative dFdy includes: setting the second distance dy equal to one quarter of the second partial derivative dFdy.

一些实施例中,根据所述目标图像上n个所述采样点的颜色,确定所述目标像素的显示颜色,包括:In some embodiments, determining the display color of the target pixel according to the colors of the n sampling points on the target image includes:

用n个所述采样点的颜色的平均值,作为所述目标像素的显示颜色。The average value of the colors of the n sampling points is used as the display color of the target pixel.

一些实施例中,所述目标图像为非矩形的畸变图像;和/或,In some embodiments, the target image is a non-rectangular distorted image; and/or,

所述目标图像的分辨率,大于显示所述目标图像的显示设备的分辨率。The resolution of the target image is greater than the resolution of a display device that displays the target image.

对于装置的实施例而言,由于其基本对应于方法实施例,所以相关之处参见方法实施例的部分说明即可。以上所描述的装置实施例仅仅是示意性的,其中所述作为分离模块说明的模块可以是或者也可以不是分开的。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。For the embodiments of the device, since they basically correspond to the method embodiments, the relevant parts refer to the partial description of the method embodiments. The device embodiments described above are merely illustrative, wherein the modules described as separation modules may or may not be separated. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of the present embodiment. Those of ordinary skill in the art can understand and implement without paying creative work.

以上,基于实施例和应用例说明了本公开的方法及装置。此外,本公开还提供一种电子设备及计算机可读存储介质,以下说明这些电子设备和计算机可读存储介质。The method and device of the present disclosure are described above based on the embodiments and application examples. In addition, the present disclosure also provides an electronic device and a computer-readable storage medium, which are described below.

下面参考图9,其示出了适于用来实现本公开实施例的电子设备(例如终端设备或服务器)800的结构示意图。本公开实施例中的终端设备可以包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多媒体播放器)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。图中示出的电子设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。Referring to FIG9 below, it shows a schematic diagram of the structure of an electronic device (e.g., a terminal device or a server) 800 suitable for implementing the embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (e.g., vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. The electronic device shown in the figure is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

电子设备800可以包括处理装置(例如中央处理器、图形处理器等)801,其可以根据存储在只读存储器(ROM)802中的程序或者从存储装置808加载到随机访问存储器(RAM)803中的程序而执行各种适当的动作和处理。在RAM803中,还存储有电子设备800操作所需的各种程序和数据。处理装置801、ROM 802以及RAM 803通过总线804彼此相连。输入/输出(I/O)接口805也连接至总线804。The electronic device 800 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage device 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the electronic device 800 are also stored. The processing device 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input/output (I/O) interface 805 is also connected to the bus 804.

通常,以下装置可以连接至I/O接口805:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置806;包括例如液晶显示器(LCD)、扬声器、振动器等的输出装置807;包括例如磁带、硬盘等的存储装置808;以及通信装置809。通信装置809可以允许电子设备800与其他设备进行无线或有线通信以交换数据。虽然图中示出了具有各种装置的电子设备800,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。Typically, the following devices may be connected to the I/O interface 805: input devices 806 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 807 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 808 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 809. The communication device 809 may allow the electronic device 800 to communicate with other devices wirelessly or by wire to exchange data. Although the electronic device 800 with various devices is shown in the figure, it should be understood that it is not required to implement or have all the devices shown. More or fewer devices may be implemented or have alternatively.

特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置809从网络上被下载和安装,或者从存储装置808被安装,或者从ROM 802被安装。在该计算机程序被处理装置801执行时,执行本公开实施例的方法中限定的上述功能。In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 809, or installed from a storage device 808, or installed from a ROM 802. When the computer program is executed by the processing device 801, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

需要说明的是,本公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

在一些实施方式中,客户端、服务器可以利用诸如HTTP(HyperText TransferProtocol,超文本传输协议)之类的任何当前已知或未来研发的网络协议进行通信,并且可以与任意形式或介质的数字数据通信(例如,通信网络)互连。通信网络的示例包括局域网(“LAN”),广域网(“WAN”),网际网(例如,互联网)以及端对端网络(例如,ad hoc端对端网络),以及任何当前已知或未来研发的网络。In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。The computer-readable medium may be included in the electronic device, or may exist independently without being installed in the electronic device.

上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备执行上述的本公开的方法。The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method of the present disclosure.

可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and/or flow chart, and the combination of the square boxes in the block diagram and/or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

描述于本公开实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,单元的名称在某种情况下并不构成对该单元本身的限定。The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit does not, in some cases, constitute a limitation on the unit itself.

本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、片上系统(SOC)、复杂可编程逻辑设备(CPLD)等等。The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.

在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

根据本公开的一个或多个实施例,提供了一种显示处理方法,包括:According to one or more embodiments of the present disclosure, a display processing method is provided, including:

确定显示设备的目标像素在目标图像上对应位置的像素坐标(u,v);Determine the pixel coordinates (u, v) of the corresponding position of the target pixel of the display device on the target image;

确定所述像素坐标在屏幕坐标系的方向上的偏导数;Determine the partial derivative of the pixel coordinate in the direction of the screen coordinate system;

根据像素坐标和偏导数确定目标图像上的n个采样点,n不小于2;Determine n sampling points on the target image according to pixel coordinates and partial derivatives, where n is not less than 2;

根据目标图像上n个采样点的颜色,确定目标像素的显示颜色。Determine the display color of the target pixel based on the colors of n sampling points on the target image.

根据本公开的一个或多个实施例,提供了一种显示处理方法,根据所述像素坐标和所述偏导数确定所述目标图像上的n个采样点,包括:According to one or more embodiments of the present disclosure, a display processing method is provided, which determines n sampling points on the target image according to the pixel coordinates and the partial derivatives, including:

根据所述偏导数确定在所述屏幕坐标系的方向上的采样距离;Determine a sampling distance in the direction of the screen coordinate system according to the partial derivative;

根所述像素坐标和所述屏幕坐标系的方向上的采样距离确定所述目标图像上n个采样点。n sampling points on the target image are determined based on the pixel coordinates and the sampling distance in the direction of the screen coordinate system.

根据本公开的一个或多个实施例,提供了一种显示处理方法,确定所述像素坐标在屏幕坐标系的方向上的偏导数,包括:确定像素坐标(u,v)在屏幕坐标系的第一方向x和第二方向y上的偏导数,得到第一偏导数dFdx和第二偏导数dFdy;According to one or more embodiments of the present disclosure, a display processing method is provided, which determines the partial derivatives of the pixel coordinates in the direction of the screen coordinate system, including: determining the partial derivatives of the pixel coordinates (u, v) in the first direction x and the second direction y of the screen coordinate system to obtain a first partial derivative dFdx and a second partial derivative dFdy;

根据所述像素坐标和所述偏导数确定所述目标图像上的n个采样点,包括:根据所述像素坐标(u,v)、所述第一偏导数dFdx和所述第二偏导数dFdy确定所述目标图像上的n个采样点。Determining n sampling points on the target image according to the pixel coordinates and the partial derivatives includes: determining n sampling points on the target image according to the pixel coordinates (u, v), the first partial derivative dFdx and the second partial derivative dFdy.

根据本公开的一个或多个实施例,提供了一种显示处理方法,根据像素坐标(u,v)、第一偏导数dFdx和第二偏导数dFdy确定目标图像上的n个采样点,包括:According to one or more embodiments of the present disclosure, a display processing method is provided, which determines n sampling points on a target image according to pixel coordinates (u, v), a first partial derivative dFdx, and a second partial derivative dFdy, including:

根据第一偏导数dFdx确定在第一方向x上的第一距离dx;Determine a first distance dx in a first direction x according to the first partial derivative dFdx;

根据第二偏导数dFdy确定在第二方向y上的第二距离dy;Determine a second distance dy in the second direction y according to the second partial derivative dFdy;

根据像素坐标(u,v)、第一距离dx和第二距离dy确定目标图像上的n个采样点。Determine n sampling points on the target image according to the pixel coordinates (u, v), the first distance dx and the second distance dy.

根据本公开的一个或多个实施例,提供了一种显示处理方法,根据像素坐标(u,v)、第一距离dx和第二距离dy确定目标图像上的n个采样点,包括:According to one or more embodiments of the present disclosure, a display processing method is provided, which determines n sampling points on a target image according to pixel coordinates (u, v), a first distance dx, and a second distance dy, including:

像素坐标(u,v)在以第一方向和第二方向为轴的坐标系中的坐标为(x0,y0);The coordinates of the pixel coordinate (u, v) in the coordinate system with the first direction and the second direction as axes are (x 0 ,y 0 );

采样点的个数为4个,分别为(x0+dx,y0)、(x0-dx,y0)、(x0,y0+dy)和(x0,y0-dy),或者,The number of sampling points is 4, namely (x 0 +dx,y 0 ), (x 0 -dx,y 0 ), (x 0 ,y 0 +dy) and (x 0 ,y 0 -dy), or,

采样点的个数为4个,分别为(x0+dx,y0+dy)、(x0+dx,y0-dy)、(x0-dx,y0+dy)和(x0-dx,y0-dy)。The number of sampling points is 4, namely (x 0 +dx, y 0 +dy), (x 0 +dx, y 0 -dy), (x 0 -dx, y 0 +dy) and (x 0 -dx, y 0 -dy).

根据本公开的一个或多个实施例,提供了一种显示处理方法,根据第一偏导数dFdx确定在第一方向x上的第一距离dx,包括:设定第一距离dx等于第一偏导数dFdx的四分之一;和/或,According to one or more embodiments of the present disclosure, a display processing method is provided, which determines a first distance dx in a first direction x according to a first partial derivative dFdx, including: setting the first distance dx equal to one quarter of the first partial derivative dFdx; and/or,

根据第二偏导数dFdy确定在第二方向y上的第二距离,包括:设定第二距离dy等于第二偏导数dFdy的四分之一。Determining a second distance in the second direction y according to the second partial derivative dFdy includes: setting the second distance dy equal to one quarter of the second partial derivative dFdy.

根据本公开的一个或多个实施例,提供了一种显示处理方法,根据目标图像上n个采样点的颜色,确定目标像素的显示颜色,包括:According to one or more embodiments of the present disclosure, a display processing method is provided, which determines the display color of a target pixel according to the colors of n sampling points on a target image, including:

用n个采样点的颜色的平均值,作为目标像素的显示颜色。Use the average color of n sampling points as the display color of the target pixel.

根据本公开的一个或多个实施例,提供了一种显示处理方法,目标图像为非矩形的畸变图像。According to one or more embodiments of the present disclosure, a display processing method is provided, wherein a target image is a non-rectangular distorted image.

根据本公开的一个或多个实施例,提供了一种显示处理方法,目标图像的分辨率,大于显示目标图像的显示设备的分辨率。According to one or more embodiments of the present disclosure, a display processing method is provided, in which the resolution of a target image is greater than the resolution of a display device that displays the target image.

根据本公开的一个或多个实施例,提供了一种显示处理装置,包括:According to one or more embodiments of the present disclosure, there is provided a display processing device, including:

确定单元,用于确定显示设备的目标像素在目标图像上对应位置的像素坐标;A determination unit, used to determine the pixel coordinates of a target pixel of a display device at a corresponding position on a target image;

计算单元,用于确定所述像素坐标在屏幕坐标系的方向上的偏导数;A calculation unit, used to determine the partial derivative of the pixel coordinate in the direction of the screen coordinate system;

所述计算单元,还用于根据所述像素坐标和所述偏导数确定所述目标图像上的n个采样点,n不小于2;The calculation unit is further used to determine n sampling points on the target image according to the pixel coordinates and the partial derivatives, where n is not less than 2;

所述计算单元,用于根据所述目标图像上n个所述采样点的颜色,确定所述目标像素的显示颜色。根据本公开的一个或多个实施例,提供了一种电子设备,包括:至少一个存储器和至少一个处理器;The calculation unit is used to determine the display color of the target pixel according to the colors of the n sampling points on the target image. According to one or more embodiments of the present disclosure, there is provided an electronic device, including: at least one memory and at least one processor;

其中,所述至少一个存储器用于存储程序代码,所述至少一个处理器用于调用所述至少一个存储器所存储的程序代码执行上述中任一项所述的方法。The at least one memory is used to store program codes, and the at least one processor is used to call the program codes stored in the at least one memory to execute any one of the above methods.

根据本公开的一个或多个实施例,提供了一种计算机可读存储介质,所述计算机可读存储介质用于存储程序代码,所述程序代码在被处理器运行时,促使所述处理器执行上述方法。According to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium is used to store program code, and when the program code is executed by a processor, the processor is prompted to execute the above method.

以上描述仅为本公开的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本公开中所涉及的公开范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述公开构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other.

此外,虽然采用特定次序描绘了各操作,但是这不应当理解为要求这些操作以所示出的特定次序或以顺序次序执行来执行。在一定环境下,多任务和并行处理可能是有利的。同样地,虽然在上面论述中包含了若干具体实现细节,但是这些不应当被解释为对本公开的范围的限制。在单独的实施例的上下文中描述的某些特征还可以组合地实现在单个实施例中。相反地,在单个实施例的上下文中描述的各种特征也可以单独地或以任何合适的子组合的方式实现在多个实施例中。In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

尽管已经采用特定于结构特征和/或方法逻辑动作的语言描述了本主题,但是应当理解所附权利要求书中所限定的主题未必局限于上面描述的特定特征或动作。相反,上面所描述的特定特征和动作仅仅是实现权利要求书的示例形式。Although the subject matter has been described in language specific to structural features and/or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.

Claims (11)

1. A display processing method, characterized by comprising:
determining pixel coordinates of a corresponding position of a target pixel of the display device on the target image;
Determining a partial derivative of the pixel coordinates in the direction of a screen coordinate system;
determining n sampling points on the target image according to the pixel coordinates and the partial derivative, wherein n is not less than 2;
And determining the display color of the target pixel according to the colors of the n sampling points on the target image.
2. The method of claim 1, wherein determining n sampling points on the target image from the pixel coordinates and the partial derivatives comprises:
determining a sampling distance in the direction of the screen coordinate system according to the partial derivative;
And determining n sampling points on the target image according to the pixel coordinates and the sampling distances in the direction of the screen coordinate system.
3. The method of claim 1, wherein the step of determining the position of the substrate comprises,
Determining the partial derivative of the pixel coordinates in the direction of the screen coordinate system comprises: determining partial derivatives of the pixel coordinates (u, v) in a first direction x and a second direction y of the screen coordinate system to obtain a first partial derivative dFdx and a second partial derivative dFdy;
Determining n sampling points on the target image according to the pixel coordinates and the partial derivative, including: n sampling points on the target image are determined from the pixel coordinates (u, v), the first partial derivative dFdx, and the second partial derivative dFdy.
4. A method according to claim 3, wherein determining n sampling points on the target image from the pixel coordinates (u, v), the first partial derivative dFdx and the second partial derivative dFdy comprises:
Determining a first distance dx in the first direction x from the first partial derivative dFdx;
determining a second distance dy in the second direction y from the second partial derivative dFdy;
N sampling points on the target image are determined from the pixel coordinates (u, v), the first distance dx and the second distance dy.
5. The method of claim 4, wherein determining n sampling points on the target image from the pixel coordinates (u, v), the first distance dx, and the second distance dy comprises:
The pixel coordinates (u, v) have coordinates (x 0,y0) in the screen coordinate system;
The number of the sampling points is 4, namely (x 0+dx,y0)、(x0-dx,y0)、(x0,y0 +dy) and (x 0,y0 -dy), or
The number of the sampling points is 4, and the sampling points are (x 0+dx,y0+dy)、(x0+dx,y0-dy)、(x0-dx,y0 +dy) and (x 0-dx,y0 -dy) respectively.
6. The method of claim 4, wherein determining a first distance dx in the first direction x from the first partial derivative dFdx comprises: setting the first distance dx equal to a quarter of the first partial derivative dFdx; and/or the number of the groups of groups,
Determining a second distance in the second direction y from the second partial derivative dFdy comprises: the second distance dy is set equal to one fourth of the second partial derivative dFdy.
7. The method of claim 1, wherein determining the display color of the target pixel based on the colors of the n sampling points on the target image comprises:
And using the average value of the colors of the n sampling points as the display color of the target pixel.
8. The method of claim 1, wherein the step of determining the position of the substrate comprises,
The target image is a non-rectangular distorted image;
And/or the number of the groups of groups,
The resolution of the target image is greater than the resolution of a display device displaying the target image.
9. A display processing apparatus, comprising:
A determining unit for determining pixel coordinates of a corresponding position of a target pixel of the display device on the target image;
A calculation unit for determining a partial derivative of the pixel coordinates in a direction of a screen coordinate system;
The computing unit is further used for determining n sampling points on the target image according to the pixel coordinates and the partial derivative, wherein n is not less than 2;
The computing unit is used for determining the display color of the target pixel according to the colors of the n sampling points on the target image.
10. An electronic device, comprising:
at least one memory and at least one processor;
Wherein the at least one memory is configured to store program code, and the at least one processor is configured to invoke the program code stored by the at least one memory to perform the method of any of claims 1 to 8.
11. A computer readable storage medium for storing program code which, when executed by a processor, causes the processor to perform the method of any one of claims 1 to 8.
CN202310180283.1A 2023-02-15 2023-02-15 Display processing method, device, electronic device and storage medium Pending CN118505830A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310180283.1A CN118505830A (en) 2023-02-15 2023-02-15 Display processing method, device, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310180283.1A CN118505830A (en) 2023-02-15 2023-02-15 Display processing method, device, electronic device and storage medium

Publications (1)

Publication Number Publication Date
CN118505830A true CN118505830A (en) 2024-08-16

Family

ID=92232025

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310180283.1A Pending CN118505830A (en) 2023-02-15 2023-02-15 Display processing method, device, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN118505830A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118939221A (en) * 2024-10-12 2024-11-12 之江实验室 A data sampling method, device and equipment based on display screen resolution

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118939221A (en) * 2024-10-12 2024-11-12 之江实验室 A data sampling method, device and equipment based on display screen resolution

Similar Documents

Publication Publication Date Title
EP4044122A1 (en) Image processing method and apparatus, computer storage medium, and electronic device
WO2021139382A1 (en) Face image processing method and apparatus, readable medium, and electronic device
WO2024198855A1 (en) Scene rendering method and apparatus, device, computer readable storage medium, and product
US20240257436A1 (en) Image rendering method and apparatus, electronic device, and storage medium
US20240273808A1 (en) Texture mapping method and apparatus, device and storage medium
US20250225681A1 (en) Image compression and transmission method and apparatus, electronic device, and storage medium
US20250104354A1 (en) Virtual object generation method and apparatus, device, and storage medium
US20250095249A1 (en) Method, apparatus, device and medium for subtitle displaying
CN114742856A (en) A video processing method, device, equipment and medium
US20250046008A1 (en) 3d target point rendering method and apparatus, device, and storage medium
EP4270322A1 (en) Image processing method and apparatus, and electronic device
CN118505830A (en) Display processing method, device, electronic device and storage medium
CN114742934B (en) Image rendering method and device, readable medium and electronic equipment
CN111862342B (en) Augmented reality texture processing method and device, electronic equipment and storage medium
US12367564B2 (en) Image processing method, device, and medium
CN117608396A (en) Mixed reality-based processing method, device, terminal and storage medium
CN113506356B (en) Method and device for drawing area map, readable medium and electronic equipment
CN113963000B (en) Image segmentation method, device, electronic equipment and program product
TWI861214B (en) Methods and apparatus for multiple lens distortion correction
CN117808955A (en) Method, apparatus, device, storage medium and computer program product for aligning images
CN114723600A (en) Method, device, equipment, storage medium and program product for generating cosmetic special effect
CN115170674B (en) Camera principal point calibration method, device, equipment and medium based on single image
CN118840467A (en) Image processing method, device, terminal and storage medium
CN117408865A (en) Terminal graphics processor control method, device, electronic equipment and storage medium
CN115994968A (en) Special effect processing method and equipment

Legal Events

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