CN104504662A - Homomorphic filtering based image processing method and system - Google Patents

Homomorphic filtering based image processing method and system Download PDF

Info

Publication number
CN104504662A
CN104504662A CN 201410834140 CN201410834140A CN104504662A CN 104504662 A CN104504662 A CN 104504662A CN 201410834140 CN201410834140 CN 201410834140 CN 201410834140 A CN201410834140 A CN 201410834140A CN 104504662 A CN104504662 A CN 104504662A
Authority
CN
China
Prior art keywords
subunit
code
code pattern
homomorphic filtering
image processing
Prior art date
Application number
CN 201410834140
Other languages
Chinese (zh)
Inventor
刘燕
邓伟
李伟
Original Assignee
北京慧眼智行科技有限公司
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 北京慧眼智行科技有限公司 filed Critical 北京慧眼智行科技有限公司
Priority to CN 201410834140 priority Critical patent/CN104504662A/en
Publication of CN104504662A publication Critical patent/CN104504662A/en

Links

Abstract

The invention provides a homomorphic filtering based image processing method and system. The method includes the steps of acquiring an original code map; subjecting the original code map to homomorphic filtering to obtain a code map subjected to homomorphic filtering; based on a preset partitioning algorithm, partitioning the code map subjected to homomorphic filtering into a plurality of code map sub-units; subjecting each code map sub-unit to binarization by an OTSU algorithm to obtain a binary code map sub-unit; combining the binary code map sub-units to generate a final binary code map. The homomorphic filtering based image processing method and system has the advantages that before binarization of the code map, homomorphic filtering is performed first, the images are effectively enhanced by homomorphic filtering, image quality decline caused by insufficiency of light is effectively avoided, the advantages of the OTSU algorithm are given to maximum play, a foreground and a background are precisely distinguished, no effective information is lost from the binary images, image binarization quality is improved, and the following image processing is simplified.

Description

一种基于同态滤波的图像处理方法及系统 An image processing method and system based on homomorphic filtering

技术领域 FIELD

[0001] 本发明属于图像处理技术领域,具体涉及一种基于同态滤波的图像处理方法及系统。 [0001] The present invention belongs to the technical field of image processing, particularly to an image processing method and system based on homomorphic filtering.

背景技术 Background technique

[0002] 在数字图像处理领域中,图像二值化占有非常重要的地位,特别是在实用的图像处理中,存在数量众多的以二值图像处理实现而构成的系统,例如,电子眼扫描车牌,手机摄像头拍摄一维码或二维码等。 [0002] In the image processing field numbers, binary image occupies a very important position, especially in the practical image processing, there is a large number in binary image processing to achieve the configuration system, e.g., an electronic eye scans the license plate, cell phone camera to take a one-dimensional code or two-dimensional codes.

[0003]图像二值化的原理为:首先将图像处理成灰度图,然后取一个合适的阈值,所有灰度大于或等于阈值的像素被判定为属于特定物体,其灰度值为255表示,否则,灰度低于阈值的像素点被排除在物体区域以外,灰度值为0,表示背景或者例外的物体区域。 [0003] The image binarization principle: the image is first processed into grayscale, and then take an appropriate threshold value, all the gray pixels greater than or equal to the threshold value is determined as belonging to a particular object, which represents a gradation value 255 otherwise, the gray pixels below the threshold are excluded from the object region, the gradation value of 0 indicates the background or the object region exceptions. 阈值的设定非常关键,如果设置过高,可能将特定物体的一些细节过滤掉;如果设置过低,背景中一些干扰物体将无法过滤掉。 Set threshold is critical, if set too high, some of the details of a particular object may be filtered out; if set too low, some of the background objects will not be able to filter out interference. 因此,围绕阈值的设定,衍生出了许多的图像二值化处理算法,其中,OTSU算法是应用比较广泛的一种算法。 Thus, based on the set threshold, derived from a number of binarization image processing algorithms, wherein, on OTSU algorithm is an algorithm used widely.

[0004] OTSU算法也称最大类间差法,有时也称之为大津算法,被认为是图像分割中阈值选取的最佳算法,具有计算简单、不受图像亮度和对比度影响的优点,因此,在数字图像处理上得到了广泛的应用。 [0004] OTSU algorithms known maximum between-class difference, sometimes referred Otsu algorithm is considered the best algorithm for image segmentation threshold selection, with a simple calculation, the advantage of image brightness and contrast is not affected, and therefore, on the digital image processing has been widely used. 其原理为:按图像的灰度特性,将图像分成背景和前景两部分。 The principle is: by the gradation characteristics of the image, the image is divided into two parts background and foreground. 背景和前景之间的类间方差越大,说明构成图像的两部分的差别越大,当部分前景错分为背景,或部分背景错分为前景时,均会导致两部分差别变小。 The larger the inter-class variance between the background and the foreground, the larger the difference of the two portions constituting the image, when the foreground portion into the wrong context or the wrong part of the background into the foreground, will result in small differences in the two parts. 因此,使类间方差最大的分割意味着错分概率最小。 Therefore, the largest variance divided between class means that the probability of misclassification minimum. 在实际的使用中,往往不会使用OTSU对整个图像进行计算取得一个阈值,而是将图像划分成多个大小合适的小块,然后对每一个小块用OTSU取阈值,进而使局部区域不受其他区域干扰。 In actual use, often do not use the entire image is calculated OTSU obtaining a threshold value, but the image is divided into a plurality of pieces of suitable size, and then each piece with OTSU thresholding, thereby enabling the local area does not other areas affected by interference.

[0005] 虽然OTSU算法为图像分割中阈值选取的最佳算法,然而,在识别二维码码图的过程中,由于码图上的码点非常小,并且,码图背景与码点颜色相差较小,或者由于光照不足导致图像质量下降,因此,直接使用OTSU 二值化算法对二维码图进行二值化时,会将部分码点误认为背景而滤掉,从而使二值化后的码图丢失了部分有效信息,进而对后续的码图识别带来影响。 [0005] Although OTSU algorithm for the best threshold value in image segmentation algorithm chosen, however, in the process of two-dimensional code identification code pattern, since the dot code on the code pattern is very small, and the code pattern with the background color difference code point small, due to insufficient illumination or image quality is degraded, and therefore, when using direct OTSU binarization algorithm to FIG two-dimensional code is binarized, partial code points will be filtered out background mistaken, so that after binarization FIG missing part code valid information, and thus affect the subsequent identification code pattern.

发明内容 SUMMARY

[0006] 针对现有技术存在的缺陷,本发明提供一种基于同态滤波的图像处理方法及系统,可有效解决上述问题。 [0006] for the drawbacks of the prior art, the present invention provides an image processing method and system based on homomorphic filtering, can effectively solve the above problems.

[0007] 本发明采用的技术方案如下: [0007] The present invention employs the following technical solutions:

[0008] 本发明提供一种基于同态滤波的图像处理方法,包括以下步骤: [0008] The present invention provides an image processing method based on homomorphic filtering, comprising the steps of:

[0009] SI,采集原始码图; [0009] SI, FIG acquisition source;

[0010] S2,对所采集到的所述原始码图进行同态滤波处理,得到同态滤波处理后的码图; [0010] S2, are collected on the source code in FIG homomorphic filtering process, to obtain the code view of the homomorphic filtering process;

[0011] S3,基于预设的划分算法,将所述同态滤波处理后的码图划分为若干个码图子单元; [0011] S3, a preset division algorithm, the code of FIG homomorphic filtering process is divided into the plurality of code patterns subunit;

[0012] S4,分别对每一个所述码图子单元采用OTSU算法进行二值化处理,得到二值化码图子单元; [0012] S4, respectively, for each of said code pattern subunit OTSU algorithm using binarization processing, to obtain binary codes FIG subunit;

[0013] S5,各个所述二值化码图子单元组合生成最终的二值化码图。 [0013] S5, each of said binary code pattern subunit composition generate a final binary code pattern.

[0014] 优选的,S3中,所述划分算法为:码图识别精度与划分的码图子单元数量正相关;即:如果设定的码图识别精度越高,则码图子单元的面积越小,划分得到的码图子单元数量越多。 [0014] Preferred, S3, the division algorithm: the number of code symbols in FIG subunit FIG recognition accuracy and the divided positive correlation; i.e.: if the code pattern is set higher recognition accuracy, then the area code of FIG subunit the smaller, the more the number of code subunit obtained by dividing FIG.

[0015] 优选的,S3中,划分得到的各个所述码图子单元的形状相同或不相同;和/或 [0015] preferably, S3, the same code pattern of the shape of each subunit obtained by dividing or different; and / or

[0016] 划分得到的各个所述码图子单元的面积相同或不相同。 The same as [0016] obtained by dividing the area of ​​each of the code patterns subunit or different.

[0017] 优选的,S4中,分别对每一个所述码图子单元采用OTSU算法进行二值化处理,得到二值化码图子单元,具体包括以下步骤: [0017] The preferred, S4 in each of said code for each subunit using the OTSU FIG algorithm binarization processing, to obtain binary codes FIG subunit comprises the steps of:

[0018] S4.1,读取待处理的所述码图子单元的像素分布,设所述码图子单元包括NXM个像素; [0018] S4.1, the pixels to be processed read code pattern subunit distribution, provided the code pattern comprises a subunit NXM pixels;

[0019] S4.2,统计所述码图子单元中灰度为i对应的像素个数n (i),则该码图子单元的平均灰度值为: [0019] The average gray S4.2, the pixel number n (i) the statistical gray code pattern is i subunit corresponding to the code pattern subunit values:

[0020] u=E i*n (i) / (M*N); [0020] u = E i * n (i) / (M * N);

[0021] S4.3,设置初始参数:记t为目标与背景的分割阈值,记灰度大于t的目标像素占码图子单元图像的比例为wl,记目标像素的平均灰度为Ul: [0021] S4.3, sets initial parameters: dividing threshold t is denoted target and background, the ratio t representing the target pixel code pattern image is referred subunit WL is larger than the gradation, the average gradation of the target pixel denoted Ul:

[0022] wl = W1/(M*N),其中,Wl是灰度值大于t的统计数 [0022] wl = W1 / (M * N), where, Wl is greater than the number t of the statistical gray

[0023] ul=E i*n (i) /Wl, i>t [0023] ul = E i * n (i) / Wl, i> t

[0024] 同理,记灰度小于t的背景像素占图像的比例《2,背景像素的平均灰度u2 ; [0024] Similarly, denoted t gray background pixels less than the proportion accounted image "2, U2 average gray background pixels;

[0025] S4.4,遍历S4.3 中的t,使得G = wl* (ul_u) * (ul_u) +w2* (u2_u) * (u2_u)最大,此时的t即为最佳阈值; [0025] S4.4, S4.3 traversal of t, so that G = wl * (ul_u) * (ul_u) + w2 * (u2_u) * (u2_u) maximum, at this time t is the optimum threshold value;

[0026] S4.5,在得到所述最佳阈值t后,以所述最佳阈值t作为二值化界线,对所述码图子单元进行二值化处理。 [0026] S4.5, after obtaining the optimal threshold value t, the optimal threshold value t to binarization line, the sub-code pattern binarization processing unit.

[0027] 优选的,所述码图为二维码码图或一维码码图。 [0027] Preferably, the picture shows a two-dimensional code or a one-dimensional code pattern code amble FIG.

[0028] 本发明还提供一种基于同态滤波的图像处理系统,包括: [0028] The present invention also provides a homomorphic filtering based image processing system, comprising:

[0029] 采集模块,用于采集原始码图; [0029] The acquisition module, for collecting FIG source;

[0030]同态滤波处理模块,用于对所述采集模块采集到的所述原始码图进行同态滤波处理,得到同态滤波处理后的码图; [0030] The homomorphic filtering processing module for the source of FIG acquisition module to the homomorphic filtering process, to obtain the code view of the homomorphic filtering process;

[0031] 划分模块,用于基于预设的划分算法,将所述同态滤波处理模块处理后的码图划分为若干个码图子单元; [0031] dividing means for dividing a preset algorithm, the code view of the state with the filter processing module is divided into a plurality of code patterns subunit;

[0032] 二值化模块,用于分别对每一个所述划分模块划分得到的码图子单元采用OTSU算法进行二值化处理,得到二值化码图子单元; [0032] The binarization module, for respectively dividing module for dividing each of said code pattern obtained using the OTSU subunit binarization processing algorithm, to obtain binary codes FIG subunit;

[0033] 二值化码图生成单元,用于将所述二值化模块得到的各个所述二值化码图子单元组合生成最终的二值化码图。 [0033] FIG binary code generating means for binarizing the respective modules obtained by the binary code in FIG subunit composition generate a final binary code in FIG.

[0034] 优选的,所述划分模块所使用的划分算法为:码图识别精度与划分的码图子单元数量正相关;即:如果设定的码图识别精度越高,则码图子单元的面积越小,划分得到的码图子单元数量越多。 [0034] Preferably, the partitioning algorithm used by the module is divided into: the number of code symbols in FIG subunit FIG recognition accuracy and the divided positive correlation; i.e.: if the code pattern is set higher recognition accuracy, the code subunit FIG. the smaller the area, the more the number of code subunit obtained by dividing FIG.

[0035] 优选的,所述划分模块划分得到的各个所述码图子单元的形状相同或不相同;和/或 [0035] Preferably, the shape of each of the sub-code pattern obtained module division unit dividing the same or different; and / or

[0036] 划分得到的各个所述码图子单元的面积相同或不相同。 The same as [0036] obtained by dividing the area of ​​each of the code patterns subunit or different.

[0037] 优选的,所述二值化模块具体用于: [0037] Preferably, the binarizing module is configured to:

[0038] S4.1,读取待处理的所述码图子单元的像素分布,设所述码图子单元包括NXM个像素; [0038] S4.1, the pixels to be processed read code pattern subunit distribution, provided the code pattern comprises a subunit NXM pixels;

[0039] S4.2,统计所述码图子单元中灰度为i对应的像素个数n (i),则该码图子单元的平均灰度值为: [0039] The average gray S4.2, the pixel number n (i) the statistical gray code pattern is i subunit corresponding to the code pattern subunit values:

[0040] u=E i*n (i) / (M*N); [0040] u = E i * n (i) / (M * N);

[0041] S4.3,设置初始参数:记t为目标与背景的分割阈值,记灰度大于t的目标像素占码图子单元图像的比例为wl,记目标像素的平均灰度为Ul: [0041] S4.3, sets initial parameters: dividing threshold t is denoted target and background, the ratio t representing the target pixel code pattern image is referred subunit WL is larger than the gradation, the average gradation of the target pixel denoted Ul:

[0042] wl = W1/(M*N),其中,Wl是灰度值大于t的统计数 [0042] wl = W1 / (M * N), where, Wl is greater than the number t of the statistical gray

[0043] ul=E i*n (i) /Wl, i>t [0043] ul = E i * n (i) / Wl, i> t

[0044] 同理,记灰度小于t的背景像素占图像的比例《2,背景像素的平均灰度u2 ; [0044] Similarly, denoted t gray background pixels less than the proportion accounted image "2, U2 average gray background pixels;

[0045] S4.4,遍历S4.3 中的t,使得G = wl* (ul_u) * (ul_u)+w2* (u2_u) * (u2_u)最大,此时的t即为最佳阈值; [0045] S4.4, S4.3 traversal of t, so that G = wl * (ul_u) * (ul_u) + w2 * (u2_u) * (u2_u) maximum, at this time t is the optimum threshold value;

[0046] S4.5,在得到所述最佳阈值t后,以所述最佳阈值t作为二值化界线,对所述码图子单元进行二值化处理。 [0046] S4.5, after obtaining the optimal threshold value t, the optimal threshold value t to binarization line, the sub-code pattern binarization processing unit.

[0047] 优选的,所述采集模块采集到的所述原始码图为二维码码图或一维码码图。 [0047] Preferably, the module collects to the source picture shows a two-dimensional code or code pattern dimensional code acquired code pattern.

[0048] 本发明的有益效果如下: [0048] Advantageous effects of the present invention are as follows:

[0049] 本发明提供的基于同态滤波的图像处理方法及系统,在对码图进行二值化之前,首先进行同态滤波处理,通过同态滤波对图像进行有效增强,从而有效避免由于光照不足引起的图像质量下降,并对感兴趣的图像细节进行有效增强,因此,后续进行二值化处理时,能最大程度发挥OTSU算法的优点,精确区分前景和背景,使二值化后的码图不会丢失有效信息,提高图像二值化的质量,减化后续图像处理过程。 [0049] Based on the image processing method and system homomorphic filtering, prior to the code pattern is binarized first homomorphic filtering process of the present invention provides for effective enhanced image by homomorphic filtering, so as to effectively avoid the light image quality degradation due to insufficient image detail of interest and effectively enhanced, and therefore, the subsequent binarization processing, can maximize the advantages of the OTSU algorithm accurately distinguish between foreground and background, so that the code binarized FIG effectively without loss of information, improving the quality of the binarized image, simplify subsequent image processing.

附图说明 BRIEF DESCRIPTION

[0050] 图1为本发明提供的基于同态滤波的图像处理方法的流程示意图; [0050] FIG. 1 is based on the flow of the image processing method of the homomorphic filtering of the present invention to provide a schematic diagram;

[0051]图2为本发明提供的基于同态滤波的图像处理系统的结构示意图。 Schematic structural diagram of [0051] FIG. 2 of the present invention to provide an image processing system based on homomorphic filtering.

具体实施方式 Detailed ways

[0052] 以下结合附图对本发明进行详细说明: [0052] The accompanying drawings in conjunction with the following detailed description of the present invention:

[0053] 如图1所示,本发明提供一种基于同态滤波的图像处理方法,包括以下步骤: [0053] As shown in FIG. 1, the present invention provides an image processing method based on homomorphic filtering, comprising the steps of:

[0054] SI,采集原始码图; [0054] SI, FIG acquisition source;

[0055] 此处,码图既可以为二维码码图,也可以为一维码码图,本发明对所采集的码图具体类型并不限制。 [0055] Here, two-dimensional code that can code pattern code pattern, one-dimensional code may be a code pattern, the present invention is not limited to the specific code pattern acquired type.

[0056] S2,对所采集到的所述原始码图进行同态滤波处理,得到同态滤波处理后的码图; [0056] S2, are collected on the source code in FIG homomorphic filtering process, to obtain the code view of the homomorphic filtering process;

[0057] 本步骤中,同态滤波是指将频率过滤和灰度变换结合起来的一种图像处理方法,其依靠图像的照度/反射率模型作为频域处理的基础,利用压缩亮度范围和增强对比度改善图像质量。 [0057] In this step, the homomorphic filtering method refers to an image processing and gradation conversion frequency filter combination which relies on the image luminance / reflectance model as the basis of frequency domain processing, and luminance range using a compression enhancement contrast enhanced image quality.

[0058] 为特别适用码图识别,本发明提供一种新型的同态滤波图像处理方法,包括以下步骤: [0058] FIG identification code is particularly useful, the present invention provides a novel image processing homomorphic filtering method, comprising the steps of:

[0059] 对所述原始码图取对数,使图像模型中的乘法运算转化为简单的加法运算,得到加法表示形式的图像函数; [0059] Taking the logarithm of the source map, enabling the image model multiplication into simple adding, to obtain an image representation of the function of the adder;

[0060] 再对图像函数进行傅里叶变换,将图像函数转换到频域,表示为亮度分量和对比度分量的函数; [0060] and then the image function Fourier transform function to convert the image to a frequency domain, expressed as a luminance component and a contrast component of the function;

[0061] 然后,压缩亮度分量的变化范围,增强对比度分量的对比度,增强细节,得到变化后的图像函数; [0061] Then, the compression range of the luminance component, to enhance the contrast of the contrast component, detail enhancement, image obtained after the change function;

[0062] 对变化后的图像函数再进行滤波处理,对滤波结果进行傅立叶反变换和指数运算,得到同态滤波后的输出结果。 [0062] The function of the image then changes the filtering process of the filtering result exponentiation and inverse Fourier transform, to obtain an output result of homomorphic filtering.

[0063] 当然,在实际应用中,也可以使用其他同态滤波算法,对原始码图进行同态滤波处理,本发明对此并不限制。 [0063] Of course, in practical applications, it is also possible to use other homomorphic filtering algorithm of FIG source homomorphic filtering process, the present invention is not limited to this.

[0064] S3,基于预设的划分算法,将所述同态滤波处理后的码图划分为若干个码图子单元; [0064] S3, a preset division algorithm, the code of FIG homomorphic filtering process is divided into the plurality of code patterns subunit;

[0065] 本步骤中,划分算法为:码图识别精度与划分的码图子单元数量正相关;即:如果设定的码图识别精度越高,则码图子单元的面积越小,划分得到的码图子单元数量越多。 [0065] In this step, the division algorithm: the number of code symbols in FIG subunit FIG recognition accuracy and the divided positive correlation; i.e.: if the code pattern is set higher recognition accuracy, the smaller the area code of FIG subunit, divided the more the number of code obtained subunit FIG.

[0066] 也就是说,本发明中,对码图划分后得到的码图子单元的数量并不限制,根据实际码图识别精度需求灵活设定。 [0066] That is, the present invention is not limit on the number of code patterns subunit obtained by dividing the code pattern, the code set flexibly according to the actual needs of the recognition accuracy FIG.

[0067] 此外,本发明中,划分得到的各个所述码图子单元的形状相同或不相同。 [0067] Further, in the present invention, each of the same shape as the code of FIG subunit obtained by dividing the same or not. 划分得到的各个所述码图子单元的面积相同或不相同。 The same area obtained by dividing each of the code patterns subunit or different.

[0068] S4,分别对每一个所述码图子单元采用OTSU算法进行二值化处理,得到二值化码图子单元; [0068] S4, respectively, for each of said code pattern subunit OTSU algorithm using binarization processing, to obtain binary codes FIG subunit;

[0069] OTSU算法是一种全局化的动态二值化方法,又叫大津法,是一种灰度图像二值化的常用算法。 [0069] OTSU dynamic binarization algorithm is a method of global, also known as Otsu method, is commonly used algorithm for image binarization. 该算法的基本思想是:设使用某一个阈值将灰度图像根据灰度大小,分成目标部分和背景部分两类,在这两类的类内方差最小和类间方差最大的时候,得到的阈值是最优的二值化阈值。 The basic idea of ​​the algorithm is: a threshold value set using a gray gradation according to the size of the image, is divided into two types of the target portion and a background portion, within the threshold between these two classes and the minimum variance when the largest class variance obtained optimal binary threshold value.

[0070] 本发明提供如下的一种改进的OTSU算法,原理为: [0070] The present invention provides an improved OTSU algorithm works as follows:

[0071] 例如,对一幅NXM个像素的图像,可采用以下二值化方法: [0071] For example, an image of NXM pixels, the binarization method may be employed:

[0072] 1、首先计算图像的平均灰度U,计算如下: [0072] 1, U calculated first average gray images, is calculated as follows:

[0073] 对于MXN个像素的图像,统计得到全部图像中灰度为i对应的像素个数n(i),则该图像的平均灰度值为: [0073] MXN pixels for the image, the counted number of pixels n (i) all of the gray-scale image corresponding to i, the average gray value of the image:

[0074] u=E i*n (i) / (M*N); [0074] u = E i * n (i) / (M * N);

[0075] 2、列出求解最佳阀值t的相关变量 [0075] 2, outlining the optimal threshold value t is Seek

[0076] 记t为目标与背景的分割阈值,记目标像素(灰度大于t)占图像的比例为wl,记目标像素的平均灰度为Ul: Ratio [0076] t is divided referred to as the target and background thresholds, denoted target pixel (grayscale greater than t) representing the image is WL, referred to the average gray target pixel Ul:

[0077] wl = ffl/(M*N),其中的Wl是灰度值大于t的统计数 [0077] wl = ffl / (M * N), wherein Wl is greater than the number t of the statistical gray

[0078] ul =Σ i*n(i)/ffl, i>t. [0078] ul = Σ i * n (i) / ffl, i> t.

[0079] 同理,得到背景像素占图像的比例《2,背景像素的平均灰度u2。 [0079] Similarly, to obtain the ratio of "2, u2 mean gray background pixels representing background pixel image.

[0080] 3、求解最佳阀值t是类差别最大 [0080] 3, to solve the optimal threshold t is the largest class differences

[0081]遍历步骤 2 中的t,使得G = wl* (ul-u)* (ul-u)+w2*(u2_u)*(u2_u)最大.G 最大时,即得到了最佳阈值 t 2 [0081] traversal step, so that the maximum G = wl * (ul-u) * (ul-u) + w2 * (u2_u) * (u2_u) .G maximum, i.e., to obtain the optimal threshold

[0082] 4、根据步骤3确定的阈值,进行图像二值化处理。 [0082] 4. The threshold value is determined in step 3, the image binarization process.

[0083] S5,各个所述二值化码图子单元组合生成最终的二值化码图。 [0083] S5, each of said binary code pattern subunit composition generate a final binary code pattern.

[0084] 如图2所示,本发明还提供一种基于同态滤波的图像处理系统,包括: [0084] 2, the present invention also provides a homomorphic filtering based image processing system, comprising:

[0085] 采集模块,用于采集原始码图; [0085] The acquisition module, for collecting FIG source;

[0086] 其中,采集模块采集到的所述原始码图为二维码码图或一维码码图。 [0086] wherein the collection module to the source picture shows two-dimensional code or a one-dimensional code pattern amble FIG.

[0087]同态滤波处理模块,用于对所述采集模块采集到的所述原始码图进行同态滤波处理,得到同态滤波处理后的码图; [0087] The homomorphic filtering processing module for the source of FIG acquisition module to the homomorphic filtering process, to obtain the code view of the homomorphic filtering process;

[0088] 划分模块,用于基于预设的划分算法,将所述同态滤波处理模块处理后的码图划分为若干个码图子单元; [0088] dividing means for dividing a preset algorithm, the code view of the state with the filter processing module is divided into a plurality of code patterns subunit;

[0089] 其中,划分模块所使用的划分算法为:码图识别精度与划分的码图子单元数量正相关;即:如果设定的码图识别精度越高,则码图子单元的面积越小,划分得到的码图子单元数量越多。 [0089] wherein dividing module partitioning algorithm used is: the number of code symbols in FIG subunit FIG recognition accuracy and the divided positive correlation; i.e.: if the code pattern is set higher recognition accuracy, then the area code of the sub-unit of FIG. small, the more the number of code subunit obtained by dividing FIG.

[0090] 划分模块划分得到的各个所述码图子单元的形状相同或不相同。 Each of the same shape as the code of FIG subunit [0090] obtained by dividing or partitioning module are not identical. 划分模块划分得到的各个所述码图子单元的面积相同或不相同。 Dividing the same obtained by dividing the area of ​​each module of the code pattern subunit or different.

[0091] 二值化模块,用于分别对每一个所述划分模块划分得到的码图子单元采用OTSU算法进行二值化处理,得到二值化码图子单元; [0091] The binarization module, for respectively dividing module for dividing each of said code pattern obtained using the OTSU subunit binarization processing algorithm, to obtain binary codes FIG subunit;

[0092] 二值化模块具体用于: [0092] The binarizing module is configured to:

[0093] S4.1,读取待处理的所述码图子单元的像素分布,设所述码图子单元包括NXM个像素; [0093] S4.1, the pixels to be processed read code pattern subunit distribution, provided the code pattern comprises a subunit NXM pixels;

[0094] S4.2,统计所述码图子单元中灰度为i对应的像素个数n (i),则该码图子单元的平均灰度值为: [0094] The average gray S4.2, the pixel number n (i) the statistical gray code pattern is i subunit corresponding to the code pattern subunit values:

[0095] u=E i*n (i) / (M*N); [0095] u = E i * n (i) / (M * N);

[0096] S4.3,设置初始参数:记t为目标与背景的分割阈值,记灰度大于t的目标像素占码图子单元图像的比例为wl,记目标像素的平均灰度为ul: [0096] S4.3, sets initial parameters: segmentation threshold referred t as a target and background, the ratio t representing the target pixel code pattern image is referred subunit WL is larger than the gradation, the average gradation of the target pixel denoted UL:

[0097] wl = ffl/(M*N),其中,Wl是灰度值大于t的统计数 [0097] wl = ffl / (M * N), where, Wl is greater than the number t of the statistical gray

[0098] ul=E i*n (i) /Wl, i>t [0098] ul = E i * n (i) / Wl, i> t

[0099] 同理,记灰度小于t的背景像素占图像的比例《2,背景像素的平均灰度u2 ; [0099] Similarly, denoted t gray background pixels less than the proportion accounted image "2, U2 average gray background pixels;

[0100] S4.4,遍历S4.3 中的t,使得G = wl*(ul_u)*(ul_u)+w2*(u2_u)*(u2_u)最大,此时的t即为最佳阈值; [0100] S4.4, S4.3 traversal of t, so that G = wl * (ul_u) * (ul_u) + w2 * (u2_u) * (u2_u) maximum, at this time t is the optimum threshold value;

[0101] S4.5,在得到所述最佳阈值t后,以所述最佳阈值t作为二值化界线,对所述码图子单元进行二值化处理。 [0101] S4.5, after obtaining the optimal threshold value t, the optimal threshold value t to binarization line, the sub-code pattern binarization processing unit.

[0102] 二值化码图生成单元,用于将所述二值化模块得到的各个所述二值化码图子单元组合生成最终的二值化码图。 [0102] FIG binary code generating means for binarizing the respective modules obtained by the binary code in FIG subunit composition generate a final binary code in FIG.

[0103] 本发明提供的基于同态滤波的图像处理方法及系统,在对码图进行二值化之前,首先进行同态滤波处理,通过同态滤波对图像进行有效增强,从而有效避免由于光照不足引起的图像质量下降,并对感兴趣的图像细节进行有效增强,因此,后续进行二值化处理时,能最大程度发挥OTSU算法的优点,精确区分前景和背景,使二值化后的码图不会丢失有效信息,提高图像二值化的质量,减化后续图像处理过程。 [0103] Based on the image processing method and system homomorphic filtering, prior to the code pattern is binarized first homomorphic filtering process of the present invention provides for effective enhanced image by homomorphic filtering, so as to effectively avoid the light image quality degradation due to insufficient image detail of interest and effectively enhanced, and therefore, the subsequent binarization processing, can maximize the advantages of the OTSU algorithm accurately distinguish between foreground and background, so that the code binarized FIG effectively without loss of information, improving the quality of the binarized image, simplify subsequent image processing.

[0104] 以上所述仅是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视本发明的保护范围。 [0104] The above are only preferred embodiments of the present invention, it should be noted that those of ordinary skill in the art, in the present invention without departing from the principles of the premise, can make various improvements and modifications, such modifications and modifications should also depend on the scope of the present invention.

Claims (10)

1.一种基于同态滤波的图像处理方法,其特征在于,包括以下步骤: SI,采集原始码图; S2,对所采集到的所述原始码图进行同态滤波处理,得到同态滤波处理后的码图; S3,基于预设的划分算法,将所述同态滤波处理后的码图划分为若干个码图子单元;S4,分别对每一个所述码图子单元采用OTSU算法进行二值化处理,得到二值化码图子单元; S5,各个所述二值化码图子单元组合生成最终的二值化码图。 An image processing method based on homomorphic filtering, characterized by, comprising the steps of: SI, FIG acquisition source; S2, are collected on the source code in FIG homomorphic filtering, homomorphic filtering to give FIG processed code; S3, a preset division algorithm based on the code patterns with the homomorphic filtering process is divided into a plurality of code patterns subunit; S4, respectively, for each of said code pattern OTSU algorithm employed subunit binarization processing, to obtain binary codes FIG subunit; S5, each of said binary code pattern subunit composition generate a final binary code pattern.
2.根据权利要求1所述的基于同态滤波的图像处理方法,其特征在于,S3中,所述划分算法为:码图识别精度与划分的码图子单元数量正相关;即:如果设定的码图识别精度越高,则码图子单元的面积越小,划分得到的码图子单元数量越多。 2. The image processing method according to claim based on homomorphic filtering, characterized in that said 1, S3, the division algorithm: the number of code symbols in FIG subunit FIG recognition accuracy and positive correlation divided; that: assuming that the higher the recognition accuracy of a given code pattern, the code pattern subunit smaller the area, the more the number of code subunit obtained by dividing FIG.
3.根据权利要求1所述的基于同态滤波的图像处理方法,其特征在于,S3中,划分得到的各个所述码图子单元的形状相同或不相同;和/或划分得到的各个所述码图子单元的面积相同或不相同。 The image processing method based on homomorphic filtering, characterized in that said 1, S3, the same or different and the shape of each sub-code pattern obtained by dividing unit as claimed in claim; and / or obtained by dividing each of the FIG said same area code or not identical subunits.
4.根据权利要求1所述的基于同态滤波的图像处理方法,其特征在于,S4中,分别对每一个所述码图子单元采用OTSU算法进行二值化处理,得到二值化码图子单元,具体包括以下步骤: S4.1,读取待处理的所述码图子单元的像素分布,设所述码图子单元包括NXM个像素; S4.2,统计所述码图子单元中灰度为i对应的像素个数n (i),则该码图子单元的平均灰度值为: u=E i*n ⑴ / (M*N); S4.3,设置初始参数:记t为目标与背景的分割阈值,记灰度大于t的目标像素占码图子单元图像的比例为wl,记目标像素的平均灰度为Ul:wl = W1/(M*N),其中,Wl是灰度值大于t的统计数ul=E i*n(i)/Wl, i>t 同理,记灰度小于t的背景像素占图像的比例w2,背景像素的平均灰度u2 ; S4.4,遍历S4.3 中的t,使得G = wl*(ul-u)*(ul-u)+w2*(u2_u)*(u2_u)最大,此时的t即为最佳阈值; S4.5,在得到所述最佳阈值t后,以所述 The image processing method based on homomorphic filtering, characterized in that said according to claim 1, S4 in each of said code for each subunit using the OTSU FIG algorithm binarization processing, to obtain binary codes in FIG. subunit includes the following steps: S4.1, the pixels to be processed read code pattern subunit distribution, provided the code pattern comprises a subunit NXM pixels; S4.2, the code pattern statistics subunit is the number of gray-scale pixel n (i) i corresponding to the average gray code pattern subunit values: u = E i * n ⑴ / (M * N); S4.3, sets initial parameters: t is denoted target and background segmentation threshold, denoted t is larger than the gradation of the target pixel represented by the code pattern image subunit WL ratio, average gray target pixel is referred Ul: wl = W1 / (M * N), wherein , Wl of the gradation value of t is larger than statistics ul = E i * n (i) / Wl, i> t Similarly, the ratio is less than t remember gradation background pixels representing image w2, average gray background pixels u2 ; S4.4, S4.3 traversing the t, so that G = wl * (ul-u) * (ul-u) + w2 * (u2_u) * (u2_u) maximum, at this time is the optimal threshold value t ; S4.5, after obtaining the optimal threshold value t, to the 佳阈值t作为二值化界线,对所述码图子单元进行二值化处理。 Good threshold t binarized line, the sub-code pattern binarization processing unit.
5.根据权利要求1-4任一项所述的基于同态滤波的图像处理方法,其特征在于,所述码图为二维码码图或一维码码图。 5. The image processing method of any of claims 1-4 based on homomorphic filtering, characterized in that one of the two-dimensional code picture shows a one-dimensional code or code pattern according to claim amble FIG.
6.一种基于同态滤波的图像处理系统,其特征在于,包括: 采集模块,用于采集原始码图; 同态滤波处理模块,用于对所述采集模块采集到的所述原始码图进行同态滤波处理,得到同态滤波处理后的码图; 划分模块,用于基于预设的划分算法,将所述同态滤波处理模块处理后的码图划分为若干个码图子单元; 二值化模块,用于分别对每一个所述划分模块划分得到的码图子单元采用OTSU算法进行二值化处理,得到二值化码图子单元; 二值化码图生成单元,用于将所述二值化模块得到的各个所述二值化码图子单元组合生成最终的二值化码图。 A homomorphic filtering based image processing system, characterized by comprising: an acquisition module, for collecting FIG source; homomorphic processing module for the collection module to the source of FIG. homomorphic filtering process, to obtain the code view of the homomorphic filtering process; dividing means for dividing a preset algorithm, the code view of the homomorphic filtering processing module is divided into a plurality of code patterns subunit; binarizing means for each module for dividing each of the divided code pattern obtained using the OTSU subunit binarization processing algorithm, to obtain binary codes FIG subunit; binary code pattern generation unit for the binarization module obtained by each of said binary codes in FIG subunit composition generate a final binary code in FIG.
7.根据权利要求6所述的基于同态滤波的图像处理系统,其特征在于,所述划分模块所使用的划分算法为:码图识别精度与划分的码图子单元数量正相关;即:如果设定的码图识别精度越高,则码图子单元的面积越小,划分得到的码图子单元数量越多。 7 based on the image processing system of claim 6 homomorphic filter according to claim, wherein the dividing module partitioning algorithm used is: the number of code symbols in FIG subunit FIG recognition accuracy and the divided positive correlation; namely: If the code pattern is set higher recognition accuracy, the area code of FIG subunit is smaller, the number of symbols obtained by dividing subunit FIG.
8.根据权利要求6所述的基于同态滤波的图像处理系统,其特征在于,所述划分模块划分得到的各个所述码图子单元的形状相同或不相同;和/或划分得到的各个所述码图子单元的面积相同或不相同。 The homomorphic filtering of the image processing system based on claim 6 wherein the shape of each of the code modules of FIG subunit obtained by dividing the division of the same or different claim 1; and / or obtained by dividing the respective the same area code pattern subunit or different.
9.根据权利要求6所述的基于同态滤波的图像处理系统,其特征在于,所述二值化模块具体用于: S4.1,读取待处理的所述码图子单元的像素分布,设所述码图子单元包括NXM个像素; S4.2,统计所述码图子单元中灰度为i对应的像素个数n (i),则该码图子单元的平均灰度值为: u=E i*n ⑴ / (M*N); S4.3,设置初始参数:记t为目标与背景的分割阈值,记灰度大于t的目标像素占码图子单元图像的比例为wl,记目标像素的平均灰度为Ul:wl = W1/(M*N),其中,Wl是灰度值大于t的统计数ul=E i*n(i)/Wl, i>t 同理,记灰度小于t的背景像素占图像的比例w2,背景像素的平均灰度u2 ; S4.4,遍历S4.3 中的t,使得G = wl*(ul-u)*(ul-u)+w2*(u2_u)*(u2_u)最大,此时的t即为最佳阈值; S4.5,在得到所述最佳阈值t后,以所述最佳阈值t作为二值化界线,对所述码图子单元进行二值化处理。 9. The basis of the image processing system according to claim 6 homomorphic filtering, wherein said binarizing module is configured to: S4.1, the code pattern read pixel distribution sub-units to be processed , provided the code pattern comprises a subunit NXM pixels; S4.2, the statistical gray code pattern subunit is the number of pixels n (i) i corresponding to the average gray value of the sub-code pattern unit is: u = E i * n ⑴ / (M * N); S4.3, sets initial parameters: segmentation threshold referred t as a target and background, the gradation is larger than t remember the target pixel code pattern representing an image proportional subunit is wl, the mean gray target pixel are referred Ul: wl = W1 / (M * N), where, Wl is greater than the grayscale value of t statistics ul = E i * n (i) / Wl, i> t Similarly, the ratio is less than t remember gradation image representing background pixels w2, average gray background pixels u2; S4.4, S4.3 traversing the t, so that G = wl * (ul-u) * (ul -u) + w2 * (u2_u) * (u2_u) maximum, at this time t is the optimal threshold; S4.5, after obtaining the optimal threshold value t, the optimal threshold value t to binarization line, the sub-code pattern binarization processing unit.
10.根据权利要求6-9任一项所述的基于同态滤波的图像处理系统,其特征在于,所述采集模块采集到的所述原始码图为二维码码图或一维码码图。 10 based on the image processing system according to any homomorphic filtering according to claims 6-9, characterized in that said acquisition module to the source picture shows a two-dimensional or one-dimensional code pattern code amble Fig.
CN 201410834140 2014-12-26 2014-12-26 Homomorphic filtering based image processing method and system CN104504662A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201410834140 CN104504662A (en) 2014-12-26 2014-12-26 Homomorphic filtering based image processing method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201410834140 CN104504662A (en) 2014-12-26 2014-12-26 Homomorphic filtering based image processing method and system

Publications (1)

Publication Number Publication Date
CN104504662A true CN104504662A (en) 2015-04-08

Family

ID=52946056

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201410834140 CN104504662A (en) 2014-12-26 2014-12-26 Homomorphic filtering based image processing method and system

Country Status (1)

Country Link
CN (1) CN104504662A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105488448A (en) * 2015-12-11 2016-04-13 杭州晟元数据安全技术股份有限公司 Barcode and two-dimensional code distinguishing method
CN105869175A (en) * 2016-04-21 2016-08-17 北京邮电大学 Image segmentation method and system
CN106373104A (en) * 2016-09-07 2017-02-01 河海大学常州校区 Adaptive enhancement method of rock boring image
CN106815587A (en) * 2015-11-30 2017-06-09 浙江宇视科技有限公司 Image processing method and device
CN106846276A (en) * 2017-02-06 2017-06-13 上海兴芯微电子科技有限公司 Image enhancement method and device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110085732A1 (en) * 2009-10-09 2011-04-14 Ting-Yuan Cheng Qr code processing method and apparatus thereof
CN103235948A (en) * 2013-04-22 2013-08-07 中山大学 Adaptive threshold binarization method for two-dimensional barcode

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110085732A1 (en) * 2009-10-09 2011-04-14 Ting-Yuan Cheng Qr code processing method and apparatus thereof
CN103235948A (en) * 2013-04-22 2013-08-07 中山大学 Adaptive threshold binarization method for two-dimensional barcode

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
张宁: "基于摄像方式的二维条码识别算法的研究", 《中国优秀硕士学位论文全文数据库》 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106815587B (en) * 2015-11-30 2019-10-18 浙江宇视科技有限公司 Image processing method and device
CN106815587A (en) * 2015-11-30 2017-06-09 浙江宇视科技有限公司 Image processing method and device
CN105488448B (en) * 2015-12-11 2018-10-09 杭州晟元数据安全技术股份有限公司 A kind of differentiating method of bar code and Quick Response Code
CN105488448A (en) * 2015-12-11 2016-04-13 杭州晟元数据安全技术股份有限公司 Barcode and two-dimensional code distinguishing method
CN105869175A (en) * 2016-04-21 2016-08-17 北京邮电大学 Image segmentation method and system
CN106373104A (en) * 2016-09-07 2017-02-01 河海大学常州校区 Adaptive enhancement method of rock boring image
CN106846276A (en) * 2017-02-06 2017-06-13 上海兴芯微电子科技有限公司 Image enhancement method and device

Similar Documents

Publication Publication Date Title
Xiaofeng et al. Discriminatively trained sparse code gradients for contour detection
Pan et al. Detecting image region duplication using SIFT features
CN101398894B (en) License Plate Recognition Method and apparatus for implementing automatic
Kang et al. Automatic single-image-based rain streaks removal via image decomposition
CN102360421B (en) Face identification method and system based on video streaming
CN102163284B (en) Chinese environment-oriented complex scene text positioning method
Kranthi et al. Automatic number plate recognition
CN104809443A (en) Convolutional neural network-based license plate detection method and system
US9292759B2 (en) Methods and systems for optimized parameter selection in automated license plate recognition
Yeh et al. Haze effect removal from image via haze density estimation in optical model
KR101795823B1 (en) Text enhancement of a textual image undergoing optical character recognition
Huang et al. Image contrast enhancement for preserving mean brightness without losing image features
Chen et al. Visual depth guided color image rain streaks removal using sparse coding
CN102937595B (en) Method, device and system for detecting printed circuit board (PCB)
JP2007524950A (en) Object detection method, the object detecting device, and the object detecting program
Gu et al. Fast FPGA-based multiobject feature extraction
CN104156704A (en) Novel license plate identification method and system
CN104299006A (en) Vehicle license plate recognition method based on deep neural network
KR100601453B1 (en) Fingerprint recognition method
CN1622589A (en) Image processing method and image processing apparatus
Chen et al. A novel color edge detection algorithm in RGB color space
CN104050471B (en) A natural scene text detection method and system
CN101593276B (en) Video OCR image-text separation method and system
CN104166841A (en) Rapid detection identification method for specified pedestrian or vehicle in video monitoring network
Yu et al. A novel license plate location method based on wavelet transform and EMD analysis

Legal Events

Date Code Title Description
C06 Publication
C10 Entry into substantive examination
RJ01