CN107063458B - Ceramic tile coloration piecemeal detection method based on machine vision - Google Patents

Ceramic tile coloration piecemeal detection method based on machine vision Download PDF

Info

Publication number
CN107063458B
CN107063458B CN201611060933.5A CN201611060933A CN107063458B CN 107063458 B CN107063458 B CN 107063458B CN 201611060933 A CN201611060933 A CN 201611060933A CN 107063458 B CN107063458 B CN 107063458B
Authority
CN
China
Prior art keywords
tile
block
image
color
mask
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201611060933.5A
Other languages
Chinese (zh)
Other versions
CN107063458A (en
Inventor
李俊
杨林杰
吴拱星
高银
庄加福
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Quanzhou Institute of Equipment Manufacturing
Original Assignee
Quanzhou Institute of Equipment Manufacturing
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 Quanzhou Institute of Equipment Manufacturing filed Critical Quanzhou Institute of Equipment Manufacturing
Priority to CN201611060933.5A priority Critical patent/CN107063458B/en
Publication of CN107063458A publication Critical patent/CN107063458A/en
Application granted granted Critical
Publication of CN107063458B publication Critical patent/CN107063458B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01JMEASUREMENT OF INTENSITY, VELOCITY, SPECTRAL CONTENT, POLARISATION, PHASE OR PULSE CHARACTERISTICS OF INFRARED, VISIBLE OR ULTRAVIOLET LIGHT; COLORIMETRY; RADIATION PYROMETRY
    • G01J3/00Spectrometry; Spectrophotometry; Monochromators; Measuring colours
    • G01J3/46Measurement of colour; Colour measuring devices, e.g. colorimeters
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01JMEASUREMENT OF INTENSITY, VELOCITY, SPECTRAL CONTENT, POLARISATION, PHASE OR PULSE CHARACTERISTICS OF INFRARED, VISIBLE OR ULTRAVIOLET LIGHT; COLORIMETRY; RADIATION PYROMETRY
    • G01J3/00Spectrometry; Spectrophotometry; Monochromators; Measuring colours
    • G01J3/46Measurement of colour; Colour measuring devices, e.g. colorimeters
    • G01J2003/467Colour computing

Landscapes

  • Physics & Mathematics (AREA)
  • Spectroscopy & Molecular Physics (AREA)
  • General Physics & Mathematics (AREA)
  • Image Analysis (AREA)

Abstract

本发明公开基于机器视觉的瓷砖色度分块检测方法,包括:步骤1、图像采集与定位;步骤2、图像位姿矫正:采用基于ROI图像斜外接矩对角线进行几何变换,以矫正瓷砖位姿;步骤3、图像分块:采用横竖分块策略将步骤2校正后的ROI图像均匀分割成测试模块,测试模块为最小ROI图像;步骤4、复合掩模:采用复合逻辑运算方法对分割后的测试模块进行掩模处理;步骤5、色差检测将掩模处理后的测试模块转换到HSV颜色空间,生成颜色特征并与标准值对比,判别出瓷砖是否存在色彩缺陷。本发明结合仿射变换、分块处理、复合掩膜、颜色空间、特征提取技术,完成瓷砖的视觉色差检测,该检测表现良好,解决了无法真实表征瓷砖固有的颜色色差检测问题。

The invention discloses a tile chromaticity block detection method based on machine vision, including: step 1, image acquisition and positioning; step 2, image pose correction: geometric transformation is performed based on the oblique circumscribed moment diagonal of the ROI image to correct the tiles Pose; step 3, image segmentation: use the horizontal and vertical segmentation strategy to evenly divide the ROI image corrected in step 2 into test modules, and the test module is the smallest ROI image; step 4, composite mask: use composite logic operations to segment The masked test module is processed; step 5, color difference detection, the masked test module is converted to the HSV color space, and the color feature is generated and compared with the standard value to determine whether there is a color defect in the tile. The invention combines affine transformation, block processing, composite mask, color space, and feature extraction technology to complete the visual color difference detection of ceramic tiles. The detection performance is good, and the problem of inability to truly represent the inherent color color difference detection of ceramic tiles is solved.

Description

基于机器视觉的瓷砖色度分块检测方法Chromatic block detection method of ceramic tiles based on machine vision

技术领域technical field

本发明涉及一种基于机器视觉的瓷砖色度分块检测方法。The invention relates to a machine vision-based tile chromaticity block detection method.

背景技术Background technique

目前工业生产过程中,瓷砖色差检测主要是有人工肉眼观察完成,该方法劳动强度大,受主观因素的影响,人工成逐渐提高,已不能满足现代自动化生产的需要;也有利用色度检测仪进行瓷砖色差检测的相关方法,如速度检测仪主要依靠水平导轨结构移动对目标进行扫描,扫描速度较慢且色度检测过分依赖生产厂商颜色制式,难以根据实际的产品颜色进行改变与适应;基于视觉的瓷砖色差检测的方法现在也比较多,但是所提出方法的存在较大的局限性,主要表现在下列几点:At present, in the process of industrial production, the color difference detection of tiles is mainly completed by manual naked eye observation. This method is labor-intensive. Affected by subjective factors, the artificial cost is gradually increased, which can no longer meet the needs of modern automated production; there are also color detectors. The related methods of ceramic tile color difference detection, such as the speed detector mainly rely on the movement of the horizontal guide rail structure to scan the target, the scanning speed is relatively slow and the chromaticity detection relies too much on the manufacturer's color system, it is difficult to change and adapt to the actual product color; based on vision There are many methods for tile color difference detection, but the proposed method has great limitations, mainly in the following points:

(1)在瓷砖检测前,需要对检测瓷砖进行精确的定位,以统计瓷砖的颜色特征信息,但是仍然无法辨别边缘邻域像素级的干扰特征,从而在进行颜色特征时,不可避免带入环境因素的影响;(1) Before the tile detection, it is necessary to accurately locate the detected tiles to count the color feature information of the tiles, but it is still impossible to distinguish the pixel-level interference features of the edge neighborhood, so when performing color features, it will inevitably be brought into the environment influence of factors;

(2)统计主要是基于全局信息进行颜色特征统计,该特征对局部颜色变换的感知能力很小,即全局信息统计会稀释掉局部色差变换的表现能力,因此色差检测的精度与准确度都会受到影响;(2) Statistics are mainly based on global information for color feature statistics. This feature has little perception of local color transformation, that is, global information statistics will dilute the performance of local color difference transformation, so the accuracy and accuracy of color difference detection will be affected. influences;

(3)颜色空间的选取对色差检测会产生很大的影响,目前还没有通用的颜色空间被所有的产品色差检测采用,只是根据产品的实际需求进行选择。基于目前瓷砖色差检测行业的现状与工程应用背景,本专利提出了一种基于分块复合掩膜色度偏差检测算法。(3) The selection of color space will have a great impact on the color difference detection. At present, there is no general color space used by all product color difference detection, and it is only selected according to the actual needs of the product. Based on the current situation and engineering application background of the ceramic tile color difference detection industry, this patent proposes a color difference detection algorithm based on block-based composite masks.

发明内容Contents of the invention

本发明为解决上述问题,提供了一种基于机器视觉的瓷砖色度分块检测方法,结合仿射变换、分块处理、复合掩膜、颜色空间、特征提取技术,完成瓷砖的视觉色差检测,该检测表现良好,解决了传统检测方法因局限性与缺陷无法真实表征瓷砖固有的颜色色差检测问题。In order to solve the above problems, the present invention provides a tile chromaticity block detection method based on machine vision, which combines affine transformation, block processing, composite mask, color space, and feature extraction technology to complete the visual color difference detection of tiles. The detection performed well, and solved the problem that the traditional detection method could not truly represent the inherent color and color difference detection of tiles due to limitations and defects.

为实现上述目的,本发明采用的技术方案为:To achieve the above object, the technical solution adopted in the present invention is:

基于机器视觉的瓷砖色度分块检测方法,包括以下步骤:The tile chromaticity block detection method based on machine vision comprises the following steps:

步骤1、图像采集与定位Step 1. Image acquisition and positioning

通过彩色相机对瓷砖图像进行采集,再通过瓷砖定位算法将仅含有瓷砖的ROI图像分割出来,将其作为独立的处理单元进行后续处理,所述ROI图像即包含整块瓷砖边界区域的图像;The tile image is collected by a color camera, and then the ROI image containing only the tile is segmented through the tile positioning algorithm, and it is used as an independent processing unit for subsequent processing, and the ROI image includes the image of the boundary area of the entire tile;

步骤2、图像位姿矫正Step 2. Image pose correction

采用基于ROI图像斜外接矩对角线为基准进行几何变换,以矫正瓷砖位姿;Use the oblique circumscribed moment diagonal of the ROI image as the reference for geometric transformation to correct the tile pose;

步骤3、图像分块Step 3, image segmentation

采用横竖分块策略将步骤2校正后的ROI图像均匀分割成测试模块,测试模块为最小ROI图像;Use the horizontal and vertical block strategy to evenly divide the ROI image corrected in step 2 into test modules, and the test module is the smallest ROI image;

步骤4、复合掩模Step 4. Composite mask

采用复合逻辑运算方法对分割后的测试模块进行掩模处理;Mask processing is performed on the divided test modules by using a compound logic operation method;

步骤5、色差检测Step 5, color difference detection

将掩模处理后的测试模块转换到HSV颜色空间,生成颜色特征并与标准值对比,判别出瓷砖是否存在色彩缺陷。Convert the masked test module to the HSV color space, generate color features and compare them with standard values to determine whether there are color defects in the tiles.

所述步骤1具体包括以下步骤:Described step 1 specifically comprises the following steps:

步骤11,通过高速线阵CCD相机采集图像;Step 11, collecting images by a high-speed linear array CCD camera;

步骤12,先灰度化图像,再进行滤波去噪处理,对滤波图采用边缘检测算法分割,再提取小瓷砖轮廓,得瓷砖轮廓图;Step 12, grayscale the image first, then perform filtering and denoising processing, segment the filtered image using an edge detection algorithm, and then extract the outline of small tiles to obtain a tile outline image;

步骤13,基于步骤12的轮廓图中瓷砖轮廓的几何特性生成相应的基元特征,基元特征包括宽度、高度和完整度;利用瓷砖自身的颜色特性生成相应的HSV颜色空间特征,HSV颜色空间特征包括色调和饱和度,然后将基元特征与颜色特征构造成定位组合特征,共同完成瓷砖的定位;Step 13, based on the geometric characteristics of the tile outline in step 12, corresponding primitive features are generated, and the primitive features include width, height and integrity; the corresponding HSV color space features are generated using the color characteristics of the tile itself, and the HSV color space The features include hue and saturation, and then the primitive features and color features are constructed into a positioning combination feature to jointly complete the positioning of the tiles;

步骤14,针对定位后的瓷砖图像,以瓷砖轮廓的外接矩形的角点为基准生成对应的ROI图像。Step 14, for the positioned tile image, a corresponding ROI image is generated based on the corner points of the circumscribed rectangle of the tile outline.

将ROI图像进行所述步骤2几何变换,公式为:The ROI image is carried out to the step 2 geometric transformation, the formula is:

式中,θc是几何变换的旋转角度,Δx,Δy为矫正平移,[x、y 1]为变换前坐标,[x1y1 1]为变换后的坐标。In the formula, θ c is the rotation angle of the geometric transformation, Δx, Δy are the correction translations, [x, y 1] are the coordinates before transformation, and [x 1 y 1 1] are the coordinates after transformation.

所述步骤3具体包括以下步骤:Described step 3 specifically comprises the following steps:

步骤31:将矫正后的图像重新进行轮廓提取,获取紧贴瓷砖目标的最小ROI图像,以该图像原点为分块的起点,初始化分块步长,分块步长的定义为:Step 31: Re-extract the contour of the rectified image to obtain the smallest ROI image that is close to the tile target, and use the origin of the image as the starting point of the block to initialize the block step size. The block step size is defined as:

Stepx与Stepy是计算后取的整数,Scale为步长计算的尺度系数; Step x and Step y are integers after calculation, and Scale is the scale coefficient for step calculation;

步骤32以矫正后最小ROI图像原点作为分块起点,然后分别在横向与纵向以其对应的步长进行块划分,完成整个瓷砖的划分步骤。Step 32 takes the origin of the corrected minimum ROI image as the starting point of block division, and then performs block division in horizontal and vertical directions with corresponding step lengths respectively, and completes the division step of the entire tile.

所述步骤32划分方式为:The step 32 is divided into:

将最小ROI图像分为中间的0区,0区左右两侧的1区和上下两侧的2区以及1区与2区交叉的3区,边界条件分为4种区域,采用如下的g(i,j)作为边界条件的判别函数,进行解析:Divide the minimum ROI image into Zone 0 in the middle, Zone 1 on the left and right sides of Zone 0, Zone 2 on the upper and lower sides, and Zone 3 intersecting Zone 1 and Zone 2. The boundary conditions are divided into 4 types of zones, and the following g( i, j) as the discriminant function of the boundary conditions, to analyze:

该判别函数表示为:The discriminant function is expressed as:

若g(i,j)=1,代表在分块遍历过程当中发生横向越界,处于临界区域的分块大小宽度的范围为[i,Width];If g(i,j)=1, it means that a horizontal cross-border occurs during the block traversal process, and the range of the block size width in the critical area is [i, Width];

若g(i,j)=2,代表在分块遍历过程当中发生纵向越界,处于临界区域的分块大小高度的范围为[j,Height];If g(i, j) = 2, it means that a vertical cross-border occurs during the block traversal process, and the range of the block size height in the critical area is [j, Height];

若g(i,j)=3,代表在分块遍历过程当中同时发生横纵向越界,处于临界区域的分块大小宽度和高度的范围分别为[i,Width]与[j,Height];If g(i, j) = 3, it means that horizontal and vertical cross-borders occur simultaneously during the block traversal process, and the ranges of the block size width and height in the critical area are [i, Width] and [j, Height] respectively;

若g(i,j)=0,代表在分块遍历过程当中没有发生越界,宽度和高度的范围分别为[i,i+Stepx];与[j,j+Stepy];If g(i, j) = 0, it means that there is no cross-border during the block traversal process, and the ranges of width and height are [i, i+Step x ]; and [j, j+Step y ];

且定义:当g(i,j)={1,2,3}时,划分的区域为外部分块,g(i,j)=0时的区域为内部分块,内部分块为不需要进行像素判别处理的部分,外部分块才需要判别处理为需要进行像素判别处理的部分。And define: when g(i,j)={1,2,3}, the divided area is the outer block, the area when g(i,j)=0 is the inner block, and the inner block is unnecessary For the part where the pixel discrimination process is performed, only the outer blocks need to be discriminated.

所述步骤4具体包括以下步骤:Described step 4 specifically comprises the following steps:

步骤41:初始化两幅与分割ROI大小相同且像素值为0的图像,分别作为瓷砖复合掩膜的母体,记为M1,M2;Step 41: Initialize two images with the same size as the segmented ROI and with a pixel value of 0, respectively as the matrix of the composite tile mask, denoted as M1 and M2;

步骤42:将瓷砖分块步骤中矫正轮廓以像素精度分别画在M1,M2掩膜图像中,填充掩膜母体轮廓内部与外部区域;即在M1图像轮廓内部填充像素为RGB(255,255,255),外部为RGB(0,0,0);M2内、外部填充像素为RGB(255,255,255)与RGB(255,0,0);Step 42: Draw the corrected outline in the tile block step in the M1 and M2 mask images with pixel precision, and fill the inner and outer areas of the mask parent outline; that is, fill the pixels inside the M1 image outline as RGB (255, 255, 255), the outside is RGB(0,0,0); the inner and outer filling pixels of M2 are RGB(255,255,255) and RGB(255,0,0);

步骤43:将位姿矫正后的图像分别与复合掩膜图像M1,M2作逻辑与运算,得到处理后的掩膜感兴趣区域图像I1与I2,内掩膜与矫正图像处理后使瓷砖轮廓内部的图像得以全部保留,外部的背景色分别为黑色与红色。Step 43: Perform logical AND operations on the pose-corrected image and the composite mask images M1 and M2 respectively to obtain the processed mask ROI images I1 and I2. After processing the inner mask and the corrected image, the inside of the tile outline The images of are all preserved, and the external background colors are black and red respectively.

步骤44:在瓷砖分块步骤中的g(i,j)={1,2,3}时,分块处于临界边界值,由于无法保证瓷砖的边与分割ROI图像的完全重合,需进行瓷砖内外部像素的判别处理,判别规则为:若处于边界分块中的像素在I1与I2中的值同时满足I1(i,j)=RGB(0,0,0)且I1(i,j)=RGB(255,0,0),则该像素值为在边界分块中的混杂背景像素,否则为瓷砖上的像素点。Step 44: When g(i, j) = {1, 2, 3} in the tile block step, the block is at a critical boundary value, since it is impossible to ensure that the edge of the tile completely coincides with the segmented ROI image, it is necessary to perform a tile The discriminative process of the inner and outer pixels, the discriminant rule is: if the values of the pixels in the boundary block in I1 and I2 satisfy I1(i, j)=RGB(0,0,0) and I1(i, j) =RGB(255,0,0), then the pixel value is a mixed background pixel in the boundary block, otherwise it is a pixel point on the tile.

所述步骤5色差检测具体为:The step 5 color difference detection is specifically:

将分块和掩膜后的ROI图像转换到HSV颜色空间,基于权重的HSV颜色空间分量生成颜色特征,表达式如下:Convert the ROI image after block and mask to HSV color space, and generate color features based on the weighted HSV color space components, the expression is as follows:

Fti=(λ1×H+λ2×S)/NF ti =(λ 1 ×H+λ 2 ×S)/N

Fti表示第i个分块生成的颜色特征,H表示色调分量,对应的权值为λ1,S表示饱和度对应权值分量λ2,N表示对应块中遍历的像素个数,取λ1=0.7或λ2=0.3;Ft i represents the color feature generated by the i-th block, H represents the hue component, and the corresponding weight is λ 1 , S represents the saturation corresponding to the weight component λ 2 , N represents the number of pixels traversed in the corresponding block, and λ 1 = 0.7 or λ 2 = 0.3;

步骤52:计算生成的瓷砖颜色特征集F{Fti|Fti,i=1,2,…N,k∈N+且N≥1},标准瓷砖颜色特征为Fm,色差检测的表达式为:Step 52: Calculate the generated tile color feature set F{F ti |F ti , i=1, 2,...N, k∈N+ and N≥1}, the standard tile color feature is F m , and the expression of color difference detection is :

ΔEti=|Fti-Fm|ΔE ti =|F ti -F m |

采用门限阈值的方法进行定位目标的判别,判别公式如下。The threshold threshold method is used to discriminate the positioning target, and the discriminating formula is as follows.

T是门限阈值的上下限,g(ΔEti)=1,表示该瓷砖的块位置不存在颜色偏差,整块瓷砖所有块对应的g()函数均为1时,才判断该瓷砖不存在颜色偏差,若其中的任一块对应的g()=0,则判别该瓷砖存在色度偏差。T is the upper and lower limits of the threshold, g(ΔE ti )=1, which means that there is no color deviation in the block position of the tile, and only when the g() function corresponding to all blocks of the entire tile is 1, it is judged that there is no color in the tile Deviation, if any one of them corresponds to g()=0, it is judged that there is a chromaticity deviation in the tile.

采用上述技术方案后,本发明具有以下优点:After adopting the technical scheme, the present invention has the following advantages:

1、采用横竖分块策略将瓷砖目标分割成为均匀检测模块,克服了传统的全局信息特征无法感知微小的色差变化的缺陷,能够突出局部色差的变化信息;1. The horizontal and vertical block strategy is used to divide the tile target into a uniform detection module, which overcomes the defect that the traditional global information feature cannot perceive small color difference changes, and can highlight the change information of local color difference;

2、采用基于瓷砖轮廓斜外接矩对角线进行几何变换的瓷砖位姿矫正方式,保证横竖分块策略的效果;2. Adopt the ceramic tile pose correction method based on the geometric transformation of the diagonal external moment of the tile outline to ensure the effect of the horizontal and vertical block strategy;

3、针对分块单元会溢出瓷砖边界影响颜色特征统计的问题,采用复合掩膜逻辑运算使越界分块里面的非瓷砖像素点不参与颜色特征的统计,从而保证颜色表述特征的准确性;3. In view of the problem that the block unit will overflow the tile boundary and affect the color feature statistics, the composite mask logic operation is used to prevent the non-tile pixels in the cross-border block from participating in the color feature statistics, thereby ensuring the accuracy of color expression features;

4、采用HSV颜色空间对分割块的进行色差检测,生成颜色特征并与标准值进行对比,判别出瓷砖色差缺陷,并可以准确定位缺陷的位置。4. Use the HSV color space to detect the color difference of the segmented blocks, generate color features and compare them with the standard values, identify the color difference defects of tiles, and accurately locate the defects.

附图说明Description of drawings

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

图1是本发明基于机器视觉的瓷砖色度分开检测方法流程简图;Fig. 1 is a schematic flow chart of the tile chromaticity separation detection method based on machine vision in the present invention;

图2是本发明瓷砖图像矫正的几何示意图;Fig. 2 is a schematic diagram of the geometry of tile image correction in the present invention;

图3是本发明分块遍示意图;Fig. 3 is a block diagram of the present invention;

图4是本发明瓷砖色差检测图。Fig. 4 is a diagram of color difference detection of ceramic tiles according to the present invention.

具体实施方式Detailed ways

为了使本发明所要解决的技术问题、技术方案及有益效果更加清楚、明白,以下结合附图及实施例对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本发明,并不用于限定本发明。In order to make the technical problems, technical solutions and beneficial effects to be solved by the present invention clearer and clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.

如图1所示本发明揭示的基于机器视觉的瓷砖色度分块检测方法,包括以下步骤:As shown in Figure 1, the tile chromaticity block detection method based on machine vision disclosed by the present invention comprises the following steps:

步骤1、图像采集与定位,其步骤1具体包括以下步骤:Step 1, image acquisition and positioning, its step 1 specifically includes the following steps:

步骤11,通过高速线阵CCD相机采集图像;Step 11, collecting images by a high-speed linear array CCD camera;

步骤12,先灰度化图像,再进行滤波去噪处理,对滤波图采用边缘检测算法分割,再提取小瓷砖轮廓,得瓷砖轮廓图;Step 12, grayscale the image first, then perform filtering and denoising processing, segment the filtered image using an edge detection algorithm, and then extract the outline of small tiles to obtain a tile outline image;

步骤13,基于步骤12的轮廓图中瓷砖轮廓的几何特性生成相应的基元特征,基元特征包括宽度、高度和完整度;利用瓷砖自身的颜色特性生成相应的HSV颜色空间特征,HSV颜色空间特征包括色调和饱和度,然后将基元特征与颜色特征构造成定位组合特征,共同完成瓷砖的定位;Step 13, based on the geometric characteristics of the tile outline in step 12, corresponding primitive features are generated, and the primitive features include width, height and integrity; the corresponding HSV color space features are generated using the color characteristics of the tile itself, and the HSV color space The features include hue and saturation, and then the primitive features and color features are constructed into a positioning combination feature to jointly complete the positioning of the tiles;

步骤14,针对定位后的瓷砖图像,以瓷砖轮廓的外接矩形的角点为基准生成对应的ROI图像。Step 14, for the positioned tile image, a corresponding ROI image is generated based on the corner points of the circumscribed rectangle of the tile outline.

将ROI图像进行所述步骤2几何变换,公式为:The ROI image is carried out to the step 2 geometric transformation, the formula is:

式中,θc是几何变换的旋转角度,Δx,Δy为矫正平移,[x、y 1]为变换前坐标,[x1y1 1]为变换后的坐标。In the formula, θ c is the rotation angle of the geometric transformation, Δx, Δy are the correction translations, [x, y 1] are the coordinates before transformation, and [x 1 y 1 1] are the coordinates after transformation.

步骤2、图像位姿矫正Step 2. Image pose correction

采用基于ROI图像斜外接矩对角线为基准进行几何变换,以矫正瓷砖位姿;矫正的几何示意图如图2所示。The geometric transformation based on the oblique circumscribed moment diagonal of the ROI image is used as the reference to correct the tile pose; the geometric diagram of the correction is shown in Figure 2.

设标准位置瓷砖的斜外接矩形的为ABCD,对角线交点为p(xp,yp),对角线BD与像素坐标的W方向夹角为θ,B与D点的坐标分别设为(xB,yB),(xD,yD),同理设任一目标位置瓷砖的斜外接矩形的为A1B1C1D1,对角线交点p1(xp1,yp1),对角线的B1D1,与像素坐标的W方向夹角为θ1,B1与D1点的坐标分别设为(xB1,yB1),(xD1,yD1),W和H分别代表像素坐标的横轴与纵轴,矫正计算以像素量纲为准,矫正平移设为Δx,Δy,旋转角度设为θc,几何变换公式为:Let the oblique circumscribed rectangle of the tile at the standard position be ABCD, the intersection of the diagonals be p(x p , y p ), the angle between the diagonal BD and the pixel coordinates in the W direction is θ, and the coordinates of points B and D are respectively set to (x B ,y B ), (x D ,y D ), similarly, let the oblique circumscribed rectangle of any target tile be A 1 B 1 C 1 D 1 , and the diagonal intersection point p 1 (x p1 ,y p1 ), B 1 D 1 on the diagonal, and the angle between the pixel coordinates in the W direction is θ 1 , and the coordinates of B 1 and D 1 are respectively set to (xB 1 , y B1 ), (x D1 , y D1 ) , W and H respectively represent the horizontal and vertical axes of the pixel coordinates, the correction calculation is based on the pixel dimension, the correction translation is set to Δx, Δy, the rotation angle is set to θ c , and the geometric transformation formula is:

式中,θc是几何变换的旋转角度,Δx,Δy为矫正平移,[x、y 1]为变换前坐标,[x1y1 1]为变换后的坐标。In the formula, θ c is the rotation angle of the geometric transformation, Δx, Δy are the correction translations, [x, y 1] are the coordinates before transformation, and [x 1 y 1 1] are the coordinates after transformation.

步骤3、图像分块,其步骤3具体包括以下步骤:Step 3, image segmentation, its step 3 specifically includes the following steps:

步骤31:将矫正后的图像重新进行轮廓提取,获取紧贴瓷砖目标的最小ROI图像(该图像处理时认为是瓷砖图像),以该图像原点为分块的起点,初始化分块步长,分块步长的定义为:Step 31: Re-extract the contour of the rectified image, obtain the smallest ROI image close to the tile target (this image is considered to be a tile image during processing), take the origin of the image as the starting point of the block, initialize the block step size, and divide The block step size is defined as:

Stepx与Stepy是计算后取的整数,Scale为步长计算的尺度系数;其值越小代表分块的精度越高,算法的时间复杂度也会提高,一般取值为0.1; Step x and Step y are integers taken after calculation, and Scale is the scale coefficient for step calculation; the smaller the value, the higher the accuracy of the block, and the time complexity of the algorithm will also increase, and the general value is 0.1;

步骤32,以矫正后最小ROI图像原点作为分块起点,然后分别在横向与纵向以其对应的步长进行块划分,完成整个瓷砖的划分步骤。Step 32, taking the origin of the corrected minimum ROI image as the starting point of the block, and then performing block division in the horizontal direction and the vertical direction with corresponding step lengths respectively, and completing the division step of the entire tile.

但在实际的划分工程当中,难以保证图像长宽是分块步长的整数倍,为防止分块越界发生处理异常,加上如下的判别条件:However, in the actual division project, it is difficult to ensure that the image length and width are integer multiples of the block step size. In order to prevent processing exceptions from occurring when the block crosses the boundary, the following discrimination conditions are added:

如图3所示,将最小ROI图像分为中间的0区,0区左右两侧的1区和上下两侧的2区以及1区与2区交叉的3区,边界条件分为4种区域,采用如下的g(i,j)作为边界条件的判别函数,进行解析:As shown in Figure 3, the minimum ROI image is divided into Zone 0 in the middle, Zone 1 on the left and right sides of Zone 0, Zone 2 on the upper and lower sides, and Zone 3 where Zone 1 and Zone 2 intersect. The boundary conditions are divided into four types of regions. , using the following g(i, j) as the discriminant function of the boundary conditions for analysis:

该判别函数表示为:The discriminant function is expressed as:

若g(i,j)=1,代表在分块遍历过程当中发生横向越界,处于临界区域的分块大小宽度的范围为[i,Width];If g(i,j)=1, it means that a horizontal cross-border occurs during the block traversal process, and the range of the block size width in the critical area is [i, Width];

若g(i,j)=2,代表在分块遍历过程当中发生纵向越界,处于临界区域的分块大小高度的范围为[j,Height];If g(i, j) = 2, it means that a vertical cross-border occurs during the block traversal process, and the range of the block size height in the critical area is [j, Height];

若g(i,j)=3,代表在分块遍历过程当中同时发生横纵向越界,处于临界区域的分块大小宽度和高度的范围分别为[i,Width]与[j,Height];If g(i, j) = 3, it means that horizontal and vertical cross-borders occur simultaneously during the block traversal process, and the ranges of the block size width and height in the critical area are [i, Width] and [j, Height] respectively;

若g(i,j)=0,代表在分块遍历过程当中没有发生越界,宽度和高度的范围分别为[i,i+Stepx];与[j,j+Stepy];If g(i, j) = 0, it means that there is no cross-border during the block traversal process, and the ranges of width and height are [i, i+Step x ]; and [j, j+Step y ];

且定义:当g(i,j)={1,2,3}时,划分的区域为外部分块,g(i,j)=0时的区域为内部分块,内部分块为不需要进行像素判别处理的部分,外部分块才需要判别处理为需要进行像素判别处理的部分。And define: when g(i,j)={1,2,3}, the divided area is the outer block, the area when g(i,j)=0 is the inner block, and the inner block is unnecessary For the part where the pixel discrimination process is performed, only the outer blocks need to be discriminated.

通过以上的算法流程,完成了对瓷砖的均匀分块,成功解决了分块的尺度与越界异常问题,为凸显局部的色差变化提供了一种新的策略;Through the above algorithm process, the uniform division of tiles is completed, the scale of the division and the abnormal problem of crossing the border are successfully solved, and a new strategy is provided for highlighting the local color difference change;

步骤4、复合掩模,其具体包括以下步骤:Step 4, compound mask, it specifically comprises the following steps:

步骤41:初始化两幅与分割ROI大小相同且像素值为0的图像,分别作为瓷砖复合掩膜的母体,记为M1,M2;Step 41: Initialize two images with the same size as the segmented ROI and with a pixel value of 0, respectively as the matrix of the composite tile mask, denoted as M1 and M2;

步骤42:将瓷砖分块步骤中矫正轮廓以像素精度分别画在M1,M2掩膜图像中,填充掩膜母体轮廓内部与外部区域;即在M1图像轮廓内部填充像素为RGB(255,255,255),外部为RGB(0,0,0);M2内、外部填充像素为RGB(255,255,255)与RGB(255,0,0);Step 42: Draw the corrected outline in the tile block step in the M1 and M2 mask images with pixel precision, and fill the inner and outer areas of the mask parent outline; that is, fill the pixels inside the M1 image outline as RGB (255, 255, 255), the outside is RGB(0,0,0); the inner and outer filling pixels of M2 are RGB(255,255,255) and RGB(255,0,0);

步骤43:将外位姿矫正后的图像分别与复合掩膜图像M1,M2作逻辑与运算,得到处理后的掩膜感兴趣区域图像I1与I2,内掩膜与矫正图像处理后使瓷砖轮廓内部的图像得以全部保留,外部的背景色分别为黑色与红色。Step 43: Perform logical AND operations on the image after external pose correction and the composite mask images M1 and M2 to obtain the processed mask ROI images I1 and I2, and the inner mask and the corrected image are processed to make the tile outline The internal images are fully preserved, and the external background colors are black and red.

步骤44:在瓷砖分块步骤中的g(i,j)={1,2,3}时,分块处于临界边界值,由于无法保证瓷砖的边与分割ROI图像的完全重合,需进行瓷砖内外部像素的判别处理,判别规则为:若处于边界分块中的像素在I1与I2中的值同时满足I1(i,j)=RGB(0,0,0)且I1(i,j)=RGB(255,0,0),则该像素值为在边界分块中的混杂背景像素,否则为瓷砖上的像素点。上述的判断条件只对处于边界分块进行像素判别处理,因此不会增加整个算法的复杂度,通过上述复合掩膜的逻辑运算方法就可以完全实现非目标像素严格不参与颜色特征的生成的目标。Step 44: When g(i, j) = {1, 2, 3} in the tile block step, the block is at a critical boundary value, since it is impossible to ensure that the edge of the tile completely coincides with the segmented ROI image, it is necessary to perform a tile The discriminative process of the inner and outer pixels, the discriminant rule is: if the values of the pixels in the boundary block in I1 and I2 satisfy I1(i, j)=RGB(0,0,0) and I1(i, j) =RGB(255,0,0), then the pixel value is a mixed background pixel in the boundary block, otherwise it is a pixel point on the tile. The above judgment conditions only perform pixel discrimination processing on the boundary blocks, so the complexity of the entire algorithm will not be increased. Through the above-mentioned logical operation method of the composite mask, the goal of non-target pixels strictly not participating in the generation of color features can be fully realized .

只对瓷砖进行几何矫正不足以保证越界分块的非目标像素严格不参与颜色特征的生成,因为图像处理过程当中的精度损失是不可避免的,瓷砖的边界不可能与分割ROI图像完全重合,掩膜是图像拓扑处理中一种十分实用的技术,最大特征是可以控制任意形状的感兴趣区域,将与感兴趣无关的特征全部屏蔽,使我们只关心处理的图像目标,在本发明中,不仅仅用到掩膜的屏蔽特征,更重要的是使用提出的“复合掩膜”逻辑运算方法判别边界分块的非目标像素,使其严格不参与颜色特征的生成,从而影响瓷砖色差检测的准确度;Only geometrically correcting the tiles is not enough to ensure that the non-target pixels that cross the border are not strictly involved in the generation of color features, because the accuracy loss in the image processing process is inevitable, and the boundaries of the tiles cannot completely coincide with the segmented ROI image. Membrane is a very practical technology in image topology processing. The biggest feature is that it can control the region of interest of any shape, and completely shield the features that are not related to interest, so that we only care about the image target to be processed. In the present invention, not only Only the shielding features of the mask are used, and more importantly, the proposed "composite mask" logic operation method is used to identify the non-target pixels of the boundary blocks, so that they are strictly not involved in the generation of color features, thus affecting the accuracy of tile color difference detection Spend;

步骤5、色差检测Step 5, color difference detection

将掩模处理后的测试模块转换到HSV颜色空间,生成颜色特征并与标准值对比,判别出瓷砖是否存在色彩缺陷。Convert the masked test module to the HSV color space, generate color features and compare them with standard values to determine whether there are color defects in the tiles.

步骤5色差检测具体为:Step 5 color difference detection is specifically:

将分块和掩膜后的ROI图像转换到HSV颜色空间,基于权重的HSV颜色空间分量生成颜色特征,表达式如下:Convert the ROI image after block and mask to HSV color space, and generate color features based on the weighted HSV color space components, the expression is as follows:

Fti=(λ1×H+λ2×S)/NF ti =(λ 1 ×H+λ 2 ×S)/N

Fti表示第i个分块生成的颜色特征,H表示色调分量,对应的权值为λ1,S表示饱和度对应权值分量λ2,N表示对应块中遍历的像素个数,取λ1=0.7或λ2=0.3;Ft i represents the color feature generated by the i-th block, H represents the hue component, and the corresponding weight is λ 1 , S represents the saturation corresponding to the weight component λ 2 , N represents the number of pixels traversed in the corresponding block, and λ 1 = 0.7 or λ 2 = 0.3;

步骤52:计算生成的瓷砖颜色特征集F{Fti|Fti,i=1,2,…N,k∈N+且N≥1},标准瓷砖颜色特征为Fm,色差检测的表达式为:Step 52: Calculate the generated tile color feature set F{F ti |F ti , i=1, 2,...N, k∈N+ and N≥1}, the standard tile color feature is F m , and the expression of color difference detection is :

ΔEti=|Fti-Fm|ΔE ti =|F ti -F m |

采用门限阈值的方法进行定位目标的判别,判别公式如下。The threshold threshold method is used to discriminate the positioning target, and the discriminating formula is as follows.

T是门限阈值的上下限,g(ΔEti)=1,表示该瓷砖的块位置不存在颜色偏差,整块瓷砖所有块对应的g()函数均为1时,才判断该瓷砖不存在颜色偏差,若其中的任一块对应的g()=0,则判别该瓷砖存在色度偏差。T is the upper and lower limits of the threshold, g(ΔE ti )=1, which means that there is no color deviation in the block position of the tile, and only when the g() function corresponding to all blocks of the entire tile is 1, it is judged that there is no color in the tile Deviation, if any one of them corresponds to g()=0, it is judged that there is a chromaticity deviation in the tile.

采用本发明检测方法对瓷砖进行实验检测发现,本发明的检测的方法可以有效的检测出瓷砖颜色突变的位置,如图4所示,统计图的横坐标为分块的个数,纵坐标为特征颜色值Fti归一化后的值。Adopt the detection method of the present invention to carry out experimental detection to ceramic tile and find that the detection method of the present invention can effectively detect the position of tile color mutation, as shown in Figure 4, the abscissa of statistical diagram is the number of blocks, and the ordinate is The normalized value of the feature color value F ti .

上述说明示出并描述了本发明的优选实施例,应当理解本发明并非局限于本文所披露的形式,不应看作是对其他实施例的排除,而可用于各种其他组合、修改和环境,并能够在本文发明构想范围内,通过上述教导或相关领域的技术或知识进行改动。而本领域人员所进行的改动和变化不脱离本发明的精神和范围,则都应在本发明所附权利要求的保护范围内。While the above description shows and describes preferred embodiments of the present invention, it should be understood that the present invention is not limited to the forms disclosed herein and should not be viewed as excluding other embodiments, but can be used in various other combinations, modifications and environments , and can be modified within the scope of the inventive concept herein through the above teachings or techniques or knowledge in related fields. However, changes and changes made by those skilled in the art do not depart from the spirit and scope of the present invention, and should all be within the protection scope of the appended claims of the present invention.

Claims (7)

1.基于机器视觉的瓷砖色度分块检测方法,其特征在于:包括以下步骤:1. the ceramic tile chroma block detection method based on machine vision, it is characterized in that: comprise the following steps: 步骤1、图像采集与定位Step 1. Image acquisition and positioning 通过彩色相机对瓷砖图像进行采集,再通过瓷砖定位算法将仅含有瓷砖的ROI图像分割出来,将其作为独立的处理单元进行后续处理,所述ROI图像即包含整块瓷砖边界区域的图像;The tile image is collected by a color camera, and then the ROI image containing only the tile is segmented through the tile positioning algorithm, and it is used as an independent processing unit for subsequent processing, and the ROI image includes the image of the boundary area of the entire tile; 步骤2、图像位姿矫正Step 2. Image pose correction 采用基于ROI图像斜外接矩对角线为基准进行几何变换,以矫正瓷砖位姿;Use the oblique circumscribed moment diagonal of the ROI image as the reference for geometric transformation to correct the tile pose; 步骤3、图像分块Step 3, image segmentation 采用横竖分块策略将步骤2校正后的ROI图像均匀分割成测试模块,测试模块为最小ROI图像;Use the horizontal and vertical block strategy to evenly divide the ROI image corrected in step 2 into test modules, and the test module is the smallest ROI image; 步骤4、复合掩模Step 4. Composite mask 采用复合逻辑运算方法对分割后的测试模块进行掩模处理;Mask processing is performed on the divided test modules by using a compound logic operation method; 步骤5、色差检测Step 5, color difference detection 将掩模处理后的测试模块转换到HSV颜色空间,生成颜色特征并与标准值对比,判别出瓷砖是否存在色彩缺陷。Convert the masked test module to the HSV color space, generate color features and compare them with standard values to determine whether there are color defects in the tiles. 2.如权利要求1所述的基于机器视觉的瓷砖色度分块检测方法,其特征在于:所述步骤1具体包括以下步骤:2. The machine vision-based ceramic tile chromaticity block detection method as claimed in claim 1, characterized in that: said step 1 specifically comprises the following steps: 步骤11,通过高速线阵CCD相机采集图像;Step 11, collecting images by a high-speed linear array CCD camera; 步骤12,先灰度化图像,再进行滤波去噪处理,对滤波图采用边缘检测算法分割,再提取小瓷砖轮廓,得瓷砖轮廓图;Step 12, grayscale the image first, then perform filtering and denoising processing, segment the filtered image using an edge detection algorithm, and then extract the outline of small tiles to obtain a tile outline image; 步骤13,基于步骤12的轮廓图中瓷砖轮廓的几何特性生成相应的基元特征,基元特征包括宽度、高度和完整度;利用瓷砖自身的颜色特性生成相应的HSV颜色空间特征,HSV颜色空间特征包括色调和饱和度,然后将基元特征与颜色特征构造成定位组合特征,共同完成瓷砖的定位;Step 13, based on the geometric characteristics of the tile outline in step 12, corresponding primitive features are generated, and the primitive features include width, height and integrity; the corresponding HSV color space features are generated using the color characteristics of the tile itself, and the HSV color space The features include hue and saturation, and then the primitive features and color features are constructed into a positioning combination feature to jointly complete the positioning of the tiles; 步骤14,针对定位后的瓷砖图像,以瓷砖轮廓的外接矩形的角点为基准生成对应的ROI图像。Step 14, for the positioned tile image, a corresponding ROI image is generated based on the corner points of the circumscribed rectangle of the tile outline. 3.如权利要求1所述的基于机器视觉的瓷砖色度分块检测方法,其特征在于:将ROI图像进行所述步骤2几何变换,公式为:3. the tile chromaticity detection method based on machine vision as claimed in claim 1, is characterized in that: ROI image is carried out described step 2 geometric transformations, and formula is: 式中,θc是几何变换的旋转角度,Δx,Δy为矫正平移,[x、y 1]为变换前坐标,[x1y1 1]为变换后的坐标。In the formula, θ c is the rotation angle of the geometric transformation, Δx, Δy are the correction translations, [x, y 1] are the coordinates before transformation, and [x 1 y 1 1] are the coordinates after transformation. 4.如权利要求1所述的基于机器视觉的瓷砖色度分块检测方法,其特征在于:所述步骤3具体包括以下步骤:4. The machine vision-based ceramic tile chromaticity block detection method as claimed in claim 1, characterized in that: said step 3 specifically comprises the following steps: 步骤31:将矫正后的图像重新进行轮廓提取,获取紧贴瓷砖目标的最小ROI图像,以该图像原点为分块的起点,初始化分块步长,分块步长的定义为:Step 31: Re-extract the contour of the rectified image to obtain the smallest ROI image that is close to the tile target, and use the origin of the image as the starting point of the block to initialize the block step size. The block step size is defined as: Stepx与Stepy是计算后取的整数,Scale为步长计算的尺度系数; Step x and Step y are integers after calculation, and Scale is the scale coefficient for step calculation; 步骤32以矫正后最小ROI图像原点作为分块起点,然后分别在横向与纵向以其对应的步长进行块划分,完成整个瓷砖的划分步骤。Step 32 takes the origin of the corrected minimum ROI image as the starting point of block division, and then performs block division in horizontal and vertical directions with corresponding step lengths respectively, and completes the division step of the entire tile. 5.如权利要求4所述的基于机器视觉的瓷砖色度分块检测方法,其特征在于:所述步骤32划分方式为:5. The tile chromaticity block detection method based on machine vision as claimed in claim 4, characterized in that: said step 32 is divided into: 将最小ROI图像分为中间的0区,0区左右两侧的1区和上下两侧的2区以及1区与2区交叉的3区,边界条件分为4种区域,采用如下的g(i,j)作为边界条件的判别函数,进行解析:Divide the minimum ROI image into Zone 0 in the middle, Zone 1 on the left and right sides of Zone 0, Zone 2 on the upper and lower sides, and Zone 3 intersecting Zone 1 and Zone 2. The boundary conditions are divided into 4 types of zones, and the following g( i, j) as the discriminant function of the boundary conditions, to analyze: 该判别函数表示为:The discriminant function is expressed as: 若g(i,j)=1,代表在分块遍历过程当中发生横向越界,处于临界区域的分块大小宽度的范围为[i,Width];If g(i,j)=1, it means that a horizontal cross-border occurs during the block traversal process, and the range of the block size width in the critical area is [i, Width]; 若g(i,j)=2,代表在分块遍历过程当中发生纵向越界,处于临界区域的分块大小高度的范围为[j,Height];If g(i, j) = 2, it means that a vertical cross-border occurs during the block traversal process, and the range of the block size height in the critical area is [j, Height]; 若g(i,j)=3,代表在分块遍历过程当中同时发生横纵向越界,处于临界区域的分块大小宽度和高度的范围分别为[i,Width]与[j,Height];If g(i, j) = 3, it means that horizontal and vertical cross-borders occur simultaneously during the block traversal process, and the ranges of the block size width and height in the critical area are [i, Width] and [j, Height] respectively; 若g(i,j)=0,代表在分块遍历过程当中没有发生越界,宽度和高度的范围分别为[i,i+Stepx];与[j,j+Stepy];If g(i, j) = 0, it means that there is no cross-border during the block traversal process, and the ranges of width and height are [i, i+Step x ]; and [j, j+Step y ]; 且定义:当g(i,j)={1,2,3}时,划分的区域为外部分块,g(i,j)=0时的区域为内部分块,内部分块为不需要进行像素判别处理的部分,外部分块才需要判别处理为需要进行像素判别处理的部分。And define: when g(i,j)={1,2,3}, the divided area is the outer block, the area when g(i,j)=0 is the inner block, and the inner block is unnecessary For the part where the pixel discrimination process is performed, only the external blocks need to be discriminated. 6.如权利要求5所述的基于机器视觉的瓷砖色度分块检测方法,其特征在于:所述步骤4具体包括以下步骤:6. The tile chromaticity block detection method based on machine vision as claimed in claim 5, characterized in that: said step 4 specifically comprises the following steps: 步骤41:初始化两幅与分割ROI大小相同且像素值为0的图像,分别作为瓷砖复合掩膜的母体,记为M1,M2;Step 41: Initialize two images with the same size as the segmented ROI and with a pixel value of 0, respectively as the matrix of the composite tile mask, denoted as M1 and M2; 步骤42:将瓷砖分块步骤中矫正轮廓以像素精度分别画在M1,M2掩膜图像中,填充掩膜母体轮廓内部与外部区域;即在M1图像轮廓内部填充像素为RGB(255,255,255),外部为RGB(0,0,0);M2内、外部填充像素为RGB(255,255,255)与RGB(255,0,0);Step 42: Draw the corrected outline in the tile block step in the M1 and M2 mask images with pixel precision, and fill the inner and outer areas of the mask parent outline; that is, fill the pixels inside the M1 image outline as RGB (255, 255, 255), the outside is RGB(0,0,0); the inner and outer filling pixels of M2 are RGB(255,255,255) and RGB(255,0,0); 步骤43:将位姿矫正后的图像分别与复合掩膜图像M1,M2作逻辑与运算,得到处理后的掩膜感兴趣区域图像I1与I2,内掩膜与矫正图像处理后使瓷砖轮廓内部的图像得以全部保留,外部的背景色分别为黑色与红色;Step 43: Perform logical AND operations on the pose-corrected image and the composite mask images M1 and M2 respectively to obtain the processed mask ROI images I1 and I2, and the inner mask and the corrected image are processed so that the tile outline The images of all images are preserved, and the external background colors are black and red respectively; 步骤44:在瓷砖分块步骤中的g(i,j)={1,2,3}时,分块处于临界边界值,由于无法保证瓷砖的边与分割ROI图像的完全重合,需进行瓷砖内外部像素的判别处理,判别规则为:若处于边界分块中的像素在I1与I2中的值同时满足I1(i,j)=RGB(0,0,0)且I1(i,j)=RGB(255,0,0),则该像素值为在边界分块中的混杂背景像素,否则为瓷砖上的像素点。Step 44: When g(i, j) = {1, 2, 3} in the tile block step, the block is at a critical boundary value, since it is impossible to ensure that the edge of the tile completely coincides with the segmented ROI image, it is necessary to perform a tile The discriminative process of the inner and outer pixels, the discriminant rule is: if the values of the pixels in the boundary block in I1 and I2 satisfy I1(i, j)=RGB(0,0,0) and I1(i, j) =RGB(255,0,0), then the pixel value is a mixed background pixel in the boundary block, otherwise it is a pixel point on the tile. 7.如权利要求1所述的基于机器视觉的瓷砖色度分块检测方法,其特征在于:所述步骤5色差检测具体为:7. The tile chromaticity block detection method based on machine vision as claimed in claim 1, characterized in that: said step 5 color difference detection is specifically: 将分块和掩膜后的ROI图像转换到HSV颜色空间,基于权重的HSV颜色空间分量生成颜色特征,表达式如下:Convert the ROI image after block and mask to HSV color space, and generate color features based on the weighted HSV color space components, the expression is as follows: Fti=(λ1×H+λ2×S)/NF ti =(λ 1 ×H+λ 2 ×S)/N Fti表示第i个分块生成的颜色特征,H表示色调分量,对应的权值为λ1,S表示饱和度对应权值分量λ2,N表示对应块中遍历的像素个数,取λ1=0.7或λ2=0.3;Ft i represents the color feature generated by the i-th block, H represents the hue component, and the corresponding weight is λ 1 , S represents the saturation corresponding to the weight component λ 2 , N represents the number of pixels traversed in the corresponding block, and λ 1 = 0.7 or λ 2 = 0.3; 步骤52:计算生成的瓷砖颜色特征集F{Fti|Fti,i=1,2,…N,k∈N+且N≥1},标准瓷砖颜色特征为Fm,色差检测的表达式为:Step 52: Calculate the generated tile color feature set F{F ti |F ti , i=1, 2,...N, k∈N+ and N≥1}, the standard tile color feature is F m , and the expression of color difference detection is : ΔEti=|Fti-Fm|ΔE ti =|F ti -F m | 采用门限阈值的方法进行定位目标的判别,判别公式如下:The method of threshold threshold is used to discriminate the positioning target, and the discriminating formula is as follows: T是门限阈值的上下限,g(ΔEti)=1,表示该瓷砖的块位置不存在颜色偏差,整块瓷砖所有块对应的g()函数均为1时,才判断该瓷砖不存在颜色偏差,若其中的任一块对应的g()=0,则判别该瓷砖存在色度偏差。T is the upper and lower limits of the threshold, g(ΔE ti )=1, which means that there is no color deviation in the block position of the tile, and only when the g() function corresponding to all blocks of the entire tile is 1, it is judged that there is no color in the tile Deviation, if any one of them corresponds to g()=0, it is judged that there is a chromaticity deviation in the tile.
CN201611060933.5A 2017-02-07 2017-02-07 Ceramic tile coloration piecemeal detection method based on machine vision Active CN107063458B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611060933.5A CN107063458B (en) 2017-02-07 2017-02-07 Ceramic tile coloration piecemeal detection method based on machine vision

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611060933.5A CN107063458B (en) 2017-02-07 2017-02-07 Ceramic tile coloration piecemeal detection method based on machine vision

Publications (2)

Publication Number Publication Date
CN107063458A CN107063458A (en) 2017-08-18
CN107063458B true CN107063458B (en) 2018-10-26

Family

ID=59619419

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611060933.5A Active CN107063458B (en) 2017-02-07 2017-02-07 Ceramic tile coloration piecemeal detection method based on machine vision

Country Status (1)

Country Link
CN (1) CN107063458B (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108890692A (en) * 2018-07-05 2018-11-27 陕西大中科技发展有限公司 A kind of material color identification method for industrial robot vision's sorting
CN109215026B (en) * 2018-09-29 2022-02-11 广东工业大学 A high-speed and accurate LED defect detection method based on machine vision
CN109829496B (en) * 2019-01-30 2021-05-25 广州市载道信息科技有限公司 Physical measurement classification method and equipment
CN109856051A (en) * 2019-01-30 2019-06-07 广州市载道信息科技有限公司 A kind of image color acquisition device
CN112085038A (en) * 2019-05-27 2020-12-15 湖北三江航天万峰科技发展有限公司 High-speed video image processing method and system based on multi-core DSP
CN110378327B (en) * 2019-07-09 2021-05-18 浙江大学 Target detection device and method with auxiliary significant features added
CN111160476A (en) * 2019-12-31 2020-05-15 佛山喀视科技有限公司 Color difference detection model generation method, tile color separation method and device
CN113408573B (en) * 2021-05-11 2023-02-21 广东工业大学 Method and device for automatic classification and classification of ceramic tile color numbers based on machine learning
CN114331817A (en) * 2021-12-27 2022-04-12 泰山信息科技有限公司 Image conversion method, system, device and computer readable storage medium
CN117132499B (en) * 2023-09-07 2024-05-14 石家庄开发区天远科技有限公司 Background removing method and device for image recognition
CN117644057B (en) * 2024-01-29 2024-05-17 蒙娜丽莎集团股份有限公司 Ceramic tile classified conveying method, system and readable storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN2795852Y (en) * 2005-05-12 2006-07-12 佛山市德科机电设备有限公司 Automatic detector for glazed tile surface property
CN102095499A (en) * 2009-12-09 2011-06-15 程好学 Method for automatic color separation of ceramic tiles
CN203241152U (en) * 2012-12-12 2013-10-16 杭州三速科技有限公司 Ceramic tile aberration detection apparatus
CN104034260A (en) * 2014-05-27 2014-09-10 佛山职业技术学院 Ceramic tile automatic detection device
CN204116238U (en) * 2014-06-24 2015-01-21 中南大学 A kind of ceramic tile texture on-line checkingi sorter
CN104458755A (en) * 2014-11-26 2015-03-25 吴晓军 Multi-type material surface defect detection method based on machine vision
CN105574841A (en) * 2014-11-05 2016-05-11 Tcl集团股份有限公司 Color-based image segmenting method and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN2795852Y (en) * 2005-05-12 2006-07-12 佛山市德科机电设备有限公司 Automatic detector for glazed tile surface property
CN102095499A (en) * 2009-12-09 2011-06-15 程好学 Method for automatic color separation of ceramic tiles
CN203241152U (en) * 2012-12-12 2013-10-16 杭州三速科技有限公司 Ceramic tile aberration detection apparatus
CN104034260A (en) * 2014-05-27 2014-09-10 佛山职业技术学院 Ceramic tile automatic detection device
CN204116238U (en) * 2014-06-24 2015-01-21 中南大学 A kind of ceramic tile texture on-line checkingi sorter
CN105574841A (en) * 2014-11-05 2016-05-11 Tcl集团股份有限公司 Color-based image segmenting method and device
CN104458755A (en) * 2014-11-26 2015-03-25 吴晓军 Multi-type material surface defect detection method based on machine vision

Also Published As

Publication number Publication date
CN107063458A (en) 2017-08-18

Similar Documents

Publication Publication Date Title
CN107063458B (en) Ceramic tile coloration piecemeal detection method based on machine vision
CN111028213B (en) Image defect detection method, device, electronic equipment and storage medium
CN108921176B (en) Pointer instrument positioning and identifying method based on machine vision
CN101398392B (en) Cotton impurity high speed real-time detection method based on HSI color space
CN108776140B (en) Machine vision-based printed matter flaw detection method and system
CN105067638B (en) Tire fetal membrane face character defect inspection method based on machine vision
CN103345755B (en) A kind of Chessboard angular point sub-pixel extraction based on Harris operator
CN101620060B (en) Automatic detection method of particle size distribution
CN101799434B (en) Printing image defect detection method
CN109993099A (en) A kind of lane line drawing recognition methods based on machine vision
CN114881915B (en) A method for detecting defects in the window area of mobile phone glass cover based on symmetry
CN107014819A (en) A kind of solar panel surface defects detection system and method
CN107239748A (en) Robot target identification and localization method based on gridiron pattern calibration technique
CN109540925B (en) Complex ceramic tile surface defect detection method based on difference method and local variance measurement operator
US20240420303A1 (en) Defect detection method, defect detection system, and defect detection program
CN104715491B (en) A kind of sub-pixel edge detection method based on one-dimensional Gray Moment
CN106529556B (en) A visual inspection system for instrument indicator lights
CN106228541A (en) Screen positioning method and device in visual inspection
CN105787912B (en) Classification-based step type edge sub-pixel positioning method
CN105678737A (en) Digital image corner point detection method based on Radon transform
CN115078365A (en) Soft package printing quality defect detection method
CN112070738B (en) A kind of mask nose bridge detection method and system
TW201723928A (en) Thermal image region segmentation method by utilizing temperature information in the thermal image plus contour information and the region smoothness information of a visible image having the same image pickup range
CN115587999B (en) N95 mask surface dirt breakage fold defect detection method based on deep learning
CN113902667B (en) Thread turning identification method and system for machine vision

Legal Events

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