[go: up one dir, main page]

CN104301578A - Image type-based processing method and device - Google Patents

Image type-based processing method and device Download PDF

Info

Publication number
CN104301578A
CN104301578A CN201410637869.7A CN201410637869A CN104301578A CN 104301578 A CN104301578 A CN 104301578A CN 201410637869 A CN201410637869 A CN 201410637869A CN 104301578 A CN104301578 A CN 104301578A
Authority
CN
China
Prior art keywords
color picture
image
picture
quality factor
processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201410637869.7A
Other languages
Chinese (zh)
Inventor
吕本伟
杨涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Qihoo Technology Co Ltd, Qizhi Software Beijing Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201410637869.7A priority Critical patent/CN104301578A/en
Publication of CN104301578A publication Critical patent/CN104301578A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N1/00Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
    • H04N1/40Picture signal circuits
    • H04N1/40068Modification of image resolution, i.e. determining the values of picture elements at new relative positions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N1/00Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
    • H04N1/41Bandwidth or redundancy reduction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N1/00Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
    • H04N1/46Colour picture communication systems
    • H04N1/56Processing of colour picture signals
    • H04N1/58Edge or detail enhancement; Noise or error suppression, e.g. colour misregistration correction

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Color Television Systems (AREA)

Abstract

The invention discloses a processing method and equipment based on an image type and relates to the technical field of image processing. The equipment comprises a judging module, a compression quality factor determining module, a first scaling module and a sharpening module, wherein the judging module is suitable for judging the type of an input image; the compression quality factor determining module is suitable for obtaining compression quality factors indicating the compression ratio of the colorful image under the situation that the judging module judges that the input image is a colorful image; the first scaling module is suitable for scaling the colorful image; the sharpening module is suitable for sharpening the colorful image obtained after scaling according to the compression quality factors of the colorful image and obtaining the output colorful image. The method and the equipment disclosed by the invention have the benefits that the image is sharpened according to the compression ratio of the colorful image, and the definition of an original low-quality color image is greatly improved after sharpening.

Description

基于图片类型的处理方法及设备Image type-based processing method and device

本申请为申请日是2012年10月19日,申请号是201210402441.5,名称是“基于图片类型的处理方法及设备”的发明专利申请的分案申请。This application is a divisional application of an invention patent application with a filing date of October 19, 2012, an application number of 201210402441.5, and a title of "Image Type-based Processing Method and Equipment".

技术领域technical field

本发明涉及图像处理技术领域,具体涉及一种基于图片类型的处理方法及设备。The present invention relates to the technical field of image processing, in particular to a processing method and device based on image type.

背景技术Background technique

在计算机图像处理中,图片缩放是指通过增加或去除像素对数字图像的尺寸进行调整的过程。由于要在效率和图像质量(例如平滑度和清晰度)之间做折衷,图片缩放并不是个平庸的过程。当前客户端处理图片的工具比较多,如Photoshop和美图秀秀等,通过这些工具可以依据用户喜好对图片进行缩放操作。In computer image processing, image scaling is the process of resizing a digital image by adding or removing pixels. Image scaling is not a trivial process due to the trade-off between efficiency and image quality such as smoothness and sharpness. At present, there are many tools for image processing on the client side, such as Photoshop and Meitu Xiuxiu, etc. Through these tools, the image can be zoomed according to the user's preference.

图片缩放技术包括图片缩小和图片放大两种技术。图片放大一般用来采用一个较小的图片填充一个较大的屏幕,当图片尺寸增大的时候,组成图片的像素增多,图片看上去就变“柔和”了。图片缩小除了用来缩小图片以适应显示区域以外,更多的是用于产生预览图片。图片放大技术一般可采用插值算法来实现。图片缩小技术可通过抽样(也可称为下采样或降采样)方法来实现。对图片的缩放操作并不能带来更多关于图片的信息,因此经缩放后,图片的质量将不可避免的受到影响。以对JPEG(JointPhotographic Experts Group,联合图像专家组)图片进行缩小为例,通过抽样的方式将去掉图片中的一些像素,这势必造成图片模糊、有颗粒感等问题,如果JPEG图片品质越差,得到的缩略图就越模糊。The image scaling technology includes two technologies of image reduction and image enlargement. Image enlargement is generally used to fill a larger screen with a smaller image. When the size of the image increases, the pixels that make up the image increase, and the image looks "softer". In addition to shrinking the image to fit the display area, image reduction is more used to generate a preview image. Image enlargement technology can generally be realized by interpolation algorithm. The image reduction technology can be implemented by sampling (also called down-sampling or down-sampling) method. The zoom operation on the picture cannot bring more information about the picture, so the quality of the picture will inevitably be affected after zooming. Taking the reduction of JPEG (Joint Photographic Experts Group, Joint Photographic Experts Group) picture as an example, some pixels in the picture will be removed by sampling, which will inevitably cause problems such as blurred and grainy pictures. If the quality of the JPEG picture is worse, The resulting thumbnails are blurrier.

发明内容Contents of the invention

鉴于上述问题,提出了本发明以便提供一种克服上述问题或者至少部分地解决上述问题的基于图片类型的处理方法和相应的基于图片类型的处理设备。In view of the above problems, the present invention is proposed to provide a picture-type-based processing method and a corresponding picture-type-based processing device that overcome the above-mentioned problems or at least partially solve the above-mentioned problems.

依据本发明的一个方面,提供了一种基于图片类型的处理方法,包括步骤:对输入图片的类型进行判断;在判断出输入图片的类型为彩色图片的情况下,获取指示彩色图片的压缩率的压缩质量因子;对彩色图片进行缩放处理;以及根据彩色图片的压缩质量因子,对缩放处理后得到的彩色图片进行图像锐化处理,得到输出彩色图片。According to one aspect of the present invention, a processing method based on picture type is provided, comprising the steps of: judging the type of the input picture; in the case of judging that the type of the input picture is a color picture, obtaining the compression ratio indicating the color picture The compression quality factor of the color picture is scaled; and according to the compression quality factor of the color picture, image sharpening is performed on the color picture obtained after scaling to obtain an output color picture.

根据本发明的另一方面,提供了一种基于图片类型的处理设备,包括:判断模块,适于对输入图片的类型进行判断;压缩质量因子确定模块,适于在判断模块判断出所述输入图片的类型为彩色图片的情况下,获取指示彩色图片的压缩率的压缩质量因子;第一缩放模块,适于对彩色图片进行缩放处理;以及锐化模块,适于根据彩色图片的压缩质量因子,对缩放处理后得到的彩色图片进行图像锐化处理,得到输出彩色图片。According to another aspect of the present invention, a processing device based on picture type is provided, including: a judging module, adapted to judge the type of an input picture; a compression quality factor determining module, adapted to judge the input In the case that the type of the picture is a color picture, the compression quality factor indicating the compression rate of the color picture is obtained; the first scaling module is adapted to perform scaling processing on the color picture; and the sharpening module is adapted to compress the quality factor according to the color picture , performing image sharpening processing on the color image obtained after scaling processing to obtain an output color image.

根据本发明提供的基于图片类型的处理方法及设备,通过对输入图片的类型进行判断,在判断出为彩色图片的情况下,获取该彩色图片的压缩质量因子,根据彩色图片的压缩质量因子对缩放处理后的彩色图片进行图像锐化处理,其中压缩质量因子指示出彩色图片的压缩率,也就是说,本发明提供的方法及设备根据彩色图片的压缩率进行图像锐化处理,经过这样的处理之后,原有的低品质的彩色图片的清晰度得到大幅提高。According to the picture type-based processing method and equipment provided by the present invention, by judging the type of the input picture, if it is judged to be a color picture, the compression quality factor of the color picture is obtained, and the compression quality factor of the color picture is compared The image sharpening process is performed on the zoomed color picture, wherein the compression quality factor indicates the compression ratio of the color picture, that is to say, the method and device provided by the present invention perform image sharpening processing according to the compression rate of the color picture, after such After processing, the clarity of the original low-quality color pictures has been greatly improved.

上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。The above description is only an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention, it can be implemented according to the contents of the description, and in order to make the above and other purposes, features and advantages of the present invention more obvious and understandable , the specific embodiments of the present invention are enumerated below.

附图说明Description of drawings

通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiment. The drawings are only for the purpose of illustrating a preferred embodiment and are not to be considered as limiting the invention. Also throughout the drawings, the same reference numerals are used to designate the same components. In the attached picture:

图1示出了根据本发明一个实施例的基于图片类型的处理方法的流程图;FIG. 1 shows a flowchart of a processing method based on a picture type according to an embodiment of the present invention;

图2示出了根据本发明另一个实施例的基于图片类型的处理方法的流程图;以及FIG. 2 shows a flowchart of a processing method based on a picture type according to another embodiment of the present invention; and

图3示出了根据本发明一个实施例的基于图片类型的处理设备的结构示意图。Fig. 3 shows a schematic structural diagram of a processing device based on a picture type according to an embodiment of the present invention.

具体实施方式Detailed ways

下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided for more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

图1示出了根据本发明一个实施例的基于图片类型的处理方法100的流程图。本实施例提供的方法主要解决的是在判断出输入图片的类型为彩色图片的情况下,如何对该彩色图片进行缩放处理。如图1所示,方法100始于步骤S101,其中对输入图片的类型进行判断。由于输入图片的类型不同导致后续缩放后所作的处理会有所不同,因此在本方法中需要首先对输入图片的类型进行判断,该判断过程主要是确定输入图片是否为彩色图片。可选地,判断的依据是输入图片的颜色空间,如果输入图片的颜色空间为RGB,那么则确定该输入图片的类型为彩色图片。Fig. 1 shows a flowchart of a processing method 100 based on a picture type according to an embodiment of the present invention. The method provided in this embodiment mainly solves how to perform scaling processing on the color picture when it is determined that the type of the input picture is a color picture. As shown in FIG. 1 , the method 100 starts at step S101 , where the type of the input picture is determined. Due to the different types of input pictures, subsequent processing after zooming will be different. Therefore, in this method, it is first necessary to judge the type of the input picture. The judgment process is mainly to determine whether the input picture is a color picture. Optionally, the judgment is based on the color space of the input picture, and if the color space of the input picture is RGB, then it is determined that the type of the input picture is a color picture.

随后,方法100进入步骤S102,在步骤S101中判断出输入图片的类型为彩色图片的情况下,在步骤S102中获取指示彩色图片的压缩率的压缩质量因子。当前互联网中的彩色图片都经过不同程度的压缩处理,以JPEG图片为例,这种类型图片的压缩主要包括四个步骤,分别为颜色转换、DCT变换(Discrete Cosine Transform,离散余弦变换)、量化和编码。在量化步骤中会选取压缩质量因子,该压缩质量因子指示了彩色图片的压缩率。若选取的压缩质量因子较大,可大幅度提高压缩比,但图像质量会较差;若选取的压缩质量因子较小,图像的重建质量较好,但压缩比较低。因此,压缩质量因子是表征彩色图片图像质量的一个因素。在判断出输入图片的类型为彩色图片的情况下,获取该彩色图片的压缩质量因子,本方法的后续步骤中将用到该压缩质量因子。Subsequently, the method 100 proceeds to step S102, and if it is determined in step S101 that the type of the input picture is a color picture, in step S102, the compression quality factor indicating the compression rate of the color picture is obtained. Currently, color images on the Internet are compressed to varying degrees. Taking JPEG images as an example, the compression of this type of image mainly includes four steps, namely color conversion, DCT transform (Discrete Cosine Transform, discrete cosine transform), quantization and encoding. A compression quality factor is chosen in the quantization step, which indicates the compression ratio of the color picture. If the selected compression quality factor is large, the compression ratio can be greatly improved, but the image quality will be poor; if the selected compression quality factor is small, the reconstruction quality of the image is better, but the compression ratio is low. Therefore, the compression quality factor is a factor that characterizes the image quality of a color picture. If it is determined that the type of the input picture is a color picture, the compression quality factor of the color picture is obtained, and the compression quality factor will be used in subsequent steps of the method.

方法100随后进入步骤S103,其中对彩色图片进行缩放处理。在获取彩色图片的压缩质量因子之后,按照插值或抽样算法,对彩色图片进行缩放处理。本步骤的缩放处理可以按照现有的方法进行,在此不再赘述。The method 100 then proceeds to step S103, where scaling processing is performed on the color picture. After obtaining the compression quality factor of the color picture, the color picture is scaled according to an interpolation or sampling algorithm. The scaling processing in this step can be performed according to an existing method, which will not be repeated here.

应当注意的是,步骤S102和S103之间没有顺序关系,两个步骤可以同时执行、先步骤S103然后步骤S102等,所有这些都在本发明的保护范围之内。It should be noted that there is no sequence relationship between steps S102 and S103, and the two steps can be executed simultaneously, step S103 first, then step S102, etc., all of which are within the protection scope of the present invention.

随后,在步骤S104中,根据在步骤S102获得的彩色图片的压缩质量因子,对缩放处理后得到的彩色图片进行图像锐化处理,得到输出彩色图片。步骤S104所做的图像锐化处理是补偿和增加图像的高频成分,使图像中的地物边界、区域边缘、线条、纹理特征和精细结构特征更加清晰和鲜明。由于在进行图像锐化处理时,图片的噪声部分会得到同样程度的增强,而且对于压缩率越高的图片,其像素丢失情况越为严重,噪声也相应越大,所以本方法对具有不同的压缩质量因子的彩色图片进行不同程度的图像锐化处理。具体地,压缩质量因子所指示的压缩率越高,图像锐化的锐化度越低,压缩质量因子所指示的压缩率越低,图像锐化的锐化度越高。经过这样的图像锐化处理之后,得到的输出彩色图片的清晰度得到大幅提高。Subsequently, in step S104, according to the compression quality factor of the color picture obtained in step S102, the image sharpening process is performed on the color picture obtained after scaling processing to obtain an output color picture. The image sharpening processing performed in step S104 is to compensate and increase the high-frequency components of the image, so as to make the object boundaries, region edges, lines, texture features and fine structure features in the image more clear and distinct. Since the noise part of the picture will be enhanced to the same extent during the image sharpening process, and for a picture with a higher compression rate, the pixel loss is more serious and the noise is correspondingly larger, so this method has different effects Color images with compressed quality factors undergo varying degrees of image sharpening. Specifically, the higher the compression ratio indicated by the compression quality factor, the lower the sharpness of image sharpening, and the lower the compression ratio indicated by the compression quality factor, the higher the sharpness of image sharpening. After such image sharpening processing, the clarity of the obtained output color picture is greatly improved.

根据本实施例提供的将图片进行缩放处理的方法,通过对输入图片的类型进行判断,在判断出为彩色图片的情况下,获取该彩色图片的压缩质量因子,根据彩色图片的压缩质量因子对缩放处理后的彩色图片进行图像锐化处理,其中压缩质量因子指示出彩色图片的压缩率,也就是说,本实施例提供的方法根据彩色图片的压缩率进行图像锐化处理,经过这样的处理之后,原有的低品质的彩色图片的清晰度得到大幅提高。According to the method for zooming a picture provided in this embodiment, by judging the type of the input picture, if it is judged to be a color picture, the compression quality factor of the color picture is obtained, and the compression quality factor of the color picture is compared to The image sharpening process is performed on the scaled color picture, wherein the compression quality factor indicates the compression ratio of the color picture, that is to say, the method provided in this embodiment performs image sharpening processing according to the compression rate of the color picture, after such processing After that, the sharpness of the original low-quality color pictures has been greatly improved.

图2示出了根据本发明另一个实施例的基于图片类型的处理方法200的流程图。如图2所示,方法200始于步骤S201,其中对输入图片的类型进行判断。由于输入图片的类型不同导致后续缩放后所作的处理会有所不同,因此在本方法中需要首先对输入图片的类型进行判断,该判断过程主要是确定输入图片是彩色图片还是灰度图片。可选地,判断的依据是输入图片的颜色空间,如果输入图片的颜色空间为灰度,那么则确定该输入图片的类型为灰度图片,执行步骤S202;如果输入图片的颜色空间为RGB,那么则确定该输入图片的类型为彩色图片,执行步骤S204。Fig. 2 shows a flowchart of a processing method 200 based on a picture type according to another embodiment of the present invention. As shown in FIG. 2 , the method 200 starts at step S201 , where the type of the input picture is determined. Due to the different types of input pictures, the subsequent processing after zooming will be different. Therefore, in this method, the type of the input picture needs to be judged first. The judgment process is mainly to determine whether the input picture is a color picture or a grayscale picture. Optionally, the basis for judging is the color space of the input picture, if the color space of the input picture is grayscale, then it is determined that the type of the input picture is a grayscale picture, and step S202 is performed; if the color space of the input picture is RGB, Then it is determined that the type of the input picture is a color picture, and step S204 is executed.

在步骤S201中判断出输入图片的类型为灰度图片的情况下,方法200进入步骤S202,在步骤S202中对灰度图片进行缩放处理。按照插值或抽样算法,对灰度图片进行缩放处理。本步骤的缩放处理可以按照现有的方法进行,在此不再赘述。If it is determined in step S201 that the type of the input image is a grayscale image, the method 200 proceeds to step S202, where the grayscale image is scaled. According to the interpolation or sampling algorithm, the grayscale image is scaled. The scaling processing in this step can be performed according to an existing method, which will not be repeated here.

在步骤S202中对灰度图片进行缩放处理之后,方法200进入步骤S203,其中将缩放处理后得到的灰度图片进行直方图均衡化处理,得到输出灰度图片。对于灰色图片,本方法采用直方图均衡化方法对其进行处理,能增强图片对比度。直方图均衡化是图像处理领域中利用图像直方图对图片对比度进行调整的方法。图像直方图的横坐标表示亮度分布,纵坐标表示像素分布。它能够显示一张图片中色调的分布情况,揭示图片中每一个亮度级别下像素出现的数量。根据这些数值所绘出的图像形态,可以初步判断图片的曝光情况。无论图片是有丰富的高光表现还是曝光过度,或者有饱满的细部暗调还是细节分辨不清,图像直方图都能很直观的显示。直方图均衡化方法通过使用累积函数对灰度值进行“调整”以实现对比度的增强。直方图均衡化处理的“中心思想”是把原始图像的灰度直方图从比较集中的某个灰度区间变成在全部灰度范围内的均匀分布。直方图均衡化就是对图像进行非线性拉伸,重新分配图像像素值,使一定灰度范围内的像素数量大致相同。简单说就是把给定图像的直方图分布改变成“均匀”分布的直方图分布。After scaling the grayscale image in step S202, the method 200 proceeds to step S203, wherein the grayscale image obtained after scaling is subjected to histogram equalization processing to obtain an output grayscale image. For the gray picture, this method adopts the histogram equalization method to process it, which can enhance the contrast of the picture. Histogram equalization is a method in the field of image processing that uses image histograms to adjust image contrast. The abscissa of the image histogram represents the brightness distribution, and the ordinate represents the pixel distribution. It shows the distribution of tones in an image, revealing how many pixels are present at each brightness level in the image. According to the shape of the image drawn by these values, the exposure of the image can be preliminarily judged. Whether the picture has rich highlights or is overexposed, or has full details and dark tones or details are unclear, the image histogram can be displayed intuitively. The histogram equalization method achieves contrast enhancement by "adjusting" the gray value using a cumulative function. The "central idea" of histogram equalization processing is to change the gray histogram of the original image from a relatively concentrated gray-scale interval to a uniform distribution in the entire gray-scale range. Histogram equalization is to stretch the image nonlinearly and redistribute the pixel values of the image so that the number of pixels in a certain gray scale range is roughly the same. Simply put, it is to change the histogram distribution of a given image into a histogram distribution of "uniform" distribution.

对于一个灰度图片,设ni表示灰度i出现的次数,图片中灰度为i的像素出现概率为:For a grayscale image, let n i represent the number of occurrences of grayscale i, and the probability of occurrence of a pixel with grayscale i in the image is:

pp xx (( ii )) == nno ii nno ,, ii ∈∈ 00 ,, .. .. .. ,, LL -- 11 -- -- -- (( 11 ))

其中,L是图片中所有的灰度数,n是图片中所有的像素数,px实际上是该图片的直方图,将其归一化到[0,1]范围内。Among them, L is all the grayscale numbers in the picture, n is the number of all pixels in the picture, and p x is actually the histogram of the picture, which is normalized to the range [0,1].

把c作为对应于px的累计概率函数,定义为:Taking c as the cumulative probability function corresponding to p x , it is defined as:

cc (( ii )) == ΣΣ jj == 00 ii pp xx (( jj )) -- -- -- (( 22 ))

c是图片的累计归一化直方图。c is the cumulative normalized histogram of the image.

创建一个形式为y=T(x)的变化函数,对于原始图片中的每个值它就产生一个y,这样y的累计概率函数就可以在所有值范围内进行线性化,转换公式定义为:Create a variation function of the form y=T(x), which produces a y for each value in the original image, so that the cumulative probability function of y can be linearized over all values, and the transformation formula is defined as:

yi=T(xi)=c(i)   (3)y i =T(x i )=c(i) (3)

注意T将不同的等级映射到[0,1]域,为了将这些值映射回它们最初的域,需要在结果上应用下面的简单变换:Note that T maps different levels to the [0,1] domain, to map these values back to their original domain, the following simple transformation needs to be applied on the result:

y′i=yi·(max-min)+min   (4)y′ i =y i ·(max-min)+min (4)

其中,max表示图片中的灰度最大值,min表示图片中的灰度最小值。Among them, max represents the maximum gray value in the picture, and min represents the minimum gray value in the picture.

由于灰度图片经过缩放后像素丢失而变得模糊,通过上述直方图均衡化处理方法可以使图片的像素倾向于占据整个可能的灰度级且分布均匀,从而达到增强图片前景、背景间的对比度的目的,使得输出灰度图片更为清晰。Since the pixels of the grayscale image are lost after zooming and become blurred, the above-mentioned histogram equalization method can make the pixels of the image tend to occupy the entire possible grayscale and be evenly distributed, so as to enhance the contrast between the foreground and background of the image The purpose of making the output grayscale image clearer.

上面描述了灰度图像上使用直方图均衡化的方法,但是通过将这种方法分别用于图像RGB颜色值的红色、绿色和蓝色分量,从而也可以对彩色图像进行处理。The method using histogram equalization on grayscale images was described above, but it can also be done on color images by applying this method separately to the red, green and blue components of the image's RGB color values.

在步骤S201中判断出输入图片的类型为彩色图片的情况下,方法200进入步骤S204,在步骤S204中获取指示彩色图片的压缩率的压缩质量因子。当前互联网中的彩色图片都经过不同程度的压缩处理,为了能更好的理解压缩质量因子的来源及作用,这里以JPEG图片为例介绍图片压缩的处理过程。JPEG图片压缩主要分为以下四个步骤来完成:If it is determined in step S201 that the type of the input picture is a color picture, the method 200 proceeds to step S204, and in step S204, the compression quality factor indicating the compression rate of the color picture is acquired. Currently, color images on the Internet are compressed to varying degrees. In order to better understand the source and function of the compression quality factor, here is a JPEG image as an example to introduce the process of image compression. JPEG image compression is mainly divided into the following four steps to complete:

(1)颜色转换。(1) Color conversion.

由于JPEG只支持YUV颜色模式的数据结构,而不支持RGB颜色模式的数据结构,所以在将彩色图片进行压缩之前,必须将彩色图片的颜色模式转换为RGB颜色模式。Since JPEG only supports the data structure of the YUV color mode, but not the data structure of the RGB color mode, before compressing the color picture, the color mode of the color picture must be converted to the RGB color mode.

(2)DCT变换。(2) DCT transformation.

将图像信号在频率域上进行变换,分离出高频信息和低频信息。后续将对图像的高频部分(即图像细节)进行压缩,以达到压缩图像数据的目的。The image signal is transformed in the frequency domain to separate high-frequency information and low-frequency information. Subsequently, the high-frequency part of the image (ie image details) will be compressed to achieve the purpose of compressing image data.

(3)量化。(3) Quantification.

由于在后续编码过程中使用的码本都是整数,因此需要对DCT变换后的频率系数进行量化,将其转换为整数。在这一过程中,会选取压缩质量因子,该压缩质量因子指示了彩色图片的压缩率。根据压缩质量因子进行量化处理后,得到的量化值都是近似值,和原始图像的数据之间有了差异,这一差异是造成图像压缩后失真的主要原因。因此,压缩质量因子的选取至为重要,若选取的压缩质量因子较大,可大幅度提高压缩比,但图像质量会较差;若选取的压缩质量因子较小,图像的重建质量较好,但压缩比较低。ISO已经制定了一组供JPEG代码实现者使用的标准量化值。Since the codebooks used in the subsequent encoding process are all integers, it is necessary to quantize the frequency coefficients after DCT transformation and convert them into integers. During this process, a compression quality factor is selected, which indicates the compression ratio of the color picture. After the quantization process is performed according to the compression quality factor, the quantized values obtained are all approximate values, which are different from the data of the original image, and this difference is the main reason for image distortion after compression. Therefore, the selection of the compression quality factor is very important. If the selected compression quality factor is large, the compression ratio can be greatly improved, but the image quality will be poor; if the selected compression quality factor is small, the reconstruction quality of the image is better. But the compression is relatively low. ISO has developed a set of standard quantization values for use by implementers of JPEG codes.

(4)编码。(4) Coding.

从前面的过程可以看出,从颜色转换完成到编码之前,图像并没有得到进一步的压缩,DCT变换和量化可以说是为编码阶段所做的准备工作。编码可以采用两种机制:一是0值的行程长度编码;二是熵编码。在JPEG中,采用曲徊序列,即以图像数据矩阵对角线的法线方向作“之”字排列图像数据矩阵中的元素。这样做的优点是使得靠近图像数据矩阵左上角、值比较大的元素排列在行程的前面,而行程的后面所排列的图像数据矩阵元素基本上为0值。行程长度编码是非常简单和常用的编码方式,在此不再赘述。编码实际上是一种基于统计特性的编码方法。在JPEG中允许采用霍夫曼编码或者算术编码。It can be seen from the previous process that the image has not been further compressed from the completion of color conversion to the encoding, and DCT transformation and quantization can be said to be preparations for the encoding stage. Encoding can use two mechanisms: one is 0-value run-length encoding; the other is entropy encoding. In JPEG, a zigzag sequence is adopted, that is, the elements in the image data matrix are arranged in a zigzag with the normal direction of the diagonal of the image data matrix. The advantage of doing this is that the elements near the upper left corner of the image data matrix with relatively large values are arranged in front of the run, and the elements of the image data matrix arranged behind the run are basically 0 values. Run-length encoding is a very simple and commonly used encoding method, which will not be repeated here. Coding is actually a coding method based on statistical properties. Huffman coding or arithmetic coding is allowed in JPEG.

通过上述JPEG图片的压缩过程可以看到,压缩质量因子是可灵活控制的,不同的实现对压缩质量因子也有不同的定义,举例来说:Through the compression process of the above JPEG image, we can see that the compression quality factor can be flexibly controlled, and different implementations have different definitions for the compression quality factor, for example:

IJG(Independent JPEG Group,独立JPEG小组)采用的压缩质量因子度量等级是1~99,且1指示图片的压缩率最低,99指示图片的压缩率最高;IJG (Independent JPEG Group, Independent JPEG Group) uses a compression quality factor measurement level of 1 to 99, and 1 indicates the lowest compression rate of the picture, and 99 indicates the highest compression rate of the picture;

Photoshop(一种图像处理软件)定义了1~12级的压缩质量因子;Photoshop (an image processing software) defines a compression quality factor of 1 to 12;

Apple(苹果)定义了0~4级的压缩质量因子;Apple (Apple) defines the compression quality factor from 0 to 4;

Paint Shop Pro(一种图像编辑软件)采用的压缩质量因子度量等级也是1~99,但与IJG相反的是,1指示图片的压缩率最高,99指示图片的压缩率最低。Paint Shop Pro (an image editing software) uses a compression quality factor scale of 1 to 99, but contrary to IJG, 1 indicates the highest compression rate of the picture, and 99 indicates the lowest compression rate of the picture.

针对上述若干种不同定义的压缩质量因子,可以将其转化为统一的度量等级。例如,在分析彩色图片的内容获取彩色图片的压缩质量因子之后,可以将它转化为IJG定义的度量等级,可选地,通过采用JPEGdump工具就可实现该功能。需要说明的是,本发明不仅限于将压缩质量因子转化为IJG定义的度量等级,也可以转化为其他类型定义的度量等级,本发明对此不做限制。For the above-mentioned several differently defined compression quality factors, they can be transformed into a unified measurement level. For example, after analyzing the content of the color picture to obtain the compression quality factor of the color picture, it can be converted into a measurement level defined by IJG. Optionally, this function can be realized by using the JPEGdump tool. It should be noted that the present invention is not limited to transforming the compression quality factor into a metric level defined by the IJG, and may also be converted into a metric level defined by other types, which is not limited by the present invention.

方法200随后进入步骤S205,其中将彩色图片的格式由原有格式转换为PNG格式(Portable Network Graphic Format,流式网络图形格式)。由于PNG格式的图片处理过程为无损过程,本方法选择在缩放处理之前将彩色图片的格式(如JPEG格式)转换为PNG格式,相对于其它格式来说,对PNG格式的彩色图片进行缩放处理,可以降低对清晰度的影响。The method 200 then proceeds to step S205, wherein the format of the color picture is converted from the original format to PNG format (Portable Network Graphic Format, streaming network graphic format). Because the picture processing process of PNG format is a lossless process, this method selects the format (such as JPEG format) of color picture to be converted into PNG format before scaling process, with respect to other formats, the color picture of PNG format is carried out scaling process, The impact on clarity can be reduced.

随后,在步骤S206中,对彩色图片进行缩放处理。具体地,按照插值或抽样算法,对彩色图片进行缩放处理。步骤S206的缩放处理可以按照现有的方法进行,在此不再赘述。Subsequently, in step S206, scaling processing is performed on the color picture. Specifically, scaling processing is performed on the color picture according to an interpolation or sampling algorithm. The zooming process in step S206 can be performed according to an existing method, which will not be repeated here.

在步骤S206中对彩色图片进行缩放处理之后,方法200进入步骤S207,其中将缩放处理后的彩色图片的格式由PNG格式转换为原有格式。为了得到更小的字节数,将缩放处理后的彩色图片再转换为原有格式(如JPEG格式)。After scaling the color picture in step S206, the method 200 proceeds to step S207, wherein the format of the scaled color picture is converted from the PNG format to the original format. In order to obtain a smaller number of bytes, the scaled color picture is converted to the original format (such as JPEG format).

上述步骤S205和步骤S207是本发明的可选步骤,本发明也可以直接对原始格式的彩色图片进行缩放处理,而无需进行格式转换。不过在进行格式转换的情况下,得到的彩色图片的清晰度会更为良好。The above step S205 and step S207 are optional steps of the present invention, and the present invention can also directly perform scaling processing on the color picture in the original format without format conversion. However, in the case of format conversion, the clarity of the obtained color pictures will be better.

应当注意的是,步骤S204与步骤S205-S207中的任一步骤之间没有顺序关系,步骤S204可以与步骤S205-S207中的任一步骤同时执行、也可在步骤S205-S207中的任一步骤之后执行,所有这些都在本发明的保护范围之内。It should be noted that there is no sequence relationship between step S204 and any of steps S205-S207, and step S204 can be executed simultaneously with any of steps S205-S207, or can be performed during any of steps S205-S207. steps are performed afterwards, all of which are within the scope of the present invention.

随后,在步骤S208中,将缩放处理后得到的彩色图片与指示不同锐化度的高斯信号进行卷积处理,得到输出彩色图片。本方法采用将彩色图片与高斯信号进行卷积处理的方式来达到图像锐化的目的,其中高斯信号所指示的锐化度由高斯信号中的参数所决定,而高斯信号中的参数的大小是根据在步骤S204获得的彩色图片的压缩质量因子确定的。设彩色图片为f(x,y),高斯信号为g(r,σ),那么经过卷积处理得到的输出彩色图片为:Subsequently, in step S208, convolution processing is performed on the color picture obtained after the scaling process and Gaussian signals indicating different sharpening degrees to obtain an output color picture. This method achieves the purpose of image sharpening by convolving the color picture with the Gaussian signal, where the sharpness indicated by the Gaussian signal is determined by the parameters in the Gaussian signal, and the size of the parameters in the Gaussian signal is Determined according to the compression quality factor of the color picture obtained in step S204. Let the color picture be f(x, y) and the Gaussian signal be g(r, σ), then the output color picture after convolution processing is:

R(x,y)=f(x,y)*g(r,σ)   (5)R(x,y)=f(x,y)*g(r,σ) (5)

其中,r和σ都是高斯信号中的参数,r为高斯信号的均值,σ为高斯信号的方差。r和σ的值的大小是根据彩色图片的压缩质量因子而确定的。Among them, r and σ are parameters in the Gaussian signal, r is the mean value of the Gaussian signal, and σ is the variance of the Gaussian signal. The value of r and σ is determined according to the compression quality factor of the color picture.

以IJG定义的度量等级的压缩质量因子Q为例:Take the compression quality factor Q of the metric level defined by IJG as an example:

若Q≥95,r=5,σ=0.4;If Q≥95, r=5, σ=0.4;

若90≤Q<95,r=5,σ=0.3;If 90≤Q<95, r=5, σ=0.3;

若85≤Q<90,r=5,σ=0.2;If 85≤Q<90, r=5, σ=0.2;

若Q<85,不进行锐化处理。If Q<85, no sharpening is performed.

上述高斯信号的参数的具体数值是本发明提供的实施例之一,但不能作为是对本发明的限制。The specific values of the parameters of the above-mentioned Gaussian signal are one of the embodiments provided by the present invention, but should not be regarded as limitations of the present invention.

根据本实施例提供的将图片进行缩放处理的方法,通过对输入图片的类型进行判断,在判断出为灰度图片的情况下,对缩放处理后的灰度图片进行直方图均衡化处理,使灰度图片的像素倾向于占据整个可能的灰度级且分布均匀,从而达到了增强图片前景、背景间的对比度的目的,使得输出灰度图片更为清晰。而在判断出为彩色图片的情况下,获取该彩色图片的压缩质量因子,根据彩色图片的压缩质量因子对缩放处理后的彩色图片进行图像锐化处理,其中压缩质量因子指示出彩色图片的压缩率,也就是说,本实施例提供的方法根据彩色图片的压缩率对彩色图片进行不同程度的图像锐化处理,经过这样的处理之后,原有的低品质的图片的清晰度得到大幅提高。总而言之,利用本实施例提供的方法可以对任何类型的图片的缩放处理进行优化,使得缩放处理后的图片更为清晰,该方法特别适用于对图片进行企业级的批量处理。According to the method for zooming a picture provided in this embodiment, by judging the type of the input picture, if it is judged to be a grayscale picture, perform histogram equalization processing on the scaled grayscale picture, so that The pixels of a grayscale image tend to occupy the entire possible grayscale and are evenly distributed, thereby achieving the purpose of enhancing the contrast between the foreground and background of the image, and making the output grayscale image clearer. If it is judged to be a color picture, the compression quality factor of the color picture is acquired, and image sharpening is performed on the scaled color picture according to the compression quality factor of the color picture, wherein the compression quality factor indicates the compression quality of the color picture That is to say, the method provided in this embodiment performs image sharpening processing on the color image to different degrees according to the compression ratio of the color image. After such processing, the definition of the original low-quality image is greatly improved. In a word, the scaling process of any type of pictures can be optimized by using the method provided in this embodiment, so that the scaled pictures are clearer. This method is especially suitable for enterprise-level batch processing of pictures.

图3示出了根据本发明一个实施例的基于图片类型的处理设备的结构示意图。如图3所示,该图片缩放设备300包括判断模块310、压缩质量因子确定模块320、第一缩放模块330和锐化模块340。Fig. 3 shows a schematic structural diagram of a processing device based on a picture type according to an embodiment of the present invention. As shown in FIG. 3 , the image scaling device 300 includes a judging module 310 , a compression quality factor determining module 320 , a first scaling module 330 and a sharpening module 340 .

在图片缩放设备300中,判断模块310接收外界传送过来的输入图片,对输入图片的类型进行判断。由于输入图片的类型不同导致对图片缩放后所作的处理会有所不同,因此在本设备中判断模块310需要首先对输入图片的类型进行判断,该判断过程主要是确定输入图片是彩色图片还是灰度图片。可选地,判断的依据是输入图片的颜色空间,如果输入图片的颜色空间为灰度,那么则确定该输入图片的类型为灰度图片;如果输入图片的颜色空间为RGB,那么则确定该输入图片的类型为彩色图片。In the picture zooming device 300, the judging module 310 receives the input picture sent from the outside, and judges the type of the input picture. Due to the different types of input pictures, the processing done after the pictures are zoomed will be different. Therefore, in this device, the judging module 310 needs to first judge the type of the input pictures. This judgment process mainly determines whether the input pictures are color pictures or gray pictures. degree picture. Optionally, the basis for judging is the color space of the input picture, if the color space of the input picture is grayscale, then determine that the type of the input picture is a grayscale picture; if the color space of the input picture is RGB, then determine the The type of the input image is a color image.

压缩质量因子确定模块320在判断模块310判断出输入图片的类型为彩色图片的情况下,获取指示彩色图片的压缩率的压缩质量因子。当前互联网中的彩色图片都经过不同程度的压缩处理,以JPEG图片为例,这种类型图片的压缩主要包括四个步骤,分别为颜色转换、DCT变换、量化和编码,这四个步骤的详细过程可以参见上述方法实施例中的描述。在量化步骤中会选取压缩质量因子,该压缩质量因子指示了彩色图片的压缩率。若选取的压缩质量因子较大,可大幅度提高压缩比,但图像质量会较差;若选取的压缩质量因子较小,图像的重建质量较好,但压缩比较低。因此,压缩质量因子是表征彩色图片图像质量的一个因素。在判断出输入图片的类型为彩色图片的情况下,压缩质量因子确定模块320获取该彩色图片的压缩质量因子。可选地,压缩质量因子确定模块320具体适于通过分析彩色图片的内容获取彩色图片的压缩质量因子,将压缩质量因子转化为IJG的度量等级,例如通过采用JPEGdump工具就可实现该功能。之后,压缩质量因子确定模块320将压缩质量因子输出给锐化模块340。The compression quality factor determination module 320 acquires the compression quality factor indicating the compression rate of the color picture when the judging module 310 determines that the type of the input picture is a color picture. Currently, color pictures on the Internet are compressed to varying degrees. Taking JPEG pictures as an example, the compression of this type of picture mainly includes four steps, namely color conversion, DCT transformation, quantization and encoding. The details of these four steps For the process, reference may be made to the description in the foregoing method embodiments. A compression quality factor is chosen in the quantization step, which indicates the compression ratio of the color picture. If the selected compression quality factor is large, the compression ratio can be greatly improved, but the image quality will be poor; if the selected compression quality factor is small, the reconstruction quality of the image is better, but the compression ratio is low. Therefore, the compression quality factor is a factor that characterizes the image quality of a color picture. If it is determined that the type of the input picture is a color picture, the compression quality factor determination module 320 acquires the compression quality factor of the color picture. Optionally, the compression quality factor determining module 320 is specifically adapted to obtain the compression quality factor of the color picture by analyzing the content of the color picture, and convert the compression quality factor into an IJG metric level, for example, this function can be realized by using a JPEGdump tool. Afterwards, the compression quality factor determination module 320 outputs the compression quality factor to the sharpening module 340 .

第一缩放模块330对彩色图片进行缩放处理。具体地,第一缩放模块330按照插值或抽样算法,对彩色图片进行缩放处理。The first scaling module 330 scales the color picture. Specifically, the first scaling module 330 scales the color picture according to an interpolation or sampling algorithm.

锐化模块340根据彩色图片的压缩质量因子,对缩放处理后得到的彩色图片进行图像锐化处理,得到输出彩色图片。其中,压缩质量因子所指示的压缩率越高,锐化模块340进行图像锐化的锐化度越低。The sharpening module 340 performs image sharpening processing on the color picture obtained after scaling according to the compression quality factor of the color picture to obtain an output color picture. Wherein, the higher the compression rate indicated by the compression quality factor, the lower the sharpening degree of image sharpening performed by the sharpening module 340 .

可选地,锐化模块340可以包括:锐化处理模块341和参数获取模块342,其中,锐化处理模块341将缩放处理后得到的彩色图片与指示不同锐化度的高斯信号进行卷积处理,得到输出彩色图片并输出;参数获取模块342根据彩色图片的压缩质量因子确定高斯信号中的参数的大小,高斯信号所指示的锐化度由高斯信号中的参数所决定。其中锐化处理模块341对彩色图片进行锐化处理的详细过程可以参见上述方法实施例中的相关描述。Optionally, the sharpening module 340 may include: a sharpening processing module 341 and a parameter acquisition module 342, wherein the sharpening processing module 341 performs convolution processing on the color picture obtained after scaling processing and Gaussian signals indicating different sharpening degrees , obtain and output the output color picture; the parameter acquisition module 342 determines the size of the parameter in the Gaussian signal according to the compression quality factor of the color picture, and the sharpness indicated by the Gaussian signal is determined by the parameter in the Gaussian signal. For the detailed process of sharpening the color picture by the sharpening processing module 341 , please refer to the related description in the above method embodiment.

可选地,图片缩放设备300还可以包括格式转换模块350,该格式转换模块350适于将彩色图片的格式由原有格式转换为PNG格式,以及将缩放处理后得到的彩色图片的格式由PNG格式转换为原有格式。由于PNG格式的图片处理过程为无损过程,本设备选择在缩放处理之前将彩色图片的格式(如JPEG格式)转换为PNG格式,相对于其它格式来说,对PNG格式的彩色图片进行缩放处理,可以降低对清晰度的影响。Optionally, the picture zooming device 300 may also include a format conversion module 350, which is suitable for converting the format of the color picture from the original format to the PNG format, and converting the format of the color picture obtained after scaling from PNG to PNG. The format is converted to the original format. Since the image processing process in PNG format is a lossless process, this device chooses to convert the format of the color image (such as JPEG format) to PNG format before scaling. Compared with other formats, the color image in PNG format is scaled. The impact on clarity can be reduced.

进一步的,图片缩放设备300还可以包括第二缩放模块360和直方图均衡化处理模块370。其中,第二缩放模块360在判断模块310判断出输入图片的类型为灰度图片的情况下,对灰度图片进行缩放处理。第二缩放模块360可按照插值或抽样算法,对灰度图片进行缩放处理。直方图均衡化处理模块370对缩放处理后得到的灰度图片进行直方图均衡化处理,得到输出灰度图片并输出。对于灰色图片,本设备采用直方图均衡化方法对其进行处理,能增强图片对比度。直方图均衡化处理模块370对灰度图片进行直方图均衡化处理的详细过程可以参见上述方法实施例的相关描述。Further, the image scaling device 300 may further include a second scaling module 360 and a histogram equalization processing module 370 . Wherein, the second scaling module 360 performs scaling processing on the grayscale picture when the judging module 310 determines that the type of the input picture is a grayscale picture. The second scaling module 360 can perform scaling processing on the gray scale image according to an interpolation or sampling algorithm. The histogram equalization processing module 370 performs histogram equalization processing on the grayscale image obtained after scaling processing, and obtains and outputs an output grayscale image. For the gray picture, the device adopts histogram equalization method to process it, which can enhance the contrast of the picture. For the detailed process of the histogram equalization processing module 370 performing the histogram equalization processing on the grayscale picture, refer to the related description of the above method embodiment.

根据本实施例提供的将图片进行缩放处理的设备,通过判断模块对输入图片的类型进行判断,在判断出为灰度图片的情况下,直方图均衡化处理模块对缩放处理后的灰度图片进行直方图均衡化处理,使灰度图片的像素倾向于占据整个可能的灰度级且分布均匀,从而达到了增强图片前景、背景间的对比度的目的,使得输出灰度图片更为清晰。而在判断出为彩色图片的情况下,压缩质量因子确定模块获取该彩色图片的压缩质量因子,锐化模块根据彩色图片的压缩质量因子对缩放处理后的彩色图片进行图像锐化处理,其中压缩质量因子指示出彩色图片的压缩率,也就是说,本实施例提供的设备根据彩色图片的压缩率对彩色图片进行不同程度的图像锐化处理,经过这样的处理之后,原有的低品质的图片的清晰度得到大幅提高。总而言之,利用本实施例提供的设备可以对任何类型的图片的缩放处理进行优化,使得缩放处理后的图片更为清晰,该设备特别适用于对图片进行企业级的批量处理。According to the device for zooming the image provided in this embodiment, the type of the input image is judged by the judging module. Perform histogram equalization processing, so that the pixels of the grayscale image tend to occupy the entire possible grayscale and distribute evenly, thereby achieving the purpose of enhancing the contrast between the foreground and background of the image, and making the output grayscale image clearer. In the case of judging that it is a color picture, the compression quality factor determination module obtains the compression quality factor of the color picture, and the sharpening module performs image sharpening processing on the scaled color picture according to the compression quality factor of the color picture, wherein the compression quality factor The quality factor indicates the compression rate of the color picture. That is to say, the device provided in this embodiment performs image sharpening processing on the color picture in different degrees according to the compression rate of the color picture. After such processing, the original low-quality The sharpness of the picture has been greatly improved. In a word, the scaling process of any type of picture can be optimized by using the device provided in this embodiment, so that the scaled picture is clearer, and the device is especially suitable for enterprise-level batch processing of pictures.

在此提供的算法和显示不与任何特定计算机、虚拟系统或者其它设备固有相关。各种通用系统也可以与基于在此的示教一起使用。根据上面的描述,构造这类系统所要求的结构是显而易见的。此外,本发明也不针对任何特定编程语言。应当明白,可以利用各种编程语言实现在此描述的本发明的内容,并且上面对特定语言所做的描述是为了披露本发明的最佳实施方式。The algorithms and displays presented herein are not inherently related to any particular computer, virtual system, or other device. Various generic systems can also be used with the teachings based on this. The structure required to construct such a system is apparent from the above description. Furthermore, the present invention is not specific to any particular programming language. It should be understood that various programming languages can be used to implement the content of the present invention described herein, and the above description of specific languages is for disclosing the best mode of the present invention.

在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure the understanding of this description.

类似地,应当理解,为了精简本公开并帮助理解各个发明方面中的一个或多个,在上面对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如下面的权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, in order to streamline this disclosure and to facilitate an understanding of one or more of the various inventive aspects, various features of the invention are sometimes grouped together in a single embodiment, figure, or its description. This method of disclosure, however, is not to be interpreted as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the Detailed Description are hereby expressly incorporated into this Detailed Description, with each claim standing on its own as a separate embodiment of this invention.

本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。Those skilled in the art can understand that the modules in the device in the embodiment can be adaptively changed and arranged in one or more devices different from the embodiment. Modules or units or components in the embodiments may be combined into one module or unit or component, and furthermore may be divided into a plurality of sub-modules or sub-units or sub-assemblies. All features disclosed in this specification (including accompanying claims, abstract and drawings) and any method or method so disclosed may be used in any combination, except that at least some of such features and/or processes or units are mutually exclusive. All processes or units of equipment are combined. Each feature disclosed in this specification (including accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.

此外,本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同的实施例。例如,在下面的权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。Furthermore, those skilled in the art will understand that although some embodiments described herein include some features included in other embodiments but not others, combinations of features from different embodiments are meant to be within the scope of the invention. and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.

本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的将图片进行缩放处理的设备中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。The various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art should understand that a microprocessor or a digital signal processor (DSP) can be used in practice to implement some or all functions of some or all of the components in the device for zooming pictures according to the embodiment of the present invention . The present invention can also be implemented as an apparatus or an apparatus program (for example, a computer program and a computer program product) for performing a part or all of the methods described herein. Such a program for realizing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet site, or provided on a carrier signal, or provided in any other form.

应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means can be embodied by one and the same item of hardware. The use of the words first, second, and third, etc. does not indicate any order. These words can be interpreted as names.

本发明公开了:A1、一种基于图片类型的处理方法,包括:The invention discloses: A1, a processing method based on picture type, comprising:

对输入图片的类型进行判断;Determine the type of input image;

在判断出所述输入图片的类型为彩色图片的情况下,获取指示所述彩色图片的压缩率的压缩质量因子;If it is determined that the type of the input picture is a color picture, acquiring a compression quality factor indicating a compression rate of the color picture;

对所述彩色图片进行缩放处理;以及performing scaling processing on the color picture; and

根据所述彩色图片的压缩质量因子,对缩放处理后得到的彩色图片进行图像锐化处理,得到输出彩色图片。According to the compression quality factor of the color picture, the image sharpening process is performed on the color picture obtained after scaling processing to obtain an output color picture.

A2、根据A1所述的方法,其中所述压缩质量因子所指示的压缩率越高,图像锐化的锐化度越低。A2. The method according to A1, wherein the higher the compression rate indicated by the compression quality factor, the lower the sharpness of image sharpening.

A3、根据A1所述的方法,所述对缩放处理后得到的彩色图片进行图像锐化处理的步骤包括:将缩放处理后得到的彩色图片与指示不同锐化度的高斯信号进行卷积处理,得到所述输出彩色图片,其中高斯信号所指示的锐化度由高斯信号中的参数所决定,而所述高斯信号中的参数的大小是根据所述彩色图片的压缩质量因子确定的。A3. According to the method described in A1, the step of performing image sharpening processing on the color picture obtained after the scaling process includes: performing convolution processing on the color picture obtained after the scaling process and Gaussian signals indicating different sharpening degrees, The output color picture is obtained, wherein the sharpness indicated by the Gaussian signal is determined by a parameter in the Gaussian signal, and the size of the parameter in the Gaussian signal is determined according to the compression quality factor of the color picture.

A4、根据A1至A3任一项所述的方法,在所述对彩色图片进行缩放处理之前还包括:将所述彩色图片的格式由原有格式转换为流式网络图形格式;A4. According to the method described in any one of A1 to A3, before the zooming processing of the color picture, it also includes: converting the format of the color picture from the original format to a streaming network graphics format;

在所述对彩色图片进行缩放处理之后还包括:将缩放处理后得到的彩色图片的格式由流式网络图形格式转换为原有格式。After the zooming process on the color picture, it further includes: converting the format of the color picture obtained after the scaling process from the streaming network graphics format to the original format.

A5、根据A1至A4任一项所述的方法,所述获取所述彩色图片的压缩质量因子的步骤包括:通过分析所述彩色图片的内容获取彩色图片的压缩质量因子,将所述压缩质量因子转化为独立JPEG小组的度量等级。A5. According to the method described in any one of A1 to A4, the step of obtaining the compression quality factor of the color picture includes: obtaining the compression quality factor of the color picture by analyzing the content of the color picture, and calculating the compression quality factor Factors converted to metric levels by the independent JPEG group.

A6、根据A1至A5任一项所述的方法,还包括:A6. The method according to any one of A1 to A5, further comprising:

在判断出所述输入图片的类型为灰度图片的情况下,对所述灰度图片进行缩放处理;When it is determined that the type of the input picture is a grayscale picture, performing scaling processing on the grayscale picture;

对缩放处理后得到的灰度图片进行直方图均衡化处理,得到输出灰度图片。Perform histogram equalization processing on the grayscale image obtained after the scaling process to obtain an output grayscale image.

本发明还公开了:B7、一种基于图片类型的处理设备,包括:The present invention also discloses: B7, a processing device based on image type, comprising:

判断模块,适于对输入图片的类型进行判断;A judging module, suitable for judging the type of the input picture;

压缩质量因子确定模块,适于在所述判断模块判断出所述输入图片的类型为彩色图片的情况下,获取指示所述彩色图片的压缩率的压缩质量因子;A compression quality factor determination module, adapted to acquire a compression quality factor indicating the compression rate of the color picture when the judging module determines that the type of the input picture is a color picture;

第一缩放模块,适于对所述彩色图片进行缩放处理;以及A first scaling module, adapted to perform scaling processing on the color picture; and

锐化模块,适于根据所述彩色图片的压缩质量因子,对缩放处理后得到的彩色图片进行图像锐化处理,得到输出彩色图片。The sharpening module is adapted to perform image sharpening processing on the color picture obtained after zooming according to the compression quality factor of the color picture to obtain an output color picture.

B8、根据B7所述的设备,所述压缩质量因子所指示的压缩率越高,所述锐化模块进行图像锐化的锐化度越低。B8. The device according to B7, the higher the compression rate indicated by the compression quality factor, the lower the sharpening degree of the image sharpening performed by the sharpening module.

B9、根据B7所述的设备,所述锐化模块包括:B9. According to the device described in B7, the sharpening module includes:

锐化处理模块,适于将缩放处理后得到的彩色图片与指示不同锐化度的高斯信号进行卷积处理,得到所述输出彩色图片;The sharpening processing module is adapted to perform convolution processing on the color picture obtained after zooming processing and Gaussian signals indicating different sharpening degrees to obtain the output color picture;

参数获取模块,适于根据所述彩色图片的压缩质量因子确定所述高斯信号中的参数的大小,高斯信号所指示的锐化度由高斯信号中的参数所决定。The parameter acquisition module is adapted to determine the size of the parameter in the Gaussian signal according to the compression quality factor of the color picture, and the sharpness indicated by the Gaussian signal is determined by the parameter in the Gaussian signal.

B10、根据B7或B8或B9所述的设备,还包括:B10. The equipment described in B7 or B8 or B9, further comprising:

格式转换模块,适于将所述彩色图片的格式由原有格式转换为流式网络图形格式,以及将缩放处理后得到的彩色图片的格式由流式网络图形格式转换为原有格式。The format conversion module is suitable for converting the format of the color picture from the original format to the streaming network graphics format, and converting the format of the color picture obtained after scaling from the streaming network graphics format to the original format.

B11、根据B7至B10任一项所述的设备,所述压缩质量因子确定模块具体适于通过分析所述彩色图片的内容获取彩色图片的压缩质量因子,将所述压缩质量因子转化为独立JPEG小组的度量等级。B11. According to the device according to any one of B7 to B10, the compression quality factor determination module is specifically adapted to obtain the compression quality factor of the color picture by analyzing the content of the color picture, and convert the compression quality factor into an independent JPEG The metric level of the group.

B12、根据B7至B11任一项所述的设备,还包括:B12. The device according to any one of B7 to B11, further comprising:

第二缩放模块,适于在所述判断模块判断出所述输入图片的类型为灰度图片的情况下,对所述灰度图片进行缩放处理;The second scaling module is adapted to perform scaling processing on the grayscale picture when the judging module determines that the type of the input picture is a grayscale picture;

直方图均衡化处理模块,适于对缩放处理后得到的灰度图片进行直方图均衡化处理,得到输出灰度图片。The histogram equalization processing module is suitable for performing histogram equalization processing on the grayscale image obtained after scaling processing to obtain an output grayscale image.

Claims (10)

1.一种基于图片类型的处理方法,包括:1. A processing method based on image type, comprising: 对输入图片的类型进行判断;Determine the type of input image; 在判断出所述输入图片的类型为彩色图片的情况下,获取指示所述彩色图片的压缩率的压缩质量因子;If it is determined that the type of the input picture is a color picture, acquiring a compression quality factor indicating a compression rate of the color picture; 对所述彩色图片进行缩放处理;以及performing scaling processing on the color picture; and 根据所述彩色图片的压缩质量因子,对缩放处理后得到的彩色图片进行图像锐化处理,得到输出彩色图片。According to the compression quality factor of the color picture, the image sharpening process is performed on the color picture obtained after scaling processing to obtain an output color picture. 2.根据权利要求1所述的方法,其中所述压缩质量因子所指示的压缩率越高,图像锐化的锐化度越低。2. The method of claim 1, wherein the higher the compression ratio indicated by the compression quality factor, the lower the sharpness of image sharpening. 3.根据权利要求1所述的方法,所述对缩放处理后得到的彩色图片进行图像锐化处理的步骤包括:将缩放处理后得到的彩色图片与指示不同锐化度的高斯信号进行卷积处理,得到所述输出彩色图片,其中高斯信号所指示的锐化度由高斯信号中的参数所决定,而所述高斯信号中的参数的大小是根据所述彩色图片的压缩质量因子确定的。3. The method according to claim 1, the step of performing image sharpening processing on the color picture obtained after the scaling process comprises: convolving the color picture obtained after the scaling process with Gaussian signals indicating different degrees of sharpness processing to obtain the output color picture, wherein the sharpness indicated by the Gaussian signal is determined by a parameter in the Gaussian signal, and the size of the parameter in the Gaussian signal is determined according to the compression quality factor of the color picture. 4.根据权利要求1至3任一项所述的方法,在所述对彩色图片进行缩放处理之前还包括:将所述彩色图片的格式由原有格式转换为流式网络图形格式;4. The method according to any one of claims 1 to 3, further comprising: converting the format of the color picture from an original format to a streaming network graphics format before the scaling process of the color picture; 在所述对彩色图片进行缩放处理之后还包括:将缩放处理后得到的彩色图片的格式由流式网络图形格式转换为原有格式。After the zooming process on the color picture, it further includes: converting the format of the color picture obtained after the scaling process from the streaming network graphics format to the original format. 5.根据权利要求1至4任一项所述的方法,所述获取所述彩色图片的压缩质量因子的步骤包括:通过分析所述彩色图片的内容获取彩色图片的压缩质量因子,将所述压缩质量因子转化为独立JPEG小组的度量等级。5. The method according to any one of claims 1 to 4, the step of obtaining the compression quality factor of the color picture comprises: obtaining the compression quality factor of the color picture by analyzing the content of the color picture, and converting the The compression quality factor translates into a metric rating from the independent JPEG group. 6.根据权利要求1至5任一项所述的方法,还包括:6. The method according to any one of claims 1 to 5, further comprising: 在判断出所述输入图片的类型为灰度图片的情况下,对所述灰度图片进行缩放处理;When it is determined that the type of the input picture is a grayscale picture, performing scaling processing on the grayscale picture; 对缩放处理后得到的灰度图片进行直方图均衡化处理,得到输出灰度图片。Perform histogram equalization processing on the grayscale image obtained after the scaling process to obtain an output grayscale image. 7.一种基于图片类型的处理设备,包括:7. A processing device based on image type, comprising: 判断模块,适于对输入图片的类型进行判断;A judging module, suitable for judging the type of the input picture; 压缩质量因子确定模块,适于在所述判断模块判断出所述输入图片的类型为彩色图片的情况下,获取指示所述彩色图片的压缩率的压缩质量因子;A compression quality factor determination module, adapted to acquire a compression quality factor indicating the compression rate of the color picture when the judging module determines that the type of the input picture is a color picture; 第一缩放模块,适于对所述彩色图片进行缩放处理;以及A first scaling module, adapted to perform scaling processing on the color picture; and 锐化模块,适于根据所述彩色图片的压缩质量因子,对缩放处理后得到的彩色图片进行图像锐化处理,得到输出彩色图片。The sharpening module is adapted to perform image sharpening processing on the color picture obtained after zooming according to the compression quality factor of the color picture to obtain an output color picture. 8.根据权利要求7所述的设备,所述压缩质量因子所指示的压缩率越高,所述锐化模块进行图像锐化的锐化度越低。8. The device according to claim 7, the higher the compression rate indicated by the compression quality factor, the lower the sharpening degree of image sharpening performed by the sharpening module. 9.根据权利要求7所述的设备,所述锐化模块包括:9. The device of claim 7, the sharpening module comprising: 锐化处理模块,适于将缩放处理后得到的彩色图片与指示不同锐化度的高斯信号进行卷积处理,得到所述输出彩色图片;The sharpening processing module is adapted to perform convolution processing on the color picture obtained after zooming processing and Gaussian signals indicating different sharpening degrees to obtain the output color picture; 参数获取模块,适于根据所述彩色图片的压缩质量因子确定所述高斯信号中的参数的大小,高斯信号所指示的锐化度由高斯信号中的参数所决定。The parameter acquisition module is adapted to determine the size of the parameter in the Gaussian signal according to the compression quality factor of the color picture, and the sharpness indicated by the Gaussian signal is determined by the parameter in the Gaussian signal. 10.根据权利要求7或8或9所述的设备,还包括:10. Apparatus according to claim 7 or 8 or 9, further comprising: 格式转换模块,适于将所述彩色图片的格式由原有格式转换为流式网络图形格式,以及将缩放处理后得到的彩色图片的格式由流式网络图形格式转换为原有格式。The format conversion module is suitable for converting the format of the color picture from the original format to the streaming network graphics format, and converting the format of the color picture obtained after scaling from the streaming network graphics format to the original format.
CN201410637869.7A 2012-10-19 2012-10-19 Image type-based processing method and device Pending CN104301578A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410637869.7A CN104301578A (en) 2012-10-19 2012-10-19 Image type-based processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410637869.7A CN104301578A (en) 2012-10-19 2012-10-19 Image type-based processing method and device

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
CN201210402441.5A Division CN102868847B (en) 2012-10-19 2012-10-19 Image type based processing method and device

Publications (1)

Publication Number Publication Date
CN104301578A true CN104301578A (en) 2015-01-21

Family

ID=52321127

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410637869.7A Pending CN104301578A (en) 2012-10-19 2012-10-19 Image type-based processing method and device

Country Status (1)

Country Link
CN (1) CN104301578A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004304561A (en) * 2003-03-31 2004-10-28 Dainippon Screen Mfg Co Ltd Apparatus and method for image processing using compression image data
CN100440952C (en) * 2005-11-28 2008-12-03 株式会社日立制作所 Image processing device and image processing method
CN101502097A (en) * 2006-08-07 2009-08-05 高通股份有限公司 Adaptive spatial image filter for filtering image information
CN102129644A (en) * 2011-03-08 2011-07-20 北京理工大学 Intelligent advertising system having functions of audience characteristic perception and counting

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004304561A (en) * 2003-03-31 2004-10-28 Dainippon Screen Mfg Co Ltd Apparatus and method for image processing using compression image data
CN100440952C (en) * 2005-11-28 2008-12-03 株式会社日立制作所 Image processing device and image processing method
CN101502097A (en) * 2006-08-07 2009-08-05 高通股份有限公司 Adaptive spatial image filter for filtering image information
CN102129644A (en) * 2011-03-08 2011-07-20 北京理工大学 Intelligent advertising system having functions of audience characteristic perception and counting

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
艾玲梅 等: "多尺度Retinex方法在车辆胎痕图像增强方面的应用", 《计算机工程与应用》 *

Similar Documents

Publication Publication Date Title
CN102868847B (en) Image type based processing method and device
EP2748792B1 (en) Image processing for hdr images
US8290295B2 (en) Multi-modal tone-mapping of images
JP6362793B2 (en) Display management for high dynamic range video
US9501818B2 (en) Local multiscale tone-mapping operator
CN108370405B (en) A kind of picture signal conversion process method, device and terminal device
EP1397780B1 (en) Image enhancement methods and apparatus therefor
JP4347625B2 (en) Method and system for generating digital image files for limited displays
CN102883165B (en) Image zooming processing method and equipment
CN107431808B (en) Improved video and image encoding process
US8781238B2 (en) Efficient decoding and post-processing of high dynamic range images
KR20150120993A (en) Display management for high dynamic range video
TWI666921B (en) Method and device for tone-mapping a high dynamic range image
EP3857505B1 (en) Image denoising in sdr to hdr image conversion
CN113784175A (en) HDR video conversion method, device, equipment and computer storage medium
CN107220934B (en) Image reconstruction method and device
CN115362675A (en) Blind local shaping in HDR imaging
Zhang et al. Multi-scale-based joint super-resolution and inverse tone-mapping with data synthesis for UHD HDR video
CN104301578A (en) Image type-based processing method and device
CN110999300B (en) Single channel inverse mapping for image/video processing
JP7627389B2 (en) Noise removal for SDR-HDR local reconstruction
WO2023205548A1 (en) Generating hdr image from corresponding camera raw and sdr images
Chatzigiorgaki et al. On the use of color appearance modeling for efficient compressed-domain image enhancement
JP2004343400A (en) Image processor, image processing method and program
Mantiuk et al. Selected problems of high dynamic range video compression and GPU-based contrast domain tone mapping

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20150121

RJ01 Rejection of invention patent application after publication