CN104463795B - A kind of dot matrix DM image in 2 D code processing method and processing device - Google Patents
A kind of dot matrix DM image in 2 D code processing method and processing device Download PDFInfo
- Publication number
- CN104463795B CN104463795B CN201410674241.4A CN201410674241A CN104463795B CN 104463795 B CN104463795 B CN 104463795B CN 201410674241 A CN201410674241 A CN 201410674241A CN 104463795 B CN104463795 B CN 104463795B
- Authority
- CN
- China
- Prior art keywords
- image
- value
- sigma
- function
- dimensional
- 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.)
- Expired - Fee Related
Links
- 239000011159 matrix material Substances 0.000 title claims abstract description 72
- 238000012545 processing Methods 0.000 title claims abstract description 44
- 238000003672 processing method Methods 0.000 title claims abstract description 6
- 238000001914 filtration Methods 0.000 claims abstract description 44
- 238000000034 method Methods 0.000 claims abstract description 35
- 238000001514 detection method Methods 0.000 claims abstract description 27
- 238000009499 grossing Methods 0.000 claims abstract description 20
- 238000005286 illumination Methods 0.000 claims abstract description 9
- 238000004422 calculation algorithm Methods 0.000 claims description 58
- 238000006243 chemical reaction Methods 0.000 claims description 18
- 230000000877 morphologic effect Effects 0.000 claims description 7
- 239000007787 solid Substances 0.000 claims description 7
- ODKSFYDXXFIFQN-UHFFFAOYSA-M argininate Chemical compound [O-]C(=O)C(N)CCCNC(N)=N ODKSFYDXXFIFQN-UHFFFAOYSA-M 0.000 claims description 4
- 238000005316 response function Methods 0.000 claims description 4
- 238000011161 development Methods 0.000 abstract description 4
- 238000013461 design Methods 0.000 abstract description 2
- 230000000694 effects Effects 0.000 description 7
- 238000007781 pre-processing Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 4
- 230000006740 morphological transformation Effects 0.000 description 3
- 238000002474 experimental method Methods 0.000 description 2
- 239000000463 material Substances 0.000 description 2
- 238000012896 Statistical algorithm Methods 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 238000007796 conventional method Methods 0.000 description 1
- 238000005260 corrosion Methods 0.000 description 1
- 230000007797 corrosion Effects 0.000 description 1
- 230000010339 dilation Effects 0.000 description 1
- 230000003628 erosive effect Effects 0.000 description 1
- 239000011521 glass Substances 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 239000002184 metal Substances 0.000 description 1
- 238000009877 rendering Methods 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
- 238000000844 transformation Methods 0.000 description 1
Landscapes
- Image Processing (AREA)
Abstract
本发明涉及一种点阵式DM二维码图像处理方法及装置,该方法包括:步骤一,读取图像并统一尺寸;步骤二,转化为灰度图;步骤三,高斯平滑滤波处理;步骤四,二值化处理;步骤五,斑点检测获得码元直径;步骤六,根据码元直径对原始灰度图进行动态滤波及改进的二值化处理;步骤七,对二值化图像进行开、闭运算,获得点阵图像;步骤八,对点阵图像中值滤波处理,转化为标准二维码图像。该方法能够克服点阵式DataMatrix码在识别中间隙过大、光照不均匀和噪声干扰等问题,可通过目前的DM码手持识别设备进行检测,硬件上无需二次开发,系统设计可行快速有效,能满足目前对点阵式DM解码的实际需求。
The present invention relates to a dot-matrix DM two-dimensional code image processing method and device, the method comprising: step 1, read the image and unify the size; step 2, convert it into a grayscale image; step 3, Gaussian smoothing filter processing; step Four, binarization processing; step five, spot detection obtains the code element diameter; step six, carries out dynamic filtering and improved binarization processing to the original gray scale image according to the code element diameter; step seven, carries out development to the binarized image , closing operation to obtain a dot matrix image; Step 8, the dot matrix image is converted into a standard two-dimensional code image by median filtering. This method can overcome the problems of too large gap, uneven illumination and noise interference in the recognition of dot-matrix DataMatrix codes. It can be detected by the current DM code handheld recognition equipment. There is no need for secondary development on the hardware, and the system design is feasible, fast and effective. It can meet the actual demand for dot-matrix DM decoding at present.
Description
技术领域technical field
本发明属于二维码计算机图像处理技术领域,特别涉及一种点阵式DM二维码图像处理方法和装置。The invention belongs to the technical field of two-dimensional code computer image processing, and in particular relates to a dot matrix DM two-dimensional code image processing method and device.
背景技术Background technique
点阵式DM(DataMatrix)目前主要应用于汽车制造、制药医疗、军队枪械管理等领域,由于其易于生成,因此在金属、玻璃、硬塑等材料中到了广泛的应用。同时由于点阵式DM二维码生成方法和使用材料的多样性导致其条形码图像普遍存在对比度低、多噪声干扰、背景复杂、采集过程中出现的光照不均匀等情况。与标准的DM符号不同,点阵式DM二维码的点间空隙大,如图1所示。如对这种码毫无处理地进行识别,则又会加大识别的难度,因此对于点阵式二维码图像进行图像预处理是很有必要的。Dot-matrix DM (DataMatrix) is currently mainly used in automobile manufacturing, pharmaceutical medical treatment, military firearms management and other fields. Because it is easy to generate, it has been widely used in metal, glass, hard plastic and other materials. At the same time, due to the diversity of dot-matrix DM two-dimensional code generation methods and materials used, the barcode images generally have low contrast, multiple noise interference, complex background, and uneven illumination during the acquisition process. Different from standard DM symbols, dot-matrix DM two-dimensional codes have large spaces between dots, as shown in Figure 1. If the code is recognized without any treatment, it will increase the difficulty of recognition, so it is necessary to perform image preprocessing on the dot matrix two-dimensional code image.
随着嵌入式平台的发展与推广,已经出现了便携式二维码识别阅读器,使对二维码的识读更加快捷方便,目前关于DM码图像预处理的研究层出不穷,但是对于点阵式DM码图像预处理的研究相对较少。因此本发明提出了点阵式DM图像预处理方法以及相应的装置。With the development and promotion of embedded platforms, portable two-dimensional code recognition readers have appeared, making the reading of two-dimensional codes faster and more convenient. At present, there are endless researches on DM code image preprocessing, but for dot matrix DM There are relatively few studies on code image preprocessing. Therefore, the present invention proposes a dot-matrix DM image preprocessing method and a corresponding device.
发明内容Contents of the invention
本发明针对点阵式DataMatrix二维码存在的识别率低的问题,提出了一系列结合二值化的形态学变换的图像预处理方法,并通过斑点检测使平滑模糊与形态学变换具有自适应性。该方法能够克服点阵式DataMatrix码在识别中间隙过大、光照不均匀和噪声干扰等问题,并将点阵式DM二维码转化为标准的格式,从而可通过目前的DM码手持识别设备进行检测,硬件上无需二次开发,系统设计可行快速有效,能满足目前对点阵式DM解码的实际需求。The present invention aims at the problem of low recognition rate of dot-matrix DataMatrix two-dimensional code, proposes a series of image preprocessing methods combined with binarized morphological transformation, and makes smooth blur and morphological transformation self-adaptive through speckle detection sex. This method can overcome the problems of too large gap, uneven illumination and noise interference in the recognition of the dot matrix DataMatrix code, and convert the dot matrix DM two-dimensional code into a standard format, so that it can be recognized by the current DM code handheld identification device For detection, there is no need for secondary development on the hardware, and the system design is feasible, fast and effective, and can meet the current actual demand for dot-matrix DM decoding.
本发明提供了一种点阵式DM二维码图像处理方法,包括:The present invention provides a dot-matrix DM two-dimensional code image processing method, comprising:
步骤一:读取点阵式DM二维码图像,在不改变原点阵式DM二维码图像宽高比例的基础上,利用最近邻插值算法或双线性插值算法进行宽度统一化处理;Step 1: Read the dot-matrix DM two-dimensional code image, and use the nearest neighbor interpolation algorithm or bilinear interpolation algorithm to unify the width without changing the width-to-height ratio of the original dot-matrix DM two-dimensional code image;
步骤二:将统一尺寸后的图像转换为灰度图;Step 2: convert the uniformly sized image into a grayscale image;
步骤三:对灰度化后的图像进行高斯平滑滤波处理,去除图像背景的细小纹理,使点阵码元的实心点更加平滑;Step 3: Carry out Gaussian smoothing filter processing to the image after gray scale, remove the tiny texture of image background, make the solid point of lattice code element smoother;
步骤四:将高斯平滑滤波后的灰度级图像转化为黑白二值化图像;Step 4: Convert the grayscale image after Gaussian smoothing filter into a black and white binary image;
步骤五:对步骤四中二值化后的图像进行码元检测,得到点阵式码元的直径;Step 5: Carry out symbol detection to the binarized image in step 4 to obtain the diameter of the dot matrix symbol;
步骤六:根据步骤五获得的点阵码元的直径大小而动态的改变平均模板的大小,进而对步骤二中的灰度图进行动态均值滤波处理,对动态均值滤波后的灰度图再进行kittler算法与Bernsen算法相结合的改进的二值化处理;Step 6: Dynamically change the size of the average template according to the diameter of the dot matrix symbol obtained in step 5, and then perform dynamic mean value filtering on the grayscale image in step 2, and then perform dynamic mean value filtering on the grayscale image after dynamic mean value filtering Improved binarization processing combining kittler algorithm and Bernsen algorithm;
步骤七:将步骤六获得的二值化图像进行形态学的开运算和闭运算操作,得到处理后的点阵图像,其中,Step 7: Perform morphological opening and closing operations on the binarized image obtained in step 6 to obtain a processed bitmap image, wherein,
开运算用下式表示:The opening operation is represented by the following formula:
闭运算用下式表示:The closing operation is represented by the following formula:
其中A为输入的二值图像,B为正方形结构元素。Among them, A is the input binary image, and B is the square structure element.
步骤八:将步骤七获得的点阵图像通过中值滤波去噪处理,转变为可识别的块状结构的标准DM二维码图像。Step 8: Convert the dot matrix image obtained in Step 7 into a standard DM two-dimensional code image with recognizable block structure through median filtering and denoising processing.
进一步的,所述步骤七开运算中的正方形结构元素B的边长优选为点阵码元直径的1/3,闭运算中正方形结构元素B的边长优选为小于点阵码元直径1至5个显示像素点。Further, the side length of the square structural element B in the seven-open operation of the step is preferably 1/3 of the diameter of the lattice symbol, and the side length of the square structural element B in the closed operation is preferably less than the diameter of the lattice symbol by 1 to 2 5 display pixels.
进一步的,步骤八使用的中值滤波去噪处理优选为通过以下步骤实现:Further, the median filter denoising process used in step 8 is preferably implemented through the following steps:
把图像中一点的值用该点的一个邻域中各点值的中值代替,让周围的像素值接近真实值,从而消除孤立的噪声点,其中二维中值滤波输出通过下式获得:The value of a point in the image is replaced by the median value of each point value in a neighborhood of the point, so that the surrounding pixel values are close to the real value, thereby eliminating isolated noise points, and the output of the two-dimensional median filter is obtained by the following formula:
g(x,y)=med{f(x-k,y-1),(k,1∈W)}g(x,y)=med{f(x-k,y-1),(k,1∈W)}
其中,med{}表示取数组序列的中间值;f(x,y),g(x,y)分别为原始图像和处理后图像;W为3×3大小的二维模板;k,l均为整数,分别表示坐标x、y方向上的增量。Among them, med{} means to take the intermediate value of the array sequence; f(x, y), g(x, y) are the original image and the processed image respectively; W is a two-dimensional template with a size of 3×3; is an integer, representing the increment in the coordinate x and y directions respectively.
进一步的,步骤六的动态均值滤波处理优选的进一步包括如下步骤:Further, the dynamic mean filtering process in step 6 preferably further includes the following steps:
(1)模板大小通过下式获得:(1) The template size is obtained by the following formula:
其中round表示取整操作; Among them, round means rounding operation;
(2)计算平均滤波模板:(2) Calculate the average filter template:
其中,k为平均模板的大小,D为点阵码元的直径,ε是平均模板;Wherein, k is the size of the average template, D is the diameter of the lattice symbol, and ε is the average template;
(3)按照下式进行平均滤波:(3) Perform average filtering according to the following formula:
I1(x,y)=ε*I(x,y)I 1 (x, y) = ε*I(x, y)
其中I(x,y)表示灰度图矩阵,I1(x,y)表示滤波后图像灰度矩阵;Wherein I(x, y) represents the grayscale matrix, and I 1 (x, y) represents the grayscale matrix of the filtered image;
进一步的,步骤四中将高斯平滑滤波后的灰度级图像转化为黑白二值化图像的过程具体包括:Further, the process of converting the grayscale image after Gaussian smoothing filtering into a black and white binarized image in step 4 specifically includes:
(1)用Kittler算法得到全局阈值T,计算该全局阈值T的方法如下:(1) Use the Kittler algorithm to obtain the global threshold T, and the method for calculating the global threshold T is as follows:
其中,f(x,y)是步骤二获得的原始的灰度图,e(x,y)=max{|ex|,|ey|}即梯度最大值,ex=f(x-1,y)-f(x+1,y)是水平方向上的梯度,ey=f(x,y-1)-f(x,y+1)是垂直方向上的梯度;Among them, f(x, y) is the original grayscale image obtained in step 2, e(x, y)=max{|e x |, |e y |} is the maximum value of the gradient, e x =f(x- 1, y)-f(x+1, y) is the gradient on the horizontal direction, e y =f(x, y-1)-f(x, y+1) is the gradient on the vertical direction;
(2)扫描整个f(x,y)灰度图像,则二值化结果为:(2) Scan the entire f(x, y) grayscale image, then the binarization result is:
其中b(x,y)为二值化结果。Where b(x, y) is the binarization result.
进一步的,步骤六使用的kittler算法与Bernsen算法相结合的改进的二值化处理包括如下具体步骤:Further, the improved binarization process combining the kittler algorithm and the Bernsen algorithm used in step 6 includes the following specific steps:
步骤(1)用Kittler算法得到全局阈值T,计算该全局阈值T的方法如下:Step (1) Use the Kittler algorithm to obtain the global threshold T, and the method for calculating the global threshold T is as follows:
其中,f(x,y)是步骤二获得的原始的灰度图,e(x,y)=max{|ex|,|ey|}即梯度最大值,ex=f(x-1,y)-f(x+1,y)是水平方向上的梯度,ey=f(x,y-1)-f(x,y+1)是垂直方向上的梯度;Among them, f(x, y) is the original grayscale image obtained in step 2, e(x, y)=max{|e x |, |e y |} is the maximum value of the gradient, e x =f(x- 1, y)-f(x+1, y) is the gradient on the horizontal direction, e y =f(x, y-1)-f(x, y+1) is the gradient on the vertical direction;
步骤(2)采用Bernsen算法对图像直方图中光照不均的区间进行处理,该区间的灰度值集中在步骤(1)得到的全局阈值T附近,如果T3>D,D是Bernsen算法处理的区间宽度即点阵码元的直径Step (2) Use the Bernsen algorithm to process the interval of uneven illumination in the image histogram. The gray value of this interval is concentrated near the global threshold T obtained in step (1). If T 3 >D, D is processed by the Bernsen algorithm The interval width is the diameter of the lattice symbol
则二值化结果 Then the binarization result
如果T3<D,D是Bernsen算法处理的区间宽度即点阵码元的直径If T 3 <D, D is the interval width processed by the Bernsen algorithm, that is, the diameter of the lattice symbol
则二值化结果 Then the binarization result
其中,in,
T3是阈值选择依据且T3(x,y)=maxs-mins,T 3 is the threshold selection basis and T 3 (x, y)=max s -min s ,
T2(x,y)=0.5(maxd+mind),T 2 (x,y)=0.5(max d +min d ),
T4(x,y)=0.5(T+T2(x,y));T 4 (x,y)=0.5(T+T 2 (x,y));
其中,in,
maxd表示像素点(x,y)在大小为4w*4w的窗口中最大像素值; max d indicates the maximum pixel value of a pixel point (x, y) in a window with a size of 4w*4w;
表示像素点(x,y)在大小为4w*4w的较大窗口中最小像素值; Indicates the minimum pixel value of a pixel point (x, y) in a larger window with a size of 4w*4w;
表示像素点(x,y)在大小为2w*2w的较小窗口中最大像素值; Indicates the maximum pixel value of a pixel point (x, y) in a smaller window with a size of 2w*2w;
表示像素点(x,y)在大小为2w*2w的较小窗口中最小像素值; Indicates the minimum pixel value of a pixel point (x, y) in a smaller window with a size of 2w*2w;
上述式中的max表示取窗口内像素的最大值,min表示取窗口内像素的最小值,k和l均为整数,分别表示坐标x、y方向上的增量;w表示局部阈值运算的窗口,w取值范围为5~9,T2表示窗口内像素灰度平均值,T4是T2与全局阈值T的平均值。In the above formula, max means to take the maximum value of the pixels in the window, min means to take the minimum value of the pixels in the window, k and l are both integers, and represent the increments in the coordinate x and y directions respectively; w represents the window of the local threshold operation , w ranges from 5 to 9, T 2 represents the average gray level of pixels in the window, and T 4 is the average value of T 2 and the global threshold T.
进一步的,步骤五中的码元检测具体流程如下:Further, the specific process of code element detection in step five is as follows:
利用高斯拉普拉斯算子检测图像码元,对于二维高斯函数:Use Gaussian Laplacian operator to detect image symbols, for two-dimensional Gaussian function:
其中,σ为函数的宽度参数即特征尺度,用于控制函数的径向作用范围,σ越大表示函数的径向越宽,其相似的码元越大,σ越小表示函数的径向越窄,其相似的码元越小,x,y表示二维空间位置,g(x,y,σ)表示二维高斯函数;Among them, σ is the width parameter of the function, that is, the characteristic scale, which is used to control the radial range of the function. The larger the σ, the wider the radial direction of the function, and the larger the similar code elements. The smaller σ, the wider the radial direction of the function. Narrow, its similar symbol is smaller, x, y represent two-dimensional space position, g (x, y, σ) represents two-dimensional Gaussian function;
式(1)的拉普拉斯变换为:The Laplace transform of formula (1) is:
其中,Δ2g表示二维高斯函数的拉普拉斯函数,Δ2表示二阶微分算子,g表示二维高斯函数;规范化的高斯拉普拉斯变换为:Among them, Δ 2 g represents the Laplace function of the two-dimensional Gaussian function, Δ 2 represents the second-order differential operator, and g represents the two-dimensional Gaussian function; the normalized Gaussian Laplace transform is:
式(3)中表示规范化的高斯拉普拉斯函数,其方差为0;In formula (3) Represents the normalized Gaussian Laplacian function with a variance of 0;
式(3)所示的规范化的二维高斯拉普拉斯函数是圆对称函数,通过改变σ的值,检测不同尺寸的二维码码元,而求取得极点值等价于求取下式:The normalized two-dimensional Gaussian Laplace function shown in formula (3) is a circular symmetric function, by changing the value of σ, detecting two-dimensional code elements of different sizes, and obtaining Obtaining the pole value is equivalent to obtaining the following formula:
其中,表示对规范化的高斯拉普拉斯函数求σ的偏导,表示求规范化的高斯拉普拉斯函数的极点值;in, Denotes the normalized Laplacian of Gaussian function Find the partial derivative of σ, Represents the normalized Laplacian of Gaussian function extreme value of
亦即:that is:
r2-2σ2=0r 2 −2σ 2 =0
其中r表示二维码图像二值化的圆形码元的半径,在尺度时,高斯拉普拉斯响应值达到最大,同理,如果图像中的圆形码元黑白反相,那么,该码元的高斯拉普拉斯响应值在尺度为时达到最小,高斯拉普拉斯响应达到峰值时的尺度σ值是码元检测的特征尺度,计算二值化后的图像在不同尺度下的离散拉普拉斯响应值,然后检查位置空间中的每个点,若该点的拉普拉斯响应值都大于或小于其它立方空间邻域的值,那么,该点就是被检测到的二维码数据元素点,上述寻找位置空间和尺度空间的峰值可通过如下函数表示:Where r represents the radius of the circular symbol of the two-dimensional code image binarization, in the scale When , the Laplace of Gaussian response value reaches the maximum. Similarly, if the circular symbol in the image is black and white, then the Laplace of Gaussian response value of the symbol is in the scale of The scale σ value when the Gaussian Laplacian response reaches the peak value is the characteristic scale of symbol detection, calculate the discrete Laplacian response values of the binarized image at different scales, and then check the position space For each point of , if the Laplace response value of this point is greater than or less than the value of other cubic space neighbors, then this point is the detected two-dimensional code data element point, and the above-mentioned search position space and scale space The peak value of can be represented by the following function:
该函数表示同时在空间位置和尺度上拉普拉斯响应达到最大值或最小值的点的取值,该点就是所要检测的码元;其中,t表示尺度值,(x,y)表示空间位置,max minlocal(x,y,t)(·)表示响应函数在空间和尺度位置上的最大值或最小值,arg(·)表示对应函数值的变量的取值,表示在尺度空间下标准二维拉普拉斯函数。This function represents the value of the point where the Laplace response reaches the maximum or minimum value at the same time in the spatial position and scale, and this point is the symbol to be detected; where, t represents the scale value, and (x, y) represents the space position, max minlocal (x, y, t) ( ) indicates the maximum or minimum value of the response function in space and scale position, arg ( ) indicates the value of the variable corresponding to the function value, Represents the standard two-dimensional Laplace function in scale space.
本发明还提供了一种点阵式DM二维码图像处理装置,包括:The present invention also provides a dot-matrix DM two-dimensional code image processing device, comprising:
图像读取模块,用于读取点阵式DM二维码图像,在不改变原点阵式DM二维码图像宽高比例的基础上,利用最近邻插值算法或双线性插值算法进行宽度统一化处理;The image reading module is used to read the dot-matrix DM two-dimensional code image. On the basis of not changing the width-to-height ratio of the original dot-matrix DM two-dimensional code image, the width is unified by using the nearest neighbor interpolation algorithm or bilinear interpolation algorithm treatment;
灰度转换模块,用于将统一尺寸后的图像转换为灰度图;A grayscale conversion module, used to convert the image of uniform size into a grayscale image;
高斯平滑滤波模块,用于对灰度化后的图像进行高斯平滑滤波处理,去除图像背景的细小纹理,使点阵码元的实心点更加平滑;The Gaussian smoothing filter module is used to carry out Gaussian smoothing filter processing to the image after the gray scale, removes the small texture of the image background, and makes the solid point of the lattice code element smoother;
二值化转换模块,用于将高斯平滑滤波后的灰度级图像转化为黑白二值化图像;The binarization conversion module is used to convert the grayscale image after Gaussian smoothing filter into a black and white binarized image;
码元检测模块,用于对二值化转换模块中二值化后的图像进行码元检测,得到点阵式码元的直径;The code element detection module is used to carry out code element detection to the binarized image in the binarization conversion module to obtain the diameter of the dot matrix code element;
动态均值滤波及二值化转换模块,用于根据码元检测模块获得的点阵码元的直径大小而动态的改变平均模板的大小,进而对灰度转换模块获得的灰度图进行动态均值滤波处理,对动态均值滤波后的灰度图再进行kittler算法与Bernsen算法相结合的改进的二值化处理;The dynamic mean filtering and binarization conversion module is used to dynamically change the size of the average template according to the diameter of the lattice symbol obtained by the symbol detection module, and then perform dynamic mean filtering on the grayscale image obtained by the grayscale conversion module Processing, the grayscale image after the dynamic mean filter is then subjected to an improved binarization process combining the kittler algorithm and the Bernsen algorithm;
运算操作模块,用于将动态均值滤波及二值化转换模块获得的二值化图像进行形态学的开运算和闭运算操作,得到处理后的点阵图像,其中,The operation operation module is used to perform morphological opening and closing operations on the binarized image obtained by the dynamic mean filtering and binarization conversion module to obtain a processed bitmap image, wherein,
开运算用下式表示:The opening operation is represented by the following formula:
闭运算用下式表示:The closing operation is represented by the following formula:
其中A为输入的二值图像;B为正方形结构元素;Where A is the input binary image; B is the square structure element;
标准化模块,用于将运算操作模块获得的点阵图像通过中值滤波去噪处理,转变为可识别的块状结构的标准DM二维码图像。The standardization module is used to convert the dot matrix image obtained by the operation module into a standard DM two-dimensional code image with a recognizable block structure through median filtering and denoising processing.
进一步的,所述运算操作模块的开运算中的正方形结构元素B的边长优选为点阵码元直径的1/3,闭运算中正方形结构元素B的边长优选为小于点阵码元直径1至5个显示像素点。Further, the side length of the square structural element B in the opening operation of the operation module is preferably 1/3 of the diameter of the lattice symbol, and the side length of the square structural element B in the closing operation is preferably less than the diameter of the lattice symbol 1 to 5 display pixels.
进一步的,标准化模块使用的中值滤波去噪处理优选为通过以下方式实现:Further, the median filter denoising process used by the standardization module is preferably implemented in the following manner:
把图像中一点的值用该点的一个邻域中各点值的中值代替,让周围的像素值接近真实值,从而消除孤立的噪声点,其中二维中值滤波输出通过下式获得:The value of a point in the image is replaced by the median value of each point value in a neighborhood of the point, so that the surrounding pixel values are close to the real value, thereby eliminating isolated noise points, and the output of the two-dimensional median filter is obtained by the following formula:
g(x,y)=med{f(x-k,y-1),(k,1∈W)}g(x,y)=med{f(x-k,y-1),(k,1∈W)}
其中,med{}表示取数组序列的中间值;f(x,y),g(x,y)分别为原始图像和处理后图像;W为3×3大小的二维模板;k,l均为整数,分别表示坐标x、y方向上的增量。Among them, med{} means to take the intermediate value of the array sequence; f(x, y), g(x, y) are the original image and the processed image respectively; W is a two-dimensional template with a size of 3×3; is an integer, representing the increment in the coordinate x and y directions respectively.
附图说明Description of drawings
图1是点阵DM码与标准DM码的对比图;Fig. 1 is a comparison diagram of a dot matrix DM code and a standard DM code;
图2是点阵DM码图像处理流程图;Fig. 2 is a flow chart of dot matrix DM code image processing;
图3是二值化的点阵DM码图像与二值化后的斑点(码元)检测示意图;Fig. 3 is the speckle (symbol) detection schematic diagram after the binarized lattice DM code image and the binarization;
图4是开运算和闭运算的效果图;Fig. 4 is the rendering of opening operation and closing operation;
图5是点阵DM码图像转换为标准DM二维码图像的效果示意图。Fig. 5 is a schematic diagram of the effect of converting a dot matrix DM code image into a standard DM two-dimensional code image.
具体实施方式detailed description
下面结合附图和具体实施例对本发明作进一步详细的说明,并不是把本发明的实施范围局限于此。The present invention will be described in further detail below in conjunction with the accompanying drawings and specific embodiments, and the implementation scope of the present invention is not limited thereto.
如图1所示,点阵DM码(右)与标准DM码(左)有着显著的区别。As shown in Figure 1, the lattice DM code (right) is significantly different from the standard DM code (left).
由于点阵式DM码是由均匀的圆点按照一定的规则组成的,如果按照常规的方法直接对图片进行模糊平滑以及形态学变化,效果很不理想,容易造成过处理以及处理效果不明显。Since the dot-matrix DM code is composed of uniform dots according to certain rules, if the image is directly blurred and smoothed and morphologically changed according to the conventional method, the effect is very unsatisfactory, and it is easy to cause over-processing and the processing effect is not obvious.
[实施例一][Example 1]
本实施例提供了一种点阵式DM二维码图像处理流程和方法,该方法可以通过计算机程序实现或是通过硬件电路实现,具体流程参照图2所示。This embodiment provides a dot-matrix DM two-dimensional code image processing flow and method, which can be realized by computer programs or hardware circuits, and the specific flow is shown in FIG. 2 .
(一)读取图像并统一尺寸(1) Read the image and unify the size
为了方便处理,首先在读取图像后对点阵式二维图像的大小进行统一化,在不改变原图宽高比例的基础上利用最近邻插值算法或双线性插值算法进行宽度统一化,经过试验表明统一化能够使辨识更加精准。For the convenience of processing, firstly, after reading the image, the size of the dot-matrix two-dimensional image is unified, and the width is unified by using the nearest neighbor interpolation algorithm or bilinear interpolation algorithm without changing the width and height ratio of the original image. Experiments show that unification can make identification more accurate.
(二)转换为灰度图(2) Convert to grayscale image
位于便于对图像进行处理,需要将原始采集的图像转换为灰度图像。It is convenient to process the image, and it is necessary to convert the original collected image into a grayscale image.
(三)高斯平滑滤波处理(3) Gaussian smoothing filter processing
由于条码背景的粗糙度影响辨识精确性,而点阵DM码的点阵模块均为实心斑点,平滑对实心点影响不大,所以,为了去除图片的复杂纹理,需要进行模糊平滑化处理。点阵式DM条码对平滑处理的要求不需要太高,通过多种平滑滤波变换的实验比较,发现动态均值滤波与高斯滤波均满足要求。因此本步骤中使用高斯平滑得到自然的平滑效果,不至于太模糊,以使斑点检测的测量更精准稳定。Because the roughness of the barcode background affects the recognition accuracy, and the dot matrix modules of the dot matrix DM code are all solid spots, smoothing has little effect on the solid dots. Therefore, in order to remove the complex texture of the picture, it is necessary to perform blurring and smoothing processing. Dot-matrix DM barcodes do not require too much smoothing. Through the experimental comparison of various smoothing and filtering transformations, it is found that both dynamic mean filtering and Gaussian filtering meet the requirements. Therefore, Gaussian smoothing is used in this step to obtain a natural smoothing effect, which will not be too blurred, so that the measurement of speckle detection is more accurate and stable.
(四)二值化处理(4) Binary processing
图像的二值化处理就是通过选取适当的阈值,将灰度级图像转化为可以反映图像整体结构和局部特征的黑白二值化图像。在点阵式Data Matrix条码图像处理过程中,通过对二值化后的图像进行相应运算,可以比较容易获取目标区域的边界、位置、大小等特征信息,从而为条码图像的分析和识别奠定基础。Image binarization is to convert the grayscale image into a black and white binarized image that can reflect the overall structure and local features of the image by selecting an appropriate threshold. In the process of dot matrix Data Matrix barcode image processing, by performing corresponding operations on the binarized image, it is relatively easy to obtain characteristic information such as the boundary, position, and size of the target area, thereby laying the foundation for the analysis and recognition of barcode images .
首先,用Kittler算法得到全局阈值T,计算该全局阈值T的方法如下:First, use the Kittler algorithm to obtain the global threshold T, and calculate the global threshold T as follows:
其中,f(x,y)是步骤二获得的原始的灰度图,e(x,y)=max{|ex|,|ey|}即梯度最大值,ex=f(x-1,y)-f(x+1,y)是水平方向上的梯度,ey=f(x,y-1)-f(x,y+1)是垂直方向上的梯度;Among them, f(x, y) is the original grayscale image obtained in step 2, e(x, y)=max{|e x |, |e y |} is the maximum value of the gradient, e x =f(x- 1, y)-f(x+1, y) is the gradient on the horizontal direction, e y =f(x, y-1)-f(x, y+1) is the gradient on the vertical direction;
然后,扫描整个f(x,y)灰度图像,则二值化结果为:Then, scan the entire f(x, y) grayscale image, then the binarization result is:
其中b(x,y)为二值化结果。Where b(x, y) is the binarization result.
(五)斑点检测(5) Spot detection
斑点检测(即点阵码元检测)的原理如下:The principle of speckle detection (i.e. dot matrix symbol detection) is as follows:
利用高斯拉普拉斯(Laplace of Guassian,LoG)算子检测图像码元,对于二维高斯函数:Utilize Laplace of Guassian (Laplace of Guassian, LoG) operator to detect image symbol, for two-dimensional Gaussian function:
其中,σ为函数的宽度参数即特征尺度,用于控制函数的径向作用范围,σ越大表示函数的径向越宽,其相似的码元越大,σ越小表示函数的径向越窄,其相似的码元越小,x,y表示二维空间位置,g(x,y,σ)表示二维高斯函数;Among them, σ is the width parameter of the function, that is, the characteristic scale, which is used to control the radial range of the function. The larger the σ, the wider the radial direction of the function, and the larger the similar code elements. The smaller σ, the wider the radial direction of the function. Narrow, its similar symbol is smaller, x, y represent two-dimensional space position, g (x, y, σ) represents two-dimensional Gaussian function;
式(1)的拉普拉斯变换为:The Laplace transform of formula (1) is:
其中,Δ2g表示二维高斯函数的拉普拉斯函数,Δ2表示二阶微分算子,g表示二维高斯函数;Wherein, Δ 2 g represents the Laplace function of the two-dimensional Gaussian function, Δ 2 represents the second-order differential operator, and g represents the two-dimensional Gaussian function;
规范化的高斯拉普拉斯变换为:The normalized Laplace of Gaussian transform is:
式(3)中表示规范化的高斯拉普拉斯函数,其方差为0;In formula (3) Represents the normalized Gaussian Laplacian function with a variance of 0;
式(3)所示的规范化的二维高斯拉普拉斯函数是圆对称函数,通过改变σ的值,检测不同尺寸的二维码码元,而求取得极点值等价于求取下式:The normalized two-dimensional Gaussian Laplace function shown in formula (3) is a circular symmetric function, by changing the value of σ, detecting two-dimensional code elements of different sizes, and obtaining Obtaining the pole value is equivalent to obtaining the following formula:
其中,表示对规范化的高斯拉普拉斯函数求σ的偏导,表示求规范化的高斯拉普拉斯函数的极点值;in, Denotes the normalized Laplacian of Gaussian function Find the partial derivative of σ, Represents the normalized Laplacian of Gaussian function extreme value of
亦即:that is:
r2-2σ2=0r 2 −2σ 2 =0
其中r表示二维码图像二值化的圆形码元的半径,在尺度时,高斯拉普拉斯响应值达到最大,同理,如果图像中的圆形码元黑白反相,那么,该码元的高斯拉普拉斯响应值在尺度为时达到最小,高斯拉普拉斯响应达到峰值时的尺度σ值是码元检测的特征尺度,计算二值化后的图像在不同尺度下的离散拉普拉斯响应值,然后检查位置空间中的每个点,若该点的拉普拉斯响应值都大于或小于其它立方空间邻域的值,那么,该点就是被检测到的二维码数据元素点,上述寻找位置空间和尺度空间的峰值可通过如下函数表示:Where r represents the radius of the circular symbol of the two-dimensional code image binarization, in the scale When , the Laplace of Gaussian response value reaches the maximum. Similarly, if the circular symbol in the image is black and white, then the Laplace of Gaussian response value of the symbol is in the scale of The scale σ value when the Gaussian Laplacian response reaches the peak value is the characteristic scale of symbol detection, calculate the discrete Laplacian response values of the binarized image at different scales, and then check the position space For each point of , if the Laplace response value of this point is greater than or less than the value of other cubic space neighbors, then this point is the detected two-dimensional code data element point, and the above-mentioned search position space and scale space The peak value of can be represented by the following function:
该函数表示同时在空间位置和尺度上拉普拉斯响应达到最大值或最小值的点的取值,该点就是所要检测的码元;其中,t表示尺度值,(x,y)表示空间位置,max minlocal(x,y,t)(·)表示响应函数在空间和尺度位置上的最大值或最小值,arg(·)表示对应函数值的变量的取值,表示在尺度空间下标准二维拉普拉斯函数。This function represents the value of the point where the Laplace response reaches the maximum or minimum value at the same time in the spatial position and scale, and this point is the symbol to be detected; where, t represents the scale value, and (x, y) represents the space position, max minlocal (x, y, t) ( ) indicates the maximum or minimum value of the response function in space and scale position, arg ( ) indicates the value of the variable corresponding to the function value, Represents the standard two-dimensional Laplace function in scale space.
根据以上原理,可以很好地检测到二维码图像的数据元素点及其各个斑点的尺寸,见图3。According to the above principles, the data element points of the two-dimensional code image and the size of each spot can be well detected, as shown in FIG. 3 .
(六)动态滤波及改进的二值化处理(6) Dynamic filtering and improved binarization processing
首先,进行动态滤波处理:First, perform dynamic filtering processing:
(1)模板大小通过下式获得:(1) The template size is obtained by the following formula:
其中round表示取整操作; Among them, round means rounding operation;
(2)计算平均滤波模板:(2) Calculate the average filter template:
其中,k为平均模板的大小,D为点阵码元的直径,ε是平均模板;Wherein, k is the size of the average template, D is the diameter of the lattice symbol, and ε is the average template;
(3)按照下式进行平均滤波:(3) Perform average filtering according to the following formula:
I1(x,y)=ε*I(x,y)I 1 (x, y) = ε*I(x, y)
其中I(x,y)表示灰度图矩阵,I1(x,y)表示滤波后图像灰度矩阵;Wherein I(x, y) represents the grayscale matrix, and I 1 (x, y) represents the grayscale matrix of the filtered image;
然后,进行改进的二值化处理:Then, an improved binarization is performed:
本方法的二值化算法选用了kittler算法与改进的Bernsen算法相结合的二值化算法,针对于点阵式二维码点模块相对于平滑,背景纹理相似的特点,可以很好的忽略不必要的背景细节,同时对光照不均匀的图片有很好的处理效果。首先根据Kittler的简单统计算法找到图像发生光照不均的区域,然后改进Bernsen算法的处理过程、调整参数、削弱原算法的伪影问题,并用改进后的算法处理图像光照不均的部分。该算法具有良好的稳定性和自适应性,可以明显提高二维条码的二值化效果和识别率。The binarization algorithm of this method selects the binarization algorithm that combines the Kittler algorithm and the improved Bernsen algorithm. For the characteristics of the dot matrix two-dimensional code point module being relatively smooth and similar to the background texture, it can be well ignored. Necessary background detail, while handling images with uneven lighting. First, according to Kittler's simple statistical algorithm, find the area where the image has uneven illumination, and then improve the processing process of Bernsen algorithm, adjust the parameters, weaken the artifact problem of the original algorithm, and use the improved algorithm to deal with the uneven illumination of the image. The algorithm has good stability and adaptability, and can significantly improve the binarization effect and recognition rate of two-dimensional barcodes.
kittler算法与改进的Bernsen算法相结合的二值化处理方法如下:The binarization processing method combining Kittler algorithm and improved Bernsen algorithm is as follows:
步骤(1)用Kittler算法得到全局阈值T,计算该全局阈值T的方法如下:Step (1) Use the Kittler algorithm to obtain the global threshold T, and the method for calculating the global threshold T is as follows:
其中,f(x,y)是步骤二获得的原始的灰度图,e(x,y)=max{|ex|,|ey|}即梯度最大值,ex=f(x-1,y)-f(x+1,y)是水平方向上的梯度,ey=f(x,y-1)-f(x,y+1)是垂直方向上的梯度;Among them, f(x, y) is the original grayscale image obtained in step 2, e(x, y)=max{|e x |, |e y |} is the maximum value of the gradient, e x =f(x- 1, y)-f(x+1, y) is the gradient on the horizontal direction, e y =f(x, y-1)-f(x, y+1) is the gradient on the vertical direction;
步骤(2)采用Bernsen算法对图像直方图中光照不均的区间进行处理,该类区间的灰度值集中在步骤(1)得到的全局阈值T附近,Step (2) uses the Bernsen algorithm to process the interval of uneven illumination in the image histogram, and the gray value of this type of interval is concentrated near the global threshold T obtained in step (1).
如果T3>D,D是Bernsen算法处理的区间宽度即点阵码元的直径If T 3 >D, D is the interval width processed by the Bernsen algorithm, that is, the diameter of the lattice symbol
则二值化结果 Then the binarization result
如果T3<D,D是Bernsen算法处理的区间宽度即点阵码元的直径If T 3 <D, D is the interval width processed by the Bernsen algorithm, that is, the diameter of the lattice symbol
则二值化结果 Then the binarization result
其中,in,
T3是阈值选择依据且T3(x,y)=maxs-mins,T 3 is the threshold selection basis and T 3 (x, y)=max s -min s ,
T2(x,y)=0.5(maxd+mind),T 2 (x,y)=0.5(max d +min d ),
T4(x,y)=0.5(T+T2(x,y));T 4 (x,y)=0.5(T+T 2 (x,y));
其中,in,
maxd表示像素点(x,y)在大小为4w*4w的窗口中最大像素值; max d indicates the maximum pixel value of a pixel point (x, y) in a window with a size of 4w*4w;
表示像素点(x,y)在大小为4w*4w的较大窗口中最小像素值; Indicates the minimum pixel value of a pixel point (x, y) in a larger window with a size of 4w*4w;
表示像素点(x,y)在大小为2w*2w的较小窗口中最大像素值; Indicates the maximum pixel value of a pixel point (x, y) in a smaller window with a size of 2w*2w;
表示像素点(x,y)在大小为2w*2w的较小窗口中最小像素值; Indicates the minimum pixel value of a pixel point (x, y) in a smaller window with a size of 2w*2w;
上述式中的max表示取窗口内像素的最大值,min表示取窗口内像素的最小值,k和l均为整数,分别表示坐标x、y方向上的增量;w表示局部阈值运算的窗口,w取值范围为5~9,T2表示窗口内像素灰度平均值,T4是T2与全局阈值T的平均值。In the above formula, max means to take the maximum value of the pixels in the window, min means to take the minimum value of the pixels in the window, k and l are both integers, and represent the increments in the coordinate x and y directions respectively; w represents the window of the local threshold operation , w ranges from 5 to 9, T 2 represents the average gray level of pixels in the window, and T 4 is the average value of T 2 and the global threshold T.
(七)进行开、闭运算,获得点阵图像(7) Perform opening and closing operations to obtain a dot matrix image
点阵式DM码是由点模块构成的,为了变为可识别的标准DM码,需要将点阵模块变为块状结构,就用到了形态学变换上开、闭运算,开、闭运算是膨胀与腐蚀的组合形式。The dot matrix DM code is composed of point modules. In order to become a recognizable standard DM code, the dot matrix module needs to be changed into a block structure, which uses the opening and closing operations on the morphological transformation. The opening and closing operations are A combination of dilation and erosion.
其中,A被B膨胀,记为定义为:Among them, A is expanded by B, denoted as defined as:
其中,A被B腐蚀,记为AΘB,定义为:Among them, A is corroded by B, denoted as AΘB, defined as:
AΘB={z|(B)z∩Ac≠Φ}AΘB={z|(B) z ∩A c ≠Φ}
A被B的形态学开运算可以记做AοB,这种运算是A被B腐蚀后再用B来膨胀腐蚀的结果:The morphological opening operation of A by B can be recorded as AοB. This operation is the result of A being corroded by B and then dilated and corroded by B:
A被B的形态学闭运算可以记做A·B,这种运算是A被B膨胀后再用B来腐蚀膨胀的结果:The morphological closing operation of A by B can be recorded as A·B. This operation is the result of A being expanded by B and then corroded and expanded by B:
在本方法中,A为输入的二值图像,B为正方形结构元素。In this method, A is the input binary image, and B is the square structure element.
开运算可以使图像的轮廓变得光滑,还能使狭窄的连接断开和消除毛刺,但与腐蚀不同的是图像大的轮廓并没有发生整体的收缩,物体位置也没有发生任何变化。闭运算同样可以使轮廓变得光滑,但与开运算相反,它通常能够弥合狭窄的间断,填充小的空洞。如图4为开运算和闭运算的示意图。因此将开运算与闭运算运用在DM二维码标准化上,可以去掉二值化后的杂散点与一些毛刺。大量实验总结可得,用斑点检测得到的斑点尺寸(即点阵码元直径)的三分之一的方形结构元素进行开运算,去除杂散点与毛刺。用稍小于斑点尺寸(即点阵码元直径)1至5个显示像素点的方形结构元素进行闭运算,使点模块变为近似块状结构,使其“L”形边界清晰可见。The opening operation can smooth the outline of the image, and can also disconnect narrow connections and eliminate burrs. However, unlike corrosion, the large outline of the image does not shrink as a whole, and the position of the object does not change. The closing operation can also smooth the contour, but in contrast to the opening operation, it is usually able to bridge narrow gaps and fill small holes. Figure 4 is a schematic diagram of the opening operation and the closing operation. Therefore, applying the opening operation and closing operation to the standardization of the DM two-dimensional code can remove the stray points and some glitches after binarization. It can be concluded from a large number of experiments that the opening operation is performed on square structural elements that are one-third the size of the spots (ie, the diameter of the lattice symbol) obtained by spot detection to remove stray points and burrs. The closed operation is performed with a square structure element slightly smaller than the spot size (that is, the diameter of the dot matrix symbol) of 1 to 5 display pixels, so that the dot module becomes an approximate block structure, and its "L" shaped boundary is clearly visible.
(八)开、闭运算后进行中值滤波处理,转化为标准二维码图像(8) Perform median filter processing after opening and closing operations, and convert it into a standard two-dimensional code image
中值滤波去噪处理优选为通过以下方式实现:The median filter denoising process is preferably implemented in the following manner:
把图像中一点的值用该点的一个邻域中各点值的中值代替,让周围的像素值接近真实值,从而消除孤立的噪声点,其中二维中值滤波输出通过下式获得:The value of a point in the image is replaced by the median value of each point value in a neighborhood of the point, so that the surrounding pixel values are close to the real value, thereby eliminating isolated noise points, and the output of the two-dimensional median filter is obtained by the following formula:
g(x,y)=med{f(x-k,y-1),(k,l∈W)}g(x,y)=med{f(x-k,y-1),(k,l∈W)}
其中,med{}表示取数组序列的中间值;f(x,y),g(x,y)分别为原始图像和处理后图像;W为3×3大小的二维模板;k,1均为整数,分别表示坐标x、y方向上的增量。Among them, med{} means to take the intermediate value of the array sequence; f(x, y), g(x, y) are the original image and the processed image respectively; W is a two-dimensional template with a size of 3×3; k, 1 mean is an integer, representing the increment in the coordinate x and y directions respectively.
转变为标准DM二维码图像后的效果如图5所示。The effect after converting to a standard DM two-dimensional code image is shown in Figure 5.
[实施例二][Example 2]
本发明还提供了一种功能模块架构的软件虚拟装置,其包括以下结构:The present invention also provides a software virtual device with a functional module architecture, which includes the following structure:
一种点阵式DM二维码图像处理装置,包括:A dot-matrix DM two-dimensional code image processing device, comprising:
图像读取模块,用于读取点阵式DM二维码图像,在不改变原点阵式DM二维码图像宽高比例的基础上,利用最近邻插值算法或双线性插值算法进行宽度统一化处理;The image reading module is used to read the dot-matrix DM two-dimensional code image. On the basis of not changing the width-to-height ratio of the original dot-matrix DM two-dimensional code image, the width is unified by using the nearest neighbor interpolation algorithm or bilinear interpolation algorithm treatment;
灰度转换模块,用于将统一尺寸后的图像转换为灰度图;A grayscale conversion module, used to convert the image of uniform size into a grayscale image;
高斯平滑滤波模块,用于对灰度化后的图像进行高斯平滑滤波处理,去除图像背景的细小纹理,使点阵码元的实心点更加平滑;The Gaussian smoothing filter module is used to carry out Gaussian smoothing filter processing to the image after the gray scale, removes the small texture of the image background, and makes the solid point of the lattice code element smoother;
二值化转换模块,用于将高斯平滑滤波后的灰度级图像转化为黑白二值化图像;The binarization conversion module is used to convert the grayscale image after Gaussian smoothing filter into a black and white binarized image;
码元检测模块,用于对二值化转换模块中二值化后的图像进行码元检测,得到点阵式码元的直径;The code element detection module is used to carry out code element detection to the binarized image in the binarization conversion module to obtain the diameter of the dot matrix code element;
动态均值滤波及二值化转换模块,用于根据码元检测模块获得的点阵码元的直径大小而动态的改变平均模板的大小,进而对灰度转换模块获得的灰度图进行动态均值滤波处理,对动态均值滤波后的灰度图再进行kittler算法与Bernsen算法相结合的改进的二值化处理:The dynamic mean filtering and binarization conversion module is used to dynamically change the size of the average template according to the diameter of the lattice symbol obtained by the symbol detection module, and then perform dynamic mean filtering on the grayscale image obtained by the grayscale conversion module Processing, the grayscale image after the dynamic mean filter is then subjected to an improved binarization process combining the kittler algorithm and the Bernsen algorithm:
运算操作模块,用于将动态均值滤波及二值化转换模块获得的二值化图像进行形态学的开运算和闭运算操作,得到处理后的点阵图像,其中,The operation operation module is used to perform morphological opening and closing operations on the binarized image obtained by the dynamic mean filtering and binarization conversion module to obtain a processed bitmap image, wherein,
开运算用下式表示:The opening operation is represented by the following formula:
闭运算用下式表示:The closing operation is represented by the following formula:
其中A为输入的二值图像;B为正方形结构元素;Where A is the input binary image; B is the square structure element;
标准化模块,用于将运算操作模块获得的点阵图像通过中值滤波去噪处理,转变为可识别的块状结构的标准DM二维码图像。The standardization module is used to transform the dot matrix image obtained by the operation module into a standard DM two-dimensional code image with a recognizable block structure through median filtering and denoising processing.
当然,上述功能模块架构的产品也能通过真实的硬件电路实现。Of course, the products with the above-mentioned functional module architecture can also be realized through real hardware circuits.
本发明中所提到的点阵斑点也被称为点阵码元,斑点和码元属于同一概念。The lattice spots mentioned in the present invention are also called lattice symbols, and the spots and symbols belong to the same concept.
基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.
Claims (2)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410674241.4A CN104463795B (en) | 2014-11-21 | 2014-11-21 | A kind of dot matrix DM image in 2 D code processing method and processing device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410674241.4A CN104463795B (en) | 2014-11-21 | 2014-11-21 | A kind of dot matrix DM image in 2 D code processing method and processing device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104463795A CN104463795A (en) | 2015-03-25 |
CN104463795B true CN104463795B (en) | 2017-03-01 |
Family
ID=52909783
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410674241.4A Expired - Fee Related CN104463795B (en) | 2014-11-21 | 2014-11-21 | A kind of dot matrix DM image in 2 D code processing method and processing device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104463795B (en) |
Families Citing this family (20)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2017113290A1 (en) * | 2015-12-31 | 2017-07-06 | 深圳配天智能技术研究院有限公司 | Method and device for positioning one-dimensional code |
CN106960427A (en) * | 2016-01-11 | 2017-07-18 | 中兴通讯股份有限公司 | The method and apparatus of image in 2 D code processing |
CN105609008A (en) * | 2016-02-05 | 2016-05-25 | 中国科学院理化技术研究所 | Control system and control method based on two-dimensional code image |
CN105938556B (en) * | 2016-04-22 | 2020-07-28 | 复旦大学 | Wide-line detection method based on water flow method |
CN106875357A (en) * | 2017-01-26 | 2017-06-20 | 上海正雅齿科科技有限公司 | Image in 2 D code processing method |
CN107169977B (en) * | 2017-04-24 | 2020-08-18 | 华南理工大学 | Self-adaptive threshold color image edge detection method based on FPGA and Kirsch |
CN108109120B (en) * | 2017-12-18 | 2020-09-08 | 凌云光技术集团有限责任公司 | Illumination compensation method and device for dot matrix two-dimensional code |
CN108491796B (en) * | 2018-03-22 | 2021-10-22 | 电子科技大学 | A Time Domain Periodic Point Target Detection Method |
CN108647550B (en) * | 2018-04-11 | 2021-07-16 | 中山大学 | A method and system for fuzzy clustering recognition of two-dimensional code based on machine learning |
CN110046528B (en) * | 2018-11-20 | 2022-10-28 | 维库(厦门)信息技术有限公司 | Dot-shaped DataMatrix two-dimensional code identification method |
CN109766656B (en) * | 2019-01-25 | 2021-03-09 | 北京航空航天大学 | A Gradient Lattice Structure Design Method Based on Topology Optimization |
CN110009615B (en) * | 2019-03-31 | 2020-06-19 | 深圳大学 | Image corner detection method and detection device |
CN110349189A (en) * | 2019-05-31 | 2019-10-18 | 广州铁路职业技术学院(广州铁路机械学校) | A kind of background image update method based on continuous inter-frame difference |
CN110287752B (en) * | 2019-06-25 | 2023-04-14 | 北京慧眼智行科技有限公司 | Lattice code detection method and device |
CN110276226A (en) * | 2019-06-26 | 2019-09-24 | 北京慧眼智行科技有限公司 | A kind of dot matrix code detection method and system |
CN110348267A (en) * | 2019-07-19 | 2019-10-18 | 北京慧眼智行科技有限公司 | A kind of horizontal and vertical parity check code detection localization method and device |
CN111553317B (en) * | 2020-05-14 | 2023-08-08 | 北京惠朗时代科技有限公司 | Anti-fake code acquisition method and device, computer equipment and storage medium |
CN112562021B (en) * | 2020-12-26 | 2023-05-23 | 苏州斯普锐智能系统股份有限公司 | Image filter processing method for bar code |
CN113034481A (en) * | 2021-04-02 | 2021-06-25 | 广州绿怡信息科技有限公司 | Equipment image blur detection method and device |
CN115829848A (en) * | 2022-07-22 | 2023-03-21 | 宁德时代新能源科技股份有限公司 | Method, apparatus and computer-readable storage medium for processing graphic symbols |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6606421B1 (en) * | 2000-05-25 | 2003-08-12 | Hewlett-Packard Development Company, L.P. | Geometric deformation correction method and system for dot pattern images |
CN1472704A (en) * | 2003-06-27 | 2004-02-04 | 上海龙贝信息科技有限公司 | Strengthening method for two-dimensional barcode digital image information |
CN103383738A (en) * | 2012-05-03 | 2013-11-06 | 香港科技大学 | 2D barcodes with embedded visual information |
CN103824257A (en) * | 2012-11-16 | 2014-05-28 | 无锡汉兴电子有限公司 | Two-dimensional code image preprocessing method |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
DE10141876A1 (en) * | 2001-08-28 | 2003-03-20 | Sick Ag | Code recognition method |
JP2013055472A (en) * | 2011-09-02 | 2013-03-21 | Sony Corp | Image processor, image processing method and program |
-
2014
- 2014-11-21 CN CN201410674241.4A patent/CN104463795B/en not_active Expired - Fee Related
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6606421B1 (en) * | 2000-05-25 | 2003-08-12 | Hewlett-Packard Development Company, L.P. | Geometric deformation correction method and system for dot pattern images |
CN1472704A (en) * | 2003-06-27 | 2004-02-04 | 上海龙贝信息科技有限公司 | Strengthening method for two-dimensional barcode digital image information |
CN103383738A (en) * | 2012-05-03 | 2013-11-06 | 香港科技大学 | 2D barcodes with embedded visual information |
CN103824257A (en) * | 2012-11-16 | 2014-05-28 | 无锡汉兴电子有限公司 | Two-dimensional code image preprocessing method |
Non-Patent Citations (2)
Title |
---|
《Data Matrix二维条码图像识别的算法研究与实现》;李雅静;《万方学位论文》;20100319;第三章和第四章 * |
《一种新的二维条码图像二值化算法》;杨硕等;《昆明理工大学学报(自然科学版)》;20080520;第33卷(第1期);摘要和第1节 * |
Also Published As
Publication number | Publication date |
---|---|
CN104463795A (en) | 2015-03-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104463795B (en) | A kind of dot matrix DM image in 2 D code processing method and processing device | |
CN105069394B (en) | Quick Response Code weighted average gray level method coding/decoding method and system | |
CN106446952B (en) | A kind of musical score image recognition methods and device | |
CN104636706B (en) | One kind is based on gradient direction uniformity complex background bar code image automatic division method | |
Wei et al. | Tensor voting guided mesh denoising | |
US8509536B2 (en) | Character recognition device and method and computer-readable medium controlling the same | |
CN101710425B (en) | Self-adaptive pre-segmentation method based on gray scale and gradient of image and gray scale statistic histogram | |
CN102902945A (en) | Distortion correction method of outer contour based on quick response matrix code | |
CN102750556A (en) | Off-line handwritten form Chinese character recognition method | |
CN110647795A (en) | Form recognition method | |
CN111899270A (en) | Card frame detection method, device and equipment and readable storage medium | |
CN104573674A (en) | 1D (one-dimensional) barcode recognition for real-time embedded system | |
CN110348264A (en) | A kind of QR image in 2 D code bearing calibration and system | |
CN107577979A (en) | DataMatrix type Quick Response Codes method for quickly identifying, device and electronic equipment | |
CN103810716A (en) | Image segmentation method based on grey scale flitting and Renyi entropy | |
CN109741273A (en) | A kind of mobile phone photograph low-quality images automatically process and methods of marking | |
CN114529715B (en) | Image identification method and system based on edge extraction | |
Bodnár et al. | A novel method for barcode localization in image domain | |
CN112508017A (en) | Intelligent digital display instrument reading identification method, system, processing equipment and storage medium | |
JP5201184B2 (en) | Image processing apparatus and program | |
CN104346596A (en) | Identification method and identification device for QR (Quick Response) code | |
CN111429437B (en) | Object Detection-Oriented Image No-Reference Sharpness Quality Detection Method | |
US10115195B2 (en) | Method and apparatus for processing block to be processed of urine sediment image | |
CN110570450B (en) | Target tracking method based on cascade context-aware framework | |
CN109815791B (en) | Blood vessel-based identity recognition method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
C41 | Transfer of patent application or patent right or utility model | ||
TR01 | Transfer of patent right |
Effective date of registration: 20170228 Address after: 050031 Hebei Province, Yuhua District, prosperous street, No. 131, North University of science and Technology Park, layer 1204, 12, Patentee after: Hebei nine degrees Software Technology Co.,Ltd. Address before: 050071 Shijiazhuang Province, Xinhua District, Heping West Road, press and Publication Bureau dormitory News Building, unit 15, unit 202, 1 Patentee before: Gao Tao |
|
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20210521 Address after: 050000 Room 302, unit 4, building 6, 108 Huaizhong Road, Qiaoxi District, Shijiazhuang City, Hebei Province Patentee after: Yuan Chong Address before: 050031 1204, 12th floor, Beida Science Park, 131 Fuqiang street, Yuhua District, Shijiazhuang City, Hebei Province Patentee before: Hebei nine degrees Software Technology Co.,Ltd. |
|
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20170301 |