JP5086970B2 - Wood appearance inspection device, wood appearance inspection method - Google Patents

Wood appearance inspection device, wood appearance inspection method Download PDF

Info

Publication number
JP5086970B2
JP5086970B2 JP2008284649A JP2008284649A JP5086970B2 JP 5086970 B2 JP5086970 B2 JP 5086970B2 JP 2008284649 A JP2008284649 A JP 2008284649A JP 2008284649 A JP2008284649 A JP 2008284649A JP 5086970 B2 JP5086970 B2 JP 5086970B2
Authority
JP
Japan
Prior art keywords
region
defect
defect candidate
value
pixels
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2008284649A
Other languages
Japanese (ja)
Other versions
JP2010112802A (en
Inventor
達也 本田
良介 三高
正治 杭ノ瀬
一成 吉村
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Panasonic Corp
Panasonic Holdings Corp
Original Assignee
Panasonic Corp
Matsushita Electric Industrial Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Panasonic Corp, Matsushita Electric Industrial Co Ltd filed Critical Panasonic Corp
Priority to JP2008284649A priority Critical patent/JP5086970B2/en
Publication of JP2010112802A publication Critical patent/JP2010112802A/en
Application granted granted Critical
Publication of JP5086970B2 publication Critical patent/JP5086970B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

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

Description

本発明は、木材の表面を撮像した画像を用いて木材の表面における節、割れ、変色などの各種の欠陥を検査する木材の外観検査装置、木材の外観検査方法に関するものである。   The present invention relates to a wood appearance inspection apparatus and a wood appearance inspection method for inspecting various defects such as nodes, cracks, and discoloration on the surface of the wood using an image obtained by imaging the surface of the wood.

従来から、木材の表面の欠陥(節、割れ、変色など)を抽出するために、木材の表面を撮像した画像を用いる技術が提案されている。たとえば、特許文献1では、検査対象である木材のカラー画像を撮像して画像内の色分布を求め、正常な木材の色分布と比較することにより、検査対象である木材の欠陥を検出する技術が開示されている。   2. Description of the Related Art Conventionally, a technique using an image obtained by capturing an image of the surface of wood has been proposed in order to extract defects (nodes, cracks, discoloration, etc.) on the surface of the wood. For example, in Patent Document 1, a technique for detecting a defect in a wood to be inspected by capturing a color image of the wood to be inspected, obtaining a color distribution in the image, and comparing it with a color distribution of normal wood. Is disclosed.

また、特許文献2には、木材の表面の反射光による画像と、木材の裏面からの透過光による画像との2画像を用い、2画像による検査を統合することによって、各種の欠陥を抽出する技術が記載されている。   In Patent Document 2, various images are extracted by using two images, that is, an image of reflected light from the surface of wood and an image of transmitted light from the back of the wood, and integrating inspections using the two images. The technology is described.

さらに、特許文献3では、木材の表面のカラー画像を撮像し、カラー画像を2値化した2値化画像から特徴パラメータを抽出することにより欠陥部位を検出する技術が記載されている。欠陥部位は、あらかじめ設定した判定値と特徴パラメータとを対比することにより検出している。
特開2007−147442号公報 特開2007−40913号公報 特開平9−210785号公報
Further, Patent Document 3 describes a technique for detecting a defective part by capturing a color image of the surface of a wood and extracting a feature parameter from a binarized image obtained by binarizing the color image. The defective part is detected by comparing a predetermined judgment value with a characteristic parameter.
JP 2007-147442 A JP 2007-40913 A JP-A-9-210785

上述した特許文献1、3に記載された技術はカラー画像を用いているから、モノクロの画像処理に比較するとデータ量が多く処理負荷が大きくなり、データの転送時間や処理時間が長くなるという問題を有している。すなわち、木材を搬送している場合のように欠陥の検出のための画像処理に用いることができる時間が短くなる用途では高性能のハードウェア資源(プロセッサ、メモリ)が要求され、カラー画像を撮像する工業用の撮像装置とともにシステムが高額になる要因になっている。   Since the techniques described in Patent Documents 1 and 3 described above use color images, the amount of data is large and the processing load is large, and the data transfer time and processing time are long compared to monochrome image processing. have. In other words, high-performance hardware resources (processor, memory) are required for applications where the time that can be used for image processing for defect detection is shortened, such as when carrying wood, and color images are taken. Together with industrial imaging devices, the system becomes a factor.

また、特許文献2に記載された技術では、反射光による画像と透過光による画像との2画像を統合するために、2画像を記憶するためのハードウェア資源が必要になって高額になる上に、これらの2画像では欠陥の部位の輪郭が異なる場合があるから、欠陥の輪郭を正確に検出することができず、欠陥の大きさを精度よく見積もることができない場合がある。   Further, in the technique described in Patent Document 2, in order to integrate the two images of the reflected light image and the transmitted light image, hardware resources for storing the two images are required, which is expensive. In addition, since the contour of the defect part may be different in these two images, the defect contour cannot be detected accurately, and the size of the defect may not be accurately estimated.

特許文献3に記載された技術では、カラー画像を用いるから、特許文献1と同様にシステムが高額になるという問題があり、しかも、欠陥部位を判定するための判定値を特徴パラメータと比較するから、欠陥の種類ごとに特徴パラメータを設定しなければならず、あらかじめ特徴パラメータが設定されていない新規の欠陥では、欠陥を見逃す場合がある。   Since the technique described in Patent Document 3 uses a color image, there is a problem that the system becomes expensive as in Patent Document 1, and the determination value for determining the defective portion is compared with the feature parameter. A feature parameter must be set for each type of defect, and a defect may be missed in a new defect for which no feature parameter is set in advance.

本発明は上記事由に鑑みて為されたものであり、その目的は、モノクロの濃淡画像に対する画像処理のみで欠陥を正確に抽出することを可能にした木材の外観検査装置を提供し、加えて木材の外観検査方法を提供することにある。   The present invention has been made in view of the above-mentioned reasons, and its object is to provide a wood appearance inspection apparatus capable of accurately extracting defects only by image processing on a monochrome grayscale image. It is to provide an appearance inspection method for wood.

請求項1の発明は、木材の外観検査装置であって、複数の検査対象領域に区画されている木材の表面を撮像する撮像手段と、撮像手段により撮像された複数の検査対象領域を含む濃淡画像を第1のしきい値により2値化した2値画像から一次欠陥候補領域を抽出する一次候補抽出部と、一次欠陥候補領域が抽出された着目する検査対象領域について前記濃淡画像を木目と欠陥とを分離するように設定した第2のしきい値により2値化した2値画像から二次欠陥候補領域を抽出する二次候補抽出部と、二次欠陥候補領域を含む検査対象領域において二次欠陥候補領域に含まれる画素の濃淡値と二次欠陥候補領域の周辺の画素の濃淡値との差分を用いて欠陥を判別する欠陥抽出部とを備えることを特徴とする。   The invention according to claim 1 is an appearance inspection apparatus for wood, which includes an imaging unit that images the surface of wood partitioned into a plurality of inspection target regions, and a gray scale that includes a plurality of inspection target regions imaged by the imaging unit. A primary candidate extraction unit that extracts a primary defect candidate region from a binary image obtained by binarizing the image with a first threshold value; and the grayscale image of the target inspection target region from which the primary defect candidate region is extracted as a grain In a secondary candidate extraction unit that extracts a secondary defect candidate area from a binary image binarized by a second threshold set so as to separate defects, and an inspection target area including the secondary defect candidate area And a defect extraction unit that determines a defect using a difference between a gray value of a pixel included in the secondary defect candidate area and a gray value of pixels around the secondary defect candidate area.

請求項2の発明では、請求項1の発明において、前記木材は目地溝により区画された複数のピースを表面に配列した板材であって、前記二次候補抽出部は、各ピースを前記検査対象領域とし各ピースの濃淡値の平均値を第2のしきい値に用いて二次欠陥候補領域を抽出することを特徴とする。   According to a second aspect of the present invention, in the first aspect of the invention, the wood is a plate material in which a plurality of pieces partitioned by joint grooves are arranged on the surface, and the secondary candidate extraction unit sets each piece to the inspection object. A secondary defect candidate region is extracted using the average value of the gray value of each piece as a second threshold value as a region.

請求項3の発明では、請求項1又は2の発明において、前記二次候補抽出部は、前記濃淡画像に含まれる前記検査対象領域ごとに前記第2のしきい値を設定することを特徴とする。   According to a third aspect of the present invention, in the first or second aspect of the invention, the secondary candidate extraction unit sets the second threshold value for each of the inspection target regions included in the grayscale image. To do.

請求項4の発明では、請求項1〜3のいずれかの発明において、前記欠陥抽出部は、前記二次欠陥候補領域の外接矩形を囲む判定領域を設定し、判定領域内において二次欠陥候補領域の画素と二次欠陥候補領域を除く範囲の画素との濃淡値を用いて領域拡張しきい値を設定し、領域拡張しきい値により判定領域内の画素の濃淡値を二値化することにより、欠陥候補となる領域を抽出し、当該領域について欠陥を判別することを特徴とする。   According to a fourth aspect of the present invention, in the invention according to any one of the first to third aspects, the defect extraction unit sets a determination area surrounding a circumscribed rectangle of the secondary defect candidate area, and the secondary defect candidate is within the determination area. A region expansion threshold is set using the gray value of the pixel in the region and the pixel in the range excluding the secondary defect candidate region, and the gray value of the pixel in the determination region is binarized by the region expansion threshold. Thus, a region as a defect candidate is extracted, and a defect is determined for the region.

請求項5の発明では、請求項1〜3のいずれかの発明において、前記欠陥抽出部は、前記二次欠陥候補領域の慣性主軸を求め、慣性主軸に沿う方向に並ぶ画素の濃淡値の変化と、慣性主軸に直交する方向に並ぶ画素の濃淡値の変化とを用いて二次欠陥候補領域から欠陥候補となる領域を抽出し、当該領域について欠陥を判別することを特徴とする。   According to a fifth aspect of the present invention, in the invention according to any one of the first to third aspects, the defect extraction unit obtains an inertia main axis of the secondary defect candidate region, and changes in gray values of pixels arranged in a direction along the inertia main axis. And a change in gray value of pixels arranged in a direction orthogonal to the principal axis of inertia is used to extract a region as a defect candidate from the secondary defect candidate region, and to determine a defect in the region.

請求項6の発明では、請求項1〜5のいずれかの発明において、前記欠陥抽出部は、前記二次欠陥候補領域を囲む判定領域を設定し、判定領域内において二次欠陥候補領域の画素と二次欠陥候補領域を除く範囲の画素との濃淡値の差分を求め、判定領域内の二次欠陥候補領域を除く範囲の画素の濃淡値に対して設定されている判定用のしきい値と前記差分とを比較することにより、欠陥を判別することを特徴とする。   In the invention of claim 6, in any one of claims 1 to 5, the defect extraction unit sets a determination region surrounding the secondary defect candidate region, and a pixel of the secondary defect candidate region in the determination region Is a threshold value for determination that is set for the gray value of pixels in the range excluding the secondary defect candidate area in the determination area. And comparing the difference with each other to determine a defect.

請求項7の発明では、請求項1〜7のいずれかの発明において、前記欠陥抽出部は、前記二次欠陥候補領域の形状に応じて、周辺の画素との濃淡値の差が大きくなるように規定した規則で判定領域を設定し、判定領域において二次欠陥候補領域を除く範囲の画素を周辺の画素に用いることを特徴とする。   According to a seventh aspect of the present invention, in the invention according to any one of the first to seventh aspects, the defect extraction unit is configured such that a difference in gray value with surrounding pixels increases according to the shape of the secondary defect candidate region. The determination region is set according to the rule defined in (1), and pixels in a range excluding the secondary defect candidate region in the determination region are used as peripheral pixels.

請求項8の発明では、請求項1〜7のいずれかの発明において、前記欠陥抽出部は、前記二次欠陥候補領域を囲む判定領域を設定し、判定領域に含まれる画素のうち濃淡値が下位である規定の割合の画素に関する濃淡値の代表値と、判定領域に含まれる画素のうち濃淡値が上位である規定の割合の画素についての濃淡値の代表値との差を用いて欠陥を判別することを特徴とする。   In the invention of claim 8, in the invention of any one of claims 1 to 7, the defect extraction unit sets a determination region that surrounds the secondary defect candidate region, and a gray value among pixels included in the determination region is Defects are determined using the difference between the representative value of the gray value for a pixel with a specified ratio that is lower and the representative value of the gray value for a pixel with a specified value that has a higher gray value among the pixels included in the determination area. It is characterized by discriminating.

請求項9の発明は、木材の外観検査方法であって、複数の検査対象領域に区画されている木材の表面を撮像手段により撮像した濃淡画像を用い、複数の検査対象領域を含む濃淡画像を第1のしきい値により2値化した2値画像から一次欠陥候補領域を抽出し、次に、着目する検査対象領域について前記濃淡画像を木目と欠陥とを分離するように設定した第2のしきい値により2値化した2値画像から二次欠陥候補領域を抽出した後、二次欠陥候補領域を含む検査対象領域において二次欠陥候補領域に含まれる画素の濃淡値と二次欠陥候補領域の周辺の画素の濃淡値との差分を用いて欠陥を判別することを特徴とする。   The invention of claim 9 is a method of inspecting the appearance of wood, and uses a grayscale image obtained by imaging an image of the surface of wood divided into a plurality of inspection target areas, and uses a grayscale image including a plurality of inspection target areas. A primary defect candidate area is extracted from the binary image binarized by the first threshold value, and then the grayscale image is set so as to separate the grain and the defect for the target inspection target area. After extracting the secondary defect candidate area from the binary image binarized by the threshold value, the gray value of the pixel included in the secondary defect candidate area and the secondary defect candidate in the inspection target area including the secondary defect candidate area It is characterized in that a defect is discriminated using a difference from the gray value of pixels around the area.

請求項1、請求項9の発明の構成によれば、撮像手段により撮像された画像の濃淡値のみを用いて欠陥の判別を行うから、モノクロ画像により欠陥の判別が可能であって、カラー画像を扱う場合よりも処理負荷が比較的小さく、またハードウェア資源もカラー画像を扱う場合よりも少なくなる。すなわち、比較的安価で単純なシステム構成で、木材の表面に存在する欠陥を検出することが可能である。また、木材の表面の全体から一次欠陥候補領域を抽出し、さらに、一次欠陥候補領域が抽出された検査対象領域から二次候補抽出部を抽出し、二次欠陥候補領域について欠陥を判別するから、欠陥を判別する範囲を絞り込むことにより、木目と欠陥とを識別して欠陥を正確に判別することが可能になる。   According to the first and ninth aspects of the invention, since the defect is determined using only the gray value of the image picked up by the image pickup means, the defect can be determined from a monochrome image, and the color image The processing load is relatively smaller than the case of handling color images, and the hardware resources are less than that of handling color images. That is, it is possible to detect defects existing on the surface of wood with a relatively inexpensive and simple system configuration. In addition, a primary defect candidate region is extracted from the entire surface of the wood, and further, a secondary candidate extraction unit is extracted from the inspection target region from which the primary defect candidate region is extracted, and the defect is determined for the secondary defect candidate region. By narrowing down the range for discriminating defects, it is possible to discriminate between the grain and the defect and accurately discriminate the defect.

請求項2の発明の構成によれば、目地溝により区画されている木材について、目地溝により仕切られているピースごとに第2のしきい値を設定するから、二次欠陥候補領域を抽出するにあたってピースごとに第2のしきい値を適正化することができ、二次欠陥候補領域を的確に抽出することが可能になる。   According to the configuration of the second aspect of the invention, since the second threshold value is set for each piece partitioned by the joint groove, the secondary defect candidate region is extracted for the wood partitioned by the joint groove. In this case, the second threshold value can be optimized for each piece, and the secondary defect candidate region can be accurately extracted.

請求項3の発明の構成によれば、検査対象領域ごとに第2のしきい値を設定するから、二次欠陥候補領域を抽出するための第2のしきい値を検査対象領域ごとに適正化することができ、検査対象である木材の場所ごとの濃淡値の相違を反映させた正確な欠陥検出が可能になる。   According to the configuration of the invention of claim 3, since the second threshold value is set for each inspection target region, the second threshold value for extracting the secondary defect candidate region is appropriate for each inspection target region. This makes it possible to accurately detect defects reflecting the difference in gray value for each location of the wood to be inspected.

請求項4の発明の構成によれば、二次欠陥候補領域の外接矩形を囲んで設定した判定領域において領域拡張しきい値を設定し、領域拡張しきい値により判定領域内の画素の濃淡値を二値化して欠陥候補となる領域を抽出するから、二次欠陥候補領域に基づいてさらに精度よく欠陥候補の領域を抽出することができ、結果的に欠陥の判別を正確に行うことが可能になる。とくに、欠陥候補となる領域と周辺との濃淡差が大きいときには、二次欠陥候補領域が実際の欠陥とは異なるサイズで抽出されることがあるが、二次欠陥候補領域の周囲の近傍の画素のみで欠陥候補を抽出するから、欠陥候補を正確に抽出することができる。   According to the configuration of the invention of claim 4, the region expansion threshold is set in the determination region set surrounding the circumscribed rectangle of the secondary defect candidate region, and the gray value of the pixel in the determination region is determined by the region expansion threshold Since the defect candidate region is extracted by binarizing the defect candidate region, the defect candidate region can be extracted more accurately based on the secondary defect candidate region, and as a result, the defect can be accurately identified. become. In particular, when the density difference between the defect candidate area and the periphery is large, the secondary defect candidate area may be extracted with a size different from the actual defect, but the neighboring pixels around the secondary defect candidate area may be extracted. Therefore, defect candidates can be extracted accurately.

請求項5の発明の構成によれば、二次欠陥候補領域の慣性主軸の方向の濃淡値の変化と慣性主軸に直交する方向の濃淡値の変化とを用いて欠陥候補となる領域を抽出するから、欠陥候補と周辺との境界を正確に抽出することができることにより、欠陥候補となる領域の周辺におけるノイズの影響が軽減され、木目などによるノイズを低減して欠陥候補の領域を正確に抽出することができる
請求項6の発明の構成によれば、判定領域において二次欠陥候補領域と二次欠陥候補領域を除く範囲との濃淡値の差分を、あらかじめ定められた判定用のしきい値と比較することにより欠陥を判別するものであり、判定用のしきい値として判定領域内の二次欠陥候補領域を除く範囲の画素の濃淡値に対して設定されている値を用いるから、欠陥の判別を目視に近い状態で正確に行うことが可能になる。
According to the configuration of the fifth aspect of the present invention, a region that is a defect candidate is extracted using the change in the gray value in the direction of the principal axis of inertia of the secondary defect candidate region and the change in the gray value in the direction perpendicular to the main axis of inertia. Therefore, it is possible to accurately extract the boundary between the defect candidate and the periphery, thereby reducing the influence of noise around the defect candidate area and accurately extracting the defect candidate area by reducing noise caused by wood grain. According to the configuration of the invention of claim 6, the difference in gray value between the secondary defect candidate region and the range excluding the secondary defect candidate region in the determination region is set as a predetermined threshold for determination. Since the value set for the gray value of the pixel in the range excluding the secondary defect candidate area in the determination area is used as a determination threshold value, Eyes It becomes possible to perform accurately in a state close to vision.

請求項7の発明の構成によれば、二次欠陥候補領域の形状に応じて、周辺の画素との濃淡値の差が大きくなるように規定した規則で判定領域を設定するから、欠陥の形状に適した判定領域の設定により欠陥の判別を正確に行うことができる
請求項8の発明の構成によれば、判定領域に含まれる画素のうち濃淡値が下位である規定の割合の画素に関する濃淡値の代表値と、判定領域に含まれる画素のうち濃淡値が上位である規定の割合の画素についての濃淡値の代表値との差を用いて欠陥を判別するから、欠陥候補となる領域と、周辺となる領域との濃淡値の差が大きくなり、欠陥の判別が容易になる。
According to the configuration of the invention of claim 7, since the determination region is set according to the rule that is defined so that the gray value difference with the surrounding pixels is large according to the shape of the secondary defect candidate region, the shape of the defect According to the configuration of the invention of claim 8, the density of pixels in a specified ratio with a lower gray value among the pixels included in the determination area can be determined accurately. Since the defect is determined using the difference between the representative value of the value and the representative value of the gray value for the pixels of the specified ratio having the higher gray value among the pixels included in the determination region, the defect candidate region The difference in gray value with the surrounding area becomes large, and the defect can be easily identified.

(実施形態1)
以下に説明する実施形態において、検査対象となる木材としては、合板の表面に貼り合わせるために用いる単板であって薄厚でシート状に形成された単板(突き板など)や、この単板を貼り合わせた合板を想定する。ここでは、木材3が床材や壁材として用いられる建築用板であり、図3に示すように、目地溝31により区画された複数個のピース32が表面に配列されているものとする。この種の木材3は定尺(たとえば、1800mm×300mm)の矩形状に形成されていることが多く、以下の説明では図2に示すように、搬送されている間に外観検査を行うものとする。
(Embodiment 1)
In the embodiments described below, the wood to be inspected is a single plate (such as a veneer) that is used for bonding to the surface of a plywood and is thin and formed into a sheet shape, or this single plate Assume a plywood laminated together. Here, it is assumed that the wood 3 is a building board used as a flooring material or a wall material, and a plurality of pieces 32 partitioned by joint grooves 31 are arranged on the surface as shown in FIG. This type of wood 3 is often formed in a rectangular shape (for example, 1800 mm × 300 mm), and in the following description, as shown in FIG. To do.

なお、木材3は上述の形状であることは必須ではなく、木材3の表面が複数の領域に区画されていれば本発明の技術思想を適用することができる。したがって、木材3の表面にピース32が配列されていることは必須ではない。木材3の表面を区画している各領域はそれぞれ検査対象領域であって、以下の実施形態ではピース32を検査対象領域として扱う。   In addition, it is not essential that the wood 3 has the above-described shape, and the technical idea of the present invention can be applied as long as the surface of the wood 3 is partitioned into a plurality of regions. Therefore, it is not essential that the pieces 32 are arranged on the surface of the wood 3. Each region that divides the surface of the wood 3 is an inspection target region, and in the following embodiment, the piece 32 is handled as the inspection target region.

図2に示すように、木材3は、コンベア21により一方向(図2(a)の矢印A方向)に搬送される。搬送方向は、木材3の短手方向に一致する。したがって、図2(b)に示すように、木材3の長手方向において複数台(図示例は4台)のコンベア21が並べられる。コンベア21の上方には撮像装置としてのラインセンサカメラ1が配置される。ラインセンサカメラ1は、木材3の全長に亘る領域を撮像することができるように、コンベア21を並べた方向(木材3の長手方向)に離間して複数台(図示例では3台)が並べられる。また、ラインセンサカメラ1は、光軸が木材3の表面に略直交するように配置されている。   As shown in FIG. 2, the wood 3 is conveyed in one direction (in the direction of arrow A in FIG. 2A) by the conveyor 21. The conveyance direction coincides with the short direction of the wood 3. Therefore, as shown in FIG. 2B, a plurality of conveyors (four in the illustrated example) are arranged in the longitudinal direction of the wood 3. A line sensor camera 1 as an imaging device is disposed above the conveyor 21. A plurality of units (three in the illustrated example) are arranged in the line sensor camera 1 so as to be spaced apart in the direction in which the conveyors 21 are arranged (longitudinal direction of the wood 3) so that an area covering the entire length of the wood 3 can be imaged. It is done. The line sensor camera 1 is arranged so that the optical axis is substantially orthogonal to the surface of the wood 3.

さらに、木材3の表面をラインセンサカメラ1により撮像する際の照明として、発光ダイオードを用いた照明装置2をコンベア21の上方に配置してある。照明装置2は、木材3の長手方向の全長に亘って均一な照度で照明を行うことができるように、多数個の発光ダイオードを直線上に配列するとともに、光取出面に拡散板を配置した構成を有する。また、照明装置2は、ラインセンサカメラ1に対して木材3が搬送される向きの下流側に配置される。照明装置2からの光は木材3の表面に対して所定角度θ(たとえば、60度)をなす方向から照射され、木材3に対して斜方照明を行う。したがって、ラインセンサカメラ1には木材3の表面からの拡散反射光が入射する。   Further, an illumination device 2 using light emitting diodes is disposed above the conveyor 21 as illumination when the surface of the wood 3 is imaged by the line sensor camera 1. The illuminating device 2 has a large number of light emitting diodes arranged in a straight line and a diffuser plate disposed on the light extraction surface so that illumination can be performed with uniform illuminance over the entire length of the wood 3 in the longitudinal direction. It has a configuration. Moreover, the illuminating device 2 is arrange | positioned with respect to the line sensor camera 1 in the downstream of the direction in which the timber 3 is conveyed. Light from the lighting device 2 is irradiated from a direction that forms a predetermined angle θ (for example, 60 degrees) with respect to the surface of the wood 3, and obliquely illuminates the wood 3. Therefore, the diffuse reflected light from the surface of the wood 3 is incident on the line sensor camera 1.

ラインセンサカメラ1により撮像される画像はモノクロの濃淡画像であって、画像処理装置4において以下に説明する画像処理が施されることにより木材3の欠陥が検出される。   The image captured by the line sensor camera 1 is a monochrome grayscale image, and the image processing device 4 performs image processing described below to detect a defect in the wood 3.

画像処理装置4は、図1に示すように、一次候補抽出部11と二次候補抽出部12と欠陥抽出部13とを主要な構成要素としている。一次候補抽出部11および二次候補抽出部12は、ラインセンサカメラ1により撮像された濃淡画像を2値化した2値画像から欠陥候補領域を抽出する。一次候補抽出部11では木材3の表面の全面を検査対象とし、二次候補抽出部12では木材3の表面のうち一次候補抽出部11で抽出された一次欠陥候補領域を含むピース32の範囲を検査領域とする。また、欠陥検出部13では、二次候補抽出部12で抽出された二次欠陥候補領域について、欠陥か否かを判定する。   As shown in FIG. 1, the image processing apparatus 4 includes a primary candidate extraction unit 11, a secondary candidate extraction unit 12, and a defect extraction unit 13 as main components. The primary candidate extraction unit 11 and the secondary candidate extraction unit 12 extract a defect candidate region from a binary image obtained by binarizing the grayscale image captured by the line sensor camera 1. In the primary candidate extraction unit 11, the entire surface of the wood 3 is to be inspected, and in the secondary candidate extraction unit 12, the range of the piece 32 including the primary defect candidate region extracted by the primary candidate extraction unit 11 out of the surface of the wood 3. The inspection area. Further, the defect detection unit 13 determines whether or not the secondary defect candidate area extracted by the secondary candidate extraction unit 12 is a defect.

画像処理装置4の構成をさらに詳しく説明する。なお、画像処理装置4は、パーソナルコンピュータや画像処理専用のプロセッサを備えるコンピュータを用いて以下の動作を行うプログラムを実行することにより実現される。画像処理装置4は、ラインセンサカメラ1からの濃淡画像を取り込むためのインターフェイスや、モニタ装置に画像を出力するためのインターフェイスなどを備えるが、これらの構成は周知のものを用いればよいから説明を省略する。また、画像処理装置4には、ラインセンサカメラ1からの濃淡画像を格納するとともに、画像処理の過程で生じる画像データを格納する作業記憶となる画像メモリ14が設けられる。   The configuration of the image processing apparatus 4 will be described in more detail. The image processing apparatus 4 is realized by executing a program for performing the following operations using a personal computer or a computer including a processor dedicated to image processing. The image processing device 4 includes an interface for capturing a grayscale image from the line sensor camera 1 and an interface for outputting an image to the monitor device. However, these configurations may be used because well-known ones may be used. Omitted. In addition, the image processing apparatus 4 is provided with an image memory 14 that serves as a working memory for storing grayscale images from the line sensor camera 1 and for storing image data generated in the course of image processing.

以下の説明では、ラインセンサカメラ1により撮像した濃淡画像から、木材3の表面に相当する領域の画素のみを背景から分離して画像メモリ14に格納しているものとする。木材3の表面に相当する画素を抽出するには、ラインセンサカメラ1により撮像した濃淡画像の2値化を行い、この2値画像を用いて背景の領域を分離すればよい。   In the following description, it is assumed that only pixels in a region corresponding to the surface of the wood 3 are separated from the background and stored in the image memory 14 from the grayscale image captured by the line sensor camera 1. In order to extract pixels corresponding to the surface of the wood 3, the grayscale image captured by the line sensor camera 1 is binarized, and the background region may be separated using the binary image.

一次候補抽出部11は、画像メモリ14に格納された木材3の表面の全体に関する濃淡画像を第1のしきい値により2値化する第1の2値化処理部11aと、第1の2値化処理部11aにより得られた2値画像を用いて一次欠陥候補領域を抽出する第1の候補領域抽出部11bとを備える。ここで、一次欠陥候補領域を抽出するにあたっては、抽出しようとする欠陥の種別に応じて設定したしきい値を用いる。つまり、第1のしきい値は、1種類ではなく複数種類が設定される。本実施形態では、欠陥の種別として、穴、節、入皮(若木の段階で皮が入り込み壊死した欠陥)、カナスジ(若木の段階で付いた傷が壊死した欠陥)を想定しており、これらの欠陥を抽出することができるように、第1のしきい値を複数段階(たとえば、4段階)に設定する第1のしきい値設定部11cが設けられる。   The primary candidate extraction unit 11 includes a first binarization processing unit 11a that binarizes a grayscale image relating to the entire surface of the wood 3 stored in the image memory 14 with a first threshold, and a first 2 A first candidate region extraction unit 11b that extracts a primary defect candidate region using the binary image obtained by the binarization processing unit 11a; Here, in extracting the primary defect candidate region, a threshold value set according to the type of defect to be extracted is used. That is, a plurality of types of first threshold values are set instead of one type. In the present embodiment, the types of defects are assumed to be holes, nodes, perforations (defects in which the skin entered and killed at the stage of young trees), canasuji (defects in which the wound attached at the stage of young trees became necrotic), and these The first threshold value setting unit 11c that sets the first threshold value to a plurality of levels (for example, 4 levels) is provided so that the first defect can be extracted.

二次候補抽出部12は、一次候補抽出部11により抽出された一次欠陥候補領域に着目し、一次欠陥候補領域を含むピース32ごとに第2のしきい値により2値化する第2の2値化処理部12aと、第2の2値化処理部12aにより得られた2値画像を用いて二次欠陥候補領域を抽出する第2の候補領域抽出部12bとを備える。また、第1のしきい値と同様に、第2のしきい値についても複数種類の欠陥を抽出することができるように複数段階に設定される。第2のしきい値を設定する第2のしきい値設定部12cは、一次候補抽出部11において用いた第1のしきい値と同数個の第2のしきい値を設定する。   The secondary candidate extraction unit 12 pays attention to the primary defect candidate region extracted by the primary candidate extraction unit 11, and binarizes with a second threshold value for each piece 32 including the primary defect candidate region. A binarization processing unit 12a and a second candidate region extraction unit 12b that extracts a secondary defect candidate region using the binary image obtained by the second binarization processing unit 12a are provided. Similarly to the first threshold value, the second threshold value is set in a plurality of stages so that a plurality of types of defects can be extracted. The second threshold value setting unit 12 c that sets the second threshold value sets the same number of second threshold values as the first threshold value used in the primary candidate extraction unit 11.

第2のしきい値Th2は、第1のしきい値Th1に対して補正値ΔThを加算または減算することにより設定する。つまり、Th2=Th1±ΔThになる。濃淡画像の各画素の濃淡値が8ビットの階調を有している(つまり、濃淡値は0〜255の範囲になる)場合、着目しているピース32内の濃淡値の平均値が128未満であるときには補正値ΔTh=−10とし、ピース32内の濃淡値の平均値が128以上であるときにはΔTh=10とする。すなわち、ピース32内の濃淡値の平均値に応じてピース32ごとに補正値ΔThを定める。なお、補正値ΔThは、10以外の適宜の値に設定することが可能であり、また補正値ΔThを各ピースごとに設定することも可能である。   The second threshold value Th2 is set by adding or subtracting the correction value ΔTh to the first threshold value Th1. That is, Th2 = Th1 ± ΔTh. When the gray value of each pixel of the gray image has an 8-bit gradation (that is, the gray value is in the range of 0 to 255), the average value of the gray values in the piece 32 of interest is 128. When the average value is less than 128, the correction value ΔTh = −10, and when the average value of the gray values in the piece 32 is 128 or more, ΔTh = 10. That is, the correction value ΔTh is determined for each piece 32 according to the average value of the gray values in the piece 32. The correction value ΔTh can be set to an appropriate value other than 10, and the correction value ΔTh can also be set for each piece.

第2のしきい値を第1のしきい値に基づいて設定していることにより、第1のしきい値において抽出しようとする欠陥の種類を第2のしきい値においても引き継ぐことができ、あらためて欠陥の種類ごとに第2のしきい値を設定する手間を省くことができる。たとえば、濃淡値が60〜70と他の欠陥に比較して明るい入皮やカナスジのような欠陥についても、あらためて第2のしきい値を設定しなおす必要がなく、第2のしきい値を第1のしきい値に基づいて他の欠陥と区別できるように設定することができる。   By setting the second threshold value based on the first threshold value, the type of defect to be extracted at the first threshold value can be inherited at the second threshold value. The trouble of setting the second threshold value for each type of defect can be saved. For example, it is not necessary to re-set the second threshold value for defects such as skin penetration or cane lines that are lighter than 60 to 70, and the second threshold value is set again. Based on the first threshold value, it can be set so that it can be distinguished from other defects.

上述したように、一次候補抽出部11において抽出された一次欠陥候補領域を含むピース32についてのみ、二次候補抽出部12において第2のしきい値を設定して二次欠陥候補領域を再度抽出するから、一次候補抽出部11で抽出された一次欠陥候補領域に近いピース32の範囲内で、欠陥を抽出するために適正化された第2のしきい値を設定することができ、欠陥の範囲を一次欠陥候補領域から二次欠陥候補領域に絞り込むことができる。   As described above, only for the piece 32 including the primary defect candidate region extracted by the primary candidate extraction unit 11, the secondary candidate extraction unit 12 sets the second threshold value and extracts the secondary defect candidate region again. Therefore, it is possible to set the second threshold value optimized for extracting the defect within the range of the piece 32 close to the primary defect candidate area extracted by the primary candidate extracting unit 11, The range can be narrowed down from the primary defect candidate region to the secondary defect candidate region.

欠陥抽出部13は、二次欠陥候補領域を抽出した各ピース32の範囲内の画素において、それぞれ二次欠陥候補領域に含まれる画素の濃淡値を求める内側値算出部13aと、二次欠陥候補領域の周辺の濃淡値を求める外側値算出部13bと、内側値算出部13aで求めた濃淡値と外側値算出部13bで求めた濃淡値との差分を求めるとともに当該差分を用いて着目する二次欠陥候補領域が欠陥か否かを判定する判定部13cとを備える。内側値算出部13aおよび外側値算出部13bにより求める濃淡値としては代表値を用いる。この種の代表値には平均値を用いることが多いが、中央値や最頻値を用いることも可能である。   The defect extraction unit 13 includes an inner value calculation unit 13a that obtains a gray value of each pixel included in the secondary defect candidate region for each pixel within the range of each piece 32 from which the secondary defect candidate region is extracted, and a secondary defect candidate. The outer value calculation unit 13b for obtaining the gray value around the area, the difference between the gray value obtained by the inner value calculation unit 13a and the gray value obtained by the outer value calculation unit 13b are obtained and attention is paid using the difference. And a determination unit 13c that determines whether or not the next defect candidate region is a defect. A representative value is used as the gray value obtained by the inner value calculating unit 13a and the outer value calculating unit 13b. An average value is often used as this type of representative value, but a median value or mode value can also be used.

判定部13cでは、濃淡値の差分が規定の基準値(たとえば、20)以上であり、かつ二次欠陥候補領域の面積が規定の基準値(たとえば、20mm)以上であるときに、当該二次欠陥候補領域を欠陥と判定する。面積に対して設定する基準値は、二次欠陥候補領域を抽出する際に用いた第2のしきい値に応じて設定される(第2のしきい値に応じて欠陥の種類が異なるから、欠陥の種類ごとに面積の基準値を設定する)。なお、判定部13cでは、一次欠陥候補として抽出されたものの二次欠陥候補としては抽出されなかった領域であっても、二次欠陥候補を抽出する際に用いた第2のしきい値に応じて設定された面積を有する場合には、欠陥と判定する。 In the determination unit 13c, when the difference between the gray values is equal to or greater than a specified reference value (for example, 20) and the area of the secondary defect candidate region is equal to or greater than the specified reference value (for example, 20 mm 2 ), The next defect candidate area is determined as a defect. The reference value set for the area is set according to the second threshold value used when the secondary defect candidate region is extracted (since the type of defect differs depending on the second threshold value). , Set the area reference value for each defect type). Note that the determination unit 13c responds to the second threshold value used when extracting the secondary defect candidate even if it is an area extracted as the primary defect candidate but not extracted as the secondary defect candidate. If it has the set area, it is determined as a defect.

上述した動作をまとめて図4に示す。ステップS1〜S3が一次候補抽出部11に相当する処理であり、まず第1のしきい値による2値化を行って2値画像を生成し(S1)、この2値画像から一次欠陥候補領域を抽出する(S2)。ステップS1,S2はすべての一次欠陥候補領域の抽出が完了するまで繰り返す(S3)。ここで、第1のしきい値が複数種類の欠陥に対して設定されているときには、すべての第1のしきい値に対してステップS1,S2を繰り返す。   The operations described above are collectively shown in FIG. Steps S1 to S3 are processes corresponding to the primary candidate extraction unit 11. First, binarization is performed using a first threshold value to generate a binary image (S1), and a primary defect candidate region is generated from the binary image. Is extracted (S2). Steps S1 and S2 are repeated until extraction of all primary defect candidate areas is completed (S3). Here, when the first threshold value is set for a plurality of types of defects, steps S1 and S2 are repeated for all the first threshold values.

図4のステップS4〜S8は二次候補抽出部12に相当する処理であり、まず、一次欠陥候補領域が抽出されたピース32ごとに上述した手順で補正値を設定する(S4)。次に、第1のしきい値と補正値とを用いて第2のしきい値を設定した後(S5)、第2のしきい値による2値化を行って2値画像を生成し(S6)、この2値画像から二次欠陥候補領域を抽出する(S7)。ステップS5〜S7はすべての二次欠陥候補領域の抽出が完了するまで繰り返す(S8)。   Steps S4 to S8 in FIG. 4 are processes corresponding to the secondary candidate extraction unit 12, and first, a correction value is set by the above-described procedure for each piece 32 from which a primary defect candidate area has been extracted (S4). Next, after setting the second threshold value using the first threshold value and the correction value (S5), binarization is performed using the second threshold value to generate a binary image ( S6), a secondary defect candidate area is extracted from the binary image (S7). Steps S5 to S7 are repeated until extraction of all secondary defect candidate regions is completed (S8).

図4のステップS9〜S13は欠陥抽出部13に相当する処理であり、まず、一次欠陥候補領域の中から二次欠陥候補領域を抽出した後(S9)、二次欠陥候補領域の内側と外側との濃淡値を算出する(S10)。ここで、濃淡値には代表値を用いる。濃淡値を求めた後には濃度差を求め(S11)、濃度差と画素数との評価により欠陥か否かを判定する(S12)。なお、ステップS9において一次欠陥候補領域のうち二次欠陥候補領域ではないと判定された領域については、ステップS11において画素数を評価して欠陥か否かを判定する。ステップS9〜S12はすべての一次欠陥候補領域および二次欠陥候補領域の判定が終了するまで繰り返す(S13)。   Steps S9 to S13 in FIG. 4 are processes corresponding to the defect extraction unit 13. First, after extracting a secondary defect candidate area from the primary defect candidate area (S9), the inside and outside of the secondary defect candidate area. The shade value is calculated (S10). Here, a representative value is used as the gray value. After obtaining the gray value, a density difference is obtained (S11), and it is determined whether or not the defect is determined by evaluating the density difference and the number of pixels (S12). In addition, about the area | region determined not to be a secondary defect candidate area | region among primary defect candidate area | regions in step S9, the number of pixels is evaluated in step S11, and it is determined whether it is a defect. Steps S9 to S12 are repeated until the determination of all primary defect candidate areas and secondary defect candidate areas is completed (S13).

ところで、木目を有する木材3では、一次欠陥候補領域から二次欠陥候補領域を抽出する際に用いる第2のしきい値は、各ピース32において木目と欠陥とを区別できるように設定することが要求される。   By the way, in the wood 3 having a grain, the second threshold value used when extracting the secondary defect candidate area from the primary defect candidate area can be set so that the grain and the defect can be distinguished in each piece 32. Required.

いま、一次欠陥候補領域を除くピース32内の濃淡値の平均値に対して木目および欠陥(1mm以上の領域)の濃淡値をプロットをとると、図5のような結果が得られる。図5において四角形は木目であり、菱形は欠陥である。この関係によれば、木目と欠陥とを分離することができる濃淡値は、図5に示す直線Ltにほぼ沿っていることがわかる。 Now, when plotting the gray value of the grain and the defect (area of 1 mm 2 or more) against the average value of the gray value in the piece 32 excluding the primary defect candidate area, a result as shown in FIG. 5 is obtained. In FIG. 5, the rectangle is a grain and the diamond is a defect. According to this relationship, it can be seen that the gray value capable of separating the grain and the defect is substantially along the straight line Lt shown in FIG.

図5に示す直線Ltの式で表される濃淡値Vbを例とし、ピース32において一次欠陥候補領域を除いた周辺の濃淡値の平均値をAvとすれば、Vb=0.4・Av+8.0と表すことができるから、一次欠陥候補領域から二次欠陥候補領域を抽出する際の第2のしきい値Th2を決定するにあたって、各ピース32ごとに一次欠陥候補領域を除く周辺の濃淡値の平均値Avを求め、この平均値Avを上式に当てはめて求めた濃淡値Vbを、第2のしきい値Th2として用いるようにすれば、第2のしきい値Th2により木目と欠陥とをほぼ分離することが可能になる。   Taking the gray value Vb represented by the equation of the straight line Lt shown in FIG. 5 as an example and assuming that the average value of the gray values in the periphery of the piece 32 excluding the primary defect candidate region is Av, Vb = 0.4 · Av + 8. Since it can be expressed as 0, in determining the second threshold value Th2 when extracting the secondary defect candidate region from the primary defect candidate region, the surrounding grayscale value excluding the primary defect candidate region for each piece 32 If the average value Av is obtained and the gray value Vb obtained by applying this average value Av to the above equation is used as the second threshold value Th2, the grain value and the defect are determined by the second threshold value Th2. Can be substantially separated.

なお、上述の例では一次候補領域を含むピース32についてのみ、第2のしきい値Th2を設定しているが、すべてのピース32について第2のしきい値Th2を設定することも可能である。ただし、この場合には第1のしきい値Th1はピース32の分離のみに用いられることになる。   In the above example, the second threshold value Th2 is set only for the piece 32 including the primary candidate region, but the second threshold value Th2 can be set for all the pieces 32. . However, in this case, the first threshold value Th1 is used only for separating the pieces 32.

ところで、上述の例では、判定部13cにおいて二次欠陥候補領域が欠陥か否かを判定するために、内側値算出部13aでは二次欠陥候補領域に含まれる画素の濃淡値を求め、外側値算出部13bでは二次欠陥候補領域の周辺の画素の濃淡値を求めている。周辺の画素の濃淡値は、ピース32の全体とすることが可能であるが、外側値算出部13bで濃淡値を求める領域内に木目が含まれることから、内側値算出部13aにより求めた濃淡値との差分を十分に大きくとることができない場合がある。   By the way, in the above-described example, in order to determine whether or not the secondary defect candidate region is defective in the determination unit 13c, the inner value calculation unit 13a obtains the gray value of the pixels included in the secondary defect candidate region, and the outer value. The calculation unit 13b obtains gray values of pixels around the secondary defect candidate region. The gray value of the surrounding pixels can be the whole of the piece 32. Since the grain value is included in the area where the gray value is obtained by the outer value calculation unit 13b, the gray value obtained by the inner value calculation unit 13a is included. In some cases, the difference from the value cannot be made sufficiently large.

そこで、ラインセンサカメラ1により図6(a)のような濃淡画像P1が撮像され、図6(b)のような二次欠陥候補領域D2が抽出されたときに、二次欠陥候補領域D2の外接矩形となる判定領域Drを設定し、判定領域Drの範囲内において、二次欠陥候補領域D2の内側と外側との濃淡値を比較するのが望ましい。   Therefore, when the line sensor camera 1 captures the grayscale image P1 as shown in FIG. 6A and the secondary defect candidate area D2 as shown in FIG. 6B is extracted, the secondary defect candidate area D2 is extracted. It is desirable to set a determination region Dr that is a circumscribed rectangle, and to compare the gray value between the inner side and the outer side of the secondary defect candidate region D2 within the range of the determination region Dr.

このように外接矩形の判定領域Drを設定することにより、二次欠陥候補領域D2の周辺とする範囲を狭めることができ、二次欠陥候補領域D2から離れた場所の木目などが判定結果に影響するのを防止することができる。また、ピース32内に複数個の二次欠陥候補領域D2が存在する場合に、それぞれの二次欠陥候補領域D2を個別に評価することが可能になる。   By setting the circumscribed rectangular determination region Dr in this way, the range around the secondary defect candidate region D2 can be narrowed, and the grain of the place away from the secondary defect candidate region D2 affects the determination result. Can be prevented. Further, when a plurality of secondary defect candidate regions D2 exist in the piece 32, each secondary defect candidate region D2 can be individually evaluated.

判定領域Drを規定する外接矩形の設定には、画像処理の分野における周知技術を用いればよく、二次欠陥候補領域D2に対して幾何学的な外接矩形である必要はない。この種の外接矩形を求めるには、二次欠陥候補領域Drに含まれる画素の慣性主軸を抽出し、慣性主軸の方向を矩形の一辺の方向に用い、当該方向に直交する方向を矩形の他辺の方向に用いればよい。また、二次欠陥候補領域D2を連結領域(隣接画素が同じ画素値を持つ画素の集合)の範囲のみとするか、1〜5画素程度の隙間がある複数の二次欠陥候補領域D2を1個の二次欠陥候補領域D2とみなすかは適宜に選択すればよい。   In order to set the circumscribed rectangle that defines the determination region Dr, a well-known technique in the field of image processing may be used, and it is not necessary to use a geometric circumscribed rectangle for the secondary defect candidate region D2. In order to obtain this kind of circumscribed rectangle, the inertia principal axis of the pixel included in the secondary defect candidate region Dr is extracted, the direction of the inertia principal axis is used as the direction of one side of the rectangle, and the direction orthogonal to the direction is the other rectangle. What is necessary is just to use for the direction of a side. Further, the secondary defect candidate region D2 is limited to the range of the connected region (a set of pixels in which adjacent pixels have the same pixel value), or a plurality of secondary defect candidate regions D2 having a gap of about 1 to 5 pixels are defined as 1 Whether to consider the secondary defect candidate regions D2 may be appropriately selected.

さらに、判定領域Drを二次欠陥候補領域D2の輪郭に接するように設定するか、二次欠陥候補領域D2の輪郭から外側に数画素離して設定するかは適宜に選択すればい。また、判定領域Drは二次欠陥候補領域D2の周辺の画素を含んでいればよいから、外接矩形ではない他の形状を選択することも可能である。もっとも、判定領域Drとして外接矩形を選択しておけば、判定領域Drの設定が容易であり、しかも二次欠陥候補領域D2の周辺の画素を略均等に反映する情報が得られることになる。   Furthermore, it is only necessary to appropriately select whether the determination region Dr is set so as to be in contact with the contour of the secondary defect candidate region D2 or set several pixels away from the contour of the secondary defect candidate region D2. Further, since the determination region Dr only needs to include pixels around the secondary defect candidate region D2, it is possible to select another shape that is not a circumscribed rectangle. However, if a circumscribed rectangle is selected as the determination region Dr, the determination region Dr can be easily set, and information that reflects pixels around the secondary defect candidate region D2 can be obtained almost equally.

上述のように判定領域Drを設定して欠陥の有無を判定する場合に、図4におけるステップS9とステップS10との間に図7に示す手順を挿入してもよい。ここでは、判定領域Drはすでに設定されているものとする。欠陥の判定のためには、まず第2のしきい値Th2を設定する(S1)。次に、判定領域Drについて、二次欠陥候補領域D2と二次欠陥候補領域D2と除く範囲との濃淡値の平均値Av1,Av2を内側値算出部13aおよび外側値算出部13bを用いて算出する(S2)。   When the determination region Dr is set as described above to determine the presence or absence of a defect, the procedure shown in FIG. 7 may be inserted between step S9 and step S10 in FIG. Here, it is assumed that the determination region Dr has already been set. In order to determine a defect, first, a second threshold value Th2 is set (S1). Next, with respect to the determination region Dr, the average values Av1 and Av2 of the gray value in the range excluding the secondary defect candidate region D2 and the secondary defect candidate region D2 are calculated using the inner value calculation unit 13a and the outer value calculation unit 13b. (S2).

ここで、内側値算出部13aで求めた値Av1と外側値算出部13bで求めた値Av2との平均値を領域拡張しきい値(=(Av1+Av2)/2)として求め(S3)、求めた領域拡張しきい値を用いて着目しているピース32(望ましくは、判定領域Drの内部)をあらためて2値化する(S4)。領域拡張しきい値を用いて2値化するのは、二次欠陥候補領域D2として抽出される範囲が実寸とは異なっている可能性があるからであって、二次欠陥候補領域D2の周辺の画素の濃淡値を用いることで、欠陥候補となる領域をより精度よく抽出することができる(S5)。この処理は、すべての二次欠陥候補領域D2について行う(S6)。   Here, the average value of the value Av1 obtained by the inner value calculation unit 13a and the value Av2 obtained by the outer value calculation unit 13b is obtained as a region expansion threshold (= (Av1 + Av2) / 2) (S3), and obtained. The piece 32 of interest (desirably, inside the determination region Dr) is binarized again using the region expansion threshold (S4). The reason why the binarization is performed using the area expansion threshold is that the range extracted as the secondary defect candidate area D2 may be different from the actual size. By using the gray value of this pixel, it is possible to more accurately extract a region as a defect candidate (S5). This process is performed for all secondary defect candidate regions D2 (S6).

なお、上述したように、判定領域Drは外接矩形である必要はないから、領域拡張しきい値を求める際の判定領域Drについて、二次欠陥候補領域D2の外接矩形の縦横比を維持した矩形や楕円形の領域を二次欠陥候補領域D2の外側に判定領域Drとして設定してもよい。   As described above, since the determination area Dr does not have to be a circumscribed rectangle, the determination area Dr for obtaining the area expansion threshold is a rectangle that maintains the aspect ratio of the circumscribed rectangle of the secondary defect candidate area D2. Alternatively, an elliptical region may be set as the determination region Dr outside the secondary defect candidate region D2.

上述の例では、欠陥の判定を行う際に二次欠陥候補領域D2を用いるのではなく、欠陥の判定には二次欠陥候補領域D2を用いて再抽出した欠陥候補の領域を用いている。このように、二次欠陥候補領域D2の周辺において欠陥か否かを判定する範囲を調整すれば、欠陥の有無に関する判定精度を高めることができる。   In the above-described example, the secondary defect candidate region D2 is not used when the defect is determined, but the defect candidate region re-extracted using the secondary defect candidate region D2 is used for the defect determination. Thus, by adjusting the range for determining whether or not there is a defect in the vicinity of the secondary defect candidate region D2, the determination accuracy regarding the presence or absence of the defect can be increased.

また、図6(b)のように二次欠陥候補領域D2について慣性主軸Axを求め、慣性主軸Axの上の画素について濃淡値の分布を評価するとともに、慣性主軸Axに直交する方向の画素について濃淡値の分布を評価することによって、欠陥候補の領域を調整してもよい。   Further, as shown in FIG. 6B, the inertia main axis Ax is obtained for the secondary defect candidate region D2, and the distribution of the gray value is evaluated for the pixels above the inertia main axis Ax, and the pixels in the direction orthogonal to the inertia main axis Ax are evaluated. The defect candidate area may be adjusted by evaluating the distribution of gray values.

ここでは、慣性主軸Axの上の画素について濃淡値の微分値(慣性主軸Axの上で隣接する画素の濃淡値の差分でもよい)を求めており、図8に示すように、欠陥の周囲では欠陥よりも明るくなるから(濃淡値は明るいほうが大きいものとする)、二次欠陥候補領域D2の内側から慣性主軸Axの上の画素を追跡し、微分値が増加した後に低下するか変化しなくなった(つまり、微分値が規定値以下になった)部位を欠陥候補の外側の領域と判断すればよい。図8では左端が重心の画素であり、右端が欠陥候補の外側の画素に相当する。   Here, the differential value of the gray value (which may be the difference between the gray values of adjacent pixels on the inertial main axis Ax) is obtained for the pixel on the inertial main axis Ax, and as shown in FIG. Since it becomes brighter than the defect (it is assumed that the gray value is larger), the pixel on the inertial main axis Ax is traced from the inside of the secondary defect candidate region D2, and it decreases or does not change after the differential value increases. It is only necessary to determine the region where the differential value is equal to or less than the specified value as the region outside the defect candidate. In FIG. 8, the left end corresponds to the pixel at the center of gravity, and the right end corresponds to the pixel outside the defect candidate.

また、慣性主軸Axに直交する方向についても同様であり、たとえば、二次欠陥候補領域D2における重心Gを通り慣性主軸Axに直交する方向の直線上で、慣性主軸Axの上の画素と同様にして濃淡値の分布を評価する。   The same applies to the direction orthogonal to the inertial main axis Ax. For example, on the straight line passing through the center of gravity G in the secondary defect candidate region D2 and orthogonal to the inertial main axis Ax, the same as the pixel above the inertial main axis Ax. To evaluate the distribution of gray values.

慣性主軸Axあるいは慣性主軸Axに直交する方向の直線上の上の画素について欠陥候補となる領域の境界位置を求める手順を図9に示す(以下では、慣性主軸Axに着目して記載するが、慣性主軸Axに直交する方向も同様)。図9では最初の起点の位置として二次欠陥候補領域D2の重心Gの位置を用いている。これは慣性主軸Axが重心Gを通り、かつ重心Gは二次欠陥候補領域D2の内側に存在しており、重心Gの位置を起点の初期位置に用いると、欠陥候補になる領域の境界を内側から外側に向かって検出することができるからである。   FIG. 9 shows a procedure for obtaining the boundary position of a region that is a defect candidate for a pixel on a straight line in a direction orthogonal to the inertial principal axis Ax or the inertial principal axis Ax (the following description will be made focusing on the inertial principal axis Ax. The same applies to the direction orthogonal to the inertial main axis Ax). In FIG. 9, the position of the center of gravity G of the secondary defect candidate region D2 is used as the position of the first starting point. This is because the inertial axis Ax passes through the center of gravity G, and the center of gravity G exists inside the secondary defect candidate region D2, and if the position of the center of gravity G is used as the initial position of the starting point, the boundary of the region that becomes the defect candidate is defined. This is because it can be detected from the inside to the outside.

したがって、まず初期状態では、起点位置として重心位置を用いる(S1)。起点が決まると、起点の濃淡値を求めるとともに(S2)、慣性主軸Axの上で起点から所定画素(たとえば、5画素)だけ離れた画素の濃淡値を求める(S3)。ここで、濃淡値を求めるには画像メモリ14に格納された濃淡画像を読み出せばよい。   Therefore, in the initial state, the center of gravity position is used as the starting point position (S1). When the starting point is determined, the gray value of the starting point is obtained (S2), and the gray value of a pixel separated from the starting point by a predetermined pixel (for example, 5 pixels) on the inertia main axis Ax is obtained (S3). Here, in order to obtain the gray value, the gray image stored in the image memory 14 may be read.

次に、両濃淡値の差分を求め(S4)、差分値が規定値(図示例では、10)を超えていると欠陥領域の境界付近の画素とみなし、欠陥候補となる領域の外側の画素を探索するためのフラグ(探索フラグ)を設定する(S5)。また、差分が規定値以下のときには、慣性主軸Axの上で次の画素を起点にし(S7)、上述したステップS2〜S5の処理を繰り返す。   Next, a difference between the gray values is obtained (S4), and if the difference value exceeds a specified value (10 in the illustrated example), it is regarded as a pixel near the boundary of the defect region, and a pixel outside the region serving as a defect candidate. A flag (search flag) for searching for is set (S5). When the difference is less than or equal to the specified value, the next pixel on the inertial main axis Ax is set as the starting point (S7), and the above-described steps S2 to S5 are repeated.

一方、ステップS5において探索フラグが設定されており、かつ上記差分が規定値(図示例では5)より小さくなれば(S6)、欠陥候補となる領域の外側の画素であると判断し、探索を停止する(S8)。つまり、起点位置の画素から所定画素だけ離れた位置の画素の位置を、欠陥候補となる領域の境界線に隣接し、かつ欠陥候補となる領域の外側の画素の位置であるとみなす。   On the other hand, if the search flag is set in step S5 and the difference is smaller than a specified value (5 in the illustrated example) (S6), it is determined that the pixel is outside the region that is a defect candidate, and the search is performed. Stop (S8). That is, the position of the pixel located at a predetermined pixel away from the starting position pixel is regarded as the position of the pixel adjacent to the boundary line of the defect candidate area and outside the defect candidate area.

起点の画素と濃淡値の差分を求める画素との間の画素数をどの程度に設定するかは適宜に設定することができ、小さく設定すれば精度は高くなるが処理負荷が増加し、大きく設定すれば精度はやや低下するが処理負荷を低減することができる。   The number of pixels between the starting pixel and the pixel for which the difference between the gray values is calculated can be set as appropriate. Setting a smaller value increases the accuracy but increases the processing load and increases the setting. If this is done, the processing load can be reduced although the accuracy is slightly reduced.

また、起点の画素と濃淡値の差分を求める画素との間の画素数が、判定領域Drの範囲を超えている場合には、複数画素の間隔とせずに1画素ずつの間隔で濃淡値の差分を求める。起点になる画素からの画素数が判定領域Drの範囲を超えるのは、判定領域Drの寸法が当該画素数よりも小さい場合と、起点が判定領域Drの境界付近まで移動した場合とがある。前者の場合は、欠陥候補となる領域の境界の探索を開始した時点から起点の移動を1画素単位とし、後者の場合は、起点が判定領域Drの境界付近まで移動したときに起点の移動が1画素単位になる。   Further, when the number of pixels between the starting pixel and the pixel for which the difference between the gray values is calculated exceeds the range of the determination region Dr, the gray value is not set at the interval of a plurality of pixels but at the interval of one pixel at a time. Find the difference. The number of pixels from the starting pixel exceeds the range of the determination area Dr when the dimension of the determination area Dr is smaller than the number of pixels or when the start point moves to the vicinity of the boundary of the determination area Dr. In the former case, the movement of the starting point is set to one pixel unit from the start of the search for the boundary of the defect candidate area, and in the latter case, the starting point moves when the starting point moves to the vicinity of the boundary of the determination area Dr. One pixel unit.

上述の例では、欠陥候補の領域の境界を探索することにより求められる画素の濃淡値の差は常に正になることが予想されるが、ノイズによって濃淡値が変動した場合などは、濃淡値の差が負になることがある。このような場合は、ノイズにより探索が誤停止した可能性があるから、探索フラグの設定を解除し、重心の位置からの探索をやり直すのが望ましい。   In the above example, it is expected that the difference in the gray value of the pixel obtained by searching for the boundary of the defect candidate area will always be positive, but when the gray value varies due to noise, The difference can be negative. In such a case, the search may be erroneously stopped due to noise, so it is desirable to cancel the setting of the search flag and restart the search from the position of the center of gravity.

なお、上述の例では慣性主軸Axの上の画素と、重心を通り慣性主軸Axに直交する直線の上の画素とにのみ着目しており、2本の直線上の画素にのみ着目しており、欠陥候補となる領域の範囲を2本の直線上でのみ調整することができるが(あるいは、判定領域Drを調整することができるが)、各直線に平行な複数本の直線を規定して同様の判定を行えば、欠陥候補となる領域をより精度よく確定することができる。また、欠陥候補の領域の境界は形状が複雑であるから、平滑化を行った後に上述の処理を行うことで、境界の形状による検出結果のばらつきを抑制することができる。   In the above example, attention is paid only to pixels on the inertial main axis Ax and pixels on a straight line passing through the center of gravity and orthogonal to the inertial main axis Ax, and attention is paid only to pixels on the two straight lines. The range of defect candidate areas can be adjusted only on two straight lines (or the determination area Dr can be adjusted), but a plurality of straight lines parallel to each straight line are defined. If a similar determination is made, a region as a defect candidate can be determined with higher accuracy. In addition, since the boundary of the defect candidate region has a complicated shape, it is possible to suppress variation in detection results due to the shape of the boundary by performing the above-described processing after smoothing.

図4のステップS12においては、以下の判定を行うことにより欠陥候補の領域について欠陥の有無を判定すればよい。すなわち、判定領域Drにおいて、欠陥候補の領域を除く範囲の濃淡値の平均値をパラメータとして、欠陥候補の領域とそれ以外の領域との濃淡値の差分との関係を求めると、カバ材では、図10に示すように、木目(菱形で示す値)と欠陥(正方形で示す値)との境界値が直線Lsにほぼ沿っていることがわかる。   In step S12 of FIG. 4, the presence or absence of a defect may be determined for the defect candidate region by performing the following determination. That is, in the determination area Dr, using the average value of the gray value in the range excluding the defect candidate area as a parameter, the relationship between the gray value difference between the defect candidate area and the other areas is obtained. As shown in FIG. 10, it can be seen that the boundary value between the grain (value indicated by a diamond) and the defect (value indicated by a square) is substantially along the straight line Ls.

図10に示す直線Lsの式で表される濃淡値の差分ΔCを例とし、判定領域Drにおいて欠陥候補の領域を除く範囲の濃淡値の平均値をAwとすれば、ΔC=0.75・Aw−20.0という関係式で表すことができる。したがって、判定領域Drのうち欠陥候補の領域を除く範囲の濃淡値の平均値Awを求め、差分ΔCを判定用のしきい値に用いて木目と欠陥とを判別する。   Taking the grayscale value difference ΔC represented by the equation of the straight line Ls shown in FIG. 10 as an example, if the average grayscale value in the range excluding the defect candidate area in the determination area Dr is Aw, then ΔC = 0.75 · It can be represented by the relational expression Aw-20.0. Therefore, the average value Aw of the shade values in the range excluding the defect candidate area in the determination area Dr is obtained, and the grain and the defect are determined using the difference ΔC as a determination threshold value.

すなわち、判定領域Drのうち欠陥候補の領域の画素の濃淡値の代表値(平均値、最頻値など)と、判定領域Drのうち欠陥候補の領域以外の画素の濃淡値の代表値(平均値、最頻値など)との差分を求め、上述した関係式から求めた判定用のしきい値との比較により、木目と欠陥とを判別するのである。図示例によれば、周辺の濃淡値(判定領域Drのうち欠陥候補の領域以外の画素の濃淡値の代表値)から上記関係式により求められる判定用のしきい値(差分ΔC)に対して、欠陥候補の領域の画素の濃淡値の代表値と欠陥候補の領域以外の画素の濃淡値の代表値との差分が大きいときに、欠陥候補の領域が欠陥として判別されることになる。   That is, the representative value (average value, mode value, etc.) of the pixels in the defect candidate area in the determination area Dr, and the representative value (average value) of the pixels other than the defect candidate area in the determination area Dr. The difference between the value and the mode value is determined, and the grain and the defect are determined by comparison with the threshold value for determination obtained from the relational expression described above. According to the illustrated example, with respect to the threshold value for determination (difference ΔC) obtained by the above relational expression from the surrounding gray value (representative value of the gray value of the pixel other than the defect candidate region in the determination region Dr). When the difference between the representative value of the gray value of the pixel in the defect candidate area and the representative value of the gray value of the pixels other than the defect candidate area is large, the defect candidate area is determined as a defect.

ところで、判定領域Drを設定するにあたっては、欠陥の種類に応じて異なる規則を適用してもよい。たとえば、図11(a)のような丸形の欠陥(以下では、丸形欠陥という)Df1と、図11(b)のような筋状の欠陥(以下では、スジ欠陥という)Df2とでは、判定領域Drの設定規則を変えるのである。ここでは、外接矩形を設定したときに縦寸法Hと横寸法Wとの関係が1/2<H/W<2という条件を満たすときに丸形欠陥Df1と呼び、当該条件を満たさないときにスジ欠陥Df2と呼ぶ。   By the way, when setting the determination region Dr, different rules may be applied depending on the type of defect. For example, a round defect (hereinafter referred to as a round defect) Df1 as shown in FIG. 11A and a streak defect (hereinafter referred to as a streak defect) Df2 as shown in FIG. The setting rule of the determination area Dr is changed. Here, when the circumscribed rectangle is set, the relationship between the vertical dimension H and the horizontal dimension W is called a round defect Df1 when the condition of 1/2 <H / W <2 is satisfied, and when the condition is not satisfied This is called a streak defect Df2.

丸形欠陥Df1は方向性がほとんどないから、縦寸法Hと横寸法Wとをそれぞれ2倍にした判定領域Drを設定する。つまり、目視検査を行ったときに丸形の欠陥候補の領域は周囲全体との濃度差があるときに欠陥と認識されやすいから、欠陥候補の領域の周囲を全体に拡張した判定領域Drを設定する。一方、スジ欠陥Df2には方向性を有しているから、縦寸法Hと横寸法Wとのうち小さいほうのみを2倍にした判定領域Drを設定する。これは、目視検査を行ったときに筋状の欠陥候補の領域は幅方向において濃度差があるときに欠陥と認識されやすいから、欠陥候補の領域の周囲を幅方向に拡張した判定領域Drを設定するのである。いずれの場合でも判定領域Drの中心は外接矩形の中心と一致させる。   Since the round defect Df1 has almost no directionality, a determination region Dr in which the vertical dimension H and the horizontal dimension W are each doubled is set. That is, when a visual inspection is performed, a round defect candidate area is easily recognized as a defect when there is a density difference from the entire surrounding area. Therefore, a determination area Dr that extends the entire periphery of the defect candidate area is set. To do. On the other hand, since the streak defect Df2 has directionality, a determination region Dr is set in which only the smaller one of the vertical dimension H and the horizontal dimension W is doubled. This is because, when a visual inspection is performed, a streak defect candidate region is easily recognized as a defect when there is a density difference in the width direction. Therefore, a determination region Dr in which the periphery of the defect candidate region is expanded in the width direction is used. Set it. In any case, the center of the determination area Dr is made to coincide with the center of the circumscribed rectangle.

欠陥候補の領域について欠陥か否かを判定する例を図12に示す。いま、周囲よりも濃淡値が小さい(暗い)領域が図12(a)のような形で存在しているものとし、判定領域Drが図のように設定された場合を想定する。   An example of determining whether or not a defect candidate area is defective is shown in FIG. Assume that a region having a gray value smaller (darker) than the surroundings exists in the form as shown in FIG. 12A, and the determination region Dr is set as shown in the drawing.

ここで、判定領域Drにおける画素の濃淡値に関してヒストグラムを生成すると、図12(b)のようになる。図12(b)では、判定領域Drにおいて、欠陥候補を除く領域における濃淡値の度数を正方形で示し、欠陥候補の領域における濃淡値の度数を菱形で示している。図12(b)を見ればわかるように、欠陥候補の領域と欠陥候補を除く領域とでは濃淡値の分布が異なっている。欠陥と非欠陥とを分離するには、各領域について濃淡値の差ができるだけ大きくなるように選択した代表値について比較するのが望ましい。つまり、各領域の全体について濃淡値の平均値を比較するよりも、各領域において数の多い濃淡値から代表値を選択するのが望ましい。   Here, when a histogram is generated regarding the gray value of the pixel in the determination region Dr, the result is as shown in FIG. In FIG. 12B, in the determination area Dr, the frequency of the gray value in the area excluding the defect candidate is indicated by a square, and the frequency of the gray value in the area of the defect candidate is indicated by a rhombus. As can be seen from FIG. 12B, the distribution of the gray value is different between the defect candidate region and the region excluding the defect candidate. In order to separate the defect from the non-defect, it is desirable to compare the representative values selected so that the difference between the gray values for each region is as large as possible. That is, it is desirable to select a representative value from a large number of gray values in each region, rather than comparing the average value of gray values in each region.

欠陥候補の領域では濃淡値が小さいほうに偏在しているから、濃淡値の下位側の一定割合を占める画素について濃淡値の平均値を求めて代表値とし、欠陥候補を除く領域では濃淡値が大きいほうに偏在しているから、濃淡値の上位側の一定割合を占める画素について濃淡値の平均値を求めて代表値とする。たとえば、欠陥候補の領域の全画素のうち濃淡値が下位である30%の画素について濃淡値の平均値V1を求めるとともに、欠陥候補を除いた領域の全画素のうち濃淡値が上位である30%の画素について濃淡値の平均値V2を求め、両平均値V1,V2の差ΔV(=V2−V1)を評価するのである。   In the defect candidate area, the gray value is unevenly distributed, so the average value of the gray value is obtained for the pixels that occupy a certain ratio on the lower side of the gray value, and is used as a representative value. Since it is unevenly distributed, the average value of the gray values is obtained for the pixels that occupy a certain ratio on the upper side of the gray value and set as a representative value. For example, the average value V1 of the gray values is obtained for 30% of the pixels in which the gray value is lower among all the pixels in the defect candidate region, and the gray value is the upper 30 in all the pixels in the region excluding the defect candidate. The average value V2 of the light and shade values is obtained for% pixels, and the difference ΔV (= V2−V1) between the two average values V1 and V2 is evaluated.

各領域の代表値として採用する画素数の割合は適宜に設定することができ、30%とすることは必須ではない。たとえば、検査対象や判定しようとする欠陥の種類に応じて値を変えてもよい。また、各領域の代表値としては最頻値を用いてもよい。   The ratio of the number of pixels employed as the representative value of each region can be set as appropriate, and it is not essential to set it to 30%. For example, the value may be changed according to the inspection object and the type of defect to be determined. The mode value may be used as the representative value of each region.

実施形態を示すブロック図である。It is a block diagram which shows embodiment. (a)は同上の側面図、(b)は同上の斜視図である。(A) is a side view of the above, (b) is a perspective view of the same. (a)は同上に用いる木材を示す概略平面図、(b)は同上に用いる木材を示す平面図である。(A) is a schematic top view which shows the timber used for the same as the above, (b) is a top view which shows the timber used for the same as the above. 同上の動作説明図である。It is operation | movement explanatory drawing same as the above. 同上における木目と欠陥とを分離する原理を説明する図である。It is a figure explaining the principle which isolate | separates the grain and defect in the same as the above. (a)は同上に用いる濃淡画像を示す図、(b)は同図(a)を二値化した画像を示す図である。(A) is a figure which shows the grayscale image used for the same as the above, (b) is a figure which shows the image which binarized the figure (a). 同上の要部の動作説明図である。It is operation | movement explanatory drawing of the principal part same as the above. 同上において欠陥候補の領域を抽出する原理を説明する図である。It is a figure explaining the principle which extracts the area | region of a defect candidate in the same as the above. 同上の要部の動作説明図である。It is operation | movement explanatory drawing of the principal part same as the above. 同上において木目と欠陥とを分離する原理を説明する図である。It is a figure explaining the principle which isolate | separates a grain and a defect in the same as the above. (a)は丸形欠陥に対して設定する判定領域を説明する図、(b)はスジ欠陥に対して設定する判定領域を説明する図である。(A) is a figure explaining the determination area | region set with respect to a round defect, (b) is a figure explaining the determination area | region set with respect to a stripe defect. (a)は同上に用いる濃淡画像を示す図、(b)は同図(a)から求めた濃淡値の度数分布を示す図である。(A) is a figure which shows the gradation image used for the same as the above, (b) is a figure which shows the frequency distribution of the gradation value calculated | required from the figure (a).

符号の説明Explanation of symbols

1 ラインセンサカメラ(撮像手段)
2 照明装置
3 木材
4 画像処理装置
11 一次候補抽出部
12 二次候補抽出部
13 欠陥抽出部
14 画像メモリ
21 コンベア
31 目地溝
32 ピース
Ax 慣性主軸
Dr 判定領域
1 Line sensor camera (imaging means)
DESCRIPTION OF SYMBOLS 2 Illuminating device 3 Wood 4 Image processing apparatus 11 Primary candidate extraction part 12 Secondary candidate extraction part 13 Defect extraction part 14 Image memory 21 Conveyor 31 Joint groove 32 Piece Ax Inertial spindle Dr determination area | region

Claims (9)

複数の検査対象領域に区画されている木材の表面を撮像する撮像手段と、撮像手段により撮像された複数の検査対象領域を含む濃淡画像を第1のしきい値により2値化した2値画像から一次欠陥候補領域を抽出する一次候補抽出部と、一次欠陥候補領域が抽出された着目する検査対象領域について前記濃淡画像を木目と欠陥とを分離するように設定した第2のしきい値により2値化した2値画像から二次欠陥候補領域を抽出する二次候補抽出部と、二次欠陥候補領域を含む検査対象領域において二次欠陥候補領域に含まれる画素の濃淡値と二次欠陥候補領域の周辺の画素の濃淡値との差分を用いて欠陥を判別する欠陥抽出部とを備えることを特徴とする木材の外観検査装置。   An imaging unit that images the surface of wood divided into a plurality of inspection target areas, and a binary image obtained by binarizing a grayscale image including the plurality of inspection target areas captured by the imaging unit using a first threshold value A primary candidate extraction unit for extracting a primary defect candidate area from a second threshold value set so as to separate the gray image and the defect for the inspection target area from which the primary defect candidate area is extracted; A secondary candidate extraction unit that extracts a secondary defect candidate area from the binarized binary image, and a gray value and a secondary defect of pixels included in the secondary defect candidate area in the inspection target area including the secondary defect candidate area A wood appearance inspection apparatus comprising: a defect extraction unit that determines a defect using a difference from a gray value of pixels around a candidate area. 前記木材は目地溝により区画された複数のピースを表面に配列した板材であって、前記二次候補抽出部は、各ピースを前記検査対象領域とし各ピースの濃淡値の平均値を第2のしきい値に用いて二次欠陥候補領域を抽出することを特徴とする請求項1記載の木材の外観検査装置。   The wood is a plate material in which a plurality of pieces partitioned by joint grooves are arranged on the surface, and the secondary candidate extraction unit sets each piece as the inspection target region and sets an average value of gray values of each piece as a second value. 2. The wood appearance inspection apparatus according to claim 1, wherein a secondary defect candidate region is extracted using the threshold value. 前記二次候補抽出部は、前記濃淡画像に含まれる前記検査対象領域ごとに前記第2のしきい値を設定することを特徴とする請求項1又は2記載の木材の外観検査装置。   3. The wood appearance inspection apparatus according to claim 1, wherein the secondary candidate extraction unit sets the second threshold value for each of the inspection target regions included in the grayscale image. 前記欠陥抽出部は、前記二次欠陥候補領域の外接矩形を囲む判定領域を設定し、判定領域内において二次欠陥候補領域の画素と二次欠陥候補領域を除く範囲の画素との濃淡値を用いて領域拡張しきい値を設定し、領域拡張しきい値により判定領域内の画素の濃淡値を二値化することにより、欠陥候補となる領域を抽出し、当該領域について欠陥を判別することを特徴とする請求項1〜3のいずれか1項に記載の木材の外観検査装置。   The defect extraction unit sets a determination region that encloses a circumscribed rectangle of the secondary defect candidate region, and calculates a gray value between a pixel in the secondary defect candidate region and a pixel in a range excluding the secondary defect candidate region in the determination region. Use this to set a region expansion threshold, binarize the gray value of the pixels in the determination region using the region expansion threshold, extract a region that is a defect candidate, and determine the defect for that region The wood appearance inspection apparatus according to any one of claims 1 to 3. 前記欠陥抽出部は、前記二次欠陥候補領域の慣性主軸を求め、慣性主軸に沿う方向に並ぶ画素の濃淡値の変化と、慣性主軸に直交する方向に並ぶ画素の濃淡値の変化とを用いて二次欠陥候補領域から欠陥候補となる領域を抽出し、当該領域について欠陥を判別することを特徴とする請求項1〜3のいずれか1項に記載の木材の外観検査装置。   The defect extraction unit obtains an inertial main axis of the secondary defect candidate region, and uses a change in gray value of pixels arranged in a direction along the inertial main axis and a change in gray value of pixels arranged in a direction orthogonal to the inertial main axis. 4. The wood appearance inspection apparatus according to claim 1, wherein a region that is a defect candidate is extracted from a secondary defect candidate region, and a defect is determined for the region. 5. 前記欠陥抽出部は、前記二次欠陥候補領域を囲む判定領域を設定し、判定領域内において二次欠陥候補領域の画素と二次欠陥候補領域を除く範囲の画素との濃淡値の差分を求め、判定領域内の二次欠陥候補領域を除く範囲の画素の濃淡値に対して設定されている判定用のしきい値と前記差分とを比較することにより、欠陥を判別することを特徴とする請求項1〜5のいずれか1項に記載の木材の外観検査装置。   The defect extraction unit sets a determination region surrounding the secondary defect candidate region, and obtains a difference in gray value between a pixel in the secondary defect candidate region and a pixel in a range excluding the secondary defect candidate region in the determination region. The defect is discriminated by comparing the difference with the threshold value for determination set for the gray value of the pixels in the range excluding the secondary defect candidate area in the determination area. The wood appearance inspection apparatus according to any one of claims 1 to 5. 前記欠陥抽出部は、前記二次欠陥候補領域の形状に応じて、周辺の画素との濃淡値の差が大きくなるように規定した規則で判定領域を設定し、判定領域において二次欠陥候補領域を除く範囲の画素を周辺の画素に用いることを特徴とする請求項1〜7のいずれか1項に記載の木材の外観検査装置。   The defect extraction unit sets a determination region according to a rule that is defined so that a difference in gray value with surrounding pixels is increased according to the shape of the secondary defect candidate region, and the secondary defect candidate region in the determination region 8. The wood appearance inspection apparatus according to claim 1, wherein pixels in a range excluding the range are used as peripheral pixels. 前記欠陥抽出部は、前記二次欠陥候補領域を囲む判定領域を設定し、判定領域に含まれる画素のうち濃淡値が下位である規定の割合の画素に関する濃淡値の代表値と、判定領域に含まれる画素のうち濃淡値が上位である規定の割合の画素についての濃淡値の代表値との差を用いて欠陥を判別することを特徴とする請求項1〜7のいずれか1項に記載の木材の外観検査装置。   The defect extraction unit sets a determination region that surrounds the secondary defect candidate region, and includes a gray value representative value for pixels of a specified ratio with a lower gray value among pixels included in the determination region, and a determination region. The defect is determined using a difference from a representative value of the gray value for pixels of a specified ratio in which the gray value is higher among the included pixels. Wood appearance inspection equipment. 複数の検査対象領域に区画されている木材の表面を撮像手段により撮像した濃淡画像を用い、複数の検査対象領域を含む濃淡画像を第1のしきい値により2値化した2値画像から一次欠陥候補領域を抽出し、次に、着目する検査対象領域について前記濃淡画像を木目と欠陥とを分離するように設定した第2のしきい値により2値化した2値画像から二次欠陥候補領域を抽出した後、二次欠陥候補領域を含む検査対象領域において二次欠陥候補領域に含まれる画素の濃淡値と二次欠陥候補領域の周辺の画素の濃淡値との差分を用いて欠陥を判別することを特徴とする木材の外観検査方法。   First, a binary image obtained by binarizing a grayscale image including a plurality of inspection target areas using a first threshold value using a grayscale image obtained by imaging an image of the surface of the wood partitioned into a plurality of inspection target areas. A defect candidate area is extracted, and then a secondary defect candidate is obtained from a binary image obtained by binarizing the grayscale image with a second threshold value set so as to separate the grain and the defect for the inspection target area of interest. After extracting the area, in the inspection target area including the secondary defect candidate area, the defect is determined using the difference between the gray value of the pixel included in the secondary defect candidate area and the gray value of the pixels around the secondary defect candidate area. A method for inspecting the appearance of wood, characterized by discriminating.
JP2008284649A 2008-11-05 2008-11-05 Wood appearance inspection device, wood appearance inspection method Expired - Fee Related JP5086970B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008284649A JP5086970B2 (en) 2008-11-05 2008-11-05 Wood appearance inspection device, wood appearance inspection method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008284649A JP5086970B2 (en) 2008-11-05 2008-11-05 Wood appearance inspection device, wood appearance inspection method

Publications (2)

Publication Number Publication Date
JP2010112802A JP2010112802A (en) 2010-05-20
JP5086970B2 true JP5086970B2 (en) 2012-11-28

Family

ID=42301468

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008284649A Expired - Fee Related JP5086970B2 (en) 2008-11-05 2008-11-05 Wood appearance inspection device, wood appearance inspection method

Country Status (1)

Country Link
JP (1) JP5086970B2 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5373989B1 (en) * 2013-04-12 2013-12-18 橋本電機工業株式会社 Single plate sorting and deposition apparatus and single plate sorting method
JP2014205338A (en) * 2013-09-18 2014-10-30 橋本電機工業株式会社 Veneer screening and stacking apparatus, and veneer screening method
KR20180123088A (en) * 2016-03-25 2018-11-14 마크텍 가부시키가이샤 Flaw detection apparatus and method for detecting defects by a flaw detection apparatus

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5100877B1 (en) * 2011-09-26 2012-12-19 日本リライアンス株式会社 Surface inspection device
CA2959844C (en) 2016-03-01 2024-05-28 Vab Solutions Inc. Tracking system and methods for tracking wood products in a production line
JP6357617B2 (en) * 2016-10-18 2018-07-18 株式会社高瀬文夫商店 Defect inspection equipment
CN106680299B (en) * 2017-01-12 2018-12-18 国家林业局北京林业机械研究所 Plate knot Evaluation on Appearance Quality method
CN108398431A (en) * 2017-12-29 2018-08-14 北京林业大学 A kind of device and method of wood materials defects detection
CN110779926A (en) * 2019-11-06 2020-02-11 山东建筑大学 Machine vision detection system for correcting surface defects in artificial board transportation
JPWO2022249875A1 (en) * 2021-05-28 2022-12-01
CN114820594B (en) * 2022-06-21 2022-09-23 中科慧远视觉技术(北京)有限公司 Method for detecting edge sealing defect of plate based on image, related equipment and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08145914A (en) * 1994-11-16 1996-06-07 Nakajima:Kk Detecting equipment of defect of lumber by one-dimensional tv camera
JP3399497B2 (en) * 1996-11-19 2003-04-21 丸天星工業株式会社 Glued laminate manufacturing method and apparatus
JP3998990B2 (en) * 2002-02-04 2007-10-31 永大産業株式会社 Defect repair equipment for wooden materials
JP5022648B2 (en) * 2006-08-11 2012-09-12 東京エレクトロン株式会社 Defect inspection method and defect inspection apparatus

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5373989B1 (en) * 2013-04-12 2013-12-18 橋本電機工業株式会社 Single plate sorting and deposition apparatus and single plate sorting method
JP2014205338A (en) * 2013-09-18 2014-10-30 橋本電機工業株式会社 Veneer screening and stacking apparatus, and veneer screening method
KR20180123088A (en) * 2016-03-25 2018-11-14 마크텍 가부시키가이샤 Flaw detection apparatus and method for detecting defects by a flaw detection apparatus
KR102342791B1 (en) 2016-03-25 2021-12-22 마크텍 가부시키가이샤 A flaw detection device, and a method for detecting defects by the flaw detection device

Also Published As

Publication number Publication date
JP2010112802A (en) 2010-05-20

Similar Documents

Publication Publication Date Title
JP5086970B2 (en) Wood appearance inspection device, wood appearance inspection method
JP5351673B2 (en) Appearance inspection device, appearance inspection method
JP5174540B2 (en) Wood defect detection device
JP6079948B1 (en) Surface defect detection device and surface defect detection method
JP2007078540A (en) Visual inspection method and visual inspection device
JP6197340B2 (en) Image processing apparatus, image processing method, and program
JP2015210150A (en) Method and device for detecting surface defect
JP5520006B2 (en) Wood defect detection apparatus and method
JP2015040827A (en) Defect determination device, and defect determination method
JP5520005B2 (en) Wood defect detection apparatus and method
JP2010085166A (en) Prepreg defect inspection method
KR101977647B1 (en) Apparatus and Method for Detection MURA in Display Device
JP2006090921A (en) Visual examination device, threshold determining method visual examination method and program for functionalizing computer as visual examination device
JP2011058939A (en) Apparatus and method for visual inspection
JP2006343185A (en) Inspection device of surface flaw
KR101562988B1 (en) Apparatus and method for detecting surface defects of hot billet
KR101604528B1 (en) Hole inspection apparatus
KR20140031392A (en) Container mouth portion inspection method and device
JP2006275802A (en) Method and device for inspecting defect
JP6566903B2 (en) Surface defect detection method and surface defect detection apparatus
JP2009229200A (en) Foreign matter inspection method and foreign matter inspection device
JP4956077B2 (en) Defect inspection apparatus and defect inspection method
JP4998722B2 (en) Work defect inspection method by image processing
JP2000132684A (en) External appearance inspecting method
JP5346304B2 (en) Appearance inspection apparatus, appearance inspection system, and appearance inspection method

Legal Events

Date Code Title Description
RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20100715

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20110617

A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A712

Effective date: 20120112

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: 20120815

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20120815

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20120907

R150 Certificate of patent or registration of utility model

Ref document number: 5086970

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20150914

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees