JP2023104829A - Rod-shaped cigarette surface defect detection method and device - Google Patents

Rod-shaped cigarette surface defect detection method and device Download PDF

Info

Publication number
JP2023104829A
JP2023104829A JP2022018435A JP2022018435A JP2023104829A JP 2023104829 A JP2023104829 A JP 2023104829A JP 2022018435 A JP2022018435 A JP 2022018435A JP 2022018435 A JP2022018435 A JP 2022018435A JP 2023104829 A JP2023104829 A JP 2023104829A
Authority
JP
Japan
Prior art keywords
image
detection
stick
cigarette
images
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.)
Granted
Application number
JP2022018435A
Other languages
Japanese (ja)
Other versions
JP7142991B1 (en
Inventor
雪梅 李
Xuemei Li
紫陽 羅
Ziyang Luo
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.)
Chengdu Univeristy of Technology
Original Assignee
Chengdu Univeristy of Technology
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 Chengdu Univeristy of Technology filed Critical Chengdu Univeristy of Technology
Application granted granted Critical
Publication of JP7142991B1 publication Critical patent/JP7142991B1/en
Publication of JP2023104829A publication Critical patent/JP2023104829A/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)
  • Image Analysis (AREA)
  • Length Measuring Devices By Optical Means (AREA)

Abstract

To provide rod-shaped cigarette surface defect detection method and device.SOLUTION: The invention discloses a rod-shaped cigarette surface defect detection method which comprises the following steps of: S1, acquiring images of the front surface and two end surfaces of a rod-shaped cigarette to obtain initial images of the front surface and the two end surfaces of the rod-shaped cigarette; S2, performing preprocessing of format conversion operation, median filtering operation, sobel edge detection operation, OTSU adaptive binarization operation and Hough line detection operation on each collected initial image to obtain preprocessed images of the front surface and the two end surfaces of the rod-shaped cigarette; and S3, performing defect detection on the surface of the rod-shaped cigarette according to the preprocessed images of the front surface and the two end surfaces of the rod-shaped cigarette, wherein the defect detection comprises opening tape missing detection, opening tape offset detection and end surface polyline detection. According to the invention, on the basis of image acquisition and analysis on the surface of the rod-shaped cigarette, defect detection on the surface of the rod-shaped cigarette is achieved, and application in automatic detection is facilitated.SELECTED DRAWING: Figure 1

Description

本発明は、棒状たばこの検出に関し、特に、棒状たばこ表面欠陥検出の方法及び装置に関わる。 The present invention relates to tobacco rod detection, and more particularly to a method and apparatus for detecting surface imperfections in tobacco rods.

現在我が国のたばこ製造レベルは、生産技術の絶え間ない革新が伴うことで、紙巻たばこの巻き包装工程技術が基本的に成熟を迎えているが、棒状たばこ外箱の品質欠陥検出において多くの企業が今でも最も伝統的な手動検出手段を採用している。現在のたばこ外箱包装機の速度は、非常に速く、基本的に700~800箱/分のレベルに達し、新開発の紙巻たばこ包装機が900箱/分にも達することができる。しかしこのようなペースの速い高強度の包装や製造工程では、人間自身の特性上、長期間集中力が続かないため、品質を保証することができないことで、棒状たばこの誤検査、検査漏れにつながる可能性があった。また、一部の極端な環境での検出結果の正確性及び検出データの標準化された保存も、たばこ企業にとっての問題点であった。 At present, the level of cigarette manufacturing in our country is basically maturing in cigarette wrapping process technology, accompanied by constant innovation in production technology. It still employs the most traditional manual detection means. The speed of the current cigarette outer packaging machine is very fast, basically reaching the level of 700-800 boxes/minute, and the newly developed cigarette packaging machine can reach as high as 900 boxes/minute. However, in such a fast-paced, high-strength packaging and manufacturing process, due to the nature of human beings, we cannot concentrate for a long period of time. could be connected. Accuracy of detection results in some extreme environments and standardized storage of detection data have also been issues for tobacco companies.

一部の国内たばこ加工・製造企業は、往々にしてさまざまなセンサーと手動検出という組み合わせ方法を採用することで、検査漏れ率を一般的な許容レベルに制御できるが、開封テープのずれなどの欠陥を検出することが困難である。 Some domestic tobacco processing and manufacturing companies often adopt a combination of various sensors and manual detection methods to control the inspection failure rate to generally acceptable levels, but defects such as tear tape misalignment is difficult to detect.

本発明の目的は、従来技術の不足を克服し、棒状たばこ表面の画像への捕捉分析に基づいて、棒状たばこ表面の欠陥検出を実現でき、自動化検出内に運用することにも便利となる棒状たばこ表面欠陥検出の方法及び装置を提供することである。 The purpose of the present invention is to overcome the deficiencies of the prior art, and to realize the detection of defects on the surface of tobacco rods based on the capture analysis of the surface of tobacco rods, which is also convenient to operate in automated detection. To provide a method and apparatus for tobacco surface defect detection.

本発明の目的は、以下の技術的手段を介して実現する。 The object of the present invention is achieved through the following technical means.

棒状たばこ表面の欠陥検出方法は、以下の構成を有する。すなわち、
S1:棒状たばこの前面及び2つの端面の画像を捕捉して、棒状たばこの前面及び2つの端面の初期画像を得るステップ、
画像を捕捉する方法には、次の構成を有する。すなわち、
第一に、カメラを直接グレースケール出力用に構成し、構成形式はYUV422で、カメラで棒状たばこの前面及び2つの端面の画像を捕捉し、次にYUV422形式の画像をYUV444形式に変換し、棒状たばこの前面及び2つの端面の初期画像を得;
第二に、カメラの出力をRGB565出力として構成し、カメラで棒状たばこの前面及び2つの端面の画像を捕捉して、3枚の画像を得てから3枚の画像を各々RGB565からYUV422形式に変換し、次にYUV422形式の画像をYUV444形式に変換して、棒状たばこの前面及び2つの端面の初期画像を得る。
A method for detecting defects on the surface of a tobacco rod has the following configuration. i.e.
S1: Capturing an image of the front face and two end faces of the tobacco stick to obtain an initial image of the front face and two end faces of the tobacco stick;
A method of capturing an image has the following components. i.e.
First, the camera is configured for direct grayscale output, the configuration format is YUV422, the camera captures images of the front and two end faces of the cigarette stick, and then the images in YUV422 format are converted to YUV444 format, Obtain initial images of the front and two end faces of the tobacco rod;
Second, configure the output of the camera as an RGB565 output, capture images of the front and two end faces of the cigarette stick with the camera, obtain three images, and then convert each of the three images from RGB565 to YUV422 format. Convert and then convert the YUV422 format image to YUV444 format to obtain initial images of the front and two end faces of the cigarette stick.

好ましくは、前記棒状たばこの2つの端面とは、棒状たばこの面積が最小の2つの面をいい、各端面及び棒状たばこの前面に対してそれぞれカメラで画像を捕捉する。 Preferably, the two end faces of the tobacco stick refer to the two faces with the smallest areas of the tobacco stick, and the respective end faces and the front face of the tobacco stick are imaged by a camera.

S2:捕捉した各初期画像に対して形式変換操作、メディアンフィルタ操作、sobelエッジ検出操作、OTSUの適応的二値化操作及びハフライン検出操作の前処理を施し、棒状たばこの前面及び2つの端面の前処理画像を得るステップ、
前記ステップS2は、次のサブステップS201~S206を含む。すなわち、
ステップS1で得られた初期画像のいずれかについて、YUV444形式の画像データからAXI4プロトコルのStreamビデオストリームの専用形式に変換するステップS201、
変換されたAXI4-Stream形式の画像データに対してメディアンフィルタ操作を行い、画像内のゴマ塩ノイズを除去して、不必要な干渉を減らすステップS202、
メディアンフィルタ後の画像データに対してSobelエッジ検出操作を行い、Sobelオペレータをコアとして、メディアンフィルタ後の画像データの画像全体に対してエッジ検出操作を行い、操作後に出力される画像データは棒状たばこの背景などの干渉情報を破棄し、画像全体の全ての境界線を保持し、さらに不必要な干渉を減らすことで、後処理のためにリソース及び時間を節約するステップS203、
エッジ検出後の画像データに対してOTSUの適応的二値化操作を行い、画像全体をモノクロ画像に分割(すなわち、グレースケール値は0と255のみである)することで、境界線の特徴を強調すると共に背景などの役に立たない情報を弱め、その後の判断が容易になるステップS204、
二値化した画像データに対してハフライン検出操作を行い、画像全体の直線を分割し、ハフライン検出操作は検出された画像データを出力すると同時にパラメータMAX_LINE_NUMを返し、前記パラメータの意味は検出過程中で検出された斜線の数の合計であり、前のエッジ検出後の画像内の線が連続していないため、ハフライン検出は検出精度をさらに向上し、その後の判断が容易になるステップS205、
棒状たばこの前面及び2つの端面の初期画像に対してそれぞれステップS201~S205の前処理を施し、棒状たばこの前面及び2つの端面の前処理画像を得るステップS206。
S2: Each captured initial image is preprocessed with a format conversion operation, a median filter operation, a sobel edge detection operation, an OTSU adaptive binarization operation, and a hough line detection operation, and the front and two end faces of the cigarette stick are obtained. obtaining a preprocessed image;
Said step S2 includes the following sub-steps S201-S206. i.e.
Step S201 for converting any of the initial images obtained in step S1 from YUV444 format image data into a dedicated format for the AXI4 protocol Stream video stream;
Step S202 of performing a median filter operation on the converted AXI4-Stream format image data to remove salt and pepper noise in the image to reduce unnecessary interference;
A Sobel edge detection operation is performed on the image data after the median filter. With the Sobel operator as the core, an edge detection operation is performed on the entire image of the image data after the median filter. step S203, discarding interference information such as the background of the
OTSU adaptive binarization is performed on the image data after edge detection, and the entire image is divided into monochrome images (i.e., the grayscale values are only 0 and 255), so that the boundary features can be identified. Step S204 for emphasizing and weakening useless information such as the background to facilitate subsequent judgment;
A Hough line detection operation is performed on the binarized image data to divide straight lines in the entire image. The Hough line detection operation outputs the detected image data and returns a parameter MAX_LINE_NUM at the same time. It is the total number of detected oblique lines, and since the lines in the image after the previous edge detection are not continuous, the Hough line detection further improves the detection accuracy and facilitates the subsequent judgment step S205;
The initial images of the front face and the two end faces of the cigarette stick are preprocessed in steps S201 to S205, respectively, to obtain preprocessed images of the front face and the two end faces of the cigarette stick in step S206.

S3:棒状たばこの前面及び2つの端面の前処理画像に従って、開封テープ欠落検出、開封テープのずれ検出及び端面ポリライン検出を含む棒状たばこの表面欠陥検出を行うステップ。 S3: A step of performing surface defect detection of the cigarette stick, including tear tape missing detection, tear tape deviation detection and end face polyline detection, according to the pre-processed images of the front face and two end faces of the cigarette stick.

ステップS3に記載の開封テープ欠落検出は、以下の構成を有する。すなわち、
棒状たばこ箱の長さを280mm、高さを85mmとし、カメラで棒状たばこの表面画像を捕捉する時、撮影精度は0.12mm/Pixelになる場合(ここでPixelはピクセルを表す)、画像内の各行の合計は280mm/(0.12mm/Pixel)=2332Pixelで、各列の合計が85mm/(0.12mm/Pixel)=708Pixelであること、
棒状たばこ前面の前処理画像へのスキャン:
画像の各ピクセルのグレースケール値を左から右、上から下に順次スキャンして、0に初期化されるカウンターを構築し、スキャン過程中に1行に11個連続のピクセルのグレースケール値が255の場合、カウンターは1ずつ増加し、画像全体をスキャンした後、カウンターのカウント値は画像全体内の判断条件を満たす行数の合計であり、この時再度判定を行い、すなわち、
カウンターの値が棒状たばこの高さのピクセル値の2/3を超える場合(すなわち、708Pixel×2/3=472Pixelを超える)、前記棒状たばこの開封テープが存在すると判断され、超えない場合、開封テープ欠落の欠陥が現れたと判断される。
The missing tape detection described in step S3 has the following configuration. i.e.
If the cigarette stick has a length of 280 mm and a height of 85 mm, and the surface image of the cigarette stick is captured by a camera, the photographing accuracy is 0.12 mm/pixel (here, Pixel represents a pixel). each row sums 280 mm/(0.12 mm/Pixel) = 2332 Pixels and each column sums 85 mm/(0.12 mm/Pixel) = 708 Pixels;
Scanning to a preprocessed image of the front face of a cigarette stick:
By sequentially scanning the grayscale value of each pixel in the image from left to right and top to bottom, a counter is constructed that is initialized to 0, and during the scanning process the grayscale values of 11 consecutive pixels in a row are obtained. 255, the counter is incremented by 1. After scanning the entire image, the count value of the counter is the sum of the number of lines in the entire image that satisfy the judgment condition, and then make another judgment, namely:
If the value of the counter exceeds 2/3 of the height pixel value of the cigarette stick (i.e., exceeds 708 Pixels x 2/3 = 472 Pixels), it is determined that the tear tape on the cigarette stick is present; It is determined that a missing tape defect has appeared.

ステップS3に記載の開封テープのずれ検出は、以下の構成を有する。すなわち、
棒状たばこの前面の前処理画像について、開封テープ欠落の判断を経た後で開封テープが存在する場合、2次元配列を構築するステップA1:
棒状たばこの前面の前処理画像について、各列内のグレースケール値が255のピクセル数の合計を集計するステップA11、
2次元座標系を構築するステップA12:原点は、棒状たばこの前面の前処理画像の右下隅にあり、y軸と棒状たばこの前面の前処理画像の右の境界線が同一直線上にあり、y軸の方向は下から上となり;x軸と棒状たばこの前面の前処理画像の下の境界線が同一直線上にあり、x軸の方向は右から左となり、
右から左への方向で、棒状たばこの前面の前処理画像のi列目のピクセルについて、この列のシリアル番号iをx軸座標xiとし、この列のグレースケール値が255のピクセル数の合計をy軸座標yiとした場合、i列目のピクセルの2次元座標(xi、yi)であり、ここで、i=1、2、…Nで、Nは棒状たばこの前面の前処理画像のピクセルの列数を表し、N=2332;
各列のピクセルについて、ステップA12を繰り返し、全ての2次元座標を得て2次元配列(x1、y1)、(x2、y2)、…、(xN、yN)を形成するステップA13、
2次元配列をトラバースすることにより、左右の境界線x1、xNを除いて、配列に格納されているピクセル総数の最大の2つのx軸座標を見つけ出して、xk1、xk2として記録し、これは開封テープの2つの境界線の位置であり、さらにxk1、xk2の中間位置を取り出して、開封テープの中心点のx軸座標x0を得るステップA14、
開封テープの中心点と棒状たばこの前面の前処理画像の右の境界線との間の距離は、実際に開封テープの中心点とy軸との間の距離、すなわち開封テープの中心点のx座標軸の座標x0に相当し、開封テープの中心点と棒状たばこの前面の前処理画像の右の境界線との間の距離をD=x0として記録し、距離Dを標準距離STDと比較して、ずれ量T=D-STDを得;
ずれ量Tの絶対値が予め設定されたしきい値を超える場合、開封テープのずれ欠陥が存在するとみなされるステップA2。
The deviation detection of the opening tape described in step S3 has the following configuration. i.e.
For the preprocessed image of the front face of the cigarette bar, if the tear tape is present after the determination of the tear tape missing, step A1 of constructing a two-dimensional array:
step A11 of summing the number of pixels with a grayscale value of 255 in each column for the preprocessed image of the front face of the cigarette stick;
Step A12 of constructing a two-dimensional coordinate system: the origin is at the lower right corner of the preprocessed image of the front surface of the cigarette stick, the y-axis and the right boundary line of the preprocessed image of the front surface of the tobacco stick are on the same straight line, The direction of the y-axis is from bottom to top;
In the direction from right to left, for pixels in the i-th column of the preprocessed image of the front face of the cigarette stick, the serial number i of this column is the x-axis coordinate xi, and the total number of pixels whose grayscale value is 255 in this column is the two-dimensional coordinate (xi, yi) of the i-th pixel, where i=1, 2, . represents the number of columns of pixels, N=2332;
step A13 of repeating step A12 for each column of pixels to obtain all the two-dimensional coordinates to form a two-dimensional array (x1, y1), (x2, y2), ..., (xN, yN);
By traversing the two-dimensional array, excluding the left and right borders x1, xN, find the two x-axis coordinates with the largest total number of pixels stored in the array and record them as xk1, xk2, which is the unpacking Step A14, which is the position of the two boundary lines of the tape, and further extracts the intermediate position between xk1 and xk2 to obtain the x-axis coordinate x0 of the center point of the unsealed tape;
The distance between the center point of the tear tape and the right border of the preprocessed image of the front face of the cigarette stick is actually the distance between the center point of the tear tape and the y-axis, i.e. the x of the center point of the tear tape. Corresponding to the coordinate x0 of the coordinate axes, the distance between the center point of the tear tape and the right border of the preprocessed image of the front face of the cigarette stick was recorded as D=x0, and the distance D was compared with the standard distance STD. , to obtain the amount of deviation T = D - STD;
If the absolute value of the deviation amount T exceeds a preset threshold value, step A2, it is assumed that there is a deviation defect of the opening tape.

好ましくは、開封テープのずれ欠陥が存在した場合、Tの正又は負に従ってずれの方向を確認し、すなわちT>0の場合、開封テープが左にずれ、T<0の場合、開封テープが右にずれる。 Preferably, if a tear tape deviation defect is present, the direction of deviation is determined according to the positive or negative of T, i.e., if T>0, the tear tape is shifted to the left, and if T<0, the tear tape is shifted to the right. shift to

ステップS3に記載の端面ポリライン検出は、以下の構成を有する。すなわち、
ステップS2で各端面の前処理画像を得ると共に、ステップS205で返されたパラメータMAX_LINE_NUMに従って端面ポリライン検出を実行するステップ:MAX_LINE_NUM値が4に等しい場合、1を出力し、現在の端面が正常であることを示し、それ以外の場合0を出力し、現在の端面に欠陥があることを示す。
The edge face polyline detection described in step S3 has the following configuration. i.e.
Obtaining a preprocessed image of each endface in step S2 and performing endface polyline detection according to the parameter MAX_LINE_NUM returned in step S205: if the MAX_LINE_NUM value is equal to 4, then output 1, the current endface is normal. Otherwise, output 0 to indicate that the current endface is defective.

棒状たばこ表面の欠陥検出装置であって、
検出領域における棒状たばこの前面及び2つの端面の画像を捕捉し、棒状たばこの前面及び2つの端面の初期画像を得て、制御モジュールに伝送するための棒状たばこ画像捕捉装置と、
捕捉した各初期画像に対して形式変換操作、メディアンフィルタ操作、sobelエッジ検出操作、OTSUの適応的二値化操作及びハフライン検出操作の前処理を施し、棒状たばこの前面及び2つの端面の前処理画像を得、棒状たばこの前面及び2つの端面の前処理画像に基づいて棒状たばこ表面の欠陥検出を行い、欠陥の有無及び欠陥がある場合の欠陥タイプである欠陥検出結果を出力し、欠陥がある場合、不良品排除コマンドを生成するための制御モジュールとを備える。
An apparatus for detecting defects on the surface of a tobacco rod,
a tobacco rod image capture device for capturing an image of the front and two end faces of the tobacco rod in the detection area to obtain an initial image of the front and two end faces of the tobacco rod and transmitting to the control module;
Each initial captured image was preprocessed with a format conversion operation, a median filter operation, a sobel edge detection operation, an OTSU adaptive binarization operation, and a hough line detection operation to preprocess the front and two end faces of the cigarette stick. An image is obtained, and defect detection is performed on the surface of the tobacco rod based on the preprocessed images of the front surface and two end surfaces of the tobacco rod, and a defect detection result, which is the presence or absence of a defect and the defect type if there is a defect, is output. A control module for generating rejection commands, if any.

前記欠陥検出装置は、棒状たばこ搬送装置と、検出光源と、不良品排除装置と、表示モジュールとをさらに備え、
前記棒状たばこ搬送装置は、検出対象の棒状たばこを検出領域に搬送し、検出が完了した後、検出対象の棒状たばこを検出領域から搬出するために用いられ、
前記検出光源は、検出領域を照らし、検出領域の明るさを確保するために用いられ、
前記表示モジュールは、制御モジュールから出力された欠陥判断結果を受信して表示するために用いられ、
前記不良品排除装置は、制御モジュールが棒状たばこに欠陥があることを検出した時、制御モジュールで生成された不良品排除コマンドに従って欠陥がある棒状たばこを排除するために用いられる。
The defect detection device further includes a cigarette stick conveying device, a detection light source, a defective product exclusion device, and a display module,
The tobacco rod conveying device is used to convey the tobacco rod to be detected to the detection area, and after the detection is completed, carry out the tobacco rod to be detected from the detection area,
The detection light source is used to illuminate the detection area and ensure the brightness of the detection area,
The display module is used to receive and display the defect determination result output from the control module,
Said rejection device is used to reject the defective cigarette stick according to the rejection command generated by the control module when the control module detects that the cigarette stick is defective.

前記棒状たばこ画像捕捉装置は、3台のカメラを備え、1台のカメラが棒状たばこの前面画像を捕捉するために用いられ、他の2台のカメラが棒状たばこの端面画像を捕捉するために用いられる。 The cigarette stick image capturing device comprises three cameras, one camera is used to capture the front image of the cigarette stick, and the other two cameras are used to capture the end image of the cigarette stick. Used.

本発明は、棒状たばこ表面の画像捕捉分析に基づき、棒状たばこ表面の欠陥検出を実現でき、自動化検出への応用に便利で、製造包装工程中の不合格品の排除のために条件を提供する。 Based on the image capture analysis of the surface of the tobacco rod, the present invention can realize the detection of defects on the surface of the tobacco rod, which is convenient for the application of automated detection and provides the conditions for rejection during the manufacturing and packaging process. .

本発明の方法のフローチャートである。3 is a flow chart of the method of the invention; 本発明の装置の原理を示す概略図である。1 is a schematic diagram illustrating the principle of the device of the invention; FIG.

以下、添付図面を参照しつつ、本発明の技術的手段をさらに詳細に描写するが、本発明の保護範囲は下記に限定されない。 Hereinafter, the technical means of the present invention will be described in more detail with reference to the accompanying drawings, but the scope of protection of the present invention is not limited to the following.

図1に示すように、棒状たばこ表面の欠陥検出方法は、以下の構成を有する。すなわち、
S1:棒状たばこの前面及び2つの端面の画像を捕捉して、棒状たばこの前面及び2つの端面の初期画像を得るステップ
前記棒状たばこの2つの端面とは、棒状たばこの面積が最小の2つの面をいい、各端面及び棒状たばこの前面に対してそれぞれカメラで画像を捕捉し;
画像を捕捉する方法には、次の構成を有する。すなわち、
第一に、カメラを直接グレースケール出力用に構成し、構成形式はYUV422で、カメラで棒状たばこの前面及び2つの端面の画像を捕捉し、次にYUV422形式の画像をYUV444形式に変換し、棒状たばこの前面及び2つの端面の初期画像を得;
第二に、カメラの出力をRGB565出力として構成し、カメラで棒状たばこの前面及び2つの端面の画像を捕捉して、3枚の画像を得てから3枚の画像を各々RGB565からYUV422形式に変換し、次にYUV422形式の画像をYUV444形式に変換して、棒状たばこの前面及び2つの端面の初期画像を得る。
As shown in FIG. 1, the method for detecting defects on the surface of a tobacco stick has the following configuration. i.e.
S1: A step of capturing images of the front surface and two end surfaces of the tobacco rod to obtain initial images of the front surface and the two end surfaces of the tobacco rod. The surface is captured by a camera for each end surface and the front surface of the tobacco rod;
A method of capturing an image has the following components. i.e.
First, the camera is configured for direct grayscale output, the configuration format is YUV422, the camera captures images of the front and two end faces of the cigarette stick, and then the images in YUV422 format are converted to YUV444 format, Obtain initial images of the front and two end faces of the tobacco rod;
Second, configure the output of the camera as an RGB565 output, capture images of the front and two end faces of the cigarette stick with the camera, obtain three images, and then convert each of the three images from RGB565 to YUV422 format. Convert and then convert the YUV422 format image to YUV444 format to obtain initial images of the front and two end faces of the cigarette stick.

S2:捕捉した各初期画像に対して形式変換操作、メディアンフィルタ操作、sobelエッジ検出操作、OTSUの適応的二値化操作及びハフライン検出操作の前処理を施し、棒状たばこの前面及び2つの端面の前処理画像を得るステップ
前記ステップS2は、次のサブステップS201~S206を含む。すなわち、
ステップS1で得られた初期画像のいずれかについて、YUV444形式の画像データからAXI4プロトコルのStreamビデオストリームの専用形式に変換するステップS201、
変換されたAXI4-Stream形式の画像データに対してメディアンフィルタ操作を行い、画像内のゴマ塩ノイズを除去して、不必要な干渉を減らすステップS202、
メディアンフィルタ後の画像データに対してSobelエッジ検出操作を行い、Sobelオペレータをコアとして、メディアンフィルタ後の画像データの画像全体に対してエッジ検出操作を行い、操作後に出力される画像データは棒状たばこの背景などの干渉情報を破棄し、画像全体の全ての境界線を保持し、さらに不必要な干渉を減らすことで、後処理のためにリソース及び時間を節約するステップS203、
エッジ検出後の画像データに対してOTSUの適応的二値化操作を行い、画像全体をモノクロ画像に分割(すなわち、グレースケール値は0と255のみである)することで、境界線の特徴を強調すると共に背景などの役に立たない情報を弱め、その後の判断が容易になるステップS204、
二値化した画像データに対してハフライン検出操作を行い、画像全体の直線を分割し、ハフライン検出操作は検出された画像データを出力すると同時にパラメータMAX_LINE_NUMを返し、前記パラメータの意味は検出過程中で検出された斜線の数の合計であり、前のエッジ検出後の画像内の線が連続していないため、ハフライン検出は検出精度をさらに向上し、その後の判断が容易になるステップS205、
棒状たばこの前面及び2つの端面の初期画像に対してそれぞれステップS201~S205の前処理を施し、棒状たばこの前面及び2つの端面の前処理画像を得るステップS206。
S2: Each captured initial image is preprocessed with a format conversion operation, a median filter operation, a sobel edge detection operation, an OTSU adaptive binarization operation, and a hough line detection operation, and the front and two end faces of the cigarette stick are obtained. Obtaining a preprocessed image Said step S2 comprises the following sub-steps S201-S206. i.e.
Step S201 for converting any of the initial images obtained in step S1 from YUV444 format image data into a dedicated format for the AXI4 protocol Stream video stream;
Step S202 of performing a median filter operation on the converted AXI4-Stream format image data to remove salt and pepper noise in the image to reduce unnecessary interference;
A Sobel edge detection operation is performed on the image data after the median filter. With the Sobel operator as the core, an edge detection operation is performed on the entire image of the image data after the median filter. step S203, discarding interference information such as the background of the
OTSU adaptive binarization is performed on the image data after edge detection, and the entire image is divided into monochrome images (i.e., the grayscale values are only 0 and 255), so that the boundary features can be identified. Step S204 for emphasizing and weakening useless information such as the background to facilitate subsequent judgment;
A Hough line detection operation is performed on the binarized image data to divide straight lines in the entire image. The Hough line detection operation outputs the detected image data and returns a parameter MAX_LINE_NUM at the same time. It is the total number of detected oblique lines, and since the lines in the image after the previous edge detection are not continuous, the Hough line detection further improves the detection accuracy and facilitates the subsequent judgment step S205;
The initial images of the front face and the two end faces of the cigarette stick are preprocessed in steps S201 to S205, respectively, to obtain preprocessed images of the front face and the two end faces of the cigarette stick in step S206.

S3:棒状たばこの前面及び2つの端面の前処理画像に従って、開封テープ欠落検出、開封テープのずれ検出及び端面ポリライン検出を含む棒状たばこの表面欠陥検出を行うステップ。 S3: A step of performing surface defect detection of the cigarette stick, including tear tape missing detection, tear tape deviation detection and end face polyline detection, according to the pre-processed images of the front face and two end faces of the cigarette stick.

ステップS3に記載の開封テープ欠落検出は、以下の構成を有する。すなわち、
棒状たばこ箱の長さを280mm、高さを85mmとし、カメラで棒状たばこの表面画像を捕捉する時、撮影精度は0.12mm/Pixelになる場合(ここでPixelはピクセルを表す)、画像内の各行の合計は280mm/(0.12mm/Pixel)=2332Pixelで、各列の合計が85mm/(0.12mm/Pixel)=708Pixelであること、
棒状たばこ前面の前処理画像へのスキャン:
画像の各ピクセルのグレースケール値を左から右、上から下に順次スキャンして、0に初期化されるカウンターを構築し、スキャン過程中に1行に11個連続のピクセルのグレースケール値が255の場合、カウンターは1ずつ増加し、画像全体をスキャンした後、カウンターのカウント値は画像全体内の判断条件を満たす行数の合計であり、この時再度判定を行い、すなわち、
カウンターの値が棒状たばこの高さのピクセル値の2/3を超える場合(すなわち、708Pixel×2/3=472Pixelを超える)、前記棒状たばこの開封テープが存在すると見なされ、超えない場合、開封テープ欠落の欠陥が現れたと見なされる。
The missing tape detection described in step S3 has the following configuration. i.e.
If the cigarette stick has a length of 280 mm and a height of 85 mm, and the surface image of the cigarette stick is captured by a camera, the photographing accuracy is 0.12 mm/pixel (here, Pixel represents a pixel). each row sums 280 mm/(0.12 mm/Pixel) = 2332 Pixels and each column sums 85 mm/(0.12 mm/Pixel) = 708 Pixels;
Scanning to a preprocessed image of the front face of a cigarette stick:
By sequentially scanning the grayscale value of each pixel in the image from left to right and top to bottom, a counter is constructed that is initialized to 0, and during the scanning process the grayscale values of 11 consecutive pixels in a row are obtained. 255, the counter is incremented by 1. After scanning the entire image, the count value of the counter is the sum of the number of lines in the entire image that satisfy the judgment condition, and then make another judgment, namely:
If the value of the counter exceeds 2/3 of the cigarette stick height pixel value (i.e., exceeds 708 Pixels x 2/3 = 472 Pixels), the tear tape on said cigarette stick is considered present; A missing tape defect is assumed to have appeared.

ステップS3に記載の開封テープのずれ検出は、以下の構成を有する。すなわち、
棒状たばこの前面の前処理画像について、開封テープ欠落の判断を経た後で開封テープが存在する場合、2次元配列を構築するステップA1:
棒状たばこの前面の前処理画像について、各列内のグレースケール値が255のピクセル数の合計を集計するステップA11、
2次元座標系を構築するステップA12:原点は、棒状たばこの前面の前処理画像の右下隅にあり、y軸と棒状たばこの前面の前処理画像の右の境界線が同一直線上にあり、y軸の方向は下から上となり;x軸と棒状たばこの前面の前処理画像の下の境界線が同一直線上にあり、x軸の方向は右から左となり、
右から左への方向で、棒状たばこの前面の前処理画像のi列目のピクセルについて、この列のシリアル番号iをx軸座標xiとし、この列のグレースケール値が255のピクセル数の合計をy軸座標yiとした場合、i列目のピクセルの2次元座標(xi、yi)であり、ここで、i=1、2、…Nで、Nは棒状たばこの前面の前処理画像のピクセルの列数を表し、N=2332;
各列のピクセルについて、ステップA12を繰り返し、全ての2次元座標を得て2次元配列(x1、y1)、(x2、y2)、…、(xN、yN)を形成するステップA13、
2次元配列をトラバースすることにより、左右の境界線x1、xNを除いて、配列に格納されているピクセル総数の最大の2つのx軸座標を見つけ出して、xk1、xk2として記録し、これは開封テープの2つの境界線の位置であり、さらにxk1、xk2の中間位置を取り出して、開封テープの中心点のx軸座標x0を得るステップA14、
開封テープの中心点と棒状たばこの前面の前処理画像の右の境界線との間の距離は、実際に開封テープの中心点とy軸との間の距離、すなわち開封テープの中心点のx座標軸の座標x0に相当し、開封テープの中心点と棒状たばこの前面の前処理画像の右の境界線との間の距離をD=x0として記録し、距離Dを標準距離STDと比較して、ずれ量T=D-STDを得;
ずれ量Tの絶対値が予め設定されたしきい値を超える場合、開封テープのずれ欠陥が存在するとみなされ;
好ましくは、開封テープのずれ欠陥が存在した場合、Tの正又は負に従ってずれの方向を確認し、すなわちT>0の場合、開封テープが左にずれ、T<0の場合、開封テープが右にずれるステップA2。
The deviation detection of the opening tape described in step S3 has the following configuration. i.e.
For the preprocessed image of the front face of the cigarette bar, if the tear tape is present after the determination of the tear tape missing, step A1 of constructing a two-dimensional array:
step A11 of summing the number of pixels with a grayscale value of 255 in each column for the preprocessed image of the front face of the cigarette stick;
Step A12 of constructing a two-dimensional coordinate system: the origin is at the lower right corner of the preprocessed image of the front surface of the cigarette stick, the y-axis and the right boundary line of the preprocessed image of the front surface of the tobacco stick are on the same straight line, The direction of the y-axis is from bottom to top;
In the direction from right to left, for pixels in the i-th column of the preprocessed image of the front face of the cigarette stick, the serial number i of this column is the x-axis coordinate xi, and the total number of pixels whose grayscale value is 255 in this column is the two-dimensional coordinate (xi, yi) of the i-th pixel, where i=1, 2, . represents the number of columns of pixels, N=2332;
step A13 of repeating step A12 for each column of pixels to obtain all the two-dimensional coordinates to form a two-dimensional array (x1, y1), (x2, y2), ..., (xN, yN);
By traversing the two-dimensional array, excluding the left and right borders x1, xN, find the two x-axis coordinates with the largest total number of pixels stored in the array and record them as xk1, xk2, which is the unpacking Step A14, which is the position of the two boundary lines of the tape, and further extracts the intermediate position between xk1 and xk2 to obtain the x-axis coordinate x0 of the center point of the unsealed tape;
The distance between the center point of the tear tape and the right border of the preprocessed image of the front face of the cigarette stick is actually the distance between the center point of the tear tape and the y-axis, i.e. the x of the center point of the tear tape. Corresponding to the coordinate x0 of the coordinate axes, the distance between the center point of the tear tape and the right border of the preprocessed image of the front face of the cigarette stick was recorded as D=x0, and the distance D was compared with the standard distance STD. , to obtain the amount of deviation T = D - STD;
If the absolute value of the deviation amount T exceeds a preset threshold, it is considered that there is a deviation defect of the tear tape;
Preferably, if a tear tape deviation defect is present, the direction of deviation is determined according to the positive or negative of T, i.e., if T>0, the tear tape is shifted to the left, and if T<0, the tear tape is shifted to the right. step A2.

いくつかの実施例において、開封テープのずれ欠陥が存在した場合、Tの正又は負に従ってずれの方向を確認でき、すなわちT>0の場合、開封テープが左にずれ、T<0の場合、開封テープが右にずれる。 In some embodiments, if a tear tape misalignment defect is present, the direction of the misalignment can be identified according to the positive or negative of T, i.e., if T>0, the tear tape is displaced to the left; The tear tape shifts to the right.

ステップS3に記載の端面ポリライン検出は、以下の構成を有する。すなわち、
ステップS2で各端面の前処理画像を得ると共に、ステップS205で返されたパラメータMAX_LINE_NUMに従って端面ポリライン検出を実行するステップ:MAX_LINE_NUM値が4に等しい場合、1を出力し、現在の端面が正常であることを示し、それ以外の場合0を出力し、現在の端面に欠陥があることを示す。
The edge face polyline detection described in step S3 has the following configuration. i.e.
Obtaining a preprocessed image of each endface in step S2 and performing endface polyline detection according to the parameter MAX_LINE_NUM returned in step S205: if the MAX_LINE_NUM value is equal to 4, then output 1, the current endface is normal. Otherwise, output 0 to indicate that the current endface is defective.

図2に示すように、棒状たばこ表面の欠陥検出装置であって、
検出領域における棒状たばこの前面及び2つの端面の画像を捕捉し、棒状たばこの前面及び2つの端面の初期画像を得て、制御モジュールに伝送するための棒状たばこ画像捕捉装置と、
捕捉した各初期画像に対して形式変換操作、メディアンフィルタ操作、sobelエッジ検出操作、OTSUの適応的二値化操作及びハフライン検出操作の前処理を施し、棒状たばこの前面及び2つの端面の前処理画像を得、棒状たばこの前面及び2つの端面の前処理画像に基づいて棒状たばこ表面の欠陥検出を行い、欠陥の有無及び欠陥がある場合の欠陥タイプである欠陥検出結果を出力し、欠陥がある場合、不良品排除コマンドを生成するための制御モジュールとを備える。
As shown in FIG. 2, an apparatus for detecting defects on the surface of a tobacco rod, comprising:
a tobacco rod image capture device for capturing an image of the front and two end faces of the tobacco rod in the detection area to obtain an initial image of the front and two end faces of the tobacco rod and transmitting to the control module;
Each initial captured image was preprocessed with a format conversion operation, a median filter operation, a sobel edge detection operation, an OTSU adaptive binarization operation, and a hough line detection operation to preprocess the front and two end faces of the cigarette stick. An image is obtained, and defect detection is performed on the surface of the tobacco rod based on the preprocessed images of the front surface and two end surfaces of the tobacco rod, and a defect detection result, which is the presence or absence of a defect and the defect type if there is a defect, is output. A control module for generating rejection commands, if any.

前記欠陥検出装置は、棒状たばこ搬送装置と、検出光源と、不良品排除装置と、表示モジュールとをさらに備え、
前記棒状たばこ搬送装置は、検出対象の棒状たばこを検出領域に搬送し、検出が完了した後、検出対象の棒状たばこを検出領域から搬出するために用いられ;本出願のいくつかの実施例において、前記棒状たばこ搬送装置は、コンベアベルトを用いることができ、検出対象の棒状たばこを検出領域に搬送し、検出が完了するたびに、棒状たばこを棒状たばこの貯蔵箱/ケースに搬送し続け;コンベアベルトを用いるため、流れてくるように検出でき、1本のコンベアベルト上で複数の検出対象の棒状たばこを順次搬送でき、各棒状たばこが検出領域に到達した後に検出でき、検出が完了した後、次の棒状たばこが到達すると検出を続行し;
前記検出光源は、検出領域を照らし、検出領域の明るさを確保するために用いられ、
前記表示モジュールは、制御モジュールから出力された欠陥判断結果を受信して表示するために用いられ、
前記不良品排除装置は、制御モジュールが棒状たばこに欠陥があることを検出した時、制御モジュールで生成された不良品排除コマンドに従って欠陥がある棒状たばこを排除するために用いられ;本出願の実施例において、前記不良品排除装置は、マニピュレータを用いることができ、制御モジュールの排除コマンドを受信した時、欠陥のある棒状たばこを拾い上げて指定された欠陥のある棒状たばこ収集箱/ケース等に入れ;不良品排除装置はまた、運動方向と搬送装置の搬送方向との共面に垂直なシリンダを用いることができ、シリンダのピストンの運動方向に欠陥のある棒状たばこ収集箱/ケースを設け、制御モジュールの排除コマンドを受信した時、シリンダで欠陥のある棒状たばこを欠陥のある棒状たばこ収集箱/ケース内に押し込む(例えば棒状たばこ搬送装置がコンベアベルトを用いる場合、シリンダのピストン運動方向をコンベアベルトがある平面に設け、コンベアベルトの搬送方向に垂直で、制御モジュールの排除コマンドを受信した後、欠陥のある棒状たばこをコンベアベルトから押し出し、押し出し位置のコンベアベルトの真下に欠陥のある棒状たばこ収集箱/ケースを設けて収集を完了できる)。
The defect detection device further includes a cigarette stick conveying device, a detection light source, a defective product exclusion device, and a display module,
The tobacco rod conveying device is used to convey the tobacco rod to be detected to the detection area, and after the detection is completed, carry out the tobacco rod to be detected from the detection area; , the tobacco stick conveying device can use a conveyor belt to convey the tobacco rod to be detected to the detection area, and continue to convey the tobacco rod to the tobacco rod storage box/case each time detection is completed; Since a conveyor belt is used, it can be detected as if it is flowing, a plurality of rod-shaped cigarettes to be detected can be sequentially conveyed on one conveyor belt, and each rod-shaped tobacco can be detected after it reaches the detection area, and detection is completed. After that, continue detecting when the next cigarette stick arrives;
The detection light source is used to illuminate the detection area and ensure the brightness of the detection area,
The display module is used to receive and display the defect determination result output from the control module,
The rejection device is used to reject the defective cigarette stick according to the rejection command generated by the control module when the control module detects that the cigarette stick is defective; In an example, the reject device may use a manipulator to pick up the defective cigarette stick and place it in a designated defective cigarette stick collection box/case or the like when receiving a reject command from the control module. the reject device can also use a cylinder perpendicular to the co-planar direction of movement and the direction of conveyance of the conveying device, providing a collection box/case of defective cigarette rods/cases in the direction of movement of the piston of the cylinder and controlling Upon receiving the module's eviction command, the cylinder pushes the defective tobacco rod into the defective tobacco rod collection bin/case (e.g., if the tobacco rod transport device uses a conveyor belt, the direction of piston movement of the cylinder is the direction of the conveyor belt). set in a plane, perpendicular to the conveying direction of the conveyor belt, push the defective cigarette stick out of the conveyor belt after receiving a reject command from the control module, and collect the defective tobacco stick directly under the conveyor belt at the push-out position; A box/case can be provided to complete the collection).

本出願の実施例において、前記制御モジュールは、PLCコントローラとZYNQモジュールで構成され、前記ZYNQモジュールは画像前処理及び欠陥検出を実現し、欠陥検出結果を表示モジュールに伝送して表示し;欠陥がある場合、検出結果をPLCコントローラに伝送し、PLCコントローラが不良品排除コマンドを生成し、不良品排除装置を制御して欠陥のある棒状たばこを排除する。 In an embodiment of the present application, the control module is composed of a PLC controller and a ZYNQ module, the ZYNQ module implements image preprocessing and defect detection, and transmits the defect detection result to the display module for display; In some cases, the detection result is transmitted to the PLC controller, which generates a rejection command and controls the rejection device to reject the defective cigarette stick.

前記棒状たばこ画像捕捉装置は、3台のカメラを備え、1台のカメラが棒状たばこの前面画像を捕捉するために用いられ、他の2台のカメラが棒状たばこの端面画像を捕捉するために用いられる。 The cigarette stick image capturing device comprises three cameras, one camera is used to capture the front image of the cigarette stick, and the other two cameras are used to capture the end image of the cigarette stick. Used.

上記の説明は、本発明の好ましい実施例を描写したが、上記のように、本発明は、本明細書に開示される形態に限定されず、他の実施例を排除すると見なされるべきではなく、多種多様な組み合わせ、修正および環境に使用されることができ、本明細書に記載の本発明の技術的思想の範囲内で上述の教示または関連分野における技術または知識によって変更することができることに理解されたい。当業者によって行われた変更および変化は、本発明の精神および範囲から逸脱しない場合、本発明の添付の特許請求の範囲の保護範囲内に含まれるべきである。
While the above description depicts preferred embodiments of the invention, as noted above, the invention is not limited to the forms disclosed herein and should not be considered to the exclusion of other embodiments. , is capable of use in a wide variety of combinations, modifications and environments, and is capable of modification according to the above teachings or skill or knowledge in the related field within the spirit of the invention described herein. be understood. Modifications and changes made by persons skilled in the art should fall within the protection scope of the appended claims of the present invention without departing from the spirit and scope of the present invention.

本発明は、棒状たばこ箱の検出に関し、特に、棒状たばこ箱表面欠陥検出の方法及び装置に関わる。 The present invention relates to cigarette bar detection, and more particularly to a method and apparatus for bar surface defect detection.

現在我が国のたばこ製造レベルは、生産技術の絶え間ない革新が伴うことで、紙巻たばこの巻き包装工程技術が基本的に成熟を迎えているが、棒状たばこ箱外箱の品質欠陥検出において多くの企業が今でも最も伝統的な手動検出手段を採用している。現在のたばこ外箱包装機の速度は、非常に速く、基本的に700~800箱/分のレベルに達し、新開発の紙巻たばこ包装機が900箱/分にも達することができる。しかしこのようなペースの速い高強度の包装や製造工程では、人間自身の特性上、長期間集中力が続かないため、品質を保証することができないことで、棒状たばこ箱の誤検査、検査漏れにつながる可能性があった。また、一部の極端な環境での検出結果の正確性及び検出データの標準化された保存も、たばこ企業にとっての問題点であった。 At present, the level of tobacco production in our country is accompanied by constant innovation in production technology, and the technology of the cigarette wrapping process has basically matured. still employ the most traditional manual detection means. The speed of the current cigarette outer packaging machine is very fast, basically reaching the level of 700-800 boxes/minute, and the newly developed cigarette packaging machine can reach as high as 900 boxes/minute. However, in such a fast-paced, high-strength packaging and manufacturing process, due to the nature of human beings, we cannot concentrate for a long period of time , so quality cannot be guaranteed. could lead to Accuracy of detection results in some extreme environments and standardized storage of detection data have also been issues for tobacco companies.

一部の国内たばこ加工・製造企業は、往々にしてさまざまなセンサーと手動検出という組み合わせ方法を採用することで、検査漏れ率を一般的な許容レベルに制御できるが、開封テープのずれなどの欠陥を検出することが困難である。 Some domestic tobacco processing and manufacturing companies often adopt a combination of various sensors and manual detection methods to control the inspection failure rate to generally acceptable levels, but defects such as tear tape misalignment is difficult to detect.

本発明の目的は、従来技術の不足を克服し、棒状たばこ箱表面の画像への捕捉分析に基づいて、棒状たばこ箱表面の欠陥検出を実現でき、自動化検出内に運用することにも便利となる棒状たばこ箱表面欠陥検出の方法及び装置を提供することである。 The purpose of the present invention is to overcome the shortcomings of the prior art, and based on the capture analysis of the surface of the cigarette stick , it is possible to realize the detection of defects on the surface of the cigarette stick , and it is convenient to operate in the automated detection. It is an object of the present invention to provide a method and apparatus for detecting surface defects in a stick-shaped cigarette pack .

本発明の目的は、以下の技術的手段を介して実現する。 The object of the present invention is achieved through the following technical means.

棒状たばこ箱表面の欠陥検出方法は、以下の構成を有する。すなわち、
S1:棒状たばこ箱の前面及び2つの端面の画像を捕捉して、棒状たばこ箱の前面及び2つの端面の初期画像を得るステップ、
画像を捕捉する方法には、次の構成のいずれかを有する。すなわち、
第一に、カメラの出力をYUV422形式として構成し、カメラで棒状たばこ箱の前面及び2つの端面の画像を捕捉し、次にYUV422形式の画像をYUV444形式に変換し、棒状たばこ箱の前面及び2つの端面の初期画像を得る構成又は、第二に、カメラの出力をRGB565出力として構成し、カメラで棒状たばこ箱の前面及び2つの端面の画像を捕捉して、3枚の画像を得てから3枚の画像を各々RGB565からYUV422形式に変換し、次にYUV422形式の画像をYUV444形式に変換して、棒状たばこ箱の前面及び2つの端面の初期画像を得る構成を有する
A method for detecting defects on the surface of a bar-shaped cigarette pack has the following configuration. i.e.
S1: Capturing images of the front face and two end faces of the cigarette stick to obtain initial images of the front face and two end faces of the cigarette stick ;
A method of capturing an image has any of the following configurations. i.e.
First, configure the output of the camera as YUV422 format, capture images of the front face and two end faces of the cigarette stick with the camera, then convert the YUV422 format images to YUV444 format, and convert the images in YUV422 format to YUV444 format. configuration to obtain initial images of two end faces ; After acquisition, each of the three images is converted from RGB565 to YUV422 format, and then the YUV422 format images are converted to YUV444 format to obtain initial images of the front face and two end faces of the cigarette stick .

好ましくは、前記棒状たばこ箱の2つの端面とは、棒状たばこ箱の面積が最小の2つの面をいい、各端面及び棒状たばこ箱の前面に対してそれぞれカメラで画像を捕捉する。 Preferably, the two end faces of the cigarette stick refer to the two faces of the cigarette stick whose area is the smallest, and the camera captures images of each of the end faces and the front face of the cigarette stick .

S2:捕捉した各初期画像に対して形式変換操作、メディアンフィルタ操作、sobelエッジ検出操作、OTSUの適応的二値化操作及びハフライン検出操作の前処理を施し、棒状たばこ箱の前面及び2つの端面の前処理画像を得るステップ、
前記ステップS2は、次のサブステップS201~S206を含む。すなわち、
ステップS1で得られた初期画像のいずれかについて、YUV444形式の画像データからAXI4-Streamビデオストリーム形式に変換するステップS201、
変換されたAXI4-Stream形式の画像データに対してメディアンフィルタ操作を行い、画像内のゴマ塩ノイズを除去して、不必要な干渉を減らすステップS202、
メディアンフィルタ後の画像データに対してSobelエッジ検出操作を行い、Sobelオペレータをコアとして、メディアンフィルタ後の画像データの画像全体に対してエッジ検出操作を行い、操作後に出力される画像データは棒状たばこ箱の背景などの干渉情報を破棄し、画像全体の全ての境界線を保持し、さらに不必要な干渉を減らすことで、後処理のためにリソース及び時間を節約するステップS203、
エッジ検出後の画像データに対してOTSUの適応的二値化操作を行い、画像全体をモノクロ画像に分割(すなわち、グレースケール値は0と255のみである)することで、境界線の特徴を強調すると共に背景などの役に立たない情報を弱め、その後の判断が容易になるステップS204、
二値化した画像データに対してハフライン検出操作を行い、画像全体の直線を分割し、ハフライン検出操作は検出された画像データを出力すると同時にパラメータMAX_LINE_NUMを返し、前記パラメータの意味は検出過程中で検出された斜線の数の合計であり、前のエッジ検出後の画像内の線が連続していないため、ハフライン検出は検出精度をさらに向上し、その後の判断が容易になるステップS205、
棒状たばこ箱の前面及び2つの端面の初期画像に対してそれぞれステップS201~S205の前処理を施し、棒状たばこ箱の前面及び2つの端面の前処理画像を得るステップS206。
S2: Each captured initial image is preprocessed with a format conversion operation, a median filter operation, a sobel edge detection operation, an OTSU adaptive binarization operation and a Hough line detection operation, and the front and two end faces of the cigarette stick are obtained. obtaining a preprocessed image of
Said step S2 includes the following sub-steps S201-S206. i.e.
Step S201 for converting any of the initial images obtained in step S1 from YUV444 format image data to AXI4 - Stream video stream format ;
Step S202 of performing a median filter operation on the converted AXI4-Stream format image data to remove salt and pepper noise in the image to reduce unnecessary interference;
A Sobel edge detection operation is performed on the image data after the median filter. With the Sobel operator as the core, an edge detection operation is performed on the entire image of the image data after the median filter . discarding interference information such as box background, preserving all borders across the image, and reducing unnecessary interference, thus saving resources and time for post-processing step S203;
OTSU adaptive binarization is performed on the image data after edge detection, and the entire image is divided into monochrome images (i.e., the grayscale values are only 0 and 255), so that the boundary features can be identified. Step S204 for emphasizing and weakening useless information such as the background to facilitate subsequent judgment;
The Hough line detection operation is performed on the binarized image data to divide the straight lines of the entire image. The Hough line detection operation outputs the detected image data and returns a parameter ( MAX_LINE_NUM ) at the same time. is the sum of the number of oblique lines detected in step S205, and since the lines in the image after the previous edge detection are not continuous, the Hough line detection further improves the detection accuracy and facilitates the subsequent judgment step S205;
The initial images of the front face and the two end faces of the cigarette stick are pre-processed in steps S201 to S205, respectively, and preprocessed images of the front face and the two end faces of the cigarette stick are obtained in step S206.

S3:棒状たばこ箱の前面及び2つの端面の前処理画像に従って、開封テープ欠落検出、開封テープのずれ検出及び端面ポリライン検出を含む棒状たばこ箱の表面欠陥検出を行うステップ。 S3: A step of performing surface defect detection of the cigarette stick , including tear tape missing detection, tear tape shift detection and end face polyline detection, according to the pre-processed images of the front face and two end faces of the cigarette stick .

ステップS3に記載の開封テープ欠落検出は、以下の構成を有する。すなわち、
棒状たばこ箱の長さを280mm、高さを85mmとし、カメラで棒状たばこ箱の表面画像を捕捉する時、撮影精度は0.12mm/Pixelになる場合(ここでPixelはピクセルを表す)、画像内の各行の合計は280mm/(0.12mm/Pixel)=2332Pixelで、各列の合計が85mm/(0.12mm/Pixel)=708Pixelであること、
棒状たばこ箱前面の前処理画像へのスキャン:
画像の各ピクセルのグレースケール値を左から右、上から下に順次スキャンして、0に初期化されるカウンターを構築し、スキャン過程中に1行に11個連続のピクセルのグレースケール値が255の場合、カウンターは1ずつ増加し、画像全体をスキャンした後、カウンターのカウント値は画像全体内の判断条件を満たす行数の合計であり、この時再度判定を行い、すなわち、
カウンターの値が棒状たばこ箱の高さのピクセル値の2/3を超える場合(すなわち、708Pixel×2/3=472Pixelを超える)、前記棒状たばこ箱の開封テープが存在すると判断され、超えない場合、開封テープ欠落の欠陥が現れたと判断される。
The missing tape detection described in step S3 has the following configuration. i.e.
If the cigarette stick has a length of 280 mm and a height of 85 mm, and the surface image of the cigarette stick is captured by a camera, the photographing accuracy is 0.12 mm/pixel (where Pixel represents a pixel). The sum of each row in is 280 mm/(0.12 mm/Pixel) = 2332 Pixels, and the sum of each column is 85 mm/(0.12 mm/Pixel) = 708 Pixels;
Scanning to a preprocessed image of the front face of a cigarette stick :
By sequentially scanning the grayscale value of each pixel in the image from left to right and top to bottom, a counter is constructed that is initialized to 0, and during the scanning process the grayscale values of 11 consecutive pixels in a row are obtained. 255, the counter is incremented by 1. After scanning the entire image, the count value of the counter is the sum of the number of lines in the entire image that satisfy the judgment condition, and then make another judgment, namely:
If the value of the counter exceeds 2/3 of the pixel value of the cigarette stick height (i.e., exceeds 708 Pixels × 2/3 = 472 Pixels), it is determined that there is an opening tape of the cigarette stick , otherwise , it is judged that the defect of missing tape has appeared.

ステップS3に記載の開封テープのずれ検出は、以下の構成を有する。すなわち、
棒状たばこ箱の前面の前処理画像について、開封テープ欠落の判断を経た後で開封テープが存在する場合、次のA11ないしA14の処理により2次元配列を構築するステップA1、すなわち、棒状たばこ箱の前面の前処理画像について、各列内のグレースケール値が255のピクセル数の合計を集計するステップA11、
2次元座標系を構築するステップA12:原点は、棒状たばこ箱の前面の前処理画像の右下隅にあり、y軸と棒状たばこ箱の前面の前処理画像の右の境界線が同一直線上にあり、y軸の方向は下から上となり;x軸と棒状たばこ箱の前面の前処理画像の下の境界線が同一直線上にあり、x軸の方向は右から左となり、
右から左への方向で、棒状たばこ箱の前面の前処理画像のi列目のピクセルについて、この列のシリアル番号iをx軸座標xiとし、この列のグレースケール値が255のピクセル数の合計をy軸座標yiとした場合、i列目のピクセルの2次元座標(xi、yi)であり、ここで、i=1、2、…Nで、Nは棒状たばこ箱の前面の前処理画像のピクセルの列数を表し、N=2332;
各列のピクセルについて、ステップA12を繰り返し、全ての2次元座標を得て2次元配列(x1、y1)、(x2、y2)、…、(xN、yN)を形成するステップA13、
2次元配列をトラバースすることにより、左右の境界線x1、xNを除いて、配列に格納されているピクセル総数の最大の2つのx軸座標を見つけ出して、xk1、xk2として記録し、これは開封テープの2つの境界線の位置であり、さらにxk1、xk2の中間位置を取り出して、開封テープの中心点のx軸座標x0を得るステップA14、
開封テープの中心点と棒状たばこ箱の前面の前処理画像の右の境界線との間の距離は、実際に開封テープの中心点とy軸との間の距離、すなわち開封テープの中心点のx座標軸の座標x0に相当し、開封テープの中心点と棒状たばこ箱の前面の前処理画像の右の境界線との間の距離をD=x0として記録し、距離Dを標準距離STDと比較して、ずれ量T=D-STDを得;
ずれ量Tの絶対値が予め設定されたしきい値を超える場合、開封テープのずれ欠陥が存在するとみなされるステップA2。
The deviation detection of the opening tape described in step S3 has the following configuration. i.e.
With respect to the preprocessed image of the front surface of the stick-shaped cigarette pack , if there is a tear-opening tape after it is determined that the tear-tape is missing, the following steps A11 to A14 are performed to construct a two-dimensional array : step A11 of summing the number of pixels with a grayscale value of 255 in each column for the foreground preprocessed image;
Step A12 of constructing a two-dimensional coordinate system: The origin is at the lower right corner of the preprocessed image of the front surface of the cigarette stick , and the y-axis and the right boundary line of the preprocessed image of the front surface of the cigarette stick are collinear. Yes, the direction of the y- axis is from bottom to top;
In the direction from right to left, for the i-th pixel of the preprocessed image of the front face of the cigarette stick , the serial number i of this column is the x-axis coordinate xi, and the grayscale value of this column is the number of pixels of 255. The two-dimensional coordinates (xi, yi) of the i-th pixel, where sum is the y-axis coordinate yi, where i=1, 2, . represents the number of columns of pixels in the image, N=2332;
step A13 of repeating step A12 for each column of pixels to obtain all the two-dimensional coordinates to form a two-dimensional array (x1, y1), (x2, y2), ..., (xN, yN);
By traversing the two-dimensional array, excluding the left and right borders x1, xN, find the two x-axis coordinates with the largest total number of pixels stored in the array and record them as xk1, xk2, which is the unpacking Step A14, which is the position of the two boundary lines of the tape, and further extracts the intermediate position between xk1 and xk2 to obtain the x-axis coordinate x0 of the center point of the unsealed tape;
The distance between the center point of the tear tape and the right boundary line of the preprocessed image of the front face of the cigarette stick is actually the distance between the center point of the tear tape and the y-axis, that is, the distance between the center point of the tear tape and the y-axis. Corresponding to the coordinate x0 of the x-coordinate axis, the distance between the center point of the tear tape and the right border of the preprocessed image of the front surface of the cigarette stick was recorded as D=x0, and the distance D was compared with the standard distance STD. to obtain the amount of deviation T = D - STD;
If the absolute value of the deviation amount T exceeds a preset threshold value, step A2, it is assumed that there is a deviation defect of the opening tape.

好ましくは、開封テープのずれ欠陥が存在した場合、Tの正又は負に従ってずれの方向を確認し、すなわちT>0の場合、開封テープが左にずれ、T<0の場合、開封テープが右にずれる。 Preferably, if a tear tape deviation defect is present, the direction of deviation is determined according to the positive or negative of T, i.e., if T>0, the tear tape is shifted to the left, and if T<0, the tear tape is shifted to the right. shift to

ステップS3に記載の端面ポリライン検出は、以下の構成を有する。すなわち、
ステップS2で各端面の前処理画像を得ると共に、ステップS205で返されたパラメータMAX_LINE_NUMに従って端面ポリライン検出を実行するステップ:MAX_LINE_NUM値が4に等しい場合、1を出力し、現在の端面が正常であることを示し、それ以外の場合0を出力し、現在の端面に欠陥があることを示す。
The edge face polyline detection described in step S3 has the following configuration. i.e.
Obtaining the preprocessed image of each endface in step S2 and performing endface polyline detection according to the parameter MAX_LINE_NUM returned in step S205: if the MAX_LINE_NUM value is equal to 4, then output 1, the current endface is normal. Otherwise, output 0 to indicate that the current endface is defective.

棒状たばこ箱表面の欠陥検出装置であって、
検出領域における棒状たばこ箱の前面及び2つの端面の画像を捕捉し、棒状たばこ箱の前面及び2つの端面の初期画像を得て、制御モジュールに伝送するための棒状たばこ箱画像捕捉装置と、
捕捉した各初期画像に対して形式変換操作、メディアンフィルタ操作、sobelエッジ検出操作、OTSUの適応的二値化操作及びハフライン検出操作の前処理を施し、棒状たばこ箱の前面及び2つの端面の前処理画像を得、棒状たばこ箱の前面及び2つの端面の前処理画像に基づいて棒状たばこ箱表面の欠陥検出を行い、欠陥の有無及び欠陥がある場合の欠陥タイプである欠陥検出結果を出力し、欠陥がある場合、不良品排除コマンドを生成するための制御モジュールとを備える。
A defect detection device for the surface of a bar-shaped cigarette pack ,
a cigarette stick image capture device for capturing an image of the front face and two end faces of the cigarette stick in the detection area, obtaining an initial image of the front face and two end faces of the cigarette stick and transmitting to the control module;
Each captured initial image was preprocessed with a format conversion operation, a median filter operation, a sobel edge detection operation, an OTSU adaptive binarization operation, and a Hough line detection operation to obtain the front and two end faces of the cigarette stick. A processed image is obtained, and based on the preprocessed images of the front surface and two end faces of the cigarette stick, defect detection is performed on the surface of the cigarette stick , and defect detection results indicating the presence or absence of defects and defect types when there are defects are output. , and a control module for generating a reject command if there is a defect.

前記欠陥検出装置は、棒状たばこ箱搬送装置と、検出光源と、不良品排除装置と、表示モジュールとをさらに備え、
前記棒状たばこ箱搬送装置は、検出対象の棒状たばこ箱を検出領域に搬送し、検出が完了した後、検出対象の棒状たばこ箱を検出領域から搬出するために用いられ、
前記検出光源は、検出領域を照らし、検出領域の明るさを確保するために用いられ、
前記表示モジュールは、制御モジュールから出力された欠陥判断結果を受信して表示するために用いられ、
前記不良品排除装置は、制御モジュールが棒状たばこ箱に欠陥があることを検出した時、制御モジュールで生成された不良品排除コマンドに従って欠陥がある棒状たばこ箱を排除するために用いられる。
The defect detection device further includes a stick-shaped cigarette pack conveying device, a detection light source, a defective product exclusion device, and a display module,
The rod-shaped cigarette pack conveying device is used to convey the rod-shaped cigarette pack to be detected to the detection area, and after the detection is completed, carry out the rod-shaped cigarette pack to be detected from the detection area,
The detection light source is used to illuminate the detection area and ensure the brightness of the detection area,
The display module is used to receive and display the defect determination result output from the control module,
Said rejection device is used to reject the defective cigarette stick according to the rejection command generated by the control module when the control module detects that the cigarette stick is defective.

前記棒状たばこ箱画像捕捉装置は、3台のカメラを備え、1台のカメラが棒状たばこ箱の前面画像を捕捉するために用いられ、他の2台のカメラが棒状たばこ箱の端面画像を捕捉するために用いられる。 The cigarette stick image capture device comprises three cameras, one camera is used to capture the front image of the cigarette stick , and the other two cameras are used to capture end images of the cigarette stick. used to

本発明は、棒状たばこ箱表面の画像捕捉分析に基づき、棒状たばこ箱表面の欠陥検出を実現でき、自動化検出への応用に便利で、製造包装工程中の不合格品の排除のために条件を提供する。 Based on the image capture analysis of the surface of the cigarette stick , the present invention can realize the detection of defects on the surface of the cigarette stick. offer.

本発明の方法のフローチャートである。3 is a flow chart of the method of the invention; 本発明の装置の原理を示す概略図である。1 is a schematic diagram illustrating the principle of the device of the invention; FIG.

以下、添付図面を参照しつつ、本発明の技術的手段をさらに詳細に描写するが、本発明の保護範囲は下記に限定されない。 Hereinafter, the technical means of the present invention will be described in more detail with reference to the accompanying drawings, but the scope of protection of the present invention is not limited to the following.

図1に示すように、棒状たばこ箱表面の欠陥検出方法は、以下の構成を有する。すなわち、
S1:棒状たばこ箱の前面及び2つの端面の画像を捕捉して、棒状たばこ箱の前面及び2つの端面の初期画像を得るステップ
前記棒状たばこ箱の2つの端面とは、棒状たばこ箱の面積が最小の2つの面をいい、各端面及び棒状たばこ箱の前面に対してそれぞれカメラで画像を捕捉し;
画像を捕捉する方法には、次の構成を有する。すなわち、
第一に、カメラを直接グレースケール出力用に構成し、構成形式はYUV422で、カメラで棒状たばこ箱の前面及び2つの端面の画像を捕捉し、次にYUV422形式の画像をYUV444形式に変換し、棒状たばこ箱の前面及び2つの端面の初期画像を得;
第二に、カメラの出力をRGB565出力として構成し、カメラで棒状たばこ箱の前面及び2つの端面の画像を捕捉して、3枚の画像を得てから3枚の画像を各々RGB565からYUV422形式に変換し、次にYUV422形式の画像をYUV444形式に変換して、棒状たばこ箱の前面及び2つの端面の初期画像を得る。
As shown in FIG. 1, the method for detecting defects on the surface of a stick-shaped cigarette pack has the following configuration. i.e.
S1: A step of capturing images of the front surface and two end surfaces of the rod-shaped cigarette packet to obtain initial images of the front surface and two end surfaces of the rod-shaped cigarette packet . The minimum two faces, each of which captures an image with a camera for each end face and the front face of the cigarette stick ;
A method of capturing an image has the following components. i.e.
First, the camera was configured for direct grayscale output, the configuration format was YUV422, the camera captured images of the front and two end faces of the cigarette stick , and then the YUV422 format images were converted to YUV444 format. , obtaining initial images of the front face and two end faces of the cigarette stick ;
Second, the output of the camera is configured as an RGB565 output, and the camera captures images of the front and two end faces of the cigarette stick to obtain three images, each of which is in RGB565 to YUV422 format. , and then the YUV422 format image is converted to YUV444 format to obtain initial images of the front and two end faces of the cigarette stick .

S2:捕捉した各初期画像に対して形式変換操作、メディアンフィルタ操作、sobelエッジ検出操作、OTSUの適応的二値化操作及びハフライン検出操作の前処理を施し、棒状たばこ箱の前面及び2つの端面の前処理画像を得るステップ
前記ステップS2は、次のサブステップS201~S206を含む。すなわち、
ステップS1で得られた初期画像のいずれかについて、YUV444形式の画像データからAXI4-Streamビデオストリーム形式に変換するステップS201、
変換されたAXI4-Stream形式の画像データに対してメディアンフィルタ操作を行い、画像内のゴマ塩ノイズを除去して、不必要な干渉を減らすステップS202、
メディアンフィルタ後の画像データに対してSobelエッジ検出操作を行い、Sobelオペレータをコアとして、メディアンフィルタ後の画像データの画像全体に対してエッジ検出操作を行い、操作後に出力される画像データは棒状たばこ箱の背景などの干渉情報を破棄し、画像全体の全ての境界線を保持し、さらに不必要な干渉を減らすことで、後処理のためにリソース及び時間を節約するステップS203、
エッジ検出後の画像データに対してOTSUの適応的二値化操作を行い、画像全体をモノクロ画像に分割(すなわち、グレースケール値は0と255のみである)することで、境界線の特徴を強調すると共に背景などの役に立たない情報を弱め、その後の判断が容易になるステップS204、
二値化した画像データに対してハフライン検出操作を行い、画像全体の直線を分割し、ハフライン検出操作は検出された画像データを出力すると同時にパラメータMAX_LINE_NUMを返し、前記パラメータの意味は検出過程中で検出された斜線の数の合計であり、前のエッジ検出後の画像内の線が連続していないため、ハフライン検出は検出精度をさらに向上し、その後の判断が容易になるステップS205、
棒状たばこ箱の前面及び2つの端面の初期画像に対してそれぞれステップS201~S205の前処理を施し、棒状たばこ箱の前面及び2つの端面の前処理画像を得るステップS206。
S2: Each captured initial image is preprocessed with a format conversion operation, a median filter operation, a sobel edge detection operation, an OTSU adaptive binarization operation and a Hough line detection operation, and the front and two end faces of the cigarette stick are obtained. Obtaining a preprocessed image of The step S2 includes the following substeps S201-S206. i.e.
Step S201 for converting any of the initial images obtained in step S1 from YUV444 format image data to AXI4 - Stream video stream format ;
Step S202 of performing a median filter operation on the converted AXI4-Stream format image data to remove salt and pepper noise in the image to reduce unnecessary interference;
A Sobel edge detection operation is performed on the image data after the median filter. With the Sobel operator as the core, an edge detection operation is performed on the entire image of the image data after the median filter . discarding interference information such as box background, preserving all borders across the image, and reducing unnecessary interference, thus saving resources and time for post-processing step S203;
OTSU adaptive binarization is performed on the image data after edge detection, and the entire image is divided into monochrome images (i.e., the grayscale values are only 0 and 255), so that the boundary features can be identified. Step S204 for emphasizing and weakening useless information such as the background to facilitate subsequent judgment;
The Hough line detection operation is performed on the binarized image data to divide the straight line of the entire image. The Hough line detection operation outputs the detected image data and returns the parameter MAX_LINE_NUM at the same time. It is the total number of detected oblique lines, and since the lines in the image after the previous edge detection are not continuous, the Hough line detection further improves the detection accuracy and facilitates the subsequent judgment step S205;
The initial images of the front face and the two end faces of the cigarette stick are pre-processed in steps S201 to S205, respectively, and preprocessed images of the front face and the two end faces of the cigarette stick are obtained in step S206.

S3:棒状たばこ箱の前面及び2つの端面の前処理画像に従って、開封テープ欠落検出、開封テープのずれ検出及び端面ポリライン検出を含む棒状たばこ箱の表面欠陥検出を行うステップ。 S3: A step of performing surface defect detection of the cigarette stick , including tear tape missing detection, tear tape shift detection and end face polyline detection, according to the pre-processed images of the front face and two end faces of the cigarette stick .

ステップS3に記載の開封テープ欠落検出は、以下の構成を有する。すなわち、
棒状たばこ箱の長さを280mm、高さを85mmとし、カメラで棒状たばこ箱の表面画像を捕捉する時、撮影精度は0.12mm/Pixelになる場合(ここでPixelはピクセルを表す)、画像内の各行の合計は280mm/(0.12mm/Pixel)=2332Pixelで、各列の合計が85mm/(0.12mm/Pixel)=708Pixelであること、
棒状たばこ箱前面の前処理画像へのスキャン:
画像の各ピクセルのグレースケール値を左から右、上から下に順次スキャンして、0に初期化されるカウンターを構築し、スキャン過程中に1行に11個連続のピクセルのグレースケール値が255の場合、カウンターは1ずつ増加し、画像全体をスキャンした後、カウンターのカウント値は画像全体内の判断条件を満たす行数の合計であり、この時再度判定を行い、すなわち、
カウンターの値が棒状たばこ箱の高さのピクセル値の2/3を超える場合(すなわち、708Pixel×2/3=472Pixelを超える)、前記棒状たばこ箱の開封テープが存在すると見なされ、超えない場合、開封テープ欠落の欠陥が現れたと見なされる。
The missing tape detection described in step S3 has the following configuration. i.e.
If the cigarette stick has a length of 280 mm and a height of 85 mm, and the surface image of the cigarette stick is captured by a camera, the photographing accuracy is 0.12 mm/pixel (where Pixel represents a pixel). The sum of each row in is 280 mm/(0.12 mm/Pixel) = 2332 Pixels, and the sum of each column is 85 mm/(0.12 mm/Pixel) = 708 Pixels;
Scanning to a preprocessed image of the front face of a cigarette stick :
By sequentially scanning the grayscale value of each pixel in the image from left to right and top to bottom, a counter is constructed that is initialized to 0, and during the scanning process the grayscale values of 11 consecutive pixels in a row are obtained. 255, the counter is incremented by 1. After scanning the entire image, the count value of the counter is the sum of the number of lines in the entire image that satisfy the judgment condition, and then make another judgment, namely:
If the value of the counter exceeds 2/3 of the pixel value of the cigarette stick height (i.e., exceeds 708 Pixels x 2/3 = 472 Pixels), the tear tape of said cigarette stick is considered present; , is deemed to have exhibited the defect of missing tear tape.

ステップS3に記載の開封テープのずれ検出は、以下の構成を有する。すなわち、
棒状たばこ箱の前面の前処理画像について、開封テープ欠落の判断を経た後で開封テープが存在する場合、次のA11ないしA14の処理により2次元配列を構築するステップA1、すなわち、
棒状たばこ箱の前面の前処理画像について、各列内のグレースケール値が255のピクセル数の合計を集計するステップA11、
2次元座標系を構築するステップA12:原点は、棒状たばこ箱の前面の前処理画像の右下隅にあり、y軸と棒状たばこ箱の前面の前処理画像の右の境界線が同一直線上にあり、y軸の方向は下から上となり;x軸と棒状たばこ箱の前面の前処理画像の下の境界線が同一直線上にあり、x軸の方向は右から左となり、
右から左への方向で、棒状たばこ箱の前面の前処理画像のi列目のピクセルについて、この列のシリアル番号iをx軸座標xiとし、この列のグレースケール値が255のピクセル数の合計をy軸座標yiとした場合、i列目のピクセルの2次元座標(xi、yi)であり、ここで、i=1、2、…Nで、Nは棒状たばこ箱の前面の前処理画像のピクセルの列数を表し、N=2332;
各列のピクセルについて、ステップA12を繰り返し、全ての2次元座標を得て2次元配列(x1、y1)、(x2、y2)、…、(xN、yN)を形成するステップA13、
2次元配列をトラバースすることにより、左右の境界線x1、xNを除いて、配列に格納されているピクセル総数の最大の2つのx軸座標を見つけ出して、xk1、xk2として記録し、これは開封テープの2つの境界線の位置であり、さらにxk1、xk2の中間位置を取り出して、開封テープの中心点のx軸座標x0を得るステップA14、
開封テープの中心点と棒状たばこ箱の前面の前処理画像の右の境界線との間の距離は、実際に開封テープの中心点とy軸との間の距離、すなわち開封テープの中心点のx座標軸の座標x0に相当し、開封テープの中心点と棒状たばこ箱の前面の前処理画像の右の境界線との間の距離をD=x0として記録し、距離Dを標準距離STDと比較して、ずれ量T=D-STDを得;
ずれ量Tの絶対値が予め設定されたしきい値を超える場合、開封テープのずれ欠陥が存在するとみなされ;
好ましくは、開封テープのずれ欠陥が存在した場合、Tの正又は負に従ってずれの方向を確認し、すなわちT>0の場合、開封テープが左にずれ、T<0の場合、開封テープが右にずれるステップA2。
The deviation detection of the opening tape described in step S3 has the following configuration. i.e.
With respect to the preprocessed image of the front surface of the bar-shaped cigarette packet , if the tear tape is present after it has been determined that the tear tape is missing, step A1 of constructing a two-dimensional array by the following processes A11 to A14 , that is,
step A11 of totaling the number of pixels with a grayscale value of 255 in each column for the preprocessed image of the front face of the cigarette stick ;
Step A12 of constructing a two-dimensional coordinate system: The origin is at the lower right corner of the preprocessed image of the front surface of the cigarette stick , and the y-axis and the right boundary line of the preprocessed image of the front surface of the cigarette stick are collinear. Yes, the direction of the y- axis is from bottom to top;
In the direction from right to left, for the i-th pixel of the preprocessed image of the front face of the cigarette stick , the serial number i of this column is the x-axis coordinate xi, and the grayscale value of this column is the number of pixels of 255. The two-dimensional coordinates (xi, yi) of the i-th pixel, where sum is the y-axis coordinate yi, where i=1, 2, . represents the number of columns of pixels in the image, N=2332;
step A13 of repeating step A12 for each column of pixels to obtain all the two-dimensional coordinates to form a two-dimensional array (x1, y1), (x2, y2), ..., (xN, yN);
By traversing the two-dimensional array, excluding the left and right borders x1, xN, find the two x-axis coordinates with the largest total number of pixels stored in the array and record them as xk1, xk2, which is the unpacking Step A14, which is the position of the two boundary lines of the tape, and further extracts the intermediate position between xk1 and xk2 to obtain the x-axis coordinate x0 of the center point of the unsealed tape;
The distance between the center point of the tear tape and the right boundary line of the preprocessed image of the front face of the cigarette stick is actually the distance between the center point of the tear tape and the y-axis, that is, the distance between the center point of the tear tape and the y-axis. Corresponding to the coordinate x0 of the x-coordinate axis, the distance between the center point of the tear tape and the right border of the preprocessed image of the front surface of the cigarette stick was recorded as D=x0, and the distance D was compared with the standard distance STD. to obtain the amount of deviation T = D - STD;
If the absolute value of the deviation amount T exceeds a preset threshold, it is considered that there is a deviation defect of the tear tape;
Preferably, if a tear tape deviation defect is present, the direction of deviation is determined according to the positive or negative of T, i.e., if T>0, the tear tape is shifted to the left, and if T<0, the tear tape is shifted to the right. step A2.

いくつかの実施例において、開封テープのずれ欠陥が存在した場合、Tの正又は負に従ってずれの方向を確認でき、すなわちT>0の場合、開封テープが左にずれ、T<0の場合、開封テープが右にずれる。 In some embodiments, if a tear tape misalignment defect is present, the direction of the misalignment can be identified according to the positive or negative of T, i.e., if T>0, the tear tape is displaced to the left; The tear tape shifts to the right.

ステップS3に記載の端面ポリライン検出は、以下の構成を有する。すなわち、
ステップS2で各端面の前処理画像を得ると共に、ステップS205で返されたパラメータMAX_LINE_NUMに従って端面ポリライン検出を実行するステップ:MAX_LINE_NUM値が4に等しい場合、1を出力し、現在の端面が正常であることを示し、それ以外の場合0を出力し、現在の端面に欠陥があることを示す。
The edge face polyline detection described in step S3 has the following configuration. i.e.
Obtaining the preprocessed image of each endface in step S2 and performing endface polyline detection according to the parameter MAX_LINE_NUM returned in step S205: if the MAX_LINE_NUM value is equal to 4, then output 1, the current endface is normal. Otherwise, output 0 to indicate that the current endface is defective.

図2に示すように、棒状たばこ箱表面の欠陥検出装置であって、
検出領域における棒状たばこ箱の前面及び2つの端面の画像を捕捉し、棒状たばこ箱の前面及び2つの端面の初期画像を得て、制御モジュールに伝送するための棒状たばこ箱画像捕捉装置と、
捕捉した各初期画像に対して形式変換操作、メディアンフィルタ操作、sobelエッジ検出操作、OTSUの適応的二値化操作及びハフライン検出操作の前処理を施し、棒状たばこ箱の前面及び2つの端面の前処理画像を得、棒状たばこ箱の前面及び2つの端面の前処理画像に基づいて棒状たばこ箱表面の欠陥検出を行い、欠陥の有無及び欠陥がある場合の欠陥タイプである欠陥検出結果を出力し、欠陥がある場合、不良品排除コマンドを生成するための制御モジュールとを備える。
As shown in FIG. 2, an apparatus for detecting defects on the surface of a stick-shaped cigarette pack ,
a cigarette stick image capture device for capturing an image of the front face and two end faces of the cigarette stick in the detection area, obtaining an initial image of the front face and two end faces of the cigarette stick and transmitting to the control module;
Each captured initial image was preprocessed with a format conversion operation, a median filter operation, a sobel edge detection operation, an OTSU adaptive binarization operation, and a Hough line detection operation to obtain the front and two end faces of the cigarette stick. A processed image is obtained, and based on the preprocessed images of the front surface and two end faces of the cigarette stick, defect detection is performed on the surface of the cigarette stick , and defect detection results indicating the presence or absence of defects and defect types when there are defects are output. , and a control module for generating a reject command if there is a defect.

前記欠陥検出装置は、棒状たばこ箱搬送装置と、検出光源と、不良品排除装置と、表示モジュールとをさらに備え、
前記棒状たばこ箱搬送装置は、検出対象の棒状たばこ箱を検出領域に搬送し、検出が完了した後、検出対象の棒状たばこ箱を検出領域から搬出するために用いられ;本出願のいくつかの実施例において、前記棒状たばこ箱搬送装置は、コンベアベルトを用いることができ、検出対象の棒状たばこ箱を検出領域に搬送し、検出が完了するたびに、棒状たばこ箱棒状たばこ箱の貯蔵箱/ケースに搬送し続け;コンベアベルトを用いるため、流れてくるように検出でき、1本のコンベアベルト上で複数の検出対象の棒状たばこ箱を順次搬送でき、各棒状たばこ箱が検出領域に到達した後に検出でき、検出が完了した後、次の棒状たばこ箱が到達すると検出を続行し;
前記検出光源は、検出領域を照らし、検出領域の明るさを確保するために用いられ、
前記表示モジュールは、制御モジュールから出力された欠陥判断結果を受信して表示するために用いられ、
前記不良品排除装置は、制御モジュールが棒状たばこ箱に欠陥があることを検出した時、制御モジュールで生成された不良品排除コマンドに従って欠陥がある棒状たばこ箱を排除するために用いられ;本出願の実施例において、前記不良品排除装置は、マニピュレータを用いることができ、制御モジュールの排除コマンドを受信した時、欠陥のある棒状たばこ箱を拾い上げて指定された欠陥のある棒状たばこ箱収集箱/ケース等に入れ;不良品排除装置はまた、運動方向と搬送装置の搬送方向との共面に垂直なシリンダを用いることができ、シリンダのピストンの運動方向に欠陥のある棒状たばこ箱収集箱/ケースを設け、制御モジュールの排除コマンドを受信した時、シリンダで欠陥のある棒状たばこ箱を欠陥のある棒状たばこ箱収集箱/ケース内に押し込む(例えば棒状たばこ箱搬送装置がコンベアベルトを用いる場合、シリンダのピストン運動方向をコンベアベルトがある平面に設け、コンベアベルトの搬送方向に垂直で、制御モジュールの排除コマンドを受信した後、欠陥のある棒状たばこ箱をコンベアベルトから押し出し、押し出し位置のコンベアベルトの真下に欠陥のある棒状たばこ箱収集箱/ケースを設けて収集を完了できる)。
The defect detection device further includes a stick-shaped cigarette pack conveying device, a detection light source, a defective product exclusion device, and a display module,
The stick-shaped cigarette pack conveying device is used to carry the stick-shaped cigarette pack to be detected to the detection area, and after the detection is completed, carry out the stick-shaped cigarette pack to be detected from the detection area; In an embodiment, the stick-shaped cigarette pack conveying device can use a conveyor belt to carry the stick-shaped cigarette pack to be detected to the detection area, and every time detection is completed, the stick-shaped cigarette pack is transferred to the storage box of the stick-shaped cigarette pack. /Continue conveying to the case; Since a conveyor belt is used, it can be detected as if it is flowing, and a plurality of rod-shaped cigarette packs to be detected can be sequentially conveyed on one conveyor belt, and each rod-shaped cigarette pack reaches the detection area. After the detection is completed, the detection is continued when the next cigarette pack arrives;
The detection light source is used to illuminate the detection area and ensure the brightness of the detection area,
The display module is used to receive and display the defect determination result output from the control module,
The reject device is used to reject the defective cigarette stick according to the reject command generated by the control module when the control module detects that the cigarette stick is defective; In the embodiment of , the defective product rejection device can use a manipulator to pick up the defective cigarette stick and put it into the designated defective cigarette stick collection box/ put into a case, etc.; the reject device can also use a cylinder perpendicular to the co-planar movement direction and the conveying direction of the conveying device, and remove the stick-shaped cigarette packet collection box / A case is provided, and upon receipt of an eject command from the control module, a cylinder pushes the defective cigarette bar into the defective cigarette bar collection box/case (e.g., if the cigarette bar conveyor uses a conveyor belt, The piston movement direction of the cylinder is set in the plane where the conveyor belt is located, perpendicular to the conveying direction of the conveyor belt, and after receiving the control module's rejection command, pushes the defective cigarette stick out of the conveyor belt, and pushes the conveyor belt in the pushing position. collection can be completed by placing a defective cigarette stick collection box/case directly under the .

本出願の実施例において、前記制御モジュールは、PLCコントローラとZYNQモジュールで構成され、前記ZYNQモジュールは画像前処理及び欠陥検出を実現し、欠陥検出結果を表示モジュールに伝送して表示し;欠陥がある場合、検出結果をPLCコントローラに伝送し、PLCコントローラが不良品排除コマンドを生成し、不良品排除装置を制御して欠陥のある棒状たばこ箱を排除する。 In an embodiment of the present application, the control module is composed of a PLC controller and a ZYNQ module, the ZYNQ module implements image preprocessing and defect detection, and transmits the defect detection result to the display module for display; In some cases, the detection result is transmitted to the PLC controller, and the PLC controller generates a rejection command and controls the rejection device to reject the defective cigarette stick .

前記棒状たばこ箱画像捕捉装置は、3台のカメラを備え、1台のカメラが棒状たばこ箱の前面画像を捕捉するために用いられ、他の2台のカメラが棒状たばこ箱の端面画像を捕捉するために用いられる。 The cigarette stick image capture device comprises three cameras, one camera is used to capture the front image of the cigarette stick , and the other two cameras are used to capture end images of the cigarette stick. used to

上記の説明は、本発明の好ましい実施例を描写したが、上記のように、本発明は、本明細書に開示される形態に限定されず、他の実施例を排除すると見なされるべきではなく、多種多様な組み合わせ、修正および環境に使用されることができ、本明細書に記載の本発明の技術的思想の範囲内で上述の教示または関連分野における技術または知識によって変更することができることに理解されたい。当業者によって行われた変更および変化は、本発明の精神および範囲から逸脱しない場合、本発明の添付の特許請求の範囲の保護範囲内に含まれるべきである。
While the above description depicts preferred embodiments of the invention, as noted above, the invention is not limited to the forms disclosed herein and should not be considered to the exclusion of other embodiments. , is capable of use in a wide variety of combinations, modifications and environments, and is capable of modification according to the above teachings or skill or knowledge in the related field within the spirit of the invention described herein. be understood. Modifications and changes made by persons skilled in the art should fall within the protection scope of the appended claims of the present invention without departing from the spirit and scope of the present invention.

Claims (10)

棒状たばこ表面の欠陥検出方法であって、
棒状たばこの前面及び2つの端面の画像をカメラで捕捉して、棒状たばこの前面及び2つの端面の初期画像を得るステップS1と、
捕捉した各前記初期画像に対して形式変換操作、メディアンフィルタ操作、sobelエッジ検出操作、OTSUの適応的二値化操作及びハフライン検出操作の前処理を施し、棒状たばこの前面及び2つの端面の前処理画像を得るステップS2と、
前記棒状たばこの前面及び2つの端面の前処理画像に従って、開封テープ欠落検出、開封テープのずれ検出及び端面ポリライン検出を含む棒状たばこの表面欠陥検出を行うステップS3と、
を含むことを特徴とする、棒状たばこ表面の欠陥検出方法。
A method for detecting defects on the surface of a tobacco rod, comprising:
a step S1 of capturing an image of the front face and two end faces of the cigarette stick with a camera to obtain an initial image of the front face and the two end faces of the cigarette stick;
Each of the initial images captured is preprocessed with a format conversion operation, a median filtering operation, a sobel edge detection operation, an OTSU adaptive binarization operation, and a Hough line detection operation to obtain the front and two end faces of the cigarette stick. a step S2 of obtaining a processed image;
a step S3 of performing surface defect detection of the cigarette stick, including detection of missing tape, deviation of the tear tape, and polyline detection of the end face, according to the preprocessed images of the front face and the two end faces of the cigarette bar;
A method for detecting defects on the surface of a tobacco stick, comprising:
棒状たばこの2つの端面とは、棒状たばこの面積が最小の2つの面をいい、各前記端面及び前記棒状たばこの前面に対してそれぞれカメラで画像を捕捉することを特徴とする、請求項1に記載の棒状たばこ表面の欠陥検出方法。 2. The two end faces of the tobacco stick refer to the two faces with the smallest areas of the tobacco stick, and the images of each of the end faces and the front face of the tobacco stick are respectively captured by a camera. 3. The method for detecting defects on the surface of a tobacco rod according to . 前記ステップS1における画像を捕捉する方法には、次の構成、すなわち、
第一に、前記カメラを直接グレースケール出力用に構成し、構成形式はYUV422で、前記カメラで前記棒状たばこの前面及び2つの端面の画像を捕捉し、次に前記YUV422形式の画像をYUV444形式に変換し、前記棒状たばこの前面及び2つの端面の初期画像を得;
第二に、前記カメラの出力をRGB565出力として構成し、前記カメラで前記棒状たばこの前面及び2つの端面の画像を捕捉して、3枚の画像を得てから前記3枚の画像を各々前記RGB565から前記YUV422形式に変換し、次に前記YUV422形式の画像を前記YUV444形式に変換して、前記棒状たばこの前面及び2つの端面の初期画像を得る、
を有することを特徴とする、請求項1に記載の棒状たばこ表面の欠陥検出方法。
The method for capturing an image in step S1 includes the following components:
First, the camera is configured for direct grayscale output, the configuration format is YUV422, the camera captures images of the front and two end faces of the cigarette bar, and then the YUV422 format images are converted to YUV444 format. to obtain initial images of the front and two ends of the tobacco rod;
Secondly, the output of the camera is configured as an RGB565 output, and the camera captures images of the front and two end faces of the cigarette rod to obtain three images, and then to each of the three images. converting from RGB565 to the YUV422 format and then converting the YUV422 format image to the YUV444 format to obtain initial images of the front and two end faces of the tobacco rod;
The method for detecting defects on the surface of a tobacco rod according to claim 1, characterized by:
前記ステップS2は、次のサブステップS201~S206、すなわち
前記ステップS1で得られた前記初期画像のいずれかについて、前記YUV444形式の画像データからAXI4プロトコルのStreamビデオストリームの専用形式に変換するステップS201、
変換された前記AXI4-Stream形式の画像データに対してメディアンフィルタ操作を行い、画像内のゴマ塩ノイズを除去するステップS202、
メディアンフィルタ後の画像データに対してSobelエッジ検出操作を行い、Sobelオペレータをコアとして、メディアンフィルタ後の画像データの画像全体に対してエッジ検出操作を行い、操作後に出力される画像データは棒状たばこの背景などの干渉情報を破棄し、画像全体の全ての境界線を保持するステップS203、
前記エッジ検出後の画像データに対してOTSUの適応的二値化操作を行い、画像全体をモノクロ画像に分割(すなわち、グレースケール値は0と255のみである)することで、境界線の特徴を強調すると共に背景などの役に立たない情報を弱めるステップS204、
二値化した画像データに対してハフライン検出操作を行い、画像全体の直線を分割し、ハフライン検出操作を介して検出された画像データを出力すると同時にパラメータMAX_LINE_NUMを返し、前記パラメータの意味は検出過程中で検出された斜線の数の合計であるステップS205、
前記棒状たばこの前面及び2つの端面の初期画像に対してそれぞれ前記ステップS201~S205の前処理を施し、前記棒状たばこの前面及び2つの端面の前処理画像を得るステップS206
を含むことを特徴とする、請求項3に記載の棒状たばこ表面の欠陥検出方法。
Said step S2 follows the next sub-steps S201-S206, i.e., a step S201 of converting any of said initial images obtained in said step S1 from said YUV444 format image data into a dedicated format of an AXI4 protocol Stream video stream. ,
Step S202 of performing a median filter operation on the converted AXI4-Stream format image data to remove salt and pepper noise in the image;
A Sobel edge detection operation is performed on the image data after the median filter. With the Sobel operator as the core, an edge detection operation is performed on the entire image of the image data after the median filter. step S203 of discarding interference information such as the background of and retaining all borders of the entire image;
By performing OTSU adaptive binarization operation on the image data after the edge detection and dividing the entire image into monochrome images (i.e., the grayscale values are only 0 and 255), the boundary line features and weakening useless information such as the background at step S204;
Perform a Hough line detection operation on the binarized image data, divide the straight line of the entire image, and output the image data detected through the Hough line detection operation. Step S205, which is the sum of the number of diagonal lines detected in
The initial images of the front surface and the two end surfaces of the tobacco rod are subjected to the preprocessing of steps S201 to S205, respectively, to obtain preprocessed images of the front surface and the two end surfaces of the tobacco rod in step S206.
4. The method for detecting defects on the surface of a tobacco stick according to claim 3, characterized by comprising:
前記ステップS3に記載の前記開封テープ欠落検出は、以下の構成、すなわち、
棒状たばこ箱の長さを280mm、高さを85mmとし、前記カメラで棒状たばこの表面画像を捕捉する時、撮影精度は0.12mm/Pixelになる場合(ここでPixelはピクセルを表す)、画像内の各行の合計は280mm/(0.12mm/Pixel)=2332Pixelで、各列の合計が85mm/(0.12mm/Pixel)=708Pixelであること、
棒状たばこ前面の前処理画像へのスキャン:画像の各ピクセルのグレースケール値を左から右、上から下に順次スキャンして、0に初期化されるカウンターを構築し、スキャン過程中に1行に11個連続のピクセルのグレースケール値が255の場合、カウンターは1ずつ増加し、画像全体をスキャンした後、カウンターのカウント値は画像全体内の判断条件を満たす行数の合計であり、この時再度判定を行い、すなわち、
カウンターの値が棒状たばこの高さのピクセル値の2/3を超える場合(すなわち、708Pixel×2/3=472Pixelを超える)、前記棒状たばこの前記開封テープが存在すると判断し、超えない場合、前記開封テープ欠落の欠陥が現れたと判断される、
を有することを特徴とする、請求項1に記載の棒状たばこ表面の欠陥検出方法。
The unsealing tape missing detection described in step S3 has the following configuration, that is,
If the cigarette stick packet has a length of 280 mm and a height of 85 mm, and the surface image of the cigarette stick is captured by the camera, the photographing accuracy is 0.12 mm/pixel (where Pixel represents a pixel). The sum of each row in is 280 mm/(0.12 mm/Pixel) = 2332 Pixels, and the sum of each column is 85 mm/(0.12 mm/Pixel) = 708 Pixels;
Scanning into the preprocessed image of the front face of the cigarette stick: The grayscale value of each pixel of the image is sequentially scanned from left to right and top to bottom, constructing a counter initialized to 0 and scanning one row during the scanning process. If the grayscale value of 11 consecutive pixels is 255, the counter is incremented by 1, and after scanning the entire image, the count value of the counter is the sum of the number of rows satisfying the criterion in the entire image, and this When the decision is made again, i.e.,
If the value of the counter exceeds 2/3 of the height pixel value of the cigarette stick (i.e., exceeds 708 Pixels x 2/3 = 472 Pixels), it is determined that the tear tape of the cigarette stick is present; It is determined that the opening tape missing defect has appeared,
The method for detecting defects on the surface of a tobacco rod according to claim 1, characterized by:
ステップS3に記載の前記開封テープのずれ検出は、以下の構成、すなわち、
前記棒状たばこの前面の前処理画像について、前記開封テープ欠落の判断を経た後で前記開封テープが存在する場合、2次元配列を構築するステップA1:
前記棒状たばこの前面の前処理画像について、各列内のグレースケール値が255のピクセル数の合計を集計するステップA11、
2次元座標系を構築するステップA12:原点は、前記棒状たばこの前面の前処理画像の右下隅にあり、y軸と前記棒状たばこの前面の前処理画像の右の境界線が同一直線上にあり、y軸の方向は下から上となり;x軸と前記棒状たばこの前面の前処理画像の下の境界線が同一直線上にあり、x軸の方向は右から左となり、
右から左への方向で、前記棒状たばこの前面の前処理画像のi列目のピクセルについて、この列のシリアル番号iをx軸座標xiとし、この列のグレースケール値が255のピクセル数の合計をy軸座標yiとした場合、前記i列目のピクセルの2次元座標(xi、yi)であり、ここで、i=1、2、…Nで、Nは前記棒状たばこの前面の前処理画像のピクセルの列数を表し、N=2332;
各列のピクセルについて、前記ステップA12を繰り返し、全ての2次元座標を得て2次元配列(x1、y1)、(x2、y2)、…、(xN、yN)を形成するステップA13、
前記2次元配列をトラバースすることにより、左右の境界線x1、xNを除いて、配列に格納されているピクセル総数の最大の2つのx軸座標を見つけ出して、xk1、xk2として記録し、これは前記開封テープの2つの境界線の位置であり、さらにxk1、xk2の中間位置を取り出して、前記開封テープの中心点のx軸座標x0を得るステップA14、
前記開封テープの中心点と前記棒状たばこの前面の前処理画像の右の境界線との間の距離は、実際に前記開封テープの中心点と前記y軸との間の距離、すなわち前記開封テープの中心点のx座標軸の座標x0に相当し、前記開封テープの中心点と前記棒状たばこの前面の前処理画像の右の境界線との間の距離をD=x0として記録し、距離Dを標準距離STDと比較して、ずれ量T=D-STDを得;
ずれ量Tの絶対値が予め設定されたしきい値を超える場合、前記開封テープのずれ欠陥が存在するとみなされるステップA2
を有することを特徴とする、請求項1に記載の棒状たばこ表面の欠陥検出方法。
The detection of deviation of the opening tape described in step S3 has the following configuration, that is,
Step A1 of constructing a two-dimensional array of the preprocessed image of the front surface of the cigarette bar, if the tear tape is present after the determination of the tear tape missing:
step A11 of totaling the number of pixels with a grayscale value of 255 in each column for the preprocessed image of the front face of the cigarette stick;
Step A12 of constructing a two-dimensional coordinate system: The origin is at the lower right corner of the preprocessed image of the front surface of the tobacco stick, and the y-axis and the right boundary line of the preprocessed image of the front surface of the tobacco rod are aligned on the same straight line. Yes, the direction of the y-axis is from bottom to top; the x-axis and the lower boundary line of the preprocessed image of the front surface of the tobacco rod are collinear, and the direction of the x-axis is from right to left;
In the direction from right to left, for the i-th row of pixels of the preprocessed image of the front face of said cigarette stick, the serial number i of this row is the x-axis coordinate xi, and the grayscale value of this row is the number of pixels of 255. The two-dimensional coordinates (xi, yi) of the pixel in the i-th column, where sum is the y-axis coordinate yi, where i=1, 2, . represents the number of columns of pixels in the processed image, N=2332;
step A13 of repeating said step A12 for each column of pixels, obtaining all the two-dimensional coordinates to form a two-dimensional array (x1, y1), (x2, y2), ..., (xN, yN);
By traversing the two-dimensional array, excluding the left and right borders x1, xN, find the two x-axis coordinates with the largest total number of pixels stored in the array and record them as xk1, xk2, which is A step A14, which is the position of the two boundary lines of the tear tape and extracts the intermediate position between xk1 and xk2 to obtain the x-axis coordinate x0 of the center point of the tear tape;
The distance between the center point of the tear tape and the right boundary line of the preprocessed image of the front face of the cigarette bar is actually the distance between the center point of the tear tape and the y-axis, i.e. the distance between the center point of the tear tape and the y-axis. The distance between the center point of the opening tape and the right border of the preprocessed image of the front surface of the cigarette stick is recorded as D=x0, and the distance D is Compare with the standard distance STD to get the amount of deviation T=D−STD;
If the absolute value of the deviation amount T exceeds a preset threshold value, step A2 in which it is considered that there is a deviation defect of the opening tape.
The method for detecting defects on the surface of a tobacco rod according to claim 1, characterized by:
前記ステップS3に記載の端面ポリライン検出は、以下の構成、すなわち、
前記ステップS2で各前記端面の前処理画像を得ると共に、前記ステップS205で返された前記パラメータMAX_LINE_NUMに従って端面ポリライン検出を実行するステップ:前記MAX_LINE_NUM値が4に等しい場合、1を出力し、現在の前記端面が正常であることを示し、それ以外の場合0を出力し、現在の前記端面に欠陥があることを示す、
を有することを特徴とする、請求項1に記載の棒状たばこ表面の欠陥検出方法。
The edge face polyline detection described in step S3 is configured as follows:
obtaining a pre-processed image of each said edge in said step S2 and performing edge polyline detection according to said parameter MAX_LINE_NUM returned in said step S205: if said MAX_LINE_NUM value is equal to 4, output 1; indicates that the end face is normal, otherwise outputs 0, indicating that the current end face is defective;
The method for detecting defects on the surface of a tobacco rod according to claim 1, characterized by:
請求項1~7のいずれか一項に記載の方法で棒状たばこ表面の欠陥検出を実行する棒状たばこ表面の欠陥検出装置であって、
検出領域における棒状たばこの前面及び2つの端面の画像を捕捉し、棒状たばこの前面及び2つの端面の初期画像を得て、制御モジュールに伝送するための棒状たばこ画像捕捉装置と、
捕捉した各前記初期画像に対して形式変換操作、メディアンフィルタ操作、sobelエッジ検出操作、OTSUの適応的二値化操作及びハフライン検出操作の前処理を施し、棒状たばこの前面及び2つの端面の前処理画像を得、前記棒状たばこの前面及び2つの端面の前処理画像に基づいて棒状たばこ表面の欠陥検出を行い、欠陥の有無及び欠陥がある場合の欠陥タイプである欠陥検出結果を出力し、欠陥がある場合、不良品排除コマンドを生成するための制御モジュールと、
を備えることを特徴とする、棒状たばこ表面の欠陥検出装置。
A tobacco rod surface defect detection apparatus for performing defect detection of a tobacco rod surface by the method according to any one of claims 1 to 7,
a tobacco rod image capture device for capturing an image of the front and two end faces of the tobacco rod in the detection area to obtain an initial image of the front and two end faces of the tobacco rod and transmitting to the control module;
Each of the initial images captured is preprocessed with a format conversion operation, a median filtering operation, a sobel edge detection operation, an OTSU adaptive binarization operation, and a Hough line detection operation to obtain the front and two end faces of the cigarette stick. Obtaining a processed image, performing defect detection on the surface of the tobacco rod based on the preprocessed images of the front surface and two end surfaces of the tobacco rod, and outputting defect detection results indicating the presence or absence of a defect and a defect type if there is a defect; a control module for generating a rejection command if there is a defect;
A defect detection device for a stick-shaped tobacco surface, comprising:
棒状たばこ搬送装置と、検出光源と、不良品排除装置と、表示モジュールとをさらに備え、
前記棒状たばこ搬送装置は、検出対象の棒状たばこを前記検出領域に搬送し、検出が完了した後、検出対象の棒状たばこを前記検出領域から搬出するために用いられ、
前記検出光源は、前記検出領域を照らし、前記検出領域の明るさを確保するために用いられ、
前記表示モジュールは、前記制御モジュールから出力された欠陥判断結果を受信して表示するために用いられ、
前記不良品排除装置は、前記制御モジュールが棒状たばこに欠陥があることを検出した時、前記制御モジュールで生成された前記不良品排除コマンドに従って欠陥がある棒状たばこを排除するために用いられる、
ことを特徴とする、請求項8に記載の棒状たばこ表面の欠陥検出装置。
further comprising a stick-shaped tobacco conveying device, a detection light source, a defective product rejection device, and a display module;
The tobacco rod conveying device is used for conveying a tobacco rod to be detected to the detection area, and carrying out the tobacco rod to be detected from the detection area after detection is completed,
The detection light source is used to illuminate the detection area and ensure the brightness of the detection area;
The display module is used to receive and display the defect determination results output from the control module,
The rejection device is used to reject the defective cigarette stick according to the rejection command generated by the control module when the control module detects that the cigarette stick is defective.
9. The apparatus for detecting defects on the surface of a stick-shaped tobacco according to claim 8, wherein:
前記棒状たばこ画像捕捉装置は、3台のカメラを備え、1台の前記カメラが前記棒状たばこの前面画像を捕捉するために用いられ、他の2台の前記カメラが前記棒状たばこの端面画像を捕捉するために用いられることを特徴とする、請求項8に記載の棒状たばこ表面の欠陥検出装置。
The cigarette stick image capture device includes three cameras, one of which is used to capture the front image of the cigarette stick, and the other two of which are used to capture the end image of the cigarette stick. 9. The device for detecting defects on the surface of tobacco rods according to claim 8, which is used for trapping.
JP2022018435A 2022-01-18 2022-02-09 Method and apparatus for detecting surface defects of bar-shaped cigarette packs Active JP7142991B1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210054934.8A CN114359260B (en) 2022-01-18 2022-01-18 Method and device for detecting defects on surface of tobacco rod
CN202210054934.8 2022-01-18

Publications (2)

Publication Number Publication Date
JP7142991B1 JP7142991B1 (en) 2022-09-28
JP2023104829A true JP2023104829A (en) 2023-07-28

Family

ID=81091152

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2022018435A Active JP7142991B1 (en) 2022-01-18 2022-02-09 Method and apparatus for detecting surface defects of bar-shaped cigarette packs

Country Status (2)

Country Link
JP (1) JP7142991B1 (en)
CN (1) CN114359260B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116681644B (en) * 2023-02-03 2024-01-12 红云红河烟草(集团)有限责任公司 Cigarette appearance defect detection method based on variable decibel leaf reasoning

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11173992A (en) * 1997-09-12 1999-07-02 Philip Morris Prod Inc Fold line inspection apparatus for transparent outer wrapping film
JP2012168166A (en) * 2011-01-27 2012-09-06 Ricoh Co Ltd Image inspection device, image forming device and image inspection program
JP2013122455A (en) * 2011-12-12 2013-06-20 Focke & Co (Gmbh & Co Kg) Method and device for optically testing object to be tested during production and/or packing of cigarette
JP2013200238A (en) * 2012-03-26 2013-10-03 Mitsubishi Electric Corp Image inspection method and image inspection device
JP2014125248A (en) * 2012-12-27 2014-07-07 Japan Tobacco Inc Inspection system of packaged body
JP2020160616A (en) * 2019-03-25 2020-10-01 ブラザー工業株式会社 Generation device and computer program and generation method
JP2020176978A (en) * 2019-04-22 2020-10-29 キリンホールディングス株式会社 Packaging film inspection device
CN112373874A (en) * 2020-11-10 2021-02-19 江苏众立生新材料有限公司 Packaging box and manufacturing method thereof

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4053056A (en) * 1976-07-19 1977-10-11 Amf Incorporated Cigarette package inspection apparatus
CN103512888B (en) * 2013-06-05 2015-11-11 北京化工大学 A kind of cigarette packet seal defect detecting system based on image recognition technology
CN104458748B (en) * 2013-09-25 2017-02-08 中国科学院沈阳自动化研究所 Aluminum profile surface defect detecting method based on machine vision
CN103856761B (en) * 2014-03-14 2017-02-15 山东大学 Image monitoring system based on Zynq-7000
CN107798672B (en) * 2016-08-31 2021-06-29 上海创和亿电子科技发展有限公司 Method and system for measuring width of cut tobacco or cut stem and server with system
CN207887542U (en) * 2017-12-07 2018-09-21 湖南湘华华大生物科技有限公司 A kind of irradiation cigarette carton packet detecting system
CN108665440A (en) * 2018-03-14 2018-10-16 重庆邮电大学 A kind of irregular cigarette packet image co-registration edge detection algorithm based on improved sobel method
CN108629775B (en) * 2018-05-14 2021-08-03 华中科技大学 Thermal state high-speed wire rod surface image processing method
CN109829876B (en) * 2018-05-30 2020-04-07 东南大学 Chain plate defect online detection device and method based on machine vision
CN110310255B (en) * 2019-05-24 2023-01-10 同济大学 Point switch notch detection method based on target detection and image processing
CN110717852B (en) * 2019-06-13 2022-09-16 内蒙古大学 FPGA-based field video image real-time segmentation system and method
CN112550806A (en) * 2019-09-26 2021-03-26 南京文采科技有限责任公司 Small box cigarette end face transparent paper detection device
WO2021249560A1 (en) * 2020-06-12 2021-12-16 广州极飞科技股份有限公司 Crop missing detection method and detection apparatus
CN112434544A (en) * 2020-12-09 2021-03-02 广东烟草阳江市有限责任公司 Cigarette carton code detection and identification method and device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11173992A (en) * 1997-09-12 1999-07-02 Philip Morris Prod Inc Fold line inspection apparatus for transparent outer wrapping film
JP2012168166A (en) * 2011-01-27 2012-09-06 Ricoh Co Ltd Image inspection device, image forming device and image inspection program
JP2013122455A (en) * 2011-12-12 2013-06-20 Focke & Co (Gmbh & Co Kg) Method and device for optically testing object to be tested during production and/or packing of cigarette
JP2013200238A (en) * 2012-03-26 2013-10-03 Mitsubishi Electric Corp Image inspection method and image inspection device
JP2014125248A (en) * 2012-12-27 2014-07-07 Japan Tobacco Inc Inspection system of packaged body
JP2020160616A (en) * 2019-03-25 2020-10-01 ブラザー工業株式会社 Generation device and computer program and generation method
JP2020176978A (en) * 2019-04-22 2020-10-29 キリンホールディングス株式会社 Packaging film inspection device
CN112373874A (en) * 2020-11-10 2021-02-19 江苏众立生新材料有限公司 Packaging box and manufacturing method thereof

Also Published As

Publication number Publication date
CN114359260A (en) 2022-04-15
JP7142991B1 (en) 2022-09-28
CN114359260B (en) 2023-11-03

Similar Documents

Publication Publication Date Title
CN102393397B (en) System and method for detecting surface defects of magnetic shoe
JP7055223B2 (en) Mask defect inspection method
JPS62279931A (en) Defective detector for single-sided corrugated board
CN107402220A (en) A kind of selective laser fusing shaping powdering quality vision online test method and system
JP7142991B1 (en) Method and apparatus for detecting surface defects of bar-shaped cigarette packs
CN114049557A (en) Garbage sorting robot visual identification method based on deep learning
CN111591715A (en) Belt longitudinal tearing detection method and device
WO2021135675A1 (en) Automatic bar counting method and apparatus
WO2023168984A1 (en) Area-array camera-based quality inspection method and system for cathode copper
CN111024722B (en) Data fusion-based wood defect detection system and method
KR20210073561A (en) Automated inspection of sheet parts of any shape from manufacturing film
CN111000286A (en) Anti-interference cigarette appearance quality online detection device and method
CN112432953A (en) Cigarette packet missing and reverse detection method based on machine vision technology
JP2003291929A (en) Inspection method and apparatus for single-dose package sheet
CN110694940A (en) Control method and system for adjusting blowing of spray valve in real time based on dead pixel and size
JPH08313454A (en) Image processing equipment
CN203397372U (en) Image acquisition and identification processing intelligent terminal for container and based on digital signal processor (DSP)
CN113588655A (en) Detection device for surface defects of MDF fiber lines and working method thereof
JP2022018507A (en) Image processing apparatus for subject determination, and image processing method
KR20090121612A (en) Method and apparatus for automatic detecting quality defects for corrugated board
JP2861338B2 (en) Optical inspection equipment
US20210100256A1 (en) Foreign Material Inspection System
JP2002148204A (en) Surface-inspecting apparatus for bar-shaped body
JPS63288593A (en) Carrying object photographing device
CN214608445U (en) Cigarette packet appearance quality detection device and cigarette packet packaging machine

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20220209

A871 Explanation of circumstances concerning accelerated examination

Free format text: JAPANESE INTERMEDIATE CODE: A871

Effective date: 20220209

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20220412

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20220712

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20220906

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20220907

R150 Certificate of patent or registration of utility model

Ref document number: 7142991

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150