[go: up one dir, main page]

CN111028139B - A method and system for expanding bitmap points - Google Patents

A method and system for expanding bitmap points Download PDF

Info

Publication number
CN111028139B
CN111028139B CN201911057946.0A CN201911057946A CN111028139B CN 111028139 B CN111028139 B CN 111028139B CN 201911057946 A CN201911057946 A CN 201911057946A CN 111028139 B CN111028139 B CN 111028139B
Authority
CN
China
Prior art keywords
points
rgb
point
pixel
matrix
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
CN201911057946.0A
Other languages
Chinese (zh)
Other versions
CN111028139A (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.)
Shenzhen Power Supply Bureau Co Ltd
Original Assignee
Shenzhen Power Supply Bureau 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 Shenzhen Power Supply Bureau Co Ltd filed Critical Shenzhen Power Supply Bureau Co Ltd
Priority to CN201911057946.0A priority Critical patent/CN111028139B/en
Publication of CN111028139A publication Critical patent/CN111028139A/en
Application granted granted Critical
Publication of CN111028139B publication Critical patent/CN111028139B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/04Context-preserving transformations, e.g. by using an importance map
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)
  • Facsimile Image Signal Circuits (AREA)

Abstract

本发明提供了一种扩展图像点位的方法,其包括步骤:步骤一,根据预定的扩展系数,对于待扩展图像点位矩阵中相应像素点位的坐标进行平移操作,形成多个新矩阵并获得每一个新矩阵的所有点的坐标;步骤二,获得新矩阵中各像素点至四个角位像素点的距离关系,并根据四个角位像素点的颜色灰度值进行计算,获得所述每一像素点的颜色灰度值;步骤三,根据所有新矩阵的所有点的颜色灰度值,组合形成扩展后的图像。本发明还提供了相应的系统。实施本发明,可以自动增加位图的点位,从而提高图像的清晰度。

The invention provides a method for expanding image points, which includes the following steps: Step 1: According to a predetermined expansion coefficient, perform a translation operation on the coordinates of corresponding pixel points in the image point matrix to be expanded to form multiple new matrices and Obtain the coordinates of all points in each new matrix; step two, obtain the distance relationship between each pixel in the new matrix and the four corner pixels, and calculate based on the color grayscale values of the four corner pixels to obtain all The color gray value of each pixel is described; step three is to combine the expanded image based on the color gray value of all points in all new matrices. The invention also provides a corresponding system. By implementing the present invention, the points of the bitmap can be automatically increased, thereby improving the clarity of the image.

Description

一种扩展位图点位的方法及系统A method and system for expanding bitmap points

技术领域Technical field

本发明涉及图像处理技术领域,具体为一种扩展位图点位的方法及系统。The present invention relates to the technical field of image processing, specifically a method and system for expanding bitmap points.

背景技术Background technique

在对计算软件中,在一些情形下,需要将矩阵数据描绘成图像,但是由于矩阵的数据较少,描绘出来的图像不清晰,此时需要提高图片的清晰度。In computing software, in some cases, matrix data needs to be depicted as an image. However, because the matrix contains less data, the depicted image is not clear. In this case, the clarity of the image needs to be improved.

在现有技术中,需要将图像导入特定的软件,如photoshop、美图秀秀、Alien SkinExposure,等软件对图像做二次处理。但是,现有的这些方法中,需要人工将图片导入相关的软件做二次处理,或将别的软件集成到新项目中,实现较复杂,技术要求较大,或者扩展效果不佳。In the existing technology, the image needs to be imported into specific software, such as photoshop, Meitu Xiuxiu, Alien SkinExposure, and other software to perform secondary processing on the image. However, these existing methods require manually importing images into related software for secondary processing, or integrating other software into new projects. The implementation is complex, the technical requirements are large, or the expansion effect is poor.

发明内容Contents of the invention

本发明所要解决的技术问题在于,提供一种扩展位图点位的方法及系统,可以自动增加位图的点位,从而提高图像的清晰度。The technical problem to be solved by the present invention is to provide a method and system for expanding the points of a bitmap, which can automatically increase the points of the bitmap, thereby improving the clarity of the image.

为解决上述技术问题,本发明的一方面,提供一种扩展图像点位的方法,其包括以下步骤:In order to solve the above technical problems, one aspect of the present invention provides a method for expanding image points, which includes the following steps:

步骤一,根据预定的扩展系数,对于待扩展图像点位矩阵中除原点之外的每个原始像素点位的坐标进行平移操作,使待扩展图像点位矩阵中相邻的四个像素点位于扩展后的新的矩阵的四个角上,将原始四个像素点的灰度值赋值给所述新矩阵的四个角位的像素点,获得每一个新矩阵的所有点的坐标;Step 1: According to the predetermined expansion coefficient, perform a translation operation on the coordinates of each original pixel point in the image point matrix to be expanded except the origin, so that the four adjacent pixel points in the image point matrix to be expanded are located at On the four corners of the expanded new matrix, assign the grayscale values of the original four pixels to the pixels at the four corners of the new matrix to obtain the coordinates of all points of each new matrix;

步骤二,获得新矩阵中除四个角位像素点外每一个像素点至所述四个角位像素点的距离关系,根据所述距离关系以及所述四个角位像素点的颜色灰度值进行计算,获得所述每一像素点的颜色灰度值;Step 2: Obtain the distance relationship between each pixel in the new matrix except the four corner pixels and the four corner pixels, based on the distance relationship and the color grayscale of the four corner pixels. Calculate the value to obtain the color gray value of each pixel;

步骤三,根据所有新矩阵的所有点的颜色灰度值,组合形成扩展后的图像。Step 3: Combine the color and grayscale values of all points of all new matrices to form an expanded image.

优选地,所述步骤一进一步包括:Preferably, said step one further includes:

根据所述预定的扩展系数,获得每相邻的四个原始像素点的X轴平移距离以及Y轴平移距离;According to the predetermined expansion coefficient, obtain the X-axis translation distance and Y-axis translation distance of each adjacent four original pixel points;

根据所述X轴平移距离以及Y轴平移距离对除原点以外的每个原始像素点位的坐标在X轴或/及Y轴方向上进行平移。The coordinates of each original pixel point except the origin are translated in the X-axis or/and Y-axis direction according to the X-axis translation distance and the Y-axis translation distance.

优选地,所述步骤二进一步包括:Preferably, said step two further includes:

根据下述公式分别获得新矩阵中除四个角位像素点外每一个像素点至所述四个角位像素点的距离关系:The distance relationship between each pixel in the new matrix except the four corner pixels and the four corner pixels is obtained according to the following formula:

其中,M为新矩阵中的任意一个像素点,A、B、C、D为四个角位像素点;XMA、XMB、XMC、XMD分别为M点到A、B、C、D四点的位置系数;LMA、LMB、LMC、LMD分别为M点到A、B、C、D四点的距离;Among them, M is any pixel in the new matrix, A, B, C , and D are the four corner pixels; X MA , X MB , X MC , and The position coefficients of four points D; L MA , L MB , L MC , and L MD are the distances from point M to four points A, B, C, and D respectively;

根据下述公式计算所述每一个像素点的颜色灰度值:Calculate the color gray value of each pixel according to the following formula:

MRGB=XMA×ARGB+XMB×BRGB+XMC×CRGB+XMD×DRGB M RGB =X MA ×A RGB +X MB ×B RGB +X MC ×C RGB +X MD ×D RGB

其中,MRGB、ARGB、BRGB、CRGB、DRGB分别为M、A、B、C、D的颜色灰度值。Among them, M RGB , A RGB , B RGB , C RGB , and D RGB are the color grayscale values of M, A, B, C, and D respectively.

相应地,本发明还提供一种扩展图像点位的系统,其包括:Correspondingly, the present invention also provides a system for expanding image points, which includes:

扩展平移单元,用于根据预定的扩展系数,对于待扩展图像点位矩阵中除原点之外的每个原始像素点位的坐标进行平移操作,使待扩展图像点位矩阵中相邻的四个像素点位于扩展后的新的矩阵的四个角上,将原始四个像素点的灰度值赋值给所述新矩阵的四个角位的像素点,获得每一个新矩阵的所有点的坐标;The expansion translation unit is used to perform a translation operation on the coordinates of each original pixel point in the image point matrix to be expanded except the origin according to a predetermined expansion coefficient, so that the four adjacent pixel points in the image point matrix to be expanded are The pixels are located at the four corners of the expanded new matrix. The gray values of the original four pixels are assigned to the pixels at the four corners of the new matrix to obtain the coordinates of all points of each new matrix. ;

灰度值计算单元,用于获得新矩阵中除四个角位像素点外每一个像素点至所述四个角位像素点的距离关系,根据所述距离关系以及所述四个角位像素点的颜色灰度值进行计算,获得所述每一像素点的颜色灰度值;A gray value calculation unit, used to obtain the distance relationship between each pixel in the new matrix except the four corner pixels and the four corner pixels, based on the distance relationship and the four corner pixels Calculate the color grayscale value of the point to obtain the color grayscale value of each pixel;

扩展图像形成单元,用于根据灰度值计算单元获得的所有新矩阵的所有点的颜色灰度值,组合形成扩展后的图像。The extended image forming unit is configured to combine the color grayscale values of all points of all new matrices obtained by the grayscale value calculation unit to form an expanded image.

优选地,所述扩展平移单元进一步包括:Preferably, the extended translation unit further includes:

平衡距离获得子单元,用于根据所述预定的扩展系数,获得每相邻的四个原始像素点的X轴平移距离以及Y轴平移距离;The balance distance obtaining subunit is used to obtain the X-axis translation distance and Y-axis translation distance of each adjacent four original pixel points according to the predetermined expansion coefficient;

平移处理子单元,用于根据所述X轴平移距离以及Y轴平移距离对除原点以外的每个原始像素点位的坐标在X轴或/及Y轴方向上进行平移。The translation processing subunit is used to translate the coordinates of each original pixel point except the origin in the X-axis or/and Y-axis direction according to the X-axis translation distance and the Y-axis translation distance.

优选地,所述灰度值计算单元进一步包括:Preferably, the gray value calculation unit further includes:

距离关系获得子单元,用于根据下述公式分别获得新矩阵中除四个角位像素点外每一个像素点至所述四个角位像素点的距离关系:The distance relationship acquisition subunit is used to obtain the distance relationship between each pixel in the new matrix except the four corner pixels and the four corner pixels according to the following formula:

其中,M为新矩阵中的任意一个像素点,A、B、C、D为四个角位像素点;XMA、XMB、XMC、XMD分别为M点到A、B、C、D四点的位置系数;LMA、LMB、LMC、LMD分别为M点到A、B、C、D四点的距离;Among them, M is any pixel in the new matrix, A, B, C , and D are the four corner pixels; X MA , X MB , X MC , and The position coefficients of four points D; L MA , L MB , L MC , and L MD are the distances from point M to four points A, B, C, and D respectively;

计算子单元,用于根据下述公式计算所述每一个像素点的颜色灰度值:The calculation subunit is used to calculate the color gray value of each pixel according to the following formula:

MRGB=XMA×ARGB+XMB×BRGB+XMC×CRGB+XMD×DRGB M RGB =X MA ×A RGB +X MB ×B RGB +X MC ×C RGB +X MD ×D RGB

其中,MRGB、ARGB、BRGB、CRGB、DRGB分别为M、A、B、C、D的颜色灰度值。Among them, M RGB , A RGB , B RGB , C RGB , and D RGB are the color grayscale values of M, A, B, C, and D respectively.

实施本发明实施例,具有以下的有益效果:Implementing the embodiments of the present invention has the following beneficial effects:

本发明提供的扩展位图点位的方法及系统,可以将矩阵的点位按一定的比例扩增,增加矩阵的点位,提高生成图片后的清晰度。The method and system for expanding bitmap points provided by the present invention can expand the points of the matrix according to a certain proportion, increase the points of the matrix, and improve the clarity of the generated picture.

本发明具有操作简单,耗时短的特点,在原始矩阵数据出来后,可自动扩展原来点位对数据做二次处理,处理速度快。The invention has the characteristics of simple operation and short time consumption. After the original matrix data comes out, it can automatically expand the original points to perform secondary processing on the data, and the processing speed is fast.

附图说明Description of drawings

图1为本发明提供的扩展位图点位的方法的主流程示意图;Figure 1 is a schematic diagram of the main flow of the method for extending bitmap points provided by the present invention;

图2为图1步骤S10中涉及的矩阵平移的示意图;Figure 2 is a schematic diagram of the matrix translation involved in step S10 of Figure 1;

图3为本发明提供的扩展位图点位的系统的结构示意图;Figure 3 is a schematic structural diagram of a system for extending bitmap points provided by the present invention;

图4为图3中扩展平移单元的结构示意图;Figure 4 is a schematic structural diagram of the extended translation unit in Figure 3;

图5是图3中灰度值计算单元的结构示意图。Figure 5 is a schematic structural diagram of the gray value calculation unit in Figure 3.

具体实施方式Detailed ways

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some of the embodiments of the present invention, rather than all the embodiments.

为使本领域的普通技术人员更加清楚地理解发明的目的、技术方案和优点,以下结合附图和实施例对发明做进一步的阐述。In order to enable those of ordinary skill in the art to more clearly understand the purpose, technical solutions and advantages of the invention, the invention will be further described below in conjunction with the accompanying drawings and examples.

如图1所示,示出了本发明提供的一种扩展图像点位的方法的主流程示意图,在本实施例中,所述方法包括以下步骤:As shown in Figure 1, a schematic main flow diagram of a method for expanding image points provided by the present invention is shown. In this embodiment, the method includes the following steps:

步骤S10,根据预定的扩展系数,对于待扩展图像点位矩阵中除原点之外的每个原始像素点位的坐标进行平移操作,使待扩展图像点位矩阵中相邻的四个像素点位于扩展后的新的矩阵的四个角上,将原始四个像素点的灰度值赋值给所述新矩阵的四个角位的像素点,获得每一个新矩阵的所有点的坐标;Step S10, according to the predetermined expansion coefficient, perform a translation operation on the coordinates of each original pixel point in the image point matrix to be expanded except the origin, so that the four adjacent pixel points in the image point matrix to be expanded are located at On the four corners of the expanded new matrix, assign the grayscale values of the original four pixels to the pixels at the four corners of the new matrix to obtain the coordinates of all points of each new matrix;

此步骤S10进一步包括:根据所述预定的扩展系数,获得每相邻的四个原始像素点的X轴平移距离以及Y轴平移距离;This step S10 further includes: obtaining the X-axis translation distance and Y-axis translation distance of each adjacent four original pixel points according to the predetermined expansion coefficient;

根据所述X轴平移距离以及Y轴平移距离对除原点以外的每个原始像素点位的坐标在X轴或/及Y轴方向上进行平移。The coordinates of each original pixel point except the origin are translated in the X-axis or/and Y-axis direction according to the X-axis translation distance and the Y-axis translation distance.

为便于理解,下述以一个例子进行说明,具体地,在一个例子中,需要将设原有矩阵是n*n的需要扩展成m*m的新矩阵(m>n),为了便于理解,取n为2,m为4;扩展前后的矩阵图请参考图2所示;For ease of understanding, the following is an example. Specifically, in one example, the original matrix is n*n and needs to be expanded into a new matrix of m*m (m>n). For ease of understanding, Take n as 2 and m as 4; please refer to Figure 2 for the matrix diagram before and after expansion;

其中,A、B、C、D是原矩阵任意相邻的四个点,扩展后M是扩展后矩阵任意一点,M点的颜色需要根据A、B、C、D的颜色来判定(根据距离来判断占比)。Among them, A, B, C, and D are four adjacent points of the original matrix. After expansion, M is any point of the expanded matrix. The color of point M needs to be determined based on the colors of A, B, C, and D (according to the distance to determine the proportion).

M点代表介于A,B,C,D四点所在矩形内的任一点。Point M represents any point within the rectangle between the four points A, B, C, and D.

首先定义A、B、C、D四点在原矩阵中的座标,可以理解的是,坐标轴可采用多种形式,在一个例子中,例如此处采用了坐标轴可参见图2所示,其中A点作为原点。依次定义Ao点为(0,0),Bo(1,0),Co点为(1,1),Do点为(0,1),即A点是Ax=0,Ay=0。此处A,B,C,D扩充前的坐标,所以每个下面加了o标识是扩充前坐标。First define the coordinates of the four points A, B, C, and D in the original matrix. It can be understood that the coordinate axes can take many forms. In an example, if the coordinate axes are used here, see Figure 2. Point A serves as the origin. Define the Ao point as (0, 0), Bo (1, 0), the Co point as (1, 1), and the Do point as (0, 1) in sequence, that is, the A point is Ax=0 and Ay=0. Here A, B, C, and D are the coordinates before expansion, so the o mark added below each is the coordinate before expansion.

在原矩阵中,各点的坐标:Ao点为(0,0),Bo(1,0),Co点为(1,1),Do点为(0,1)。此时扩充后的新矩阵中各点的坐标为:A点为(0,0),B(3,0),C点为(3,3),D点为(0,3)。In the original matrix, the coordinates of each point: Ao point is (0, 0), Bo (1, 0), Co point is (1, 1), and Do point is (0, 1). At this time, the coordinates of each point in the expanded new matrix are: point A is (0, 0), point B (3, 0), point C is (3, 3), and point D is (0, 3).

如此依次可以获得平移后各点的坐标,例如在其他的例子中,如果原矩阵中各点坐标为:Ao点为(1,0),Bo(2,0),Co点为(2,1),Do点为(1,1)。则扩展后的坐标为:A点为(3,0),B(6,0),C点为(6,3),D点为(3,3)。In this way, the coordinates of each point after translation can be obtained in turn. For example, in other examples, if the coordinates of each point in the original matrix are: Ao point is (1, 0), Bo (2, 0), Co point is (2, 1 ), Do point is (1, 1). Then the expanded coordinates are: point A is (3, 0), point B (6, 0), point C is (6, 3), and point D is (3, 3).

根据该方法,可以获得新矩阵中所有点的坐标。According to this method, the coordinates of all points in the new matrix can be obtained.

步骤S11,获得新矩阵中除四个角位像素点外每一个像素点至所述四个角位像素点的距离关系,根据所述距离关系以及所述四个角位像素点的颜色灰度值进行计算,获得所述每一像素点的颜色灰度值;Step S11, obtain the distance relationship from each pixel in the new matrix except the four corner pixels to the four corner pixels, based on the distance relationship and the color grayscale of the four corner pixels. Calculate the value to obtain the color gray value of each pixel;

具体地,根据下述公式分别获得新矩阵中除四个角位像素点外每一个像素点至所述四个角位像素点的距离关系:Specifically, the distance relationship between each pixel in the new matrix except the four corner pixels and the four corner pixels is obtained according to the following formula:

其中,M为新矩阵中的任意一个像素点,A、B、C、D为四个角位像素点;XMA、XMB、XMC、XMD分别为M点到A、B、C、D四点的位置系数;LMA、LMB、LMC、LMD分别为M点到A、B、C、D四点的距离;其中,距离可以通过两点的坐标计算而出,此处位置系统XMA采用M点到A点的距离占M到A、B、C、D点距离总和的比例;Among them, M is any pixel in the new matrix, A, B, C , and D are the four corner pixels; X MA , X MB , X MC , and The position coefficients of four points D; L MA , L MB , L MC , and L MD are the distances from point M to four points A, B, C, and D respectively; among them, the distance can be calculated from the coordinates of the two points, here The position system X MA uses the ratio of the distance from point M to point A to the total distance from point M to points A, B, C, and D;

根据下述公式计算所述每一个像素点的颜色灰度值:Calculate the color gray value of each pixel according to the following formula:

MRGB=XMA×ARGB+XMB×BRGB+XMC×CRGB+XMD×DRGB M RGB =X MA ×A RGB +X MB ×B RGB +X MC ×C RGB +X MD ×D RGB

其中,MRGB、ARGB、BRGB、CRGB、DRGB分别为M、A、B、C、D的颜色灰度值。Among them, M RGB , A RGB , B RGB , C RGB , and D RGB are the color grayscale values of M, A, B, C, and D respectively.

步骤S13,根据所有新矩阵的所有点的颜色灰度值,组合形成扩展后的图像。Step S13: Combine the color and grayscale values of all points of all new matrices to form an expanded image.

可以理解的是,将所有的新矩阵进行组合,即可以形成扩展后的图像。It can be understood that by combining all the new matrices, an expanded image can be formed.

相应地,如图3所示,示出了本发明提供一种扩展图像点位的系统的结构示意图,在该实施例中,所述方法1包括:Correspondingly, as shown in Figure 3, a schematic structural diagram of a system for expanding image points provided by the present invention is shown. In this embodiment, the method 1 includes:

扩展平移单元10,用于根据预定的扩展系数,对于待扩展图像点位矩阵中除原点之外的每个原始像素点位的坐标进行平移操作,使待扩展图像点位矩阵中相邻的四个像素点位于扩展后的新的矩阵的四个角上,将原始四个像素点的灰度值赋值给所述新矩阵的四个角位的像素点,获得每一个新矩阵的所有点的坐标;The expansion translation unit 10 is configured to perform a translation operation on the coordinates of each original pixel point in the image point matrix to be expanded except the origin according to a predetermined expansion coefficient, so that the adjacent four pixels in the image point matrix to be expanded are pixels are located at the four corners of the expanded new matrix, assign the grayscale values of the original four pixels to the pixels at the four corners of the new matrix, and obtain the gray value of all points of each new matrix. coordinate;

灰度值计算单元11,用于获得新矩阵中除四个角位像素点外每一个像素点至所述四个角位像素点的距离关系,根据所述距离关系以及所述四个角位像素点的颜色灰度值进行计算,获得所述每一像素点的颜色灰度值;The gray value calculation unit 11 is used to obtain the distance relationship between each pixel in the new matrix except the four corner pixels and the four corner pixels. According to the distance relationship and the four corner pixels, Calculate the color grayscale value of the pixel point to obtain the color grayscale value of each pixel point;

扩展图像形成单元12,用于根据灰度值计算单元获得的所有新矩阵的所有点的颜色灰度值,组合形成扩展后的图像。The expanded image forming unit 12 is configured to combine and form an expanded image based on the color grayscale values of all points of all new matrices obtained by the grayscale value calculation unit.

在一些具体的例子中,所述扩展平移单元10进一步包括:In some specific examples, the extended translation unit 10 further includes:

平衡距离获得子单元100,用于根据所述预定的扩展系数,获得每相邻的四个原始像素点的X轴平移距离以及Y轴平移距离;The balance distance obtaining subunit 100 is used to obtain the X-axis translation distance and Y-axis translation distance of each adjacent four original pixel points according to the predetermined expansion coefficient;

平移处理子单元101,用于根据所述X轴平移距离以及Y轴平移距离对除原点以外的每个原始像素点位的坐标在X轴或/及Y轴方向上进行平移。The translation processing subunit 101 is configured to translate the coordinates of each original pixel point except the origin in the X-axis or/and Y-axis direction according to the X-axis translation distance and the Y-axis translation distance.

在一些具体的例子中,所述灰度值计算单元11进一步包括:In some specific examples, the gray value calculation unit 11 further includes:

距离关系获得子单元110,用于根据下述公式分别获得新矩阵中除四个角位像素点外每一个像素点至所述四个角位像素点的距离关系:The distance relationship obtaining subunit 110 is used to obtain the distance relationship from each pixel in the new matrix except the four corner pixels to the four corner pixels according to the following formula:

其中,M为新矩阵中的任意一个像素点,A、B、C、D为四个角位像素点;XMA、XMB、XMC、XMD分别为M点到A、B、C、D四点的位置系数;LMA、LMB、LMC、LMD分别为M点到A、B、C、D四点的距离;Among them, M is any pixel in the new matrix, A, B, C , and D are the four corner pixels; X MA , X MB , X MC , and The position coefficients of four points D; L MA , L MB , L MC , and L MD are the distances from point M to four points A, B, C, and D respectively;

计算子单元111,用于根据下述公式计算所述每一个像素点的颜色灰度值:The calculation subunit 111 is used to calculate the color gray value of each pixel according to the following formula:

MRGB=XMA×ARGB+XMB×BRGB+XMC×CRGB+XMD×DRGB M RGB =X MA ×A RGB +X MB ×B RGB +X MC ×C RGB +X MD ×D RGB

其中,MRGB、ARGB、BRGB、CRGB、DRGB分别为M、A、B、C、D的颜色灰度值。Among them, M RGB , A RGB , B RGB , C RGB , and D RGB are the color grayscale values of M, A, B, C, and D respectively.

更多的细节,可参照前述对图1和图2的描述,在此法进行赘述。For more details, please refer to the aforementioned description of Figures 1 and 2 and will not be described again here.

在一些例子中,所述扩展图像点位的系统可以采用软件自动实现,下述即为采用Java实现的核心源程序:In some examples, the system for expanding image points can be automatically implemented using software. The following is the core source program implemented using Java:

实施本发明实施例,具有以下的有益效果:Implementing the embodiments of the present invention has the following beneficial effects:

本发明提供的扩展位图点位的方法及系统,可以将矩阵的点位按一定的比例扩增,增加矩阵的点位,提高生成图片后的清晰度。The method and system for expanding bitmap points provided by the present invention can expand the points of the matrix according to a certain proportion, increase the points of the matrix, and improve the clarity of the generated picture.

本发明具有操作简单,耗时短的特点,在原始矩阵数据出来后,可自动扩展原来点位对数据做二次处理,处理速度快。The invention has the characteristics of simple operation and short time consumption. After the original matrix data comes out, it can automatically expand the original points to perform secondary processing on the data, and the processing speed is fast.

以上所述,仅为本发明较佳的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,根据本发明的技术方案及其发明构思加以等同替换或改变,都应涵盖在本发明的保护范围之内。The above are only preferred specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person familiar with the technical field can, within the technical scope disclosed in the present invention, implement the technical solutions of the present invention. Equivalent substitutions or changes of the inventive concept thereof shall be included in the protection scope of the present invention.

Claims (4)

1. A method of expanding image points, comprising the steps of:
performing translation operation on the coordinates of each original pixel point except the original point in the image point matrix to be expanded according to a preset expansion coefficient, enabling four adjacent pixel points in the image point matrix to be expanded to be positioned at four corners of a new matrix after expansion, and assigning gray values of the original four pixel points to the pixel points at four corners of the new matrix to obtain the coordinates of all points of each new matrix;
step two, obtaining the distance relation from each pixel point to the four corner pixel points except the four corner pixel points in the new matrix, and calculating according to the distance relation and the color gray values of the four corner pixel points to obtain the color gray value of each pixel point;
combining to form an expanded image according to the color gray values of all points of all the new matrixes;
wherein, step two further includes:
the distance relation between each pixel point except four corner pixel points in the new matrix and the four corner pixel points is obtained according to the following formula:
wherein M is any pixel point in the new matrix, and A, B, C, D is four corner pixel points; x is X MA 、X MB 、X MC 、X MD The position coefficients of the M points to the A, B, C, D points are respectively; l (L) MA 、L MB 、L MC 、L MD The distances from the M point to the A, B, C, D point are respectively;
calculating the color gray value of each pixel according to the following formula:
M RGB =X MA ×A RGB +X MB ×B RGB +X MC ×C RGB +X MD ×D RGB
wherein M is RGB 、A RGB 、B RGB 、C RGB 、D RGB Respectively M, A, B, C, D.
2. The method of claim 1, wherein step one further comprises:
according to the preset expansion coefficient, obtaining X-axis translation distances and Y-axis translation distances of every two adjacent four original pixel points;
and translating the coordinates of each original pixel point except the original point in the X-axis or/and Y-axis direction according to the X-axis translation distance and the Y-axis translation distance.
3. A system for expanding image points, comprising:
the expansion translation unit is used for carrying out translation operation on the coordinates of each original pixel point except the original point in the image point position matrix to be expanded according to a preset expansion coefficient, so that four adjacent pixel points in the image point position matrix to be expanded are positioned at four corners of the new matrix after expansion, and gray values of the four original pixel points are assigned to the pixel points at four corners of the new matrix to obtain the coordinates of all points of each new matrix;
the gray value calculation unit is used for obtaining the distance relation between each pixel point except four corner pixel points in the new matrix and the four corner pixel points, and calculating according to the distance relation and the color gray values of the four corner pixel points to obtain the color gray value of each pixel point;
an extended image forming unit for combining the color gray values of all points of all the new matrices obtained by the gray value calculating unit to form an extended image;
wherein the gradation value calculation unit further includes:
a distance relation obtaining subunit, configured to obtain a distance relation from each pixel point except for four corner pixel points in the new matrix to the four corner pixel points according to the following formula:
wherein M is any pixel point in the new matrix, and A, B, C, D is four corner pixel points; x is X MA 、X MB 、X MC 、X MD The position coefficients of the M points to the A, B, C, D points are respectively; l (L) MA 、L MB 、L MC 、L MD The distances from the M point to the A, B, C, D point are respectively;
a calculating subunit, configured to calculate a color gray value of each pixel according to the following formula:
M RGB =X MA ×A RGB +X MB ×B RGB +X MC ×C RGB +X MD ×D RGB
wherein M is RGB 、A RGB 、B RGB 、C RGB 、D RGB Respectively M, A, B, C, D.
4. The system of claim 3, wherein the expansion translation unit further comprises:
a balance distance obtaining subunit, configured to obtain X-axis translation distances and Y-axis translation distances of each adjacent four original pixel points according to the predetermined expansion coefficient;
and the translation processing subunit is used for translating the coordinates of each original pixel point except the original point in the X-axis or/and Y-axis direction according to the X-axis translation distance and the Y-axis translation distance.
CN201911057946.0A 2019-11-01 2019-11-01 A method and system for expanding bitmap points Active CN111028139B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911057946.0A CN111028139B (en) 2019-11-01 2019-11-01 A method and system for expanding bitmap points

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911057946.0A CN111028139B (en) 2019-11-01 2019-11-01 A method and system for expanding bitmap points

Publications (2)

Publication Number Publication Date
CN111028139A CN111028139A (en) 2020-04-17
CN111028139B true CN111028139B (en) 2023-09-12

Family

ID=70200759

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911057946.0A Active CN111028139B (en) 2019-11-01 2019-11-01 A method and system for expanding bitmap points

Country Status (1)

Country Link
CN (1) CN111028139B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6154567A (en) * 1998-07-01 2000-11-28 Cognex Corporation Pattern similarity metric for image search, registration, and comparison
CN101742080A (en) * 2008-11-04 2010-06-16 深圳市融创天下科技发展有限公司 Method for amplifying video image by 4/3 times
CN105389165A (en) * 2015-10-21 2016-03-09 广州视睿电子科技有限公司 Document picture display method and device and terminal
CN109426795A (en) * 2017-09-05 2019-03-05 比亚迪股份有限公司 Fingerprint identification method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6154567A (en) * 1998-07-01 2000-11-28 Cognex Corporation Pattern similarity metric for image search, registration, and comparison
CN101742080A (en) * 2008-11-04 2010-06-16 深圳市融创天下科技发展有限公司 Method for amplifying video image by 4/3 times
CN105389165A (en) * 2015-10-21 2016-03-09 广州视睿电子科技有限公司 Document picture display method and device and terminal
CN109426795A (en) * 2017-09-05 2019-03-05 比亚迪股份有限公司 Fingerprint identification method and device

Also Published As

Publication number Publication date
CN111028139A (en) 2020-04-17

Similar Documents

Publication Publication Date Title
CN110189248B (en) Image fusion method and device, storage medium and electronic equipment
JP2020531931A (en) Image processing methods and devices, storage media, computer devices
CN110503146A (en) Data enhancement method, device, computing device and computer storage medium
US11206294B2 (en) Method for separating local and remote content in a camera-projector based collaborative system
US10909724B2 (en) Method, apparatus, and computer readable medium for adjusting color annotation of an image
US10403040B2 (en) Vector graphics rendering techniques
WO2023010851A1 (en) Webgl-based graphics rendering method, apparatus and system
WO2022160914A1 (en) Effect processing method and apparatus, and device and storage medium
JP2023552538A (en) Image processing methods and devices, electronic devices, storage media, and computer programs
CN110443252A (en) A kind of character detecting method, device and equipment
WO2018018941A1 (en) Method and system for zooming image by using cooperation between opengl and opencl
JP2015516584A (en) Extended range color space
CN111028139B (en) A method and system for expanding bitmap points
CN113506305B (en) Image enhancement method, semantic segmentation method and device for three-dimensional point cloud data
JP2021192244A (en) Positional information generating method, related apparatus, and computer program product
CN101477674A (en) Method for assisting data calculation by using display card
CN115601472B (en) A Method of Drawing Undistorted Black Border Based on Dilation and Corrosion Algorithm
US8134562B2 (en) Method for assisting in data calculation by using display card
CN117573048A (en) Automatic document watermark generation method and terminal
CN116561840A (en) A method and system for constructing a model of a tunnel corridor
US7859531B2 (en) Method and apparatus for three-dimensional graphics, and computer product
US11361488B2 (en) Image display method and apparatus, and storage medium
JP6821924B2 (en) Image processing device, image processing method
CN114419221A (en) Texture processing method, device, electronic device and storage medium
CN113470131B (en) Sea surface simulation image generation method and device, electronic equipment and storage medium

Legal Events

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