CN114332622A - Label detection method based on machine vision - Google Patents

Label detection method based on machine vision Download PDF

Info

Publication number
CN114332622A
CN114332622A CN202111658741.5A CN202111658741A CN114332622A CN 114332622 A CN114332622 A CN 114332622A CN 202111658741 A CN202111658741 A CN 202111658741A CN 114332622 A CN114332622 A CN 114332622A
Authority
CN
China
Prior art keywords
label
image
product
standard
inspected
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111658741.5A
Other languages
Chinese (zh)
Inventor
郑茹丹
刘洋廷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sichuan Cric Technology Co ltd
Original Assignee
Sichuan Cric Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sichuan Cric Technology Co ltd filed Critical Sichuan Cric Technology Co ltd
Priority to CN202111658741.5A priority Critical patent/CN114332622A/en
Publication of CN114332622A publication Critical patent/CN114332622A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Image Analysis (AREA)

Abstract

The invention discloses a label detection method based on machine vision, which comprises the following steps: establishing a standard database; acquiring a product image; realizing product appearance matching based on the product image; intercepting a preset position image to obtain a label image to be detected; and judging whether the image of the label to be detected meets a preset standard or not. The invention solves the problems of low accuracy of manual inspection or scanning identification and difficulty in accurately judging the displacement, pollution and other states of the label.

Description

一种基于机器视觉的标签检测方法A method for label detection based on machine vision

技术领域technical field

本发明涉及计算机视觉图像检测技术领域,具体涉及一种基于机器视觉的标签检测方法。The invention relates to the technical field of computer vision image detection, in particular to a label detection method based on machine vision.

背景技术Background technique

在产品出厂入库前,一般会在固定位置粘贴特定的标签,承载着产品型号、生产厂商、注意事项、检验标准、标识二维码等重要信息。根据产品的标签,可以快速便捷的对相应产品进行识别和追溯,是提升生产信息化、智能化的重要部分。Before the product leaves the factory and enters the warehouse, a specific label is usually pasted in a fixed position, carrying important information such as product model, manufacturer, precautions, inspection standards, and identification QR code. According to the product label, the corresponding product can be quickly and easily identified and traced, which is an important part of improving production informatization and intelligence.

对于合格规范的产品,标签需要粘贴在预先确定的位置,同时标签的表面需要保持干净无污染。而此类问题在生产线中,往往需要人工来确认,不仅需要额外的工作耗时,同时在流水线传送速度较快时,检查的准确度也较低,难以对标签的位置偏移进行较为精准的判断。For qualified products, the label needs to be affixed in a predetermined position, and the surface of the label needs to be kept clean and free of contamination. In the production line, such problems often require manual confirmation, which not only requires additional work and time-consuming, but also when the pipeline transmission speed is fast, the inspection accuracy is also low, and it is difficult to accurately measure the position offset of the label. judge.

而一般的自动检测也仅能根据扫描场景中一维码或二维码的识别情况进行是否存在相应标签的存在,不能区分标签漏粘和表面污染的情况,同时也难以检测是否偏移了预先确定的位置,对产品的外观或规范产生影响。The general automatic detection can only check whether there is a corresponding label according to the recognition of the one-dimensional code or two-dimensional code in the scanning scene, and cannot distinguish the label leakage and surface contamination. A determined location that has an impact on the appearance or specification of a product.

因此,本专利申请针对的问题是:对于有固定外形和标签粘贴位置的产品,人工对标签位置和表面污垢的检测准确度低,同时采用扫描识别的方法难以对标签位置和不合格情况进行精准定位与分析。Therefore, the problem addressed by this patent application is: for products with a fixed shape and label sticking position, the manual detection accuracy of the label position and surface dirt is low, and it is difficult to accurately detect the label position and unqualified conditions by using the method of scanning recognition. location and analysis.

发明内容SUMMARY OF THE INVENTION

本发明的目的在于提供一种基于机器视觉的标签检测方法,以期解决背景技术中存在的技术问题。The purpose of the present invention is to provide a label detection method based on machine vision, in order to solve the technical problems existing in the background art.

为了实现上述目的,本发明采用以下技术方案:In order to achieve the above object, the present invention adopts the following technical solutions:

一种基于机器视觉的标签检测方法,包括以下步骤:A machine vision-based label detection method, comprising the following steps:

建立标准数据库;establish a standard database;

获取产品图像;Get product images;

基于所述产品图像实现产品外形匹配;realizing product shape matching based on the product image;

截取预设位置图像获得待检标签图像;Capture the image of the preset position to obtain the image of the label to be inspected;

判断所述待检标签图像是否满足预设标准。It is judged whether the label image to be inspected satisfies a preset standard.

在一些实施例中,所述建立标准数据库,包括:In some embodiments, the establishment of a standard database includes:

选取符合检测标准的产品进行图像采集获得标准图像数据;Select products that meet the testing standards for image acquisition to obtain standard image data;

基于标准图像数据,依次进行产品外型和标签信息的采集。Based on the standard image data, the collection of product appearance and label information is performed in sequence.

在一些实施例中,所述产品外型的采集包括:In some embodiments, the collection of the product appearance includes:

通过边缘检测算法提取产品边缘并进行二值化;利用最大池化对边缘图像进行下采样处理,得到产品的边缘图像。The edge of the product is extracted and binarized by the edge detection algorithm; the edge image is down-sampled by the maximum pooling to obtain the edge image of the product.

在一些实施例中,所述标签信息的采集包括:In some embodiments, the collection of the label information includes:

对标签的轮廓外部进行定位,连线,截取并保留标签的图像,统计标签轮廓内像素点个数为标准标签面积S;Position, connect, intercept and retain the image of the label outside the outline of the label, and count the number of pixels in the label outline as the standard label area S;

对于标签内部的图像,将其划分为同样大小的像素区间,依次统计区间内部的像素梯度值并形成直方图,连接并归一化得到整个标签图像的HOG描述符并进行存储。For the image inside the label, it is divided into pixel intervals of the same size, and the pixel gradient values in the interval are counted in turn to form a histogram, which is connected and normalized to obtain the HOG descriptor of the entire label image and stored.

在一些实施例中,基于所述产品图像实现产品外形匹配,包括:基于获取的待检产品图像,得到待检产品的边缘图像;将待检产品的边缘图像与标准产品的边缘图像相减,统计灰度值不为0的差异像素点数;设定阈值T1,当差异像素点数大于阈值时,则认定当前产品与标准产品存在型号差异,否则,则视为外型匹配成功。In some embodiments, realizing product shape matching based on the product image includes: obtaining an edge image of the product to be inspected based on the acquired image of the product to be inspected; subtracting the edge image of the product to be inspected and the edge image of the standard product, Count the number of difference pixels whose gray value is not 0; set a threshold T 1 , when the number of difference pixels is greater than the threshold, it is determined that there is a model difference between the current product and the standard product, otherwise, it is considered that the appearance matching is successful.

在一些实施例中,所述截取预设位置图像获得待检测目标,包括:在外型匹配成功后,根据预先定位的截取位置对待测产品图像进行图像裁剪,并保留为待检标签图像。In some embodiments, the intercepting the image of the preset position to obtain the target to be detected includes: after the appearance matching is successful, image cropping is performed on the image of the product to be tested according to the pre-positioned interception position, and the image is retained as the label image to be inspected.

在一些实施例中,判断所述待检标签图像是否满足预设标准,包括:In some embodiments, judging whether the to-be-checked label image meets a preset standard includes:

判断待检标签图像的标签边缘是否满足预设标准;Determine whether the label edge of the label image to be inspected meets the preset standard;

判断待检标签图像的标签内容是否满足预设标准。It is judged whether the label content of the label image to be checked meets the preset standard.

在一些实施例中,所述判断待检标签图像的标签边缘是否满足预设标准,包括:In some embodiments, the judging whether the label edge of the label image to be inspected meets a preset standard includes:

对获取的待检标签图像进行x,y两个方向的梯度计算并保留每个像素的梯度值与梯度方向,随后进行直线检测,保留图像中最长的四条直线,连接并形成内接矩形,统计矩形面积大小S′,计算其与标准标签的IOU值,IOU值的计算方式如下:Perform the gradient calculation in the x and y directions of the acquired label image to be inspected and retain the gradient value and gradient direction of each pixel, then perform line detection, retain the longest four straight lines in the image, connect and form an inscribed rectangle, Count the size of the rectangular area S', and calculate the IOU value between it and the standard label. The calculation method of the IOU value is as follows:

Figure BDA0003446772680000031
Figure BDA0003446772680000031

设定阈值T2,当IOU值大于T2,则标签粘贴正常;否则,则证明标签未粘贴在产品表面的预定位置或标签表面存在破损、毁坏情况而导致表面不完整,需去除后重新粘贴。Set the threshold value T 2 , when the IOU value is greater than T 2 , the label is pasted normally; otherwise, it proves that the label is not pasted on the predetermined position on the product surface or the surface of the label is damaged or damaged, resulting in an incomplete surface, which needs to be removed and then pasted again. .

在一些实施例中,所述判断待检标签图像的标签内容是否满足预设标准,包括:In some embodiments, the judging whether the label content of the label image to be checked meets a preset standard includes:

确认标签完整且正常粘贴后,统计并计算待检标签图像的HOG描述符,计算待检标签图像描述符与标准图像描述符相似度,设定阈值T3,当相似度大于T3时,则判断该产品标签内容完整;否则,则判定该产品标签表面存在污染、遮挡导致标签内容残缺或标签粘贴错误的情况。After confirming that the label is complete and pasted normally, count and calculate the HOG descriptor of the label image to be inspected, calculate the similarity between the image descriptor of the label to be inspected and the standard image descriptor, and set a threshold T 3 , when the similarity is greater than T 3 , then It is judged that the content of the product label is complete; otherwise, it is judged that the surface of the product label is contaminated or blocked, resulting in incomplete label content or wrong label paste.

本申请所披露的一种基于机器视觉的标签检测方法可能带来的有益效果包括但不限于:The possible beneficial effects of a machine vision-based label detection method disclosed in this application include, but are not limited to:

通过计算机视觉图像检测的方法,结合图像采集模块对产品进行定点定位检测,相比人工检查,提升了标签异常粘贴情况的检测准确率,同时可以提供粘贴位置错误、内容残缺、存在表面污染等不同情况的报警信息,协助有关人员及时整改。Through the method of computer vision image detection, combined with the image acquisition module, the fixed-point positioning detection of the product is carried out. Compared with manual inspection, the detection accuracy of abnormal label sticking is improved. Alarm information of the situation and assist the relevant personnel to rectify in time.

附图说明Description of drawings

图1为本发明标准数据信息采集图Fig. 1 is the standard data information collection diagram of the present invention

图2为本发明标间检测流程图Fig. 2 is the flow chart of standard room detection of the present invention

具体实施方式Detailed ways

为了使本申请的目的、技术方案及优点更加清楚明白,以下结合实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the objectives, technical solutions and advantages of the present application more clear, the present application will be further described in detail below with reference to the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application.

相反,本申请涵盖任何由权利要求定义的在本申请的精髓和范围上做的替代、修改、等效方法以及方案。进一步,为了使公众对本申请有更好的了解,在下文对本申请的细节描述中,详尽描述了一些特定的细节部分。对本领域技术人员来说没有这些细节部分的描述也可以完全理解本申请。On the contrary, this application covers any alternatives, modifications, equivalents and arrangements within the spirit and scope of this application as defined by the claims. Further, in order for the public to have a better understanding of the present application, some specific details are described in detail in the following detailed description of the present application. Those skilled in the art can fully understand the present application without the description of these detailed parts.

以下将对本申请实施例所涉及的一种基于机器视觉的标签检测方法进行详细说明。值得注意的是,以下实施例仅仅用于解释本申请,并不构成对本申请的限定。A machine vision-based label detection method involved in the embodiments of the present application will be described in detail below. It should be noted that the following examples are only used to explain the present application, and do not constitute a limitation to the present application.

步骤一:搭建检测设备Step 1: Build testing equipment

首先,根据图1在传送带上方搭建检测装置,并根据传送带的运输速度和图像采集所需时间调整红外感应开关与补光设备以及图像采集模块的之间的距离,使图像采集模块能够正确清晰的采集到的产品的外型和表面的信息。First, build a detection device above the conveyor belt according to Figure 1, and adjust the distance between the infrared sensor switch, the fill light device and the image acquisition module according to the transport speed of the conveyor belt and the time required for image acquisition, so that the image acquisition module can be correctly and clearly The collected information on the appearance and surface of the product.

由于工业生产中大多使用流水线作业,产出产品型号、外观统一,放置方式也相同,因此首先确定产品在运输装置上的检测位置和方向,根据待测标签位置搭建红外感应开关、补光设备与图像采集装置,并根据装置的运输速度调整开关与采集装置之间的距离,使物体运输到确定位置触发开关后,能够在补光后通过图像采集装置获取到正面清晰且易于识别的产品图像。Since most of the industrial production uses assembly line operations, the product model and appearance are uniform, and the placement method is also the same. Therefore, first determine the detection position and direction of the product on the transportation device, and build the infrared sensor switch, fill light equipment and The image acquisition device is used, and the distance between the switch and the acquisition device is adjusted according to the transport speed of the device, so that after the object is transported to a certain position to trigger the switch, a clear and easy-to-recognize product image can be obtained through the image acquisition device after the light is filled.

步骤二:建立标准数据库Step 2: Establish a standard database

选取符合检测标准的产品进行图像采集。对于标准图像数据,需要依次进行产品外型和标签信息的采集。在产品外型的采集中,首先需要通过边缘检测算法提取产品边缘并进行二值化;随后利用最大池化对边缘图像进行下采样处理,得到产品的边缘模板。在标签信息的采集中,首先对矩形标签的轮廓外部进行定位,连线,截取并保留标签的图像以避免外部信息干扰,统计标签轮廓内像素点个数为标准标签面积S;其次,对于标签内部的图像,将其划分为同样大小的像素区间,依次统计区间内部的像素梯度值并形成直方图,连接并归一化得到整个标签图像的HOG描述符并进行存储。Select products that meet the inspection standards for image acquisition. For standard image data, it is necessary to collect product appearance and label information in sequence. In the collection of product appearance, it is first necessary to extract the edge of the product through the edge detection algorithm and perform binarization; then use the maximum pooling to downsample the edge image to obtain the edge template of the product. In the collection of label information, firstly locate, connect, intercept and retain the image of the label outside the outline of the rectangular label to avoid external information interference, and count the number of pixels in the label outline as the standard label area S; secondly, for the label The internal image is divided into pixel intervals of the same size, and the pixel gradient values in the interval are counted in turn to form a histogram, which is connected and normalized to obtain the HOG descriptor of the entire label image and stored.

采集外型、标签粘贴位置符合标准的产品外型图像,高斯滤波后储存为原始标准数据,并依次进行外型特征和标签信息的采集。The product appearance images whose appearance and label sticking position meet the standard are collected, stored as original standard data after Gaussian filtering, and the appearance features and label information are collected in sequence.

在产品外型的采集中,采用Canny算法对图像轮廓进行提取。对于原始数据中的一点P(x,y),首先根据该点与其周围8个邻域点的灰度值,结合sobel算子计算其沿x、y方向的梯度值Gx、Gy,计算方法如公式(1):In the collection of product appearance, the Canny algorithm is used to extract the image contour. For a point P(x,y) in the original data, firstly, according to the gray value of the point and its surrounding 8 neighbor points, combined with the sobel operator to calculate its gradient values Gx, Gy along the x and y directions, the calculation method is as follows Formula 1):

Figure BDA0003446772680000051
Figure BDA0003446772680000051

Figure BDA0003446772680000052
Figure BDA0003446772680000052

其中,p1,p2等为邻域中相应点的灰度值。随后,根据两个方向的梯度值,计算该点的梯度值G和梯度方向θ,计算公式如(2):Among them, p1, p2, etc. are the gray values of the corresponding points in the neighborhood. Then, according to the gradient values in the two directions, the gradient value G and the gradient direction θ of the point are calculated, and the calculation formula is as follows (2):

Figure BDA0003446772680000053
Figure BDA0003446772680000053

Figure BDA0003446772680000054
Figure BDA0003446772680000054

下一步,提取距离梯度方向最小的两邻域点的灰度值进行非极大值抑制,选取灰度值为极值的点作为初始边缘点,并设置阈值TL,将梯度值小于阈值且领域点的梯度皆高于阈值的点排除。对于筛选后的邻域点,赋值为255,其余点赋值为1,得到标准二值轮廓图并保留。Next, extract the gray value of the two neighbor points with the smallest distance from the gradient direction for non-maximum suppression, select the point whose gray value is the extreme value as the initial edge point, and set the threshold value TL, and set the gradient value less than the threshold value and the domain Points whose gradients are all higher than the threshold are excluded. For the filtered neighborhood points, the value is 255, and the remaining points are assigned 1, and the standard binary contour map is obtained and retained.

最后,对二值轮廓图进行最大池化。将图像划分为多个区域,以每个区域中的灰度最大值代替整个区域,对边缘图像进行下采样处理,得到产品的边缘模板。Finally, max pooling is performed on the binary contour map. Divide the image into multiple regions, replace the entire region with the gray value maximum value in each region, and downsample the edge image to obtain the edge template of the product.

在标签信息的采集中,首先需要人工对矩形标签进行定位,并划分略大于标签的区域对标准二值轮廓图进行图像截取。对于截取的标签图像,统计并保留其轮廓内的像素点的位置、梯度信息以及像素总数量作为标准标签的信息。In the collection of label information, it is first necessary to manually locate the rectangular label, and divide the area slightly larger than the label to perform image interception of the standard binary contour map. For the intercepted label image, the position, gradient information and total number of pixels in the contour of the pixel are counted and retained as the standard label information.

随后,将标签内部图像划分为多个区域,对于每一个区域,统计其中每个像素的梯度方向并形成梯度直方图。统计结束后,连接各区域的梯度直方图为直方矩阵,归一化处理后得到标准图像HOG描述符。Then, the internal image of the label is divided into multiple regions, and for each region, the gradient direction of each pixel is counted and a gradient histogram is formed. After the statistics are completed, the gradient histogram connecting each region is a histogram matrix, and the standard image HOG descriptor is obtained after normalization.

步骤三:运输待检产品,采集图像Step 3: Transport the product to be inspected and capture images

利用器械臂将完成了标签粘贴步骤的产品按照与标准数据采集时的方向和姿态放置于传送带,由传送带运输到制定位置,触发开关并获取其表面信息。Use the instrument arm to place the product that has completed the label sticking step on the conveyor belt according to the direction and attitude when the standard data was collected, transport it to the designated position by the conveyor belt, trigger the switch and obtain its surface information.

步骤四:待检产品外形匹配和标签截取Step 4: Shape matching and label interception of products to be inspected

根据步骤三获取的待检产品外表图像,首先,采取与步骤二中相同的参数计算待测图像中像素梯度信息和产品轮廓二值图像,并与标准轮廓二值图像相减,得到差异图像。统计差异图像中灰度值不为0的差异像素点的数量,并与设定阈值T1进行对比,当差异像素点数大于阈值时,系统报警,提示相关人员当前产品型号与预设标准不匹配。According to the appearance image of the product to be inspected obtained in step 3, firstly, adopt the same parameters as in step 2 to calculate the pixel gradient information in the image to be inspected and the product contour binary image, and subtract the standard contour binary image to obtain a difference image. Count the number of difference pixels whose gray value is not 0 in the difference image, and compare it with the set threshold T 1. When the number of difference pixels is greater than the threshold, the system will alarm, prompting the relevant personnel that the current product model does not match the preset standard .

对于外型匹配成功的待测图像,截取与步骤三中相同部位的图像作为待测标签图像并提取相应的梯度信息,储存为待检标签图像。For the image to be tested whose appearance is successfully matched, the image of the same part as in step 3 is intercepted as the image of the label to be tested, and corresponding gradient information is extracted, and stored as the image of the label to be tested.

步骤五:标签边缘检测Step 5: Label Edge Detection

首先,根据步骤四获取的待检标签图像,进行直线检测。将每个像素点的坐标映射到霍夫空间,保留霍夫空间中贡献数量最多的四个点的坐标作为标签边缘线的直线方程参数,由此求得标签图像的边缘信息。First, straight line detection is performed according to the image of the label to be inspected obtained in step 4. The coordinates of each pixel point are mapped to the Hough space, and the coordinates of the four most contributing points in the Hough space are reserved as the parameters of the line equation of the label edge line, thereby obtaining the edge information of the label image.

其次,计算边缘线的内接矩形并与标准标签图像求交并集,并计算IOU值。Second, the inscribed rectangle of the edge line is calculated and intersected with the standard label image, and the IOU value is calculated.

计算公式如(3):The calculation formula is as (3):

Figure BDA0003446772680000071
Figure BDA0003446772680000071

其中,S为标准标签所占面积,S′为待检标签面积。Among them, S is the area occupied by the standard label, and S' is the area of the label to be inspected.

最后,设定阈值T2,当IOU值小于T2,则证明标签未粘贴在产品表面的预定位置或标签表面存在破损、毁坏情况而导致表面不完整,需要去除后重新粘贴。Finally, set the threshold T 2 , when the IOU value is less than T 2 , it means that the label is not pasted on the predetermined position on the product surface or the label surface is damaged or damaged, resulting in an incomplete surface, which needs to be removed and then pasted again.

步骤六:标签内容检测Step 6: Label content detection

对于步骤五中正常粘贴的的标签图像,首先选取相同参数进行步骤二的像素区间划分方式,统计并计算待检测标签图像的HOG描述符。For the label image that is normally pasted in step 5, first select the same parameters to perform the pixel interval division method in step 2, and count and calculate the HOG descriptor of the label image to be detected.

其次,计算待检测图像描述符与标准图像描述符的巴氏距离作为相似度。设定阈值T3,当相似度大于T3时,则判断该产品标签内容完整,可进入生产的下一环节;而当相似度小于T3时,则可判定该产品标签表面存在污染、遮挡导致标签内容残缺或标签粘贴错误的情况,应通知相关人员尽快去除污染或及时更换标签。Second, calculate the Babbitt distance between the image descriptor to be detected and the standard image descriptor as the similarity. Set the threshold T3, when the similarity is greater than T3, it is judged that the content of the product label is complete, and the next step of production can be entered; and when the similarity is less than T3, it can be judged that the surface of the product label is polluted or blocked. If the content of the label is incomplete or the label is affixed incorrectly, the relevant personnel should be notified to remove the pollution as soon as possible or replace the label in time.

以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内所作的任何修改、等同替换和改进等,均应包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present invention shall be included in the protection of the present invention. within the range.

Claims (9)

1.一种基于机器视觉的标签检测方法,其特征在于,包括以下步骤:1. a label detection method based on machine vision, is characterized in that, comprises the following steps: 建立标准数据库;establish a standard database; 获取产品图像;Get product images; 基于所述产品图像实现产品外形匹配;realizing product shape matching based on the product image; 截取预设位置图像获得待检标签图像;Intercept the image of the preset position to obtain the image of the label to be inspected; 判断所述待检标签图像是否满足预设标准。It is judged whether the label image to be inspected satisfies a preset standard. 2.根据权利要求1所述的一种基于机器视觉的标签检测方法,其特征在于,所述建立标准数据库,包括:2. a kind of label detection method based on machine vision according to claim 1, is characterized in that, described establishing standard database, comprises: 选取符合检测标准的产品进行图像采集获得标准图像数据;Select products that meet the testing standards for image acquisition to obtain standard image data; 基于标准图像数据,依次进行产品外型和标签信息的采集。Based on the standard image data, the collection of product appearance and label information is performed in sequence. 3.根据权利要求2所述的一种基于机器视觉的标签检测方法,其特征在于,3. a kind of label detection method based on machine vision according to claim 2, is characterized in that, 所述产品外型的采集包括:The collection of the product appearance includes: 通过边缘检测算法提取产品边缘并进行二值化;利用最大池化对边缘图像进行下采样处理,得到产品的边缘图像。The edge of the product is extracted and binarized by the edge detection algorithm; the edge image is down-sampled by the maximum pooling to obtain the edge image of the product. 4.根据权利要求2所述的一种基于机器视觉的标签检测方法,其特征在于,4. a kind of label detection method based on machine vision according to claim 2, is characterized in that, 所述标签信息的采集包括:The collection of the label information includes: 对标签的轮廓外部进行定位,连线,截取并保留标签的图像,统计标签轮廓内像素点个数为标准标签面积S;Position, connect, intercept and retain the image of the label outside the outline of the label, and count the number of pixels in the label outline as the standard label area S; 对于标签内部的图像,将其划分为同样大小的像素区间,依次统计区间内部的像素梯度值并形成直方图,连接并归一化得到整个标签图像的HOG描述符并进行存储。For the image inside the label, it is divided into pixel intervals of the same size, and the pixel gradient values in the interval are counted in turn to form a histogram, which is connected and normalized to obtain the HOG descriptor of the entire label image and stored. 5.根据权利要求1所述的一种基于机器视觉的标签检测方法,其特征在于,基于所述产品图像实现产品外形匹配,包括:基于获取的待检产品图像,得到待检产品的边缘图像;将待检产品的边缘图像与标准产品的边缘图像相减,统计灰度值不为0的差异像素点数;设定阈值T1,当差异像素点数大于阈值时,则认定当前产品与标准产品存在型号差异,否则,则视为外型匹配成功。5 . The method for label detection based on machine vision according to claim 1 , wherein, realizing product shape matching based on the product image, comprising: obtaining an edge image of the product to be inspected based on the obtained image of the product to be inspected. 6 . ; Subtract the edge image of the product to be inspected and the edge image of the standard product, and count the difference pixels whose gray value is not 0; set a threshold T 1 , when the difference pixel number is greater than the threshold, the current product and the standard product are determined There are model differences, otherwise, it is considered that the appearance matching is successful. 6.根据权利要求1所述的一种基于机器视觉的标签检测方法,其特征在于,所述截取预设位置图像获得待检测目标,包括:在外型匹配成功后,根据预先定位的截取位置对待测产品图像进行图像裁剪,并保留为待检标签图像。6. A machine vision-based label detection method according to claim 1, wherein the intercepting a preset position image to obtain the target to be detected comprises: after the appearance matching is successful, treating the target according to the pre-positioned interception position The image of the product to be tested is cropped and retained as the image of the label to be inspected. 7.根据权利要求1所述的一种基于机器视觉的标签检测方法,其特征在于,判断所述待检标签图像是否满足预设标准,包括:7. A machine vision-based label detection method according to claim 1, wherein judging whether the to-be-checked label image satisfies a preset standard comprises: 判断待检标签图像的标签边缘是否满足预设标准;Determine whether the label edge of the label image to be inspected meets the preset standard; 判断待检标签图像的标签内容是否满足预设标准。It is judged whether the label content of the label image to be checked meets the preset standard. 8.根据权利要求7所述的一种基于机器视觉的标签检测方法,其特征在于,8. a kind of label detection method based on machine vision according to claim 7, is characterized in that, 所述判断待检标签图像的标签边缘是否满足预设标准,包括:Described judging whether the label edge of the label image to be inspected meets the preset standard, including: 对获取的待检标签图像进行x,y两个方向的梯度计算并保留每个像素的梯度值与梯度方向,随后进行直线检测,保留图像中最长的四条直线,连接并形成内接矩形,统计矩形面积大小S′,计算其与标准标签的IOU值,IOU值的计算方式如下:Perform the gradient calculation in the x and y directions of the acquired label image to be inspected and retain the gradient value and gradient direction of each pixel, then perform line detection, retain the longest four straight lines in the image, connect and form an inscribed rectangle, Count the size of the rectangular area S', and calculate the IOU value between it and the standard label. The calculation method of the IOU value is as follows:
Figure FDA0003446772670000021
Figure FDA0003446772670000021
设定阈值T2,当IOU值大于T2,则标签粘贴正常;否则,则证明标签未粘贴在产品表面的预定位置或标签表面存在破损、毁坏情况而导致表面不完整,需去除后重新粘贴。Set the threshold value T 2 , when the IOU value is greater than T 2 , the label is pasted normally; otherwise, it proves that the label is not pasted on the predetermined position on the product surface or the surface of the label is damaged or damaged, resulting in an incomplete surface, which needs to be removed and then pasted again. .
9.根据权利要求7所述的一种基于机器视觉的标签检测方法,其特征在于,9. a kind of label detection method based on machine vision according to claim 7, is characterized in that, 所述判断待检标签图像的标签内容是否满足预设标准,包括:The judging whether the label content of the label image to be checked meets the preset standard includes: 确认标签完整且正常粘贴后,统计并计算待检标签图像的HOG描述符,计算待检标签图像描述符与标准图像描述符相似度,设定阈值T3,当相似度大于T3时,则判断该产品标签内容完整;否则,则判定该产品标签表面存在污染、遮挡导致标签内容残缺或标签粘贴错误的情况。After confirming that the label is complete and pasted normally, count and calculate the HOG descriptor of the label image to be inspected, calculate the similarity between the image descriptor of the label to be inspected and the standard image descriptor, and set a threshold T 3 , when the similarity is greater than T 3 , then It is judged that the content of the product label is complete; otherwise, it is judged that the surface of the product label is contaminated or blocked, resulting in incomplete label content or wrong label paste.
CN202111658741.5A 2021-12-30 2021-12-30 Label detection method based on machine vision Pending CN114332622A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111658741.5A CN114332622A (en) 2021-12-30 2021-12-30 Label detection method based on machine vision

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111658741.5A CN114332622A (en) 2021-12-30 2021-12-30 Label detection method based on machine vision

Publications (1)

Publication Number Publication Date
CN114332622A true CN114332622A (en) 2022-04-12

Family

ID=81018211

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111658741.5A Pending CN114332622A (en) 2021-12-30 2021-12-30 Label detection method based on machine vision

Country Status (1)

Country Link
CN (1) CN114332622A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114707904A (en) * 2022-05-05 2022-07-05 江苏文友软件有限公司 Quality detection method and system based on big data
CN115457253A (en) * 2022-11-11 2022-12-09 浪潮金融信息技术有限公司 Object detection method, system, equipment and medium based on multiple camera modules
CN118365699A (en) * 2024-06-18 2024-07-19 珠海格力电器股份有限公司 Label position deviation detection method, device and detection equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1885317A (en) * 2006-07-06 2006-12-27 上海交通大学 Adaptive edge detection method based on morphology and information entropy
CN107492091A (en) * 2017-07-06 2017-12-19 东莞理工学院 Machine vision-based label appearance detection method and terminal equipment
CN109255787A (en) * 2018-10-15 2019-01-22 杭州慧知连科技有限公司 Silk ingot scratch detection system and method based on deep learning and image processing techniques
CN112001352A (en) * 2020-09-02 2020-11-27 山东大学 Textile operation workbench identification and positioning method and device based on Apriltag
CN112418265A (en) * 2020-10-14 2021-02-26 合肥联宝信息技术有限公司 Label detection method, device and storage medium
CN113393447A (en) * 2021-06-24 2021-09-14 四川启睿克科技有限公司 Needle tip true position detection method and system based on deep learning

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1885317A (en) * 2006-07-06 2006-12-27 上海交通大学 Adaptive edge detection method based on morphology and information entropy
CN107492091A (en) * 2017-07-06 2017-12-19 东莞理工学院 Machine vision-based label appearance detection method and terminal equipment
CN109255787A (en) * 2018-10-15 2019-01-22 杭州慧知连科技有限公司 Silk ingot scratch detection system and method based on deep learning and image processing techniques
CN112001352A (en) * 2020-09-02 2020-11-27 山东大学 Textile operation workbench identification and positioning method and device based on Apriltag
CN112418265A (en) * 2020-10-14 2021-02-26 合肥联宝信息技术有限公司 Label detection method, device and storage medium
CN113393447A (en) * 2021-06-24 2021-09-14 四川启睿克科技有限公司 Needle tip true position detection method and system based on deep learning

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114707904A (en) * 2022-05-05 2022-07-05 江苏文友软件有限公司 Quality detection method and system based on big data
CN115457253A (en) * 2022-11-11 2022-12-09 浪潮金融信息技术有限公司 Object detection method, system, equipment and medium based on multiple camera modules
CN118365699A (en) * 2024-06-18 2024-07-19 珠海格力电器股份有限公司 Label position deviation detection method, device and detection equipment

Similar Documents

Publication Publication Date Title
CN114332622A (en) Label detection method based on machine vision
CN109816644B (en) An automatic detection system for bearing defects based on multi-angle light source images
CN107545239B (en) Fake plate detection method based on license plate recognition and vehicle characteristic matching
CN113283439B (en) Intelligent counting method, device and system based on image recognition
CN108335331B (en) Binocular vision positioning method and equipment for steel coil
CN109839385B (en) Self-adaptive PCB defect visual positioning detection and classification system
CN113052903B (en) Vision and radar fusion positioning method for mobile robot
CN109815822B (en) Patrol diagram part target identification method based on generalized Hough transformation
CN104506857A (en) Camera position deviation detection method and device
CN102799867A (en) Meter pointer angle identification method based on image processing
CN110189375A (en) An Image Target Recognition Method Based on Monocular Vision Measurement
CN106504262A (en) A kind of small tiles intelligent locating method of multiple features fusion
CN118247331B (en) Automatic part size detection method and system based on image recognition
TWI543117B (en) Method for recognizing and locating object
JP2025501823A (en) Method for detecting template mark and correcting template position using a single camera
CN115512381A (en) Text recognition method, text recognition device, text recognition equipment, storage medium and working machine
CN110288040A (en) A kind of similar evaluation method of image based on validating topology and equipment
CN114638835B (en) Sleeper foreign matter detection method based on depth camera
CN116309882A (en) Tray detection and positioning method and system for unmanned forklift application
CN119006419B (en) Part size online detection method and system based on linear array camera
CN102896752B (en) System and method for monitoring and alarming mould image of injection moulding machine
CN111815705B (en) Method and device for identifying pollution of filter protection lens of laser tracker and electronic equipment
CN117864660A (en) A storage conveyor line operation management method and system
CN114964032B (en) Blind hole depth measurement method and device based on machine vision
CN112329770B (en) Instrument scale identification method and device

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