[go: up one dir, main page]

CN107977947A - An image processing method, mobile terminal - Google Patents

An image processing method, mobile terminal Download PDF

Info

Publication number
CN107977947A
CN107977947A CN201711400229.4A CN201711400229A CN107977947A CN 107977947 A CN107977947 A CN 107977947A CN 201711400229 A CN201711400229 A CN 201711400229A CN 107977947 A CN107977947 A CN 107977947A
Authority
CN
China
Prior art keywords
area
pixel
corner
image
corner areas
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.)
Granted
Application number
CN201711400229.4A
Other languages
Chinese (zh)
Other versions
CN107977947B (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.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication 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 Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN201711400229.4A priority Critical patent/CN107977947B/en
Publication of CN107977947A publication Critical patent/CN107977947A/en
Application granted granted Critical
Publication of CN107977947B publication Critical patent/CN107977947B/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
    • G06T5/00Image enhancement or restoration
    • G06T5/77Retouching; Inpainting; Scratch removal
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Telephone Function (AREA)

Abstract

本发明公开了一种图像处理方法、移动终端,所述方法包括:根据目标图像中任一边角对应的第一预设圆角系数,确定所述边角对应的圆角区域和边角区域;根据所述边角区域对应的图像中各像素点的像素值,在所述边角区域中确定有效区域,其中,所述有效区域表示所述边角区域中包含有效图像信息的区域;根据预设压缩算法,将所述有效区域对应的图像和所述圆角区域对应的图像压缩到所述圆角区域。本发明能够在实现图像圆角显示的同时避免了有效图像信息的丢失,有效提高图像圆角显示的显示效果。

The present invention discloses an image processing method and a mobile terminal. The method includes: determining a rounded area and a corner area corresponding to the corner according to a first preset rounding coefficient corresponding to any corner in a target image; According to the pixel value of each pixel point in the image corresponding to the corner area, determine an effective area in the corner area, wherein the effective area indicates an area containing valid image information in the corner area; according to a preset A compression algorithm is used to compress the image corresponding to the effective area and the image corresponding to the rounded corner area into the rounded corner area. The present invention can avoid the loss of effective image information while realizing the rounded corner display of the image, and effectively improve the display effect of the rounded corner display of the image.

Description

一种图像处理方法、移动终端An image processing method, mobile terminal

技术领域technical field

本发明涉及图像处理技术领域,尤其涉及一种图像处理方法、移动终端。The present invention relates to the technical field of image processing, in particular to an image processing method and a mobile terminal.

背景技术Background technique

随着终端技术的发展,手机、平板电脑等智能终端广泛应用于人们的日常生活中。在智能终端显示图像之前,为了美观需求,一般会对图像的边角进行处理,用一段与边角的两边相切的圆弧替代原来的边角以形成圆角,实现在智能终端中显示圆角图像。With the development of terminal technology, smart terminals such as mobile phones and tablet computers are widely used in people's daily life. Before the smart terminal displays the image, the corners of the image are generally processed for aesthetic requirements, and the original corner is replaced with a circular arc tangent to both sides of the corner to form a rounded corner, so that the rounded corner can be displayed on the smart terminal corner image.

目前,智能终端对图像的边角进行处理时,具体地,根据圆角系数(圆角对应的半径)裁剪掉图像中圆角以外的边角部分,或者,在圆角以外的边角部分对应的图像上覆盖黑色浮层,以实现图像的圆角显示。At present, when the smart terminal processes the corners of the image, specifically, the corners other than the rounded corners in the image are cut out according to the fillet coefficient (the radius corresponding to the rounded corners), or the corners other than the rounded corners correspond to The image of the image is overlaid with a black floating layer to realize the rounded corner display of the image.

但是,采用上述方法对图像进行圆角处理,丢弃了圆角以外的边角部分对应的图像,若该部分图像中包含时间戳或文字等有效图像信息,则会导致图像圆角显示时丢失有效图像信息,影响了图像圆角显示的显示效果。However, the above method is used to round the corners of the image, and the image corresponding to the corners other than the rounded corners is discarded. If this part of the image contains valid image information such as time stamps or text, it will cause loss of valid image information when the rounded corners of the image are displayed. Image information affects the display effect of image rounded corner display.

发明内容Contents of the invention

本发明实施例提供一种图像处理方法、移动终端,以解决现有技术中图像圆角显示时丢失有效图像信息的问题。Embodiments of the present invention provide an image processing method and a mobile terminal to solve the problem in the prior art that valid image information is lost when an image is displayed with rounded corners.

为了解决上述技术问题,本发明是这样实现的:In order to solve the problems of the technologies described above, the present invention is achieved in that:

第一方面,本发明实施例提供了一种图像处理方法,包括:In a first aspect, an embodiment of the present invention provides an image processing method, including:

根据目标图像中任一边角对应的第一预设圆角系数,确定所述边角对应的圆角区域和边角区域;According to the first preset fillet coefficient corresponding to any corner in the target image, determine the fillet area and corner area corresponding to the corner;

根据所述边角区域对应的图像中各像素点的像素值,在所述边角区域中确定有效区域,其中,所述有效区域表示所述边角区域中包含有效图像信息的区域;Determining an effective area in the corner area according to the pixel value of each pixel in the image corresponding to the corner area, wherein the effective area indicates an area containing valid image information in the corner area;

根据预设压缩算法,将所述有效区域对应的图像和所述圆角区域对应的图像压缩到所述圆角区域。Compressing the image corresponding to the effective area and the image corresponding to the rounded corner area into the rounded corner area according to a preset compression algorithm.

第二方面,本发明实施例还提供了一种移动终端,包括:In the second aspect, the embodiment of the present invention also provides a mobile terminal, including:

确定模块,用于根据目标图像中任一边角对应的第一预设圆角系数,确定所述边角对应的圆角区域和边角区域;A determining module, configured to determine the rounded area and corner area corresponding to the corner according to the first preset fillet coefficient corresponding to any corner in the target image;

所述确定模块,还用于根据所述边角区域对应的图像中各像素点的像素值,在所述边角区域中确定有效区域,其中,所述有效区域表示所述边角区域中包含有效图像信息的区域;The determining module is further configured to determine an effective area in the corner area according to the pixel values of each pixel in the image corresponding to the corner area, wherein the effective area indicates that the corner area contains area of valid image information;

压缩模块,用于根据预设压缩算法,将所述有效区域对应的图像和所述圆角区域对应的图像压缩到所述圆角区域。The compression module is configured to compress the image corresponding to the valid area and the image corresponding to the rounded area into the rounded area according to a preset compression algorithm.

第三方面,本发明实施例还提供了一种移动终端,包括处理器、存储器及存储在所述存储器上并可在所述处理器上运行的图像处理程序,所述图像处理程序被所述处理器执行时实现如上所述的图像处理方法的步骤。In the third aspect, the embodiment of the present invention also provides a mobile terminal, including a processor, a memory, and an image processing program stored in the memory and operable on the processor, and the image processing program is executed by the The processor implements the steps of the above-mentioned image processing method when executed.

第四方面,本发明实施例还提供了一种计算机存储介质,所述计算机可读存储介质上存储图像处理程序,所述图像处理程序被处理器执行时实现如上所述的图像处理方法的步骤。In a fourth aspect, an embodiment of the present invention further provides a computer storage medium, where an image processing program is stored on the computer-readable storage medium, and when the image processing program is executed by a processor, the steps of the image processing method as described above are implemented .

在本发明实施例中,根据目标图像中任一边角对应的第一预设圆角系数,确定该边角对应的圆角区域和边角区域,根据边角区域对应的图像中各像素点的像素值,在边角区域中确定包含有效图像信息的有效区域,进而根据预设压缩算法,将有效区域对应的图像和圆角区域对应的图像压缩到圆角区域,使得在圆角区域内得到该边角对应的圆角图像,从而在实现图像圆角显示的同时避免了有效图像信息的丢失,有效提高图像圆角显示的显示效果。In the embodiment of the present invention, according to the first preset fillet coefficient corresponding to any corner in the target image, the rounded area and corner area corresponding to the corner are determined, and according to the value of each pixel in the image corresponding to the corner area Pixel value, determine the effective area containing effective image information in the corner area, and then compress the image corresponding to the effective area and the image corresponding to the rounded area into the rounded area according to the preset compression algorithm, so that the rounded area can be obtained The rounded corner image corresponding to the corner avoids the loss of effective image information while realizing the rounded corner display of the image, and effectively improves the display effect of the rounded corner display of the image.

附图说明Description of drawings

此处所说明的附图用来提供对本发明的进一步理解,构成本发明的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:The accompanying drawings described here are used to provide a further understanding of the present invention, and constitute a part of the present invention. The schematic embodiments of the present invention and their descriptions are used to explain the present invention, and do not constitute improper limitations to the present invention. In the attached picture:

图1为本发明实施例提供的一种图像处理方法的流程示意图;FIG. 1 is a schematic flowchart of an image processing method provided by an embodiment of the present invention;

图2为本发明实施例提供的目标图像的示意图;Fig. 2 is a schematic diagram of a target image provided by an embodiment of the present invention;

图3为本发明实施例提供的圆角区域和边角区域的示意图;FIG. 3 is a schematic diagram of a rounded corner area and a corner area provided by an embodiment of the present invention;

图4为本发明实施例提供的圆角处理过程中的示意图;Fig. 4 is a schematic diagram of the fillet processing process provided by the embodiment of the present invention;

图5为本发明实施例提供的目标图像圆角显示的示意图;FIG. 5 is a schematic diagram of the rounded corner display of the target image provided by the embodiment of the present invention;

图6为本发明实施例提供的一种移动终端的结构示意图;FIG. 6 is a schematic structural diagram of a mobile terminal provided by an embodiment of the present invention;

图7为实现本发明各个实施例的一种移动终端的硬件结构示意图。Fig. 7 is a schematic diagram of a hardware structure of a mobile terminal implementing various embodiments of the present invention.

具体实施方式Detailed ways

下面将结合本发明具体实施例及相应的附图对本发明技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions of the present invention in conjunction with specific embodiments of the present invention and corresponding drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

以下结合附图,详细说明本发明各实施例提供的技术方案。The technical solutions provided by various embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings.

实施例1Example 1

图1为本发明实施例提供的一种图像处理方法的流程示意图。所述方法可以如下所示。FIG. 1 is a schematic flowchart of an image processing method provided by an embodiment of the present invention. The method can be as follows.

步骤102:根据目标图像中任一边角对应的第一预设圆角系数,确定该边角对应的圆角区域和边角区域。Step 102: According to the first preset fillet coefficient corresponding to any corner in the target image, determine a rounded corner area and a corner area corresponding to the corner.

其中,边角表示目标图像的相邻侧边之间的夹角。Wherein, the corner represents the angle between adjacent sides of the target image.

图2为本发明实施例提供的目标图像的示意图。FIG. 2 is a schematic diagram of a target image provided by an embodiment of the present invention.

如图2所示,目标图像为直角图像,即目标图像包含四个边角,且四个边角都是直角。As shown in FIG. 2 , the target image is a right-angle image, that is, the target image includes four corners, and the four corners are all right angles.

针对目标图像中任一边角,根据该边角对应的第一预设圆角系数,确定该边角对应的圆角区域和边角区域,其中,该边角对应的第一预设圆角系数为圆角对应的半径。For any corner in the target image, according to the first preset fillet coefficient corresponding to the corner, determine the fillet area and corner area corresponding to the corner, wherein the first preset fillet coefficient corresponding to the corner is the radius corresponding to the fillet.

需要说明的是,第一预设圆角系数可以根据实际情况确定,这里不做具体限定。It should be noted that the first preset fillet coefficient may be determined according to actual conditions, and is not specifically limited here.

优选地,目标图像中任一边角对应的圆角为四分之一的圆,也即是一个90°的弧形。Preferably, the fillet corresponding to any corner in the target image is a quarter circle, that is, a 90° arc.

图3为本发明实施例提供的圆角区域和边角区域的示意图。FIG. 3 is a schematic diagram of a rounded corner area and a corner area provided by an embodiment of the present invention.

如图3所示,边角A为一个90°的直角,边角A对应的第一预设圆角系数为a,该第一预设圆角系数a对应的圆角为一个角度为90°、半径为a的圆弧L1。边角区域31为圆弧L1以外包括边角A的区域,圆角区域32为圆弧L1以内的区域。边角区域31和圆角区域32共同构成一个边长为a的正方形区域。As shown in Figure 3, the corner A is a right angle of 90°, the first preset fillet coefficient corresponding to the corner A is a, and the fillet corresponding to the first preset fillet coefficient a is an angle of 90° , an arc L 1 with radius a. The corner area 31 is an area including the corner A outside the arc L1 , and the round area 32 is an area within the arc L1 . The corner area 31 and the rounded area 32 together form a square area with a side length a.

步骤104:根据边角区域对应的图像中各像素点的像素值,在该边角区域中确定有效区域。Step 104: Determine an effective area in the corner area according to the pixel values of each pixel in the image corresponding to the corner area.

其中,有效区域表示边角区域中包含有效图像信息的区域。Wherein, the valid area refers to the area containing valid image information in the corner area.

为了避免目标图像圆角显示时丢失边角区域中的有效图像信息(例如,时间戳,文字,等等),在边角区域中确定包含有效图像信息的有效区域。In order to avoid loss of effective image information (for example, time stamp, text, etc.) in the corner area when the target image is displayed with rounded corners, an effective area containing effective image information is determined in the corner area.

本发明实施例中,根据边角区域对应的图像中各像素点的像素值,在边角区域中确定有效区域,包括:In the embodiment of the present invention, according to the pixel value of each pixel point in the image corresponding to the corner area, the effective area is determined in the corner area, including:

确定圆角区域和边角区域共同构成的第一区域对应的背景色;Determine the background color corresponding to the first area formed by the rounded area and the corner area;

根据背景色和边角区域对应的图像中各像素点的像素值,在边角区域中确定有效区域。According to the background color and the pixel value of each pixel in the image corresponding to the corner region, an effective region is determined in the corner region.

具体地,确定圆角区域和边角区域共同构成的第一区域对应的背景色,包括:Specifically, determining the background color corresponding to the first area jointly formed by the rounded corner area and the corner area includes:

通过区域分割算法对第一区域进行区域划分,确定第一区域中的连通域;performing region division on the first region by a region segmentation algorithm, and determining connected domains in the first region;

根据连通域对应的图像中各像素点的像素值,统计任一像素值对应的像素点数目;According to the pixel value of each pixel point in the image corresponding to the connected domain, the number of pixel points corresponding to any pixel value is counted;

将像素点数目最多的像素值对应的颜色确定为背景色。The color corresponding to the pixel value with the largest number of pixels is determined as the background color.

仍以上述图3为例,边角区域和圆角区域共同构成的第一区域为一个边长为a的正方形。Still taking the above-mentioned FIG. 3 as an example, the first area jointly formed by the corner area and the rounded area is a square with side length a.

通过区域分割算法对第一区域进行区域划分,生成各个特征区域,然后剔除掉孤立的区域,最终得到非孤立的连通域。The first region is divided by the region segmentation algorithm to generate each feature region, and then the isolated regions are eliminated, and finally a non-isolated connected domain is obtained.

针对上述确定的连通域,根据该连通域对应的图像中各像素点的像素值,统计任一像素值对应的像素点数目,并将像素点数目最多的像素值对应的颜色确定为第一区域的背景色。For the connected domain determined above, according to the pixel value of each pixel in the image corresponding to the connected domain, count the number of pixels corresponding to any pixel value, and determine the color corresponding to the pixel value with the largest number of pixels as the first area the background color of .

例如,连通域中像素值255对应的像素点数目最多,则第一区域的背景色为白色。For example, if the number of pixels corresponding to the pixel value 255 in the connected domain is the largest, the background color of the first region is white.

本发明实施例中,根据背景色和边角区域对应的图像中各像素点的像素值,在边角区域中确定有效区域,包括:In the embodiment of the present invention, according to the pixel value of each pixel point in the image corresponding to the background color and the corner region, the effective region is determined in the corner region, including:

根据第二预设圆角系数,将边角区域划分为第二区域和第三区域,第二预设圆角系数小于第一预设圆角系数,其中,第二区域包括边角,第三区域为第二区域和圆角区域之间的区域;According to the second preset fillet coefficient, the corner area is divided into a second area and a third area, the second preset fillet coefficient is smaller than the first preset fillet coefficient, wherein the second area includes the corner, and the third The area is the area between the second area and the rounded corner area;

确定第二区域中背景色对应的像素比例,该像素比例表示在第二区域中背景色对应的像素点数目占总像素点数目的比例;Determine the pixel ratio corresponding to the background color in the second area, where the pixel ratio represents the ratio of the number of pixels corresponding to the background color to the total number of pixels in the second area;

若该像素比例大于预设比例阈值,则将第二预设圆角系数增大预设值,作为新的第二预设圆角系数,直到该像素比例不大于预设比例阈值;If the pixel ratio is greater than the preset ratio threshold, increasing the second preset fillet factor by a preset value as a new second preset fillet factor until the pixel ratio is not greater than the preset ratio threshold;

若该像素比例不大于预设比例阈值,则将第三区域确定为有效区域。If the pixel ratio is not greater than the preset ratio threshold, the third area is determined as an effective area.

仍以上述图3为例,根据第二预设圆角系数,将边角区域划分为第二区域和第三区域,得到图4所示圆角处理过程中的示意图。图4为本发明实施例提供的圆角处理过程中的示意图。Still taking the above-mentioned FIG. 3 as an example, the corner area is divided into the second area and the third area according to the second preset fillet coefficient, and the schematic diagram of the corner filleting process shown in FIG. 4 is obtained. FIG. 4 is a schematic diagram of a fillet processing process provided by an embodiment of the present invention.

如图4所示,第二预设圆角系数为b,该第二预设圆角系数b对应的圆角为一个角度90°、半径为b的圆弧L2。圆弧L2将边角区域划分为第二区域42和第三区域43。第二区域42包括边角A,第三区域43为第二区域42和圆角区域41之间的区域。圆角区域41、第二区域42和第三区域42共同构成第一区域:一个边长为a的正方形区域,其中,a>b。As shown in FIG. 4 , the second preset fillet coefficient is b, and the fillet corresponding to the second preset fillet coefficient b is an arc L 2 with an angle of 90° and a radius of b. The arc L 2 divides the corner area into a second area 42 and a third area 43 . The second area 42 includes a corner A, and the third area 43 is an area between the second area 42 and the rounded corner area 41 . The rounded area 41 , the second area 42 and the third area 42 together constitute the first area: a square area with side length a, where a>b.

根据上述确定的第一区域对应的背景色,统计第二区域中总像素点数目z和背景色对应的像素点数目x,进而确定第二区域中背景色对应的像素比例x/z,即确定第二区域中背景色对应的像素点数目x占总像素点数目z的比例。According to the background color corresponding to the first area determined above, count the total number of pixels z in the second area and the number x of pixels corresponding to the background color, and then determine the pixel ratio x/z corresponding to the background color in the second area, that is, determine The ratio of the number x of pixels corresponding to the background color in the second area to the total number z of pixels.

若第二区域中背景色对应的像素比例大于预设比例阈值m,即x/z>m,则可以确定第二区域中大部分为背景色,即第二区域为无效区域,不包括有效图像信息。If the proportion of pixels corresponding to the background color in the second area is greater than the preset ratio threshold m, that is, x/z>m, it can be determined that most of the second area is the background color, that is, the second area is an invalid area, excluding valid images information.

进而将第二预设圆角系数增大预设值作为新的第二预设圆角系数,随着第二预设圆角系数的增大,第二区域面积增大,第三区域面积减小。重复执行上述步骤确定第二区域中背景色对应的像素比例,直到第二区域中背景色对应的像素比例不大于预设比例阈值m,即x/z≤m,则可以确定第二区域为不包括有效图像信息的面积最大的无效区域,第三区域中开始包括目标图像中的有效图像信息,将第三区域确定为有效区域。Furthermore, the second preset fillet coefficient increases by the preset value as the new second preset fillet coefficient. With the increase of the second preset fillet coefficient, the area of the second area increases, and the area of the third area decreases. Small. Repeat the above steps to determine the proportion of pixels corresponding to the background color in the second area until the proportion of pixels corresponding to the background color in the second area is not greater than the preset proportion threshold m, that is, x/z≤m, then it can be determined that the second area is not The invalid area with the largest area including the valid image information starts to include the valid image information in the target image in the third area, and the third area is determined as the valid area.

需要说明的是,第二预设圆角系数、预设比例阈值、预设值可以根据实际情况确定,这里不做具体限定。It should be noted that the second preset fillet factor, the preset ratio threshold, and the preset value may be determined according to actual conditions, and are not specifically limited here.

例如,第二预设圆角系数和预设值相同,为1个像素点的距离;预设值预设比例阈值为90%。即第二预设圆角系数从1个像素点的距离开始确定第二区域中背景色对应的像素比例,并在确定该像素比例不大于90%时,将第二预设圆角系数增加1个像素点的距离作为新的第二预设圆角系数,并重复执行上述步骤确定第二区域中背景色对应的像素比例,直到该像素比例不大于预设比例阈值90%,则确定第三区域为有效区域。For example, the second preset fillet factor is the same as the preset value, which is a distance of 1 pixel; the preset ratio threshold of the preset value is 90%. That is, the second preset fillet factor determines the proportion of pixels corresponding to the background color in the second area from a distance of 1 pixel, and increases the second preset fillet factor by 1 when it is determined that the pixel proportion is not greater than 90%. The distance between pixels is used as the new second preset fillet factor, and the above steps are repeated to determine the pixel ratio corresponding to the background color in the second area until the pixel ratio is not greater than the preset ratio threshold 90%, then the third is determined. area is a valid area.

步骤106:根据预设压缩算法,将有效区域对应的图像和圆角区域对应的图像压缩到圆角区域。Step 106: According to a preset compression algorithm, compress the image corresponding to the effective area and the image corresponding to the rounded area into the rounded area.

在边角区域中确定包含有效图像信息的有效区域之后,采用预设压缩算法,将有效区域对应的图像和圆角区域对应的图像压缩到圆角区域中,以使得在圆角区域中得到边角对应的圆角图像。After determining the effective area containing effective image information in the corner area, the preset compression algorithm is used to compress the image corresponding to the effective area and the image corresponding to the rounded area into the rounded area, so that the edge in the rounded area Corner corresponds to the rounded image.

与将边角区域对应的图像和圆角区域对应的图像压缩到圆角区域中以得到边角对应的圆角图像相比,将边角区域中有效区域对应的图像和圆角区域对应的图像压缩到圆角区域中,可以减小得到的边角对应的圆角图像的变形程度,提高圆角图像的显示效果。Compared with compressing the image corresponding to the corner area and the image corresponding to the rounded area into the rounded area to obtain the rounded image corresponding to the corner, the image corresponding to the valid area in the corner area and the image corresponding to the rounded area Compressing into the rounded corner area can reduce the degree of deformation of the rounded corner image corresponding to the obtained corner and improve the display effect of the rounded corner image.

本发明实施例中,预设压缩算法包括:基于经纬度的矫正算法。In the embodiment of the present invention, the preset compression algorithm includes: a correction algorithm based on latitude and longitude.

需要说明的是,预设压缩算法除了可以是基于经纬度的矫正算法之外,还可以是基于同心圆的矫正算法,还可以是其他压缩算法,这里不做具体限定。It should be noted that, in addition to the correction algorithm based on latitude and longitude, the preset compression algorithm may also be a correction algorithm based on concentric circles, or other compression algorithms, which are not specifically limited here.

本发明实施例中,在圆角区域内得到边角对应的圆角图像之后,还包括:In the embodiment of the present invention, after obtaining the rounded corner image corresponding to the corner in the rounded corner area, it also includes:

按照预设显示效果显示边角区域对应的图像。The image corresponding to the corner area is displayed according to the preset display effect.

采用上述方法在圆角区域内得到边角对应的圆角图像之后,边角区域对应的图像即圆角以外可以丢弃的部分,针对于该边角部分对应图像,可以通过填充一些预设颜色(例如:黑、白、蓝等纯色,透明色,等),或者填充预设图像来实现该边角部分对应的图像的圆角显示。After using the above method to obtain the rounded image corresponding to the corner in the rounded area, the image corresponding to the corner area is the part outside the rounded corner that can be discarded. For the image corresponding to the corner part, you can fill it with some preset colors ( For example: black, white, blue and other solid colors, transparent colors, etc.), or fill the preset image to realize the rounded display of the image corresponding to the corner part.

实际应用中,可以采用上述图像处理方法对目标图像中的一个或多个边角进行圆角处理,以实现目标图像的圆角显示。In practical applications, the above image processing method may be used to perform rounding processing on one or more corners in the target image, so as to realize rounded corner display of the target image.

仍以上述2所示的目标图像为例,采用上述图像处理方法对目标图像中的四个边角进行圆角处理,得到图5所示的圆角显示效果。图5为本发明实施例提供的目标图像圆角显示的示意图。Still taking the target image shown in 2 above as an example, the above-mentioned image processing method is used to round the corners of the four corners of the target image to obtain the rounded corner display effect shown in FIG. 5 . FIG. 5 is a schematic diagram of displaying rounded corners of a target image provided by an embodiment of the present invention.

本发明实施例记载的技术方案,根据目标图像中任一边角对应的第一预设圆角系数,确定该边角对应的圆角区域和边角区域,根据边角区域对应的图像中各像素点的像素值,在边角区域中确定包含有效图像信息的有效区域,进而根据预设压缩算法,将有效区域对应的图像和圆角区域对应的图像压缩到圆角区域,使得在圆角区域内得到该边角对应的圆角图像,从而在实现图像圆角显示的同时避免了有效图像信息的丢失,有效提高图像圆角显示的显示效果。According to the technical solution described in the embodiment of the present invention, according to the first preset fillet coefficient corresponding to any corner in the target image, the rounded corner area and corner area corresponding to the corner are determined, and each pixel in the image corresponding to the corner area The pixel value of the point determines the effective area containing effective image information in the corner area, and then according to the preset compression algorithm, the image corresponding to the effective area and the image corresponding to the rounded area are compressed into the rounded area, so that in the rounded area A rounded corner image corresponding to the corner is obtained, thereby avoiding the loss of effective image information while realizing the rounded corner display of the image, and effectively improving the display effect of the rounded corner display of the image.

实施例2Example 2

图6为本发明实施例提供的一种移动终端的结构示意图。移动终端600包括:确定模块601和压缩模块602,其中:FIG. 6 is a schematic structural diagram of a mobile terminal provided by an embodiment of the present invention. The mobile terminal 600 includes: a determination module 601 and a compression module 602, wherein:

确定模块601,用于根据目标图像中任一边角对应的第一预设圆角系数,确定该边角对应的圆角区域和边角区域;A determining module 601, configured to determine a rounded area and a corner area corresponding to any corner in the target image according to a first preset fillet coefficient corresponding to the corner;

确定模块601,还用于根据边角区域对应的图像中各像素点的像素值,在边角区域中确定有效区域,其中,有效区域表示边角区域中包含有效图像信息的区域;The determining module 601 is further configured to determine an effective area in the corner area according to the pixel value of each pixel point in the image corresponding to the corner area, wherein the effective area indicates an area containing valid image information in the corner area;

压缩模块602,用于根据预设压缩算法,将有效区域对应的图像和圆角区域对应的图像压缩到圆角区域。The compression module 602 is configured to compress the image corresponding to the effective area and the image corresponding to the rounded area into the rounded area according to a preset compression algorithm.

可选地,确定模块601进一步包括:确定单元,其中:Optionally, the determining module 601 further includes: a determining unit, wherein:

确定单元,用于确定圆角区域和边角区域共同构成的第一区域对应的背景色;A determining unit, configured to determine the background color corresponding to the first area jointly formed by the rounded corner area and the corner area;

确定单元,还用于根据背景色和边角区域对应的图像中各像素点的像素值,在边角区域中确定有效区域。The determining unit is further configured to determine an effective area in the corner area according to the background color and the pixel value of each pixel in the image corresponding to the corner area.

可选地,确定单元具体用于:Optionally, the determination unit is specifically used for:

通过区域分割算法对第一区域进行区域划分,确定第一区域中的连通域;performing region division on the first region by a region segmentation algorithm, and determining connected domains in the first region;

根据连通域对应的图像中各像素点的像素值,统计任一像素值对应的像素点数目;According to the pixel value of each pixel point in the image corresponding to the connected domain, the number of pixel points corresponding to any pixel value is counted;

将像素点数目最多的像素值对应的颜色确定为背景色。The color corresponding to the pixel value with the largest number of pixels is determined as the background color.

可选地,确定单元具体用于:Optionally, the determination unit is specifically used for:

根据第二预设圆角系数,将边角区域划分为第二区域和第三区域,第二预设圆角系数小于第一预设圆角系数,其中,第二区域包括边角,第三区域为第二区域和圆角区域之间的区域;According to the second preset fillet coefficient, the corner area is divided into a second area and a third area, the second preset fillet coefficient is smaller than the first preset fillet coefficient, wherein the second area includes the corner, and the third The area is the area between the second area and the rounded corner area;

确定第二区域中背景色对应的像素比例,该像素比例表示在第二区域中背景色对应的像素点数目占总像素点数目的比例;Determine the pixel ratio corresponding to the background color in the second area, where the pixel ratio represents the ratio of the number of pixels corresponding to the background color to the total number of pixels in the second area;

若该像素比例大于预设比例阈值,则将第二预设圆角系数增大预设值,作为新的第二预设圆角系数,直到该像素比例不大于预设比例阈值;If the pixel ratio is greater than the preset ratio threshold, increasing the second preset fillet factor by a preset value as a new second preset fillet factor until the pixel ratio is not greater than the preset ratio threshold;

若该像素比例不大于预设比例阈值,则将第三区域确定为有效区域。If the pixel ratio is not greater than the preset ratio threshold, the third area is determined as an effective area.

本发明实施例提供的移动终端能够实现图1至图5的方法实施例中的各个过程,达到相同的技术效果,为避免重复,这里不再赘述。The mobile terminal provided by the embodiments of the present invention can implement each process in the method embodiments shown in FIG. 1 to FIG. 5 and achieve the same technical effect. To avoid repetition, details are not repeated here.

图7为实现本发明各个实施例的一种移动终端的硬件结构示意图,FIG. 7 is a schematic diagram of a hardware structure of a mobile terminal implementing various embodiments of the present invention,

该移动终端700包括但不限于:射频单元701、网络模块702、音频输出单元703、输入单元704、传感器705、显示单元706、用户输入单元707、接口单元708、存储器709、处理器710、以及电源711等部件。本领域技术人员可以理解,图7中示出的移动终端结构并不构成对移动终端的限定,移动终端可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。在本发明实施例中,移动终端包括但不限于手机、平板电脑、笔记本电脑、掌上电脑、车载终端、可穿戴设备、以及计步器等。The mobile terminal 700 includes but not limited to: a radio frequency unit 701, a network module 702, an audio output unit 703, an input unit 704, a sensor 705, a display unit 706, a user input unit 707, an interface unit 708, a memory 709, a processor 710, and Power supply 711 and other components. Those skilled in the art can understand that the structure of the mobile terminal shown in FIG. 7 does not constitute a limitation on the mobile terminal, and the mobile terminal may include more or less components than shown in the figure, or combine some components, or different components layout. In the embodiment of the present invention, the mobile terminal includes, but is not limited to, a mobile phone, a tablet computer, a notebook computer, a palmtop computer, a vehicle-mounted terminal, a wearable device, and a pedometer.

其中,处理器710,用于根据目标图像中任一边角对应的第一预设圆角系数,确定该边角对应的圆角区域和边角区域;根据边角区域对应的图像中各像素点的像素值,在边角区域中确定有效区域,其中,有效区域表示边角区域中包含有效图像信息的区域;根据预设压缩算法,将有效区域对应的图像和圆角区域对应的图像压缩到圆角区域。Wherein, the processor 710 is configured to determine the rounded area and the corner area corresponding to the corner according to the first preset fillet coefficient corresponding to any corner in the target image; according to each pixel in the image corresponding to the corner area The pixel value of is to determine the effective area in the corner area, wherein the effective area indicates the area containing valid image information in the corner area; according to the preset compression algorithm, the image corresponding to the effective area and the image corresponding to the rounded corner area are compressed into Rounded area.

根据目标图像中任一边角对应的第一预设圆角系数,确定该边角对应的圆角区域和边角区域,根据边角区域对应的图像中各像素点的像素值,在边角区域中确定包含有效图像信息的有效区域,进而根据预设压缩算法,将有效区域对应的图像和圆角区域对应的图像压缩到圆角区域,使得在圆角区域内得到该边角对应的圆角图像,从而在实现图像圆角显示的同时避免了有效图像信息的丢失,有效提高图像圆角显示的显示效果。According to the first preset fillet coefficient corresponding to any corner in the target image, determine the fillet area and corner area corresponding to the corner, and according to the pixel value of each pixel in the image corresponding to the corner area, in the corner area Determine the effective area containing effective image information, and then compress the image corresponding to the effective area and the image corresponding to the rounded area into the rounded area according to the preset compression algorithm, so that the rounded corner corresponding to the corner can be obtained in the rounded area image, thereby avoiding the loss of effective image information while realizing image rounded corner display, and effectively improving the display effect of image rounded corner display.

应理解的是,本发明实施例中,射频单元701可用于收发信息或通话过程中,信号的接收和发送,具体的,将来自基站的下行数据接收后,给处理器710处理;另外,将上行的数据发送给基站。通常,射频单元701包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器、双工器等。此外,射频单元701还可以通过无线通信系统与网络和其他设备通信。It should be understood that, in the embodiment of the present invention, the radio frequency unit 701 can be used to receive and send signals during sending and receiving information or during a call. Specifically, the downlink data from the base station is received and processed by the processor 710; in addition, the Uplink data is sent to the base station. Generally, the radio frequency unit 701 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 701 can also communicate with the network and other devices through a wireless communication system.

移动终端通过网络模块702为用户提供了无线的宽带互联网访问,如帮助用户收发电子邮件、浏览网页和访问流式媒体等。The mobile terminal provides users with wireless broadband Internet access through the network module 702, such as helping users send and receive emails, browse web pages, and access streaming media.

音频输出单元703可以将射频单元701或网络模块702接收的或者在存储器709中存储的音频数据转换成音频信号并且输出为声音。而且,音频输出单元703还可以提供与移动终端700执行的特定功能相关的音频输出(例如,呼叫信号接收声音、消息接收声音等等)。音频输出单元703包括扬声器、蜂鸣器以及受话器等。The audio output unit 703 may convert audio data received by the radio frequency unit 701 or the network module 702 or stored in the memory 709 into an audio signal and output as sound. Also, the audio output unit 703 can also provide audio output related to a specific function performed by the mobile terminal 700 (for example, call signal reception sound, message reception sound, etc.). The audio output unit 703 includes a speaker, a buzzer, a receiver, and the like.

输入单元704用于接收音频或视频信号。输入单元704可以包括图形处理器(Graphics Processing Unit,GPU)7041和麦克风7042,图形处理器7041对在视频捕获模式或图像捕获模式中由图像捕获装置(如摄像头)获得的静态图片或视频的图像数据进行处理。处理后的图像帧可以显示在显示单元706上。经图形处理器7041处理后的图像帧可以存储在存储器709(或其它存储介质)中或者经由射频单元701或网络模块702进行发送。麦克风7042可以接收声音,并且能够将这样的声音处理为音频数据。处理后的音频数据可以在电话通话模式的情况下转换为可经由射频单元701发送到移动通信基站的格式输出。The input unit 704 is used to receive audio or video signals. The input unit 704 may include a graphics processing unit (Graphics Processing Unit, GPU) 7041 and a microphone 7042, and the graphics processor 7041 is used for still pictures or video images obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The data is processed. The processed image frames may be displayed on the display unit 706 . The image frames processed by the graphics processor 7041 may be stored in the memory 709 (or other storage media) or sent via the radio frequency unit 701 or the network module 702 . The microphone 7042 can receive sound, and can process such sound into audio data. The processed audio data can be converted into a format that can be sent to a mobile communication base station via the radio frequency unit 701 for output in the case of a phone call mode.

移动终端700还包括至少一种传感器705,比如光传感器、运动传感器以及其他传感器。具体地,光传感器包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板7061的亮度,接近传感器可在移动终端700移动到耳边时,关闭显示面板7061和/或背光。作为运动传感器的一种,加速计传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别移动终端姿态(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等;传感器705还可以包括指纹传感器、压力传感器、虹膜传感器、分子传感器、陀螺仪、气压计、湿度计、温度计、红外线传感器等,在此不再赘述。The mobile terminal 700 also includes at least one sensor 705, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 7061 according to the brightness of the ambient light, and the proximity sensor can turn off the display panel 7061 and the / or backlighting. As a kind of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in various directions (generally three axes), and can detect the magnitude and direction of gravity when it is still, and can be used to identify the posture of mobile terminals (such as horizontal and vertical screen switching, related games, etc.) , magnetometer posture calibration), vibration recognition-related functions (such as pedometer, knocking), etc.; the sensor 705 can also include fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, thermometers, Infrared sensors, etc., will not be repeated here.

显示单元706用于显示由用户输入的信息或提供给用户的信息。显示单元706可包括显示面板7061,可以采用液晶显示器(Liquid Crystal Display,LCD)、有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板7061。The display unit 706 is used to display information input by the user or information provided to the user. The display unit 706 may include a display panel 7061, and the display panel 7061 may be configured in the form of a liquid crystal display (Liquid Crystal Display, LCD), an organic light-emitting diode (Organic Light-Emitting Diode, OLED), or the like.

用户输入单元707可用于接收输入的数字或字符信息,以及产生与移动终端的用户设置以及功能控制有关的键信号输入。具体地,用户输入单元707包括触控面板7071以及其他输入设备7072。触控面板7071,也称为触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板7071上或在触控面板7071附近的操作)。触控面板7071可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器710,接收处理器710发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触控面板7071。除了触控面板7071,用户输入单元707还可以包括其他输入设备7072。具体地,其他输入设备7072可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆,在此不再赘述。The user input unit 707 can be used to receive input numbers or character information, and generate key signal input related to user settings and function control of the mobile terminal. Specifically, the user input unit 707 includes a touch panel 7071 and other input devices 7072 . The touch panel 7071, also referred to as a touch screen, can collect touch operations of the user on or near it (for example, the user uses any suitable object or accessory such as a finger or a stylus on the touch panel 7071 or near the touch panel 7071). operate). The touch panel 7071 may include two parts, a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, and detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and sends it to the For the processor 710, receive the command sent by the processor 710 and execute it. In addition, the touch panel 7071 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 7071 , the user input unit 707 may also include other input devices 7072 . Specifically, other input devices 7072 may include, but are not limited to, physical keyboards, function keys (such as volume control keys, switch keys, etc.), trackballs, mice, and joysticks, which will not be repeated here.

进一步的,触控面板7071可覆盖在显示面板7061上,当触控面板7071检测到在其上或附近的触摸操作后,传送给处理器710以确定触摸事件的类型,随后处理器710根据触摸事件的类型在显示面板7061上提供相应的视觉输出。虽然在图7中,触控面板7071与显示面板7061是作为两个独立的部件来实现移动终端的输入和输出功能,但是在某些实施例中,可以将触控面板7071与显示面板7061集成而实现移动终端的输入和输出功能,具体此处不做限定。Furthermore, the touch panel 7071 can be covered on the display panel 7061. When the touch panel 7071 detects a touch operation on or near it, it will be sent to the processor 710 to determine the type of the touch event. The type of event provides a corresponding visual output on the display panel 7061. Although in FIG. 7, the touch panel 7071 and the display panel 7061 are used as two independent components to realize the input and output functions of the mobile terminal, in some embodiments, the touch panel 7071 and the display panel 7061 can be integrated. The implementation of the input and output functions of the mobile terminal is not specifically limited here.

接口单元708为外部装置与移动终端700连接的接口。例如,外部装置可以包括有线或无线头戴式耳机端口、外部电源(或电池充电器)端口、有线或无线数据端口、存储卡端口、用于连接具有识别模块的装置的端口、音频输入/输出(I/O)端口、视频I/O端口、耳机端口等等。接口单元708可以用于接收来自外部装置的输入(例如,数据信息、电力等等)并且将接收到的输入传输到移动终端700内的一个或多个元件或者可以用于在移动终端700和外部装置之间传输数据。The interface unit 708 is an interface for connecting an external device to the mobile terminal 700 . For example, an external device may include a wired or wireless headset port, an external power (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, audio input/output (I/O) ports, video I/O ports, headphone ports, and more. The interface unit 708 can be used to receive input from an external device (for example, data information, power, etc.) transfer data between devices.

存储器709可用于存储软件程序以及各种数据。存储器709可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据手机的使用所创建的数据(比如音频数据、电话本等)等。此外,存储器709可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。The memory 709 can be used to store software programs as well as various data. The memory 709 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application program required by a function (such as a sound playback function, an image playback function, etc.); Data created by the use of mobile phones (such as audio data, phonebook, etc.), etc. In addition, the memory 709 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage devices.

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

移动终端700还可以包括给各个部件供电的电源711(比如电池),优选的,电源711可以通过电源管理系统与处理器710逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。The mobile terminal 700 can also include a power supply 711 (such as a battery) for supplying power to various components. Preferably, the power supply 711 can be logically connected to the processor 710 through a power management system, so as to manage charging, discharging, and power consumption through the power management system. and other functions.

另外,移动终端700包括一些未示出的功能模块,在此不再赘述。In addition, the mobile terminal 700 includes some functional modules not shown, which will not be repeated here.

优选的,本发明实施例还提供一种移动终端,包括处理器710,存储器709,存储在存储器709上并可在处理器710上运行的图像处理程序,该图像处理程序被处理器710执行时实现上述图像处理方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。Preferably, the embodiment of the present invention also provides a mobile terminal, including a processor 710, a memory 709, an image processing program stored in the memory 709 and operable on the processor 710, when the image processing program is executed by the processor 710 Each process of the above embodiment of the image processing method can achieve the same technical effect, so in order to avoid repetition, details are not repeated here.

本发明实施例还提供一种计算机可读存储介质,计算机可读存储介质上存储有图像处理程序,该图像处理程序被处理器执行时实现上述图像处理方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。其中,所述的计算机可读存储介质,如只读存储器(Read-Only Memory,简称ROM)、随机存取存储器(Random Access Memory,简称RAM)、磁碟或者光盘等。The embodiment of the present invention also provides a computer-readable storage medium. An image processing program is stored on the computer-readable storage medium. When the image processing program is executed by a processor, each process of the above-mentioned image processing method embodiment is realized, and the same To avoid repetition, the technical effects will not be repeated here. Wherein, the computer-readable storage medium is, for example, a read-only memory (Read-Only Memory, ROM for short), a random access memory (Random Access Memory, RAM for short), a magnetic disk or an optical disk, and the like.

需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。It should be noted that, in this document, the term "comprising", "comprising" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article or apparatus comprising a set of elements includes not only those elements, It also includes other elements not expressly listed, or elements inherent in the process, method, article, or device. Without further limitations, an element defined by the phrase "comprising a ..." does not preclude the presence of additional identical elements in the process, method, article, or apparatus comprising that element.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本发明各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus a necessary general-purpose hardware platform, and of course also by hardware, but in many cases the former is better implementation. Based on such an understanding, the essence of the technical solution of the present invention or the part that contributes to the prior art can be embodied in the form of software products, and the computer software products are stored in a storage medium (such as ROM/RAM, disk, CD) contains several instructions to make a terminal (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) execute the methods described in various embodiments of the present invention.

上面结合附图对本发明的实施例进行了描述,但是本发明并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本发明的启示下,在不脱离本发明宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本发明的保护之内。Embodiments of the present invention have been described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementations, and the above-mentioned specific implementations are only illustrative, rather than restrictive, and those of ordinary skill in the art will Under the enlightenment of the present invention, without departing from the gist of the present invention and the protection scope of the claims, many forms can also be made, all of which belong to the protection of the present invention.

Claims (10)

  1. A kind of 1. image processing method, it is characterised in that including:
    According to the corresponding first default fillet coefficient in any corner in target image, determine the corresponding radius area in the corner and Corner areas;
    According to the pixel value of each pixel in the corresponding image of the corner areas, effective district is determined in the corner areas Domain, wherein, the effective coverage represents the region for including effective image information in the corner areas;
    According to default compression algorithm, by the corresponding image in the effective coverage and the corresponding compression of images of the radius area to institute State radius area.
  2. 2. the method as described in claim 1, it is characterised in that according to each pixel in the corresponding image of the corner areas Pixel value, determines effective coverage in the corner areas, including:
    Determine the corresponding background colour in first area that the radius area and the corner areas collectively form;
    According to the pixel value of each pixel in the background colour and the corresponding image of the corner areas, in the corner areas Determine effective coverage.
  3. 3. method as claimed in claim 2, it is characterised in that determine that the radius area and the corner areas collectively form The corresponding background colour in first area, including:
    Region division is carried out to the first area by Region Segmentation Algorithm, determines the connected domain in the first area;
    According to the pixel value of each pixel in the corresponding image of the connected domain, the corresponding pixel number of statistics any pixel value Mesh;
    The corresponding color of the most pixel value of pixel number is determined as the background colour.
  4. 4. method as claimed in claim 2 or claim 3, it is characterised in that corresponding according to the background colour and the corner areas The pixel value of each pixel in image, determines effective coverage in the corner areas, including:
    According to the second default fillet coefficient, the corner areas is divided into second area and the 3rd region, described second is default Fillet coefficient is less than the described first default fillet coefficient, wherein, the second area includes the corner, and the 3rd region is Region between the second area and the radius area;
    Determine the corresponding pixel ratio of background colour described in the second area, the pixel ratio is represented in the second area Described in the corresponding pixel number of background colour account for total pixel number purpose ratio;
    If the pixel ratio is more than preset ratio threshold value, the described second default fillet coefficient is increased into preset value, as new The second default fillet coefficient, until the pixel ratio is not more than the preset ratio threshold value;
    If the pixel ratio is not more than the preset ratio threshold value, the 3rd region is determined as the effective coverage.
  5. A kind of 5. mobile terminal, it is characterised in that including:
    Determining module, for according to the corresponding first default fillet coefficient in any corner in target image, determining the corner pair The radius area and corner areas answered;
    The determining module, is additionally operable to the pixel value according to each pixel in the corresponding image of the corner areas, on the side Effective coverage is determined in angular zone, wherein, the effective coverage represents the area for including effective image information in the corner areas Domain;
    Compression module, for according to default compression algorithm, the corresponding image in the effective coverage and the radius area to be corresponded to Compression of images to the radius area.
  6. 6. mobile terminal as claimed in claim 5, it is characterised in that the determining module further comprises:
    Determination unit, the corresponding background in first area collectively formed for determining the radius area and the corner areas Color;
    The determination unit, is additionally operable to the pixel according to each pixel in the background colour and the corresponding image of the corner areas Value, determines effective coverage in the corner areas.
  7. 7. mobile terminal as claimed in claim 6, it is characterised in that the determination unit is specifically used for:
    Region division is carried out to the first area by Region Segmentation Algorithm, determines the connected domain in the first area;
    According to the pixel value of each pixel in the corresponding image of the connected domain, the corresponding pixel number of statistics any pixel value Mesh;
    The corresponding color of the most pixel value of pixel number is determined as the background colour.
  8. 8. mobile terminal as claimed in claims 6 or 7, it is characterised in that the determination unit is specifically used for:
    According to the second default fillet coefficient, the corner areas is divided into second area and the 3rd region, described second is default Fillet coefficient is less than the described first default fillet coefficient, wherein, the second area includes the corner, and the 3rd region is Region between the second area and the radius area;
    Determine the corresponding pixel ratio of background colour described in the second area, the pixel ratio is represented in the second area Described in the corresponding pixel number of background colour account for total pixel number purpose ratio;
    If the pixel ratio is more than preset ratio threshold value, the described second default fillet coefficient is increased into preset value, as new The second default fillet coefficient, until the pixel ratio is not more than the preset ratio threshold value;
    If the pixel ratio is not more than the preset ratio threshold value, the 3rd region is determined as the effective coverage.
  9. 9. a kind of mobile terminal, it is characterised in that including processor, memory and be stored on the memory and can be described The image processing program run on processor, realizes such as claim 1 when described image processing routine is performed by the processor The step of to image processing method any one of 4.
  10. 10. a kind of computer-readable recording medium, it is characterised in that store image procossing on the computer-readable recording medium Program, realizes image processing method according to any one of claims 1 to 4 when described image processing routine is executed by processor The step of method.
CN201711400229.4A 2017-12-22 2017-12-22 An image processing method and a mobile terminal Active CN107977947B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711400229.4A CN107977947B (en) 2017-12-22 2017-12-22 An image processing method and a mobile terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711400229.4A CN107977947B (en) 2017-12-22 2017-12-22 An image processing method and a mobile terminal

Publications (2)

Publication Number Publication Date
CN107977947A true CN107977947A (en) 2018-05-01
CN107977947B CN107977947B (en) 2019-12-24

Family

ID=62007434

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711400229.4A Active CN107977947B (en) 2017-12-22 2017-12-22 An image processing method and a mobile terminal

Country Status (1)

Country Link
CN (1) CN107977947B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112261242A (en) * 2020-10-21 2021-01-22 合肥芯颖科技有限公司 Image data processing method and device
CN113412470A (en) * 2019-04-23 2021-09-17 华为技术有限公司 Method and device for processing image layer
CN113554547A (en) * 2020-04-24 2021-10-26 北京小米移动软件有限公司 Image processing method, image processing device, terminal equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103985084A (en) * 2014-05-06 2014-08-13 青岛海信电器股份有限公司 Image processing method and device
CN106056604A (en) * 2016-05-27 2016-10-26 浙江工业大学 Automatic hollowing method for augmented reality identification
CN106875328A (en) * 2015-12-11 2017-06-20 北京新媒传信科技有限公司 Image processing method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103985084A (en) * 2014-05-06 2014-08-13 青岛海信电器股份有限公司 Image processing method and device
CN106875328A (en) * 2015-12-11 2017-06-20 北京新媒传信科技有限公司 Image processing method and device
CN106056604A (en) * 2016-05-27 2016-10-26 浙江工业大学 Automatic hollowing method for augmented reality identification

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113412470A (en) * 2019-04-23 2021-09-17 华为技术有限公司 Method and device for processing image layer
CN113412470B (en) * 2019-04-23 2023-09-08 华为技术有限公司 Method and device for processing image layer
CN113554547A (en) * 2020-04-24 2021-10-26 北京小米移动软件有限公司 Image processing method, image processing device, terminal equipment and storage medium
EP3901895A1 (en) * 2020-04-24 2021-10-27 Beijing Xiaomi Mobile Software Co., Ltd. Image processing method, apparatus, terminal device and storage medium
US11450005B2 (en) 2020-04-24 2022-09-20 Beijing Xiaomi Mobile Software Co., Ltd. Image processing method, apparatus, terminal device and storage medium
CN112261242A (en) * 2020-10-21 2021-01-22 合肥芯颖科技有限公司 Image data processing method and device
CN112261242B (en) * 2020-10-21 2022-09-27 合肥芯颖科技有限公司 Image data processing method and device

Also Published As

Publication number Publication date
CN107977947B (en) 2019-12-24

Similar Documents

Publication Publication Date Title
CN108446085A (en) A kind of throwing screen display methods and mobile terminal
CN107957839A (en) A kind of display control method and mobile terminal
CN107798303A (en) A kind of method and mobile terminal for adjusting screen backlight
CN107908383A (en) A kind of screen color method of adjustment, device and mobile terminal
CN108184037A (en) A kind of method for displaying image and mobile terminal
CN108073343A (en) A kind of display interface method of adjustment and mobile terminal
CN107977652A (en) The extracting method and mobile terminal of a kind of screen display content
CN107895352A (en) A kind of image processing method and mobile terminal
CN108628565A (en) A kind of mobile terminal operating method and mobile terminal
CN108459815A (en) A kind of display control method and mobile terminal
CN108037966A (en) A kind of interface display method, device and mobile terminal
CN108595201A (en) A kind of application program update method and mobile terminal
CN107886321A (en) A kind of method of payment and mobile terminal
CN108335259B (en) Image processing method, image processing equipment and mobile terminal
CN108093306A (en) A kind of barrage display methods and mobile terminal
CN108257104A (en) A kind of image processing method and mobile terminal
CN108196815A (en) Method for adjusting call sound and mobile terminal
CN107734172A (en) A kind of method for information display and mobile terminal
CN108600544A (en) A kind of Single-hand control method and terminal
CN107977947B (en) An image processing method and a mobile terminal
CN107845363A (en) A kind of display control method and mobile terminal
CN107682637A (en) A shooting method, mobile terminal and computer-readable storage medium
CN107845074A (en) A kind of image rendering method and mobile terminal
CN108279843A (en) A kind of screenshot method and mobile terminal
CN107835402A (en) A kind of image processing method, device and mobile terminal

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