Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP5587030B2 - Peripheral edge detection device and outer edge detection method - Google Patents
[go: Go Back, main page]

JP5587030B2 - Peripheral edge detection device and outer edge detection method - Google Patents

Peripheral edge detection device and outer edge detection method Download PDF

Info

Publication number
JP5587030B2
JP5587030B2 JP2010114558A JP2010114558A JP5587030B2 JP 5587030 B2 JP5587030 B2 JP 5587030B2 JP 2010114558 A JP2010114558 A JP 2010114558A JP 2010114558 A JP2010114558 A JP 2010114558A JP 5587030 B2 JP5587030 B2 JP 5587030B2
Authority
JP
Japan
Prior art keywords
image
lip
pixel
parallax
area
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2010114558A
Other languages
Japanese (ja)
Other versions
JP2011240595A (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.)
Meinan Machinery Works Inc
Original Assignee
Meinan Machinery Works Inc
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 Meinan Machinery Works Inc filed Critical Meinan Machinery Works Inc
Priority to JP2010114558A priority Critical patent/JP5587030B2/en
Publication of JP2011240595A publication Critical patent/JP2011240595A/en
Application granted granted Critical
Publication of JP5587030B2 publication Critical patent/JP5587030B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Manufacture Of Wood Veneers (AREA)

Description

本発明は、原木木口の外周エッジ検出装置および外周エッジ検出方法に関し、特に、原木の木口の外周エッジを画像処理によって検出する装置に用いて好適なものである。   The present invention relates to an outer edge detection apparatus and an outer edge detection method for a raw wood end, and is particularly suitable for use in an apparatus for detecting an outer edge of a raw wood end by image processing.

循環可能な資源である木材を永続的に利用しようとしていく中で、林地残材として放置されている間伐材などの小径な原木を、付加価値のある有用な部材に加工する技術の開発が望まれている。その1つとして、ベニヤレースと呼ばれる切削装置で原木からシート状のベニヤ単板を切削し、複数枚のベニヤ単板を積層接着して作る単板積層材(LVL)や合板が注目されている。   While trying to permanently use timber, which is a resource that can be recycled, it is hoped to develop technology for processing small-sized raw wood, such as thinned wood that has been neglected as forest land, into useful components with added value. It is rare. As one of them, a single plate laminated material (LVL) or plywood, which is made by cutting a sheet-like veneer veneer from a raw wood with a cutting device called a veneer lace and laminating and bonding a plurality of veneer veneers, is attracting attention. .

ベニヤレースでは、先端に爪部(チャック)を備えたスピンドルによって原木の両木口を軸支し、原木を回転させながら、ナイフを取り付けた鉋台を所定の速さで原木の回転軸心に向かって移動させることによって、一定の厚さのベニヤ単板を製造する。   In veneer laces, both ends of the log are pivotally supported by a spindle with a claw (chuck) at the tip, and while the log is rotated, the table with the knife attached is moved toward the axis of rotation of the log at a specified speed. By moving, a veneer veneer having a constant thickness is manufactured.

複雑な形状をなす原木から歩留まり良くベニヤ単板を加工するためには、ベニヤレースで原木を切削するときの回転軸心である切削軸心を決定する工程が重要となる。具体的には、原木の木口の形状をあらかじめ測定し、その測定形状から最も歩留まりよくベニヤ単板を得るための切削軸心を求める必要がある。そのためには、木口の形状をより正確に把握することが求められる。   In order to process a veneer veneer from a raw wood having a complicated shape with a high yield, a process of determining a cutting axis that is a rotation axis when cutting a raw wood with a veneer race is important. Specifically, it is necessary to measure in advance the shape of the end of the log and obtain the cutting axis for obtaining the veneer veneer with the highest yield from the measured shape. For that purpose, it is required to grasp the shape of the mouth more accurately.

従来、木口の形状を測定する方法として、様々なものが提供されている。例えば、仮の回転軸を中心として原木を回転させながら、非接触型または接触型のセンサを用いて原木の外周形状を測定する方法が知られている(例えば、特許文献1参照)。このように原木の外周を輪切り状に捉えていく測定方法では、木口の外周形状を正確に再現するためには外周上の測定ポイントを多くする必要があり、処理するデータ量は膨大となる。また、原木の数箇所の測定ポイントで外周形状を測定するために原木を1回転させなければならないので、測定に時間がかかってしまう。   Conventionally, various methods have been provided as methods for measuring the shape of the mouth. For example, there is known a method of measuring the outer peripheral shape of a log using a non-contact or contact sensor while rotating the log around a temporary rotation axis (see, for example, Patent Document 1). As described above, in the measurement method that captures the outer periphery of the raw wood in a circular shape, it is necessary to increase the number of measurement points on the outer periphery in order to accurately reproduce the outer peripheral shape of the lip, and the amount of data to be processed becomes enormous. Moreover, since the log must be rotated once in order to measure the outer peripheral shape at several measurement points of the log, the measurement takes time.

これに対し、カメラで撮影した原木の両木口面の画像を処理することによって木口の形状を検出する手法も提案されている(例えば、特許文献2参照)。特許文献2に記載の技術では、カメラにより撮影された両木口面の画像の色彩に基づいて、回転中心軸に対する両木口面の心材部分の輪郭を計測し、心材部分の全体形状を推測するようになされている。ここでは木口面の心材部分の輪郭を計測しているが、木口面の外周エッジを計測することに応用することも可能である。   On the other hand, a technique for detecting the shape of the lip by processing images of both lip faces of the raw wood photographed by the camera has been proposed (see, for example, Patent Document 2). In the technique described in Patent Document 2, the contours of the heartwood parts of both the mouthpiece surfaces with respect to the rotation center axis are measured based on the colors of the images of the both mouthpiece images taken by the camera, and the overall shape of the heartwood part is estimated. Has been made. Although the contour of the heartwood portion of the mouth end surface is measured here, it can be applied to the measurement of the outer peripheral edge of the end end surface.

特開2004−338391号公報JP 2004-338391 A 特開2010−46937号公報JP 2010-46937 A

しかしながら、上記特許文献2に記載の技術では、全ての原木について木口の外周エッジを正確に検出することができるとは限らないという問題があった。すなわち、切断してから時間が経っていないスギの辺材部のように、木口外周部が白色をなし、背景色に対して明確な差の得られる原木の木口については、画像処理によって木口の外周エッジを正確に検出することができる。しかし、木口外周部の色が背景色に対して明確な差がない場合は、外周エッジを正確に検出することができなかった。   However, the technique described in Patent Document 2 has a problem in that it is not always possible to accurately detect the outer peripheral edge of the lip of all the logs. In other words, like the sapwood part of cedar that has not been cut for a long time, the outer edge of the lip is white, and for the timber lip where a clear difference is obtained with respect to the background color, The outer peripheral edge can be accurately detected. However, when the color of the outer periphery of the lip is not clearly different from the background color, the outer edge cannot be accurately detected.

つまり、切断してから時間が経ち、変色菌が浸入したことより黒色に変色してしまった木口や、色が濃い樹種の木口の場合は、背景色に対して明確な差を検出することができないため、木口の外周エッジを検出することができなかった。その場合は、作業者が手動で切削軸心を設定しなければならなくなる。そのため、生産効率が悪くなるとともに、切削軸心を求める精度も低くなり、製品歩留まりが低下するという問題があった。   In other words, in the case of a lip that has changed its color to black due to the invasion of discolored bacteria after cutting, or a lip that is dark in color, it can detect a clear difference from the background color. Since this is not possible, the outer edge of the butt cannot be detected. In that case, the operator has to manually set the cutting axis. For this reason, there is a problem in that the production efficiency is deteriorated, the accuracy of obtaining the cutting axis is lowered, and the product yield is lowered.

本発明は、このような問題を解決するために成されたものであり、原木の木口の色によらず、木口の外周エッジを精度良く検出できるようにすることを目的とする。   The present invention has been made to solve such a problem, and an object of the present invention is to make it possible to accurately detect the outer peripheral edge of the lip regardless of the color of the lip of the original wood.

上記した課題を解決するために、本発明では、画像内で原木の写る位置が異なるようにして原木の木口について撮像された2つの画像をそれぞれ第1画像および第2画像とし、第1画像と第2画像との間で対応する画素の変位量を表す視差を各画素の画素値として表した視差マップを作成する。そして、視差マップにおいて所定の中心区域の画素値またはその平均値と画素値の差が所定の範囲内となる画素の領域を木口領域として特定し、当該木口領域の外周エッジを木口外周エッジとして特定するようにしている。   In order to solve the above-described problem, in the present invention, two images captured with respect to the mouth of the raw wood so that the position of the raw wood in the image is different are defined as a first image and a second image, respectively. A parallax map is created in which the parallax representing the displacement amount of the corresponding pixel with the second image is represented as the pixel value of each pixel. Then, in the parallax map, a pixel area in which a pixel value in a predetermined central area or a difference between the average value and the pixel value falls within a predetermined range is specified as a lip area, and an outer edge of the lip area is specified as a lip edge. Like to do.

上記のように構成した本発明によれば、第1画像および第2画像に含まれる被撮像物のうち、撮像装置との距離が同じ被撮像物については視差の値(視差マップ上の画素値)が同じ値となり、撮像装置との距離が異なる被撮像物については視差の値が異なる値となる。すなわち、撮像装置との距離が大きいほど視差は小さくなり、撮像装置との距離が小さいほど視差は大きくなる。そのため、原木の木口面については視差の値がほぼ同じとなり、木口面の周りの背景部分については視差の値が異なるようになる。よって、視差の値がほぼ同じ木口面の領域を木口領域として特定することができ、その木口領域の外周エッジを木口外周エッジとして特定することができる。これにより、従来は原木木口の色の状態によって外周エッジを検出することができなかった原木に対しても、視差に基づいて精度よく木口の外周エッジを検出することができるようになる。   According to the present invention configured as described above, the parallax values (pixel values on the parallax map) of the objects to be imaged included in the first image and the second image have the same distance from the imaging device. ) Have the same value, and parallax values are different for objects to be imaged having different distances from the imaging device. That is, the greater the distance from the imaging device, the smaller the parallax, and the smaller the distance from the imaging device, the greater the parallax. Therefore, the value of the parallax is almost the same for the end face of the original wood, and the value of the parallax is different for the background portion around the end face. Therefore, it is possible to specify an area of the lip surface having substantially the same parallax value as the lip area, and to specify an outer edge of the lip area as the rim edge. As a result, it is possible to accurately detect the outer edge of the lip based on the parallax, even for a timber that has conventionally been unable to detect the outer edge due to the color state of the original lip.

本実施形態による原木木口の外周エッジ検出装置を適用したエッジ検出システム全体の構成例を示す図である。It is a figure which shows the structural example of the whole edge detection system to which the outer periphery edge detection apparatus of the raw wood clerk by this embodiment is applied. 図1に示したエッジ検出システムの一部構成例を示す斜視図である。It is a perspective view which shows the example of a partial structure of the edge detection system shown in FIG. 本実施形態による原木木口の外周エッジ検出装置が備えるコンピュータの機能構成例を示す図である。It is a figure which shows the function structural example of the computer with which the outer periphery edge detection apparatus of the raw wood clerk by this embodiment is provided. 本実施形態の第1画像および第2画像の例を示す図である。It is a figure which shows the example of the 1st image and 2nd image of this embodiment. 本実施形態の移動物体エリア抽出部による差分処理を説明するための図である。It is a figure for demonstrating the difference process by the moving object area extraction part of this embodiment. 本実施形態の視差マップ作成部による視差の算出方法を説明するための図である。It is a figure for demonstrating the calculation method of the parallax by the parallax map creation part of this embodiment. 本実施形態の視差マップ作成部により視差を求める際の類似度の算出方法を説明するための図である。It is a figure for demonstrating the calculation method of the similarity degree at the time of calculating | requiring a parallax by the parallax map creation part of this embodiment. 本実施形態の視差と類似度との関係を示す図である。It is a figure which shows the relationship between the parallax and similarity of this embodiment. 本実施形態の視差マップ作成部により作成される視差マップの一例を示す図である。It is a figure which shows an example of the parallax map created by the parallax map creation part of this embodiment. 本実施形態の木口外周エッジ特定部により特定される木口外周エッジの例を示す図である。It is a figure which shows the example of the lip | edge end edge specified by the lip end edge specific | specification part of this embodiment. 本実施形態による支持台の移動前後の第1画像と第2画像との位置関係を示す図である。It is a figure which shows the positional relationship of the 1st image before and behind the movement of the support stand by this embodiment, and a 2nd image. 本実施形態による支持台の移動前後の原木と支持台とカメラとの位置関係を示す図である。It is a figure which shows the positional relationship of the raw wood before and behind the movement of the support stand by this embodiment, a support stand, and a camera. 本実施形態による外周エッジシステムの動作例を示すフローチャートである。It is a flowchart which shows the operation example of the outer periphery edge system by this embodiment. 本実施形態による視差マップ作成処理の詳細を示すフローチャートである。It is a flowchart which shows the detail of the parallax map creation process by this embodiment. 本実施形態の支持台をY軸方向に往復移動自在に設置する場合の構成例を示す図である。It is a figure which shows the structural example in the case of installing the support stand of this embodiment so that reciprocation is possible in a Y-axis direction.

以下、本発明の一実施形態を図面に基づいて説明する。図1は、本実施形態による原木木口の外周エッジ検出装置を適用したエッジ検出システム全体の構成例を示す図である。図2は、図1に示したエッジ検出システムの一部構成例を示す斜視図である。図3は、本実施形態による原木木口の外周エッジ検出装置が備えるコンピュータの機能構成例を示す図である。   Hereinafter, an embodiment of the present invention will be described with reference to the drawings. FIG. 1 is a diagram showing a configuration example of an entire edge detection system to which an outer edge detection device for a log end according to this embodiment is applied. FIG. 2 is a perspective view illustrating a partial configuration example of the edge detection system illustrated in FIG. 1. FIG. 3 is a diagram illustrating an example of a functional configuration of a computer included in the apparatus for detecting an edge of the log edge according to the present embodiment.

図1および図2に示すように、本実施形態によるエッジ検出システムは、カメラ1A,1B、照明装置2A,2B、支持台3A,3B、左右移動装置4A,4B、上下移動装置5A,5B、インタフェースボード6およびコンピュータ7を備えて構成されている。このうち、コンピュータ7が原木木口の外周エッジ検出装置に相当する。   As shown in FIGS. 1 and 2, the edge detection system according to the present embodiment includes cameras 1A and 1B, illumination devices 2A and 2B, support bases 3A and 3B, left and right moving devices 4A and 4B, and up and down moving devices 5A and 5B. An interface board 6 and a computer 7 are provided. Of these, the computer 7 corresponds to an outer edge detection device for a log mouth.

カメラ1A,1Bは、原木100の両端側に設置された撮像装置であり、原木100の木口101A,101Bを撮像する。カメラ1A,1Bにより撮像される画像には、原木100の木口101A,101Bだけでなく、周辺の背景も写り込んでいる。カメラ1A,1Bは、インタフェースボード6を通じてコンピュータ7に接続されており、カメラ1A,1Bにより撮像された画像は、コンピュータ7の画像メモリに格納されるようになっている。なお、説明の都合上、撮像面上の横軸をX軸、縦軸をY軸、カメラ1A,1Bの光軸をZ軸とする。   The cameras 1 </ b> A and 1 </ b> B are imaging devices installed on both ends of the log 100, and image the wood ends 101 </ b> A and 101 </ b> B of the log 100. The images captured by the cameras 1A and 1B include not only the mouths 101A and 101B of the log 100 but also the surrounding background. The cameras 1A and 1B are connected to a computer 7 through an interface board 6, and images taken by the cameras 1A and 1B are stored in an image memory of the computer 7. For convenience of explanation, the horizontal axis on the imaging surface is the X axis, the vertical axis is the Y axis, and the optical axes of the cameras 1A and 1B are the Z axis.

照明装置2A,2Bは、原木100の両木口101A,101Bに向けて設置されており、カメラ1A,1Bによる撮像時に原木100の木口101A,101Bを十分な明るさで照明する。照明装置2A,2Bは、エレクトロニックフラッシュのような発光装置であっても良い。   The illuminating devices 2A and 2B are installed toward both the mouth ends 101A and 101B of the log 100, and illuminate the mouths 101A and 101B of the log 100 with sufficient brightness when imaged by the cameras 1A and 1B. The illuminating devices 2A and 2B may be light emitting devices such as an electronic flash.

支持台3A,3Bは、原木100を長手方向(Z軸方向)の2箇所で支持する支持部材である。この支持台3A,3Bは、断面がV形状の支持部を有しており、原木100の自重により原木100の略円形をした断面の中心がV形状の折れ点のほぼ真上に位置するようになっている。   The support bases 3A and 3B are support members that support the log 100 at two locations in the longitudinal direction (Z-axis direction). The support bases 3A and 3B have support portions having a V-shaped cross section so that the center of the substantially circular cross section of the log 100 is positioned directly above the V-shaped break point due to the weight of the log 100. It has become.

左右移動装置4A,4Bは、2つの支持台3A,3Bにそれぞれ備えられ、コンピュータ7からの移動命令信号により作動し、カメラ1A,1Bの光軸方向(Z軸方向)と直交する方向に支持台3A,3Bを移動させる。本実施形態では、左右移動装置4A,4Bは、支持台3A,3BをX軸方向に、第1位置から第2位置へ移動させるように構成されている。これにより、支持台3A,3Bの移動と共に原木100も第1位置から第2位置へ移動する。   The left and right moving devices 4A and 4B are provided on the two support bases 3A and 3B, respectively, and are actuated by a movement command signal from the computer 7, and are supported in a direction orthogonal to the optical axis direction (Z axis direction) of the cameras 1A and 1B. The bases 3A and 3B are moved. In the present embodiment, the left and right moving devices 4A and 4B are configured to move the support bases 3A and 3B in the X-axis direction from the first position to the second position. As a result, the log 100 also moves from the first position to the second position along with the movement of the support bases 3A and 3B.

上述したカメラ1A,1Bは、第1位置および第2位置のそれぞれにおいて、原木100の木口101A,101Bを撮像する。図4は、第1位置および第2位置で撮像された画像(それぞれ第1画像、第2画像という)を示す図である。なお、図4は、一方の木口101A側の撮像画像を示すものであり、支持台3A、左右移動装置4Aおよび原木100以外の背景は図示を省略している。   The cameras 1A and 1B described above take images of the wood ends 101A and 101B of the log 100 at the first position and the second position, respectively. FIG. 4 is a diagram illustrating images captured at the first position and the second position (referred to as a first image and a second image, respectively). FIG. 4 shows a captured image on the side of the one end 101A, and illustrations of backgrounds other than the support base 3A, the left and right moving device 4A, and the log 100 are omitted.

本実施形態において、第1位置とは、原木100の両木口101A,101Bが撮像面の略中心に位置する仮心位置である。第2位置とは、第1位置からX軸方向へ任意の距離s(mm)移動した位置である。本実施形態では、左右移動装置4A,4Bをエアーシリンダにより構成し、X軸方向に距離sだけ支持台3A,3Bを移動させる。   In the present embodiment, the first position is a temporary center position where both the mouth ends 101A and 101B of the log 100 are located substantially at the center of the imaging surface. The second position is a position moved from the first position by an arbitrary distance s (mm) in the X-axis direction. In the present embodiment, the left and right moving devices 4A and 4B are constituted by air cylinders, and the support bases 3A and 3B are moved by a distance s in the X-axis direction.

上下移動機構5A,5Bは、カメラ1A,1Bによって第1画像および第2画像を撮像するときに、木口101A,101Bが撮像面の略中心となる位置(仮心位置)へ原木100を位置出しするために、支持台3A,3BをY軸方向に移動させる。本実施形態では、前工程においてレーザ距離計等を用いてあらかじめ粗い精度で測定された原木100の仮直径に従って、上下移動機構5A,5Bにより支持台3A,3Bを仮心位置まで上昇させる。   When the first and second images are captured by the cameras 1A and 1B, the vertical movement mechanisms 5A and 5B position the log 100 to a position (temporary center position) where the throats 101A and 101B are substantially at the center of the imaging surface. In order to do this, the support bases 3A and 3B are moved in the Y-axis direction. In the present embodiment, the support bases 3A and 3B are raised to the temporary center position by the vertical movement mechanisms 5A and 5B in accordance with the temporary diameter of the log 100 that has been measured in advance by a laser distance meter or the like with rough accuracy.

図3に示すように、コンピュータ7は、画像処理プロセッサ10、マイコン等の制御部20、画像メモリ30およびROM40を備えている。制御部20は、左右移動装置4A,4Bおよび上下移動機構5A,5Bに移動命令信号を出力し、支持台3A,3Bを移動させる。また、制御部20は、カメラ1A,1Bに撮像命令信号を出力し、第1画像および第2画像を撮像させる。すなわち、制御部20は、支持台3A,3Bが第1位置にあるときにカメラ1A,1Bにより第1画像を撮像するように制御し、支持台3A,3Bを第1位置から第2位置へ移動させた後、カメラ1A,1Bにより第2画像を撮像するように制御する。   As shown in FIG. 3, the computer 7 includes an image processor 10, a control unit 20 such as a microcomputer, an image memory 30, and a ROM 40. The control unit 20 outputs a movement command signal to the left and right moving devices 4A and 4B and the vertical moving mechanisms 5A and 5B, and moves the support bases 3A and 3B. In addition, the control unit 20 outputs an imaging command signal to the cameras 1A and 1B to capture the first image and the second image. That is, the control unit 20 controls the cameras 1A and 1B to capture the first image when the support bases 3A and 3B are in the first position, and moves the support bases 3A and 3B from the first position to the second position. After the movement, the camera 1A, 1B is controlled to take a second image.

画像メモリ30は、カメラ1A,1Bにより撮像されインタフェースボード6によりコンピュータ7内に取り込まれた画像や、画像処理プロセッサ10による画像処理中の画像を格納する。画像処理プロセッサ10は、画像メモリ30に格納された画像に対して、ROM40に格納された木口エッジ検出プログラムに従って以下に述べるような画像処理を行う。なお、木口エッジ検出プログラムは、ROM40の代わりに、RAM、CD−ROM、ハードディスク、光ディスク、光磁気ディスク、DVD、半導体メモリ等の他の記録媒体に格納しても良い。   The image memory 30 stores images captured by the cameras 1 </ b> A and 1 </ b> B and captured by the interface board 6 into the computer 7 and images being processed by the image processor 10. The image processor 10 performs the following image processing on the image stored in the image memory 30 in accordance with the lip edge detection program stored in the ROM 40. The butt edge detection program may be stored in another recording medium such as a RAM, a CD-ROM, a hard disk, an optical disk, a magneto-optical disk, a DVD, or a semiconductor memory instead of the ROM 40.

画像処理プロセッサ10は、その機能構成として、画像取得部11、移動物体エリア抽出部12、視差マップ作成部13、木口領域特定部14、木口外周エッジ特定部15および木口距離算出部16を備えている。画像取得部11は、カメラ1A,1Bに対する原木100の相対的な位置がX軸方向に異なる状態で(すなわち、原木100の木口101A,101Bが第1位置および第2位置にある状態で)カメラ1A,1Bにより木口101A,101Bについて撮像された2つの画像(第1画像および第2画像)をそれぞれ取得する。   The image processing processor 10 includes an image acquisition unit 11, a moving object area extraction unit 12, a parallax map creation unit 13, a lip region specifying unit 14, a lip end edge specifying unit 15, and a lip distance calculating unit 16 as functional configurations. Yes. The image acquisition unit 11 is a camera in a state where the relative position of the log 100 with respect to the cameras 1A and 1B is different in the X-axis direction (that is, in a state where the mouths 101A and 101B of the log 100 are in the first position and the second position). Two images (a first image and a second image) captured with respect to the end portions 101A and 101B by 1A and 1B are acquired.

移動物体エリア抽出部12は、図5に示すように、第1画像と第2画像との差分をとることにより、左右移動装置4A,4Bにより移動された物体(被撮像物)が移動前後に存在する画像上のエリアを移動物体エリア50として抽出する。本実施形態において、撮像画像の中で移動している物体は、支持台3A,3B、左右移動装置4A,4Bのシリンダ部分および原木100の木口101A,101Bであり、それ以外の部分は移動していない。   As shown in FIG. 5, the moving object area extraction unit 12 calculates the difference between the first image and the second image, so that the object (object to be imaged) moved by the left and right moving devices 4A and 4B is moved before and after the movement. An area on the existing image is extracted as the moving object area 50. In the present embodiment, the moving objects in the captured image are the support bases 3A and 3B, the cylinder portions of the left and right moving devices 4A and 4B, and the wood ends 101A and 101B of the log 100, and other portions move. Not.

具体的には、移動物体エリア抽出部12は、第1画像の各画素値から第2画像の各画素値を減じることにより、差分処理画像を生成する。この差分処理画像においては、木口101A,101Bの周辺に写り込んだ背景などのように、物体が移動していない領域では全て差分値がゼロとなる。一方、移動物体の輪郭部分では差分値がゼロ以外の値となる。これにより、移動物体エリア抽出部12は、移動物体が第1画像上で存在している領域と、第2画像上で存在している領域とを合わせた領域を移動物体エリア50として抽出することができる。   Specifically, the moving object area extraction unit 12 generates a difference processed image by subtracting each pixel value of the second image from each pixel value of the first image. In this difference processed image, the difference value is zero in all areas where the object is not moving, such as the background reflected in the vicinity of the mouth ends 101A and 101B. On the other hand, the difference value is a value other than zero in the contour portion of the moving object. Thereby, the moving object area extraction unit 12 extracts, as the moving object area 50, an area obtained by combining the area where the moving object exists on the first image and the area where the moving object exists on the second image. Can do.

視差マップ作成部13は、第1画像の各画素について、第1画像と第2画像との間で対応する画素の変位量(画素数)を表す視差を算出し、当該視差を各画素の画素値として表した視差マップを作成する。視差は、カメラ1A,1Bと被撮像物との距離に応じて異なる値をとる。すなわち、カメラ1A,1Bとの距離が大きい被撮像物ほど視差は小さくなり、カメラ1A,1Bとの距離が小さい被撮像物ほど視差は大きくなる。したがって、第1画像および第2画像に含まれる被撮像物のうち、カメラ1A,1Bとの距離が同じ被撮像物については視差(視差マップ上の画素値)が同じ値となり、カメラ1A,1Bとの距離が異なる被撮像物については視差が異なる値となる。   The parallax map creation unit 13 calculates, for each pixel of the first image, a parallax indicating the amount of displacement (number of pixels) of the corresponding pixel between the first image and the second image, and the parallax is calculated for each pixel of the pixel. A parallax map expressed as a value is created. The parallax takes different values depending on the distance between the cameras 1A and 1B and the object to be imaged. That is, the parallax becomes smaller as the object to be imaged has a larger distance to the cameras 1A and 1B, and the parallax becomes larger as the object to be imaged has a smaller distance from the cameras 1A and 1B. Accordingly, among the imaging objects included in the first image and the second image, the imaging objects having the same distance from the cameras 1A and 1B have the same parallax (pixel values on the parallax map), and the cameras 1A and 1B. The object to be imaged having a different distance from each other has a different parallax value.

ここで、視差マップ作成部13による視差の求め方について、図6〜図8を用いて具体的に説明する。図6は、視差の算出方法を説明するための図である。図7は、視差を求める際の類似度の算出方法を説明するための図である。図8は、視差と類似度との関係を示す図である。   Here, how to obtain the parallax by the parallax map creation unit 13 will be specifically described with reference to FIGS. FIG. 6 is a diagram for explaining a parallax calculation method. FIG. 7 is a diagram for explaining a method of calculating similarity when obtaining parallax. FIG. 8 is a diagram illustrating the relationship between parallax and similarity.

まず、視差マップ作成部13は、図6に示すように、基準とする第1画像の注目画素(座標を(m,n)とする)およびこれに隣接する近傍画素に、3×3画素のウィンドウ51を設定する。同様に、比較する第2画像の同じ座標(m,n)にも3×3画素のウィンドウ52を設定する。そして、2つのウィンドウ51,52の類似度Rを算出する。   First, as shown in FIG. 6, the parallax map creation unit 13 adds 3 × 3 pixels to a target pixel (coordinates are (m, n)) and a neighboring pixel adjacent to the target pixel of the first image as a reference. Window 51 is set. Similarly, a window 52 of 3 × 3 pixels is set at the same coordinates (m, n) of the second image to be compared. Then, the similarity R between the two windows 51 and 52 is calculated.

類似度Rとは、比較した2点の一致の度合いを表した指標である。図7に示すように、基準とする第1画像のウィンドウ51の注目画素値をa、近傍の画素値をa〜aとする。また、比較する第2画像のウィンドウ52の比較画素値をb、近傍の画素値をb〜bとする。この場合に視差マップ作成部13は、例えば、類似度RをR=Σ(a−a)(b−b)の式により求める。 The similarity R is an index that represents the degree of coincidence of two compared points. As illustrated in FIG. 7, the target pixel value of the window 51 of the first image as a reference is a, and the neighboring pixel values are a 1 to a 8 . Further, the comparison pixel value of the window 52 of the second image to be compared is b, and the neighboring pixel values are b 1 to b 8 . In this case, for example, the parallax map creation unit 13 obtains the similarity R by the equation R = Σ ( ak− a) (b k −b).

次いで、視差マップ作成部13は、図6に示すように、比較する第2画像のウィンドウ52をX軸方向(原木100を第1位置から第2位置へと移動する方向)へ1画素ずらし、類似度Rを算出する。以降も同様に、第2画像のウィンドウ52を順次1画素ずらして類似度Rを算出していき、これを比較画素の座標が(m+dmax,n)となるまで繰り返す。その結果をグラフに表すと、図8のようになる。 Next, as illustrated in FIG. 6, the parallax map creation unit 13 shifts the window 52 of the second image to be compared by one pixel in the X-axis direction (the direction in which the log 100 is moved from the first position to the second position), The similarity R is calculated. Similarly, the second image window 52 is sequentially shifted by one pixel to calculate the similarity R, and this is repeated until the comparison pixel coordinate becomes (m + d max , n). The result is shown in a graph as shown in FIG.

図8に示すように、基準とする第1画像のウィンドウ51と、比較する第2画像のウィンドウ52とが類似し、ウィンドウ51の注目画素(m,n)とウィンドウ52の比較画素(m+d,n)とが互いに対応する点と言えるとき、類似度Rは最大値を示す。その場合におけるX軸方向の変位量を示す画素数dが、第1画像の座標(m,n)における注目画素の視差となる。なお、dmaxは視差の上限設定値のことであり、カメラ1A,1Bの解像度とシステム構成と投入する原木100の許容長さとによって、あらかじめ適宜設定する。例えば、dmax=40画素とする。 As shown in FIG. 8, the window 51 of the first image as a reference is similar to the window 52 of the second image to be compared, and the target pixel (m, n) of the window 51 and the comparison pixel (m + d, n) is a point corresponding to each other, the similarity R indicates a maximum value. In this case, the number of pixels d indicating the amount of displacement in the X-axis direction is the parallax of the pixel of interest at the coordinates (m, n) of the first image. Note that d max is an upper limit setting value of parallax, and is set as appropriate in advance depending on the resolution of the cameras 1A and 1B, the system configuration, and the allowable length of the log 100 to be input. For example, d max = 40 pixels.

ここで、図8について詳述すると、実線53は、原木100の木口101A,101Bの中心区域内における画素を注目画素とした場合の類似度Rを表したものである。破線54は、支持台3A,3Bの領域内における画素を注目画素とした場合の類似度Rを表したものである。類似度Rの最大値を示した点における画素の変位量が視差になるので、木口101A,101Bの中心区域内における画素は視差dが35画素、支持台3A,3Bの領域内における画素は視差dが25画素となる。   Here, FIG. 8 will be described in detail. A solid line 53 represents the degree of similarity R when a pixel in the central area of the wood ends 101A and 101B of the log 100 is the target pixel. A broken line 54 represents the similarity R when a pixel in the region of the support bases 3A and 3B is a target pixel. Since the displacement amount of the pixel at the point where the maximum value of the similarity R is the maximum is parallax, the parallax d is 35 pixels in the central area of the lip end 101A, 101B, and the pixels in the area of the support bases 3A, 3B are parallax d is 25 pixels.

視差dの大きさはカメラ1A,1Bから被撮像物までの距離に応じて変わり、視差dが大きいと被撮像物はカメラ1A,1Bに近く、視差dが小さくなるに従い被撮像物は遠方に位置するものと言える。よって、図8の例は、支持台3A,3Bが原木100の木口101A,101Bより遠方に位置することを示している。   The magnitude of the parallax d changes according to the distance from the cameras 1A and 1B to the object to be imaged. When the parallax d is large, the object to be imaged is closer to the cameras 1A and 1B, and as the parallax d becomes smaller, the object to be imaged is farther away. It can be said that it is located. Therefore, the example of FIG. 8 shows that the support bases 3A and 3B are located farther from the wood ends 101A and 101B of the log 100.

視差マップ作成部13は、上述した方法を用いて、注目画素の座標(m,n)を順次移動させて、基準とする第1画像の全領域について視差dを求める。そして、第1画像の各画素について求めた視差dを各画素の画素値とすることにより、視差マップを作成する。   The parallax map creation unit 13 sequentially moves the coordinates (m, n) of the pixel of interest using the method described above, and obtains the parallax d for the entire region of the first image as a reference. Then, a parallax map is created by using the parallax d obtained for each pixel of the first image as the pixel value of each pixel.

図9は、視差マップ作成部13により作成される視差マップの一例を示す図である。図9において、画像内の数値は視差dの値を示している。図9に示すように、視差マップは、同じ視差dの値を示す画素群が画像上でマップ化された(区分けされた)状態となっている。すなわち、視差マップは、カメラ1A,1Bとの距離が同じ被撮像物の領域はほぼ同じ画素値を示すという特徴がある。なお、図9では画素値を示していない空白の領域があるが、これは説明の便宜上省略しただけであって、実際には視差に応じた画素値(ほぼゼロに近い値)が存在する。   FIG. 9 is a diagram illustrating an example of a parallax map created by the parallax map creating unit 13. In FIG. 9, the numerical value in the image indicates the value of the parallax d. As shown in FIG. 9, the parallax map is in a state in which pixel groups indicating the same parallax d value are mapped (segmented) on the image. That is, the parallax map is characterized in that regions of the imaging target having the same distance from the cameras 1A and 1B show substantially the same pixel value. In FIG. 9, there is a blank area that does not indicate a pixel value, but this is simply omitted for convenience of explanation, and actually there is a pixel value corresponding to parallax (a value close to zero).

木口領域特定部14は、カメラ1A,1Bとの距離が同じ被撮像物の領域はほぼ同じ画素値を示すという視差マップの特徴を利用し、木口101A,101Bの領域を特定する。具体的には、木口領域特定部14は、視差マップ作成部13により作成された視差マップにおいて、所定の中心区域の画素値(視差dの値)またはその平均値と画素値の差が所定の範囲内となる画素の領域を木口領域として特定する。   The lip region specifying unit 14 specifies the regions of the lip portions 101A and 101B by using the feature of the parallax map that the regions of the imaging objects having the same distance from the cameras 1A and 1B show substantially the same pixel values. Specifically, in the disparity map created by the disparity map creating unit 13, the lip region specifying unit 14 has a predetermined center area pixel value (a value of the disparity d) or a difference between the average value and the pixel value. An area of a pixel that falls within the range is specified as a lip end area.

例えば、木口領域特定部14は、図9に示すように、木口101A,101Bの中心辺りである撮像面の中心部に任意の大きさの中心区域60(破線で示す区域)を設定し、その中心区域60内の画素の平均画素値Avを求める。そして、木口領域特定部14は、視差マップにおいて、各画素値と平均画素値Avとの差が所定の許容範囲α内である画素の領域を木口領域61(太い実線で示す領域)として特定する。   For example, as shown in FIG. 9, the lip region specifying unit 14 sets a central area 60 (area indicated by a broken line) of an arbitrary size at the center of the imaging surface that is around the centers of the lip ends 101A and 101B. The average pixel value Av of the pixels in the central area 60 is obtained. Then, the xylem area specifying unit 14 specifies an area of a pixel in which the difference between each pixel value and the average pixel value Av is within a predetermined allowable range α in the parallax map as the lip area 61 (area indicated by a thick solid line). .

なお、中心区域60の大きさは、エッジ検出システムに投入する最小原木径より小さい区域であればよい。具体的には、最小原木径、カメラ1A,1Bの解像度、カメラ1A,1Bと原木100の木口101A,101Bとのおおよその距離によってあらかじめ中心区域60を設定しておく。本実施形態では、撮像面の中心部分に直径100画素の円を設定し、これを中心区域60とする。   The size of the central area 60 may be an area smaller than the minimum log diameter to be input to the edge detection system. More specifically, the central area 60 is set in advance according to the minimum log diameter, the resolution of the cameras 1A and 1B, and the approximate distance between the cameras 1A and 1B and the wood ends 101A and 101B of the log 100. In the present embodiment, a circle having a diameter of 100 pixels is set at the central portion of the imaging surface, and this is defined as the central area 60.

続いて許容範囲αについて説明する。原木100の木口面は、原木100の外周面に対して必ずしも直角ではなく、ほとんどの原木100は傾斜して切断されている。そのため、支持台3A,3Bに支持された原木100の木口面とカメラ1A,1Bとの距離は必ずしも一定の距離になっておらず、木口101A,101Bとして形状を捉えるためには、許容誤差の範囲を設定する必要がある。具体的には、原木100の状態、カメラ1A,1Bの解像度、カメラ1A,1Bと原木100の木口101A,101Bとのおおよその距離によって許容範囲αをあらかじめ設定する。本実施形態では、許容範囲α=2画素とした。   Next, the allowable range α will be described. The end face of the raw wood 100 is not necessarily perpendicular to the outer peripheral surface of the raw wood 100, and most of the raw wood 100 is inclined and cut. For this reason, the distance between the front end of the log 100 supported by the support bases 3A and 3B and the cameras 1A and 1B is not always a constant distance. It is necessary to set a range. More specifically, the allowable range α is set in advance according to the state of the log 100, the resolution of the cameras 1A and 1B, and the approximate distance between the cameras 1A and 1B and the wood ends 101A and 101B of the log 100. In the present embodiment, the allowable range α = 2 pixels.

図9に示すように、視差マップの中心区域60内における画素値の平均値Avは“35”であるとする。この場合、木口領域61を特定する画素値の範囲(Av−α〜Av+α)は“33”〜“37”となり、木口領域特定部14はこの範囲の画素値を示す領域を木口領域61として特定する。なお、支持台3A,3Bの領域62は画素値が“25”となっているので、許容範囲αの範囲を超えており、木口領域61としては特定されない。   As shown in FIG. 9, it is assumed that the average value Av of the pixel values in the central area 60 of the parallax map is “35”. In this case, the range of pixel values (Av−α to Av + α) for specifying the lip region 61 is “33” to “37”, and the lip region specifying unit 14 specifies the region indicating the pixel value in this range as the lip region 61. To do. In addition, since the pixel value of the area 62 of the support bases 3A and 3B is “25”, it exceeds the allowable range α and is not specified as the lip area 61.

木口外周エッジ特定部15は、木口領域特定部14により特定された木口領域61のうち、移動物体エリア抽出部12により抽出された移動物体エリア50内で特定された木口領域61の外周エッジを木口101A,101Bの外周エッジとして特定する。図10は、木口外周エッジ特定部15により特定される木口外周エッジの例を示す図である。図10に示すように、移動物体エリア50内に絞って木口領域61の外周エッジを特定することにより、移動物体エリア50外における周辺背景の映り込みのノイズ領域64を除去し、木口外周エッジ63だけを精度よく特定することができる。   The lip end edge specifying unit 15 uses the lip end of the lip region 61 specified in the moving object area 50 extracted by the moving object area extracting unit 12 among the lip region 61 specified by the lip region specifying unit 14 as a lip. The outer peripheral edges of 101A and 101B are specified. FIG. 10 is a diagram illustrating an example of the lip outer edge specified by the lip outer edge specifying unit 15. As shown in FIG. 10, by narrowing down within the moving object area 50 and specifying the outer peripheral edge of the lip region 61, the noise region 64 of the reflection of the surrounding background outside the moving object area 50 is removed, and the lip outer edge 63. Can be identified accurately.

木口距離算出部16は、視差マップの特徴を利用して、カメラ1A,1Bと原木100の木口101A,101Bとの距離を算出する。すなわち、木口距離算出部16は、視差マップにおける木口領域の視差と、支持台領域の視差と、カメラ1A,1Bと支持台3A,3Bとの機械上の実際の距離とに基づいて、カメラ1A,1Bと原木100の木口101A,101Bとの距離を算出する。   The pier end distance calculating unit 16 calculates the distance between the cameras 1A and 1B and the pier ends 101A and 101B of the log 100 using the feature of the parallax map. In other words, the culm distance calculation unit 16 determines the camera 1A based on the parallax of the lip region in the parallax map, the parallax of the support base region, and the actual distance on the machine between the cameras 1A and 1B and the support bases 3A and 3B. , 1B and the timbers 101A and 101B of the log 100 are calculated.

以下に、カメラ1A,1Bと木口101A,101Bとの距離の具体的な求め方について、図11および図12を用いて説明する。図11は、支持台3A,3Bの移動前後の第1画像と第2画像との位置関係を示す図である。図12は、支持台3A,3Bの移動前後の原木100と支持台3Aとカメラ1Aとの位置関係を示す図である。   Hereinafter, a specific method for obtaining the distance between the cameras 1A and 1B and the end portions 101A and 101B will be described with reference to FIGS. FIG. 11 is a diagram illustrating a positional relationship between the first image and the second image before and after the movement of the support bases 3A and 3B. FIG. 12 is a diagram illustrating a positional relationship among the raw wood 100, the support base 3A, and the camera 1A before and after the movement of the support bases 3A and 3B.

図11では、第1画像を実線で表し、第2画像を破線で表している。また、d1は木口領域61内の中央区域60の視差を示し(d1=35)、d2は支持台領域の視差を示している(d2=25)。図12に示すように、カメラ1Aのレンズ70を通して撮像面71に写し出される第1画像および第2画像では、カメラ1Aに近い位置にある原木木口101Aの視差d1が大きく、カメラ1Aから遠い位置にある支持台3Aの視差d2が小さいことが分かる。   In FIG. 11, the first image is represented by a solid line, and the second image is represented by a broken line. D1 indicates the parallax of the central section 60 in the lip region 61 (d1 = 35), and d2 indicates the parallax of the support base region (d2 = 25). As shown in FIG. 12, in the first image and the second image that are projected onto the imaging surface 71 through the lens 70 of the camera 1A, the parallax d1 of the log pier 101A that is close to the camera 1A is large and is far from the camera 1A. It can be seen that the parallax d2 of a certain support base 3A is small.

図12に示すように、支持台3AのX軸方向の移動距離をs、カメラ1Aのレンズ70から原木木口101Aまでの距離をL1、カメラ1Aのレンズ70から支持台3Aまでの距離をL2、カメラ1Aの焦点距離をf、撮像面71における原木木口101Aの視差をd1、支持台3Aの視差をd2とすると、三角測量の原理より次式が成立つ。
s/L1=d1/f、s/L2=d2/f
As shown in FIG. 12, the movement distance in the X-axis direction of the support base 3A is s, the distance from the lens 70 of the camera 1A to the raw wood end 101A is L1, the distance from the lens 70 of the camera 1A to the support base 3A is L2, Assuming that the focal length of the camera 1A is f, the parallax of the log end 101A on the imaging surface 71 is d1, and the parallax of the support base 3A is d2, the following equation is established from the principle of triangulation.
s / L1 = d1 / f, s / L2 = d2 / f

上記の2式より、L1=L2×d2/d1となる。ここで、カメラ1Aのレンズ70から支持台3Aまでの距離L2は、機械構成で決定するためあらかじめ測定しておく。そうすれば、木口領域の視差d1と支持台領域の視差d2とを求めることにより、カメラ1Aのレンズ70から原木木口101Aまでの距離L1を算出することができる。つまり、原木木口101AのZ軸方向の位置を算出することができる。具体的には、木口距離算出部16は、図9に示す視差マップにおいて、あらかじめ設定した支持台領域62内の画素の平均画素値を算出してd2とし、中央区域60内の画素の平均画素値を算出してd1とし、上記式によりL1を算出する。   From the above two formulas, L1 = L2 × d2 / d1. Here, the distance L2 from the lens 70 of the camera 1A to the support base 3A is measured in advance in order to be determined by the machine configuration. By doing so, the distance L1 from the lens 70 of the camera 1A to the original wood end 101A can be calculated by obtaining the disparity d1 of the end area and the disparity d2 of the support base area. That is, the position in the Z-axis direction of the raw wood end 101A can be calculated. Specifically, the butt end distance calculation unit 16 calculates an average pixel value of pixels in the support base region 62 set in advance in the parallax map shown in FIG. The value is calculated as d1, and L1 is calculated by the above formula.

次に、上記のように構成した本実施形態による外周エッジシステムの動作を説明する。図13は、本実施形態による外周エッジシステムの動作例を示すフローチャートである。図13に示すフローチャートは、左右移動装置4A,4Bおよび上下移動機構5A,5Bにより支持台3A,3Bを第1位置に移動させたときに開始する。   Next, the operation of the outer edge system according to this embodiment configured as described above will be described. FIG. 13 is a flowchart illustrating an operation example of the outer peripheral edge system according to the present embodiment. The flowchart shown in FIG. 13 starts when the support bases 3A and 3B are moved to the first position by the left and right moving devices 4A and 4B and the up and down moving mechanisms 5A and 5B.

図13において、まず、原木100の木口101A,101Bをカメラ1A,1Bにより撮像する。画像取得部11は、カメラ1A,1Bにより撮像された画像をインタフェースボード6を介して取得し、第1画像として画像メモリ30に保存する(ステップS1)。なお、カメラ1A,1Bは、照明装置2A,2Bの互いの写り込みを防ぐため、時間差をおいて交互に撮像するのが好ましい。   In FIG. 13, first, the wood ends 101A and 101B of the log 100 are imaged by the cameras 1A and 1B. The image acquisition unit 11 acquires images captured by the cameras 1A and 1B via the interface board 6 and stores them in the image memory 30 as a first image (step S1). In addition, it is preferable that the cameras 1A and 1B capture images alternately with a time difference in order to prevent the lighting devices 2A and 2B from being reflected in each other.

続いて、左右移動装置4A,4Bは、制御部20からの移動命令信号に従い支持台3A,3Bを原木100と共に第1位置から第2位置まで距離s(30mm)だけ移動させる。その移動完了後、カメラ1A,1Bは再び原木の木口101A,101Bを撮像する。そして、画像取得部11は、カメラ1A,1Bにより撮像された画像をインタフェースボード6を介して取得し、第2画像として画像メモリ30に保存する(ステップS2)。   Subsequently, the left and right moving devices 4A and 4B move the support tables 3A and 3B together with the log 100 from the first position to the second position by a distance s (30 mm) in accordance with a movement command signal from the control unit 20. After the movement is completed, the cameras 1A and 1B again capture the logs of the log 101A and 101B. And the image acquisition part 11 acquires the image imaged with camera 1A, 1B via the interface board 6, and preserve | saves it in the image memory 30 as a 2nd image (step S2).

次に、移動物体エリア抽出部12は、画像メモリ30に格納された第1画像と第2画像との差分をとることにより、移動物体エリア50を抽出する(ステップS3)。抽出した移動物体エリア50の情報は、画像メモリ30に格納される。次いで、視差マップ作成部13は、画像メモリ30に格納された第1画像と第2画像とを比較し、第1画像の各画素における視差を求め、その視差を各画素の画素値とすることによって視差マップを作成する(ステップS4)。   Next, the moving object area extraction unit 12 extracts the moving object area 50 by taking the difference between the first image and the second image stored in the image memory 30 (step S3). Information on the extracted moving object area 50 is stored in the image memory 30. Next, the parallax map creation unit 13 compares the first image and the second image stored in the image memory 30, obtains the parallax at each pixel of the first image, and sets the parallax as the pixel value of each pixel. To create a parallax map (step S4).

図14は、視差マップ作成処理の詳細を示すフローチャートである。図14において、視差マップ作成部13は、まず、第1画像における注目画素のY座標nの値を“1”に設定するとともに(ステップS11)、X座標mの値を“1”に設定する(ステップS12)。また、視差マップ作成部13は、第2画像における比較画素の変位量を表すパラメータkの値を“0”に設定する(ステップS13)。ここまでは初期設定である。なお、m=1,2,・・・,mmax、n=1,2,・・・,nmaxである。mmaxは撮像面のX軸方向の画素数であり、nmaxは撮像面のY軸方向の画素数である。また、k=0,1,2,・・・,dmaxであり、dmaxはあらかじめ設定した視差の上限値である。 FIG. 14 is a flowchart showing details of the parallax map creation processing. In FIG. 14, the parallax map creation unit 13 first sets the value of the Y coordinate n of the target pixel in the first image to “1” (step S11) and sets the value of the X coordinate m to “1”. (Step S12). Further, the parallax map creation unit 13 sets the value of the parameter k representing the displacement amount of the comparison pixel in the second image to “0” (step S13). Up to here is the initial setting. Note that m = 1, 2,..., M max and n = 1, 2 ,. m max is the number of pixels in the X-axis direction of the imaging surface, and n max is the number of pixels in the Y-axis direction of the imaging surface. In addition, k = 0, 1, 2,..., D max , and d max is a preset parallax upper limit value.

初期設定が完了した後、視差マップ作成部13は、第1画像における座標(m,n)の注目画素と、第2画像における座標(m+k,n)の比較画素との類似度Rを算出する(ステップS14)。そして、移動量パラメータkの値がdmaxを超えたか否かを判定し(ステップS15)、超えていなければ移動量パラメータkの値をインクリメントして(ステップS16)、ステップS14の処理に戻る。このように、第2画像における比較画素について移動量パラメータkの値をdmaxまで1つずつ増やしながら、類似度Rを繰り返し算出する。 After the initial setting is completed, the parallax map creation unit 13 calculates the similarity R between the target pixel at the coordinates (m, n) in the first image and the comparison pixel at the coordinates (m + k, n) in the second image. (Step S14). Then, it is determined whether or not the value of the movement amount parameter k exceeds d max (step S15). If not, the value of the movement amount parameter k is incremented (step S16), and the process returns to step S14. In this manner, the similarity R is repeatedly calculated while increasing the value of the movement amount parameter k by 1 up to d max for the comparison pixel in the second image.

そして、移動量パラメータkの値がdmaxを超えた場合は、それまで算出した類似度Rが最大値を示したときの移動量パラメータkの値を、第1画像における注目画素の視差dとして決定する(ステップS17)。視差マップ作成部13は、座標(m,n)の注目画素について求めた視差dの値を、視差マップの画素値D(m,n)として、画像メモリ30に格納する(ステップS18)。 When the value of the movement amount parameter k exceeds d max , the value of the movement amount parameter k when the similarity R calculated so far shows the maximum value is used as the parallax d of the target pixel in the first image. Determine (step S17). The parallax map creation unit 13 stores the value of the parallax d obtained for the pixel of interest at coordinates (m, n) in the image memory 30 as the pixel value D (m, n) of the parallax map (step S18).

その後、視差マップ作成部13は、注目画素のX座標mの値がmmaxを超えたか否かを判定し(ステップS19)、超えていなければX座標mの値をインクリメントして(ステップS20)、ステップS13の処理に戻る。一方、注目画素のX座標mの値がmmaxを超えた場合は、注目画素のY座標nの値がnmaxを超えたか否かを判定し(ステップS21)、超えていなければY座標nの値をインクリメントして(ステップS22)、ステップS12の処理に戻る。 Thereafter, the parallax map creation unit 13 determines whether or not the value of the X coordinate m of the pixel of interest exceeds m max (step S19), and if not, increments the value of the X coordinate m (step S20). The process returns to step S13. On the other hand, if the value of the X coordinate m of the pixel of interest exceeds m max , it is determined whether or not the value of the Y coordinate n of the pixel of interest exceeds n max (step S21). Is incremented (step S22), and the process returns to step S12.

一方、注目画素のY座標nの値がnmaxを超えた場合は、視差マップ作成部13は、画像メモリ30に格納された各画素の画素値D(m,n)を用いて、視差マップを作成する(ステップS23)。すなわち、ステップS14〜S18の処理を第1画像の全領域に対して行うことにより、全領域の画素値D(m,n)が求まり、画像メモリ30に格納される。視差マップ作成部13は、このようにして格納された各画素の画素値D(m,n)により視差マップを作成する。 On the other hand, when the value of the Y coordinate n of the pixel of interest exceeds n max , the parallax map creation unit 13 uses the pixel value D (m, n) of each pixel stored in the image memory 30 and uses the parallax map. Is created (step S23). In other words, the pixel values D (m, n) of the entire region are obtained by performing the processes of steps S14 to S18 on the entire region of the first image and stored in the image memory 30. The parallax map creation unit 13 creates a parallax map from the pixel values D (m, n) of the pixels stored in this way.

図13に戻り、次に木口領域特定部14は、視差マップ作成部13により作成された視差マップ上で、原木100の木口101A,101Bが存在する中心区域60の平均画素値とほぼ同じ画素値を示す画素の領域である木口領域61を特定する(ステップS5)。   Returning to FIG. 13, next, the lip region specifying unit 14 on the parallax map created by the parallax map creating unit 13 has substantially the same pixel value as the average pixel value of the central area 60 where the timbers 101A and 101B of the log 100 exist. A lip region 61, which is a pixel region indicating, is specified (step S5).

次に、木口外周エッジ特定部15は、移動物体エリア50の情報を画像メモリ30から読み出し、当該移動物体エリア50内に存在する木口領域61の外周エッジを木口外周エッジ63として特定する(ステップS6)。最後に、木口距離算出部16は、視差マップ作成部13により作成された視差マップを利用して、カメラ1A,1Bと被撮像物である原木100の木口101A,101Bとの距離を算出する(ステップS7)。   Next, the lip end edge specifying unit 15 reads the information of the moving object area 50 from the image memory 30 and specifies the rim edge of the lip region 61 existing in the moving object area 50 as the lip end edge 63 (step S6). ). Finally, the culvert distance calculation unit 16 calculates the distance between the cameras 1A and 1B and the culm 101A and 101B of the log 100 that is the object to be captured using the parallax map created by the parallax map creation unit 13 ( Step S7).

以上詳しく説明したように、本実施形態では、画像内で原木100の写る位置が異なるようにして原木100の木口101A,101Bについて撮像された2つの画像をそれぞれ第1画像および第2画像として取得する。そして、第1画像と第2画像との間で対応する画素の変位量を表す視差を各画素の画素値として表した視差マップを作成する。さらに、視差マップにおいて所定の中心区域60の平均画素値と画素値の差が所定の範囲内となる画素の領域を木口領域61として特定し、当該木口領域61の外周エッジを木口外周エッジ63として特定するようにしている。   As described above in detail, in the present embodiment, two images captured with respect to the mouths 101A and 101B of the log 100 are acquired as the first image and the second image, respectively, so that the position where the log 100 is captured in the image is different. To do. And the parallax map which represented the parallax showing the displacement amount of the corresponding pixel between the 1st image and the 2nd image as a pixel value of each pixel is created. Further, in the parallax map, a pixel area in which the difference between the average pixel value and the pixel value of the predetermined central area 60 falls within a predetermined range is specified as a lip area 61, and an outer edge of the lip area 61 is defined as a lip edge 63. I try to identify.

このように構成した本実施形態によれば、図9に示したように、第1画像および第2画像に含まれる被撮像物のうち、原木100の木口101A,101Bの領域については視差の値(視差マップ上の画素値)がほぼ同じとなり、木口101A,101Bの周りの背景部分については視差の値が異なるようになる。よって、視差の値がほぼ同じ領域を木口領域61として特定することができ、その木口領域61の外周エッジを木口外周エッジ63として特定することができる。   According to the present embodiment configured as described above, as illustrated in FIG. 9, the parallax values are obtained for the areas of the wooden ends 101 </ b> A and 101 </ b> B of the raw tree 100 among the captured objects included in the first image and the second image. (Pixel values on the parallax map) are substantially the same, and the parallax values are different for the background portions around the mouthpieces 101A and 101B. Therefore, a region having substantially the same parallax value can be specified as the lip end region 61, and the outer peripheral edge of the lip end region 61 can be specified as the lip end outer peripheral edge 63.

しかも、本実施形態では、移動物体エリア50内に絞って木口領域61の外周エッジを特定することにより、移動物体エリア50外における周辺背景の映り込みのノイズ領域64を除去し、木口外周エッジ63だけを精度よく特定することができる。これにより、従来は原木木口の色の状態によって外周エッジを検出することができなかった原木100に対しても、視差に基づいて精度よく木口外周エッジ63を検出することができるようになる。その結果、原木100の心出し操作の精度が良くなり、製品の歩留まりおよび作業効率を上げることができる。   In addition, in the present embodiment, the noise edge 64 of the reflection of the surrounding background outside the moving object area 50 is removed by narrowing down the moving object area 50 to identify the outer edge of the lip area 61, and the lip outer edge 63. Can be identified accurately. As a result, the rim end edge 63 can be detected with high accuracy based on the parallax even for the timber 100 that has conventionally been unable to detect the rim edge due to the color state of the lip end. As a result, the accuracy of the centering operation of the log 100 is improved, and the product yield and work efficiency can be increased.

また、本実施形態によれば、木口外周エッジ63を検出するために作成した視差マップを利用して、カメラ1A,1Bと原木100の木口101A,101Bとの距離を算出することもできる。カメラ1A,1Bから両木口101A,101Bまでの距離がそれぞれ算出できれば、原木100の長さや位置が分かる。これにより、その後のベニヤレースに対する原木100の位置決め等に距離の計算結果を利用することが可能である。従来は、木口101A,101Bに機械的に接触して位置を測定する接触型の位置測定機構や、非接触型のレーザ変位センサ等を別途設けて木口101A,101Bの位置を測定していた。本実施形態によれば、これら別途の位置測定機構やレーザ変位センサ等を設けることなく、木口101A,101Bの位置を測定することができる。   Further, according to the present embodiment, it is possible to calculate the distance between the cameras 1A and 1B and the wood ends 101A and 101B of the log 100 by using the parallax map created to detect the outer edge 63 of the mouth end. If the distances from the cameras 1A, 1B to the two piers 101A, 101B can be calculated, the length and position of the log 100 can be known. Thereby, it is possible to use the calculation result of the distance for positioning the log 100 with respect to the subsequent veneer race. Conventionally, a contact-type position measuring mechanism for measuring the position by mechanically contacting the end portions 101A and 101B, a non-contact type laser displacement sensor, and the like are separately provided to measure the positions of the end portions 101A and 101B. According to the present embodiment, it is possible to measure the positions of the end portions 101A and 101B without providing these separate position measuring mechanisms and laser displacement sensors.

なお、上記実施形態では、左右移動装置4A,4Bとしてストローク30mmのエアーシリンダを用いたが、本発明はこれに限らない。例えば、モータを使ったクランク方式、位置検出機能付モータ駆動によるネジ送り方式による移動装置などを用いてもよい。要は、作動信号により任意の距離sだけ支持台3A,3Bを移動させることができればよい。   In the above embodiment, an air cylinder having a stroke of 30 mm is used as the left and right moving devices 4A and 4B, but the present invention is not limited to this. For example, a moving device using a crank method using a motor or a screw feed method driven by a motor with a position detection function may be used. In short, it is only necessary that the support bases 3A and 3B can be moved by an arbitrary distance s by the operation signal.

また、上記実施形態では、支持台3A,3BのX軸方向の移動距離sを30mmとしたが、本発明はこれに限定されない。すなわち、移動前後の木口101A,101Bの画像が撮像面の範囲内にあり、かつ、視差マップ上で木口領域61を特定するのに十分な2画像間の変位量に有意な差があればよく、距離sは特に30mmに限定されるものではない。   Moreover, in the said embodiment, although the moving distance s of the X-axis direction of support stand 3A, 3B was 30 mm, this invention is not limited to this. That is, it is only necessary that the images of the lip 101A and 101B before and after the movement are within the range of the imaging surface and that there is a significant difference in the displacement amount between the two images sufficient to specify the lip region 61 on the parallax map. The distance s is not particularly limited to 30 mm.

また、上記実施形態では、原木100を支持する支持台3A,3Bとして、断面がV形状の支持部を有する支持部材を用いているが、本発明はこれに限定されない。すなわち、原木100を支持できる構成であればよく、例えば原木100の外周を爪の付いたアームで挟持する構成であっても良い。   Moreover, in the said embodiment, although the support member which has a V-shaped support part is used as support stand 3A, 3B which supports the log 100, this invention is not limited to this. In other words, any structure that can support the log 100 may be used. For example, the structure in which the outer periphery of the log 100 is clamped by an arm with a claw may be used.

また、上記実施形態では、視差マップ作成部13において視差を特定する指標として類似度Rを用いたが、本発明はこれに限定されない。例えば、2乗残差法、残差逐次検定法、正規化相互相関法などの公知の方法により得られる値を指標として用いてもよい。   Moreover, in the said embodiment, although the similarity R was used as the parameter | index which specifies a parallax in the parallax map creation part 13, this invention is not limited to this. For example, a value obtained by a known method such as a square residual method, a residual successive test method, or a normalized cross correlation method may be used as an index.

また、上記実施形態では、視差マップ作成部13により第1画像の全領域の画素について視差dを求め、当該全領域の画素の視差dから視差マップを作成する例について説明したが、本発明はこれに限定されない。例えば、視差マップ作成部13が、第1画像の移動物体エリア50内の各画素についてのみ視差dを算出し、当該移動物体エリア50内の視差dを各画素の画素値として表した視差マップを作成するようにしてもよい。この場合は、図13のステップS3で抽出した移動物体エリア50内の画素のみに対して、図14のステップS14〜S18の処理を繰り返し行うことによって視差マップを作成する。   Moreover, although the said embodiment calculated | required the parallax d about the pixel of the whole area of a 1st image by the parallax map preparation part 13, and demonstrated the example which produces a parallax map from the parallax d of the pixel of the said whole area, this invention is It is not limited to this. For example, the parallax map creation unit 13 calculates a parallax d only for each pixel in the moving object area 50 of the first image, and a parallax map in which the parallax d in the moving object area 50 is expressed as a pixel value of each pixel. You may make it create. In this case, a parallax map is created by repeatedly performing the processes in steps S14 to S18 in FIG. 14 only for the pixels in the moving object area 50 extracted in step S3 in FIG.

このようにすれば、図13のステップS5〜S7の処理は、移動物体エリア50内の画素に対してのみ行えばよい。また、木口領域特定部14により特定される木口領域61は1つのみとなるから、ステップ6の処理では、木口領域61の外周エッジをそのまま木口外周エッジ63として特定すればよい。この方法により、視差を求める領域が移動物体エリア50内のみでよく、処理時間を格段に短縮することができ、木口外周エッジの検出処理の作動効率を上げることができる。   In this way, the processes in steps S5 to S7 in FIG. 13 need only be performed on the pixels in the moving object area 50. Further, since there is only one lip area 61 specified by the lip area specifying unit 14, the outer edge of the lip area 61 may be specified as the lip edge 63 as it is in the process of step 6. According to this method, the area for obtaining the parallax may be only in the moving object area 50, the processing time can be remarkably shortened, and the operating efficiency of the detection processing of the rim outer edge can be increased.

また、視差マップの視差dは第1画像の全領域の画素について求め、その後で木口領域特定部14が、視差マップのうち移動物体エリア50内に絞って木口領域61を特定するようにしてもよい。この場合も、木口領域特定部14により特定される木口領域61は1つのみとなるから、ステップ6の処理では、木口領域61の外周エッジをそのまま木口外周エッジ63として特定すればよい。   Further, the parallax d of the parallax map is obtained for the pixels of the entire area of the first image, and then the lip end specifying unit 14 narrows down the moving object area 50 in the parallax map and specifies the lip end area 61. Good. Also in this case, since there is only one lip region 61 specified by the lip region specifying unit 14, the outer edge of the lip region 61 may be specified as the lip edge 63 as it is in the process of step 6.

また、移動物体エリア抽出部12の処理は省いてもよい。例えば、木口101A,101Bの周囲からの映り込みがないように木口101A,101Bの周辺を幕などで囲むことにより、木口101A,101Bの背景におけるノイズ領域64がほとんど生じない場合は、移動物体エリア抽出部12の処理を省いても、木口外周エッジ63を特定することが可能である。   Further, the processing of the moving object area extraction unit 12 may be omitted. For example, when the noise area 64 in the background of the lip ends 101A and 101B hardly occurs by surrounding the periphery of the lip ends 101A and 101B with a curtain or the like so that there is no reflection from the periphery of the lip ends 101A and 101B, the moving object area Even if the processing of the extraction unit 12 is omitted, it is possible to specify the lip end edge 63.

また、上記実施形態では、支持台3A,3Bは左右移動装置4A,4BによりX軸方向に往復移動自在に設置されていたが、Y軸方向に往復移動自在に設置してもよい。すなわち、上記実施形態ではX軸方向に原木100を移動させ、X軸方向の視差を求める例を示したが、Y軸方向に原木100を移動させてY軸方向の視差を求めるようにしてもよい。このようにしても、原木100の木口外周エッジ63を同様に検出することができる。   In the above embodiment, the support bases 3A and 3B are installed so as to be reciprocally movable in the X-axis direction by the left and right moving devices 4A and 4B, but may be installed so as to be reciprocally movable in the Y-axis direction. That is, in the above embodiment, an example is shown in which the raw wood 100 is moved in the X-axis direction and the parallax in the X-axis direction is obtained. However, the parallax in the Y-axis direction may be obtained by moving the raw wood 100 in the Y-axis direction. Good. Even in this way, the lip outer peripheral edge 63 of the log 100 can be detected in the same manner.

図15は、支持台3A,3BをY軸方向に往復移動自在に設置する場合の構成例を示す図である。図15において、支持台3A,3Bは、その両側面を摺動部材75A,75Bでガイドされ、Y軸方向に往復移動自在に設置されている。上下移動装置76A,76Bは、支持台3A,3Bに一端を回転自在に固定された移動用ネジ77A,77Bと、それを駆動するモータ78A,78Bと、支持台3A,3Bの位置を検出する支持台位置検出装置であるエンコーダ79A,79Bとで構成されている。   FIG. 15 is a diagram illustrating a configuration example when the support bases 3A and 3B are installed so as to be reciprocally movable in the Y-axis direction. In FIG. 15, the support bases 3A and 3B are guided by sliding members 75A and 75B on both side surfaces thereof, and are installed so as to be reciprocally movable in the Y-axis direction. The vertical movement devices 76A and 76B detect the positions of movement screws 77A and 77B, one ends of which are rotatably fixed to the support bases 3A and 3B, motors 78A and 78B for driving the screws, and the support bases 3A and 3B. It is composed of encoders 79A and 79B which are support base position detection devices.

モータ78A,78Bおよびエンコーダ79A,79Bは、コンピュータ7内の制御部20に電気的に接続されている。制御部20は、エンコーダ79A,79Bから出力される支持台3A,3Bの位置情報に基づいて、モータ78A,78Bをそれぞれ駆動制御する。また、上下移動装置76A,76Bは、上下移動機構5A,5Bの働きも担っている。   The motors 78A and 78B and the encoders 79A and 79B are electrically connected to the control unit 20 in the computer 7. The control unit 20 controls driving of the motors 78A and 78B based on the position information of the support bases 3A and 3B output from the encoders 79A and 79B. The vertical movement devices 76A and 76B also function as the vertical movement mechanisms 5A and 5B.

このように構成した場合、原木100を仮心位置へ移動させるために上下移動装置76A,76Bを備えていれば、それを視差マップを作成するための支持台3A,3Bの移動機構としても用いることができる。これにより、新たに左右移動装置4A,4Bを追加して設備しなくても、木口外周エッジ63を検出することができる。   In the case of such a configuration, if the vertical movement devices 76A and 76B are provided to move the log 100 to the temporary position, it is also used as a moving mechanism of the support bases 3A and 3B for creating a parallax map. be able to. Accordingly, the outer edge 63 of the butt end can be detected without newly installing the left and right moving devices 4A and 4B.

なお、ここでは上下移動機構76A,76Bをネジ方式の構成としたが、本発明はこれに限定されない。例えば、油圧サーボシリンダ、クランク方式の機構と駆動サーボモータとを用いた方法などでも良い。要は、支持台3A,3Bをその位置を検出しながらY軸方向に移動させることができる機構であればよい。   Here, although the vertical movement mechanisms 76A and 76B have a screw-type configuration, the present invention is not limited to this. For example, a method using a hydraulic servo cylinder, a crank mechanism, and a drive servo motor may be used. In short, any mechanism that can move the support bases 3A and 3B in the Y-axis direction while detecting their positions may be used.

また、支持台位置検出装置としてエンコーダ79A,79Bを用い、支持台3A,3Bの位置を常置把握できる構成を示したが、本発明はこれに限らない。例えば、エンコーダ79A,79Bの代わりに、リミットスイッチ等の機械的スイッチを支持台3A,3Bに接触するように設置し、この機械的スイッチの信号によって第1位置と第2位置とに支持台3A,3Bを停止させる方法であってもよい。   In addition, although the encoders 79A and 79B are used as the support base position detection devices and the configuration in which the positions of the support bases 3A and 3B can be permanently grasped is shown, the present invention is not limited to this. For example, instead of the encoders 79A and 79B, a mechanical switch such as a limit switch is installed in contact with the support bases 3A and 3B, and the support base 3A is moved to the first position and the second position by a signal from the mechanical switch. , 3B may be stopped.

また、上記実施形態では、原木100の片側1台ずつのカメラ1A,1Bで、支持台3A,3Bの移動前後の木口101A,101Bを2度撮像する構成としたが、本発明はこれに限定されない。例えば、木口101A,101Bに向けて原木100の両木口側にカメラを2台ずつ並べて設置し、2台のカメラを同時に撮像した第1画像と第2画像とを処理する方法であってもよい。   Moreover, in the said embodiment, although it was set as the structure which images the wooden mouths 101A and 101B before and behind the movement of the support bases 3A and 3B with the cameras 1A and 1B of each one side of the log 100, this invention is limited to this. Not. For example, a method may be used in which two cameras are arranged side by side on both ends of the log 100 toward the ends 101A and 101B, and the first image and the second image obtained by simultaneously capturing the two cameras are processed. .

2台のカメラは、その光軸を平行に設置し、2つの光軸間の距離が上記実施形態における移動距離sと同じとなるようにする。この場合、視差マップ作成部13において類似度Rを算出するための対応点を探索する方向は、一方のカメラの光軸から他方のカメラの光軸に向けた方向とする。なお、カメラの光軸は必ずしも平行でなくてもよい。すなわち、光軸同士の角度がわかっていれば、視差を求めることが可能である。   The two cameras have their optical axes arranged in parallel so that the distance between the two optical axes is the same as the movement distance s in the above embodiment. In this case, the direction in which the disparity map creating unit 13 searches for the corresponding point for calculating the similarity R is the direction from the optical axis of one camera to the optical axis of the other camera. The optical axis of the camera does not necessarily have to be parallel. That is, if the angle between the optical axes is known, the parallax can be obtained.

このように構成した場合、第1画像と第2画像とを同時に撮像するため、左右移動装置4A,4Bにより原木100を移動させて2度停止する必要がなく、作業効率を上げることができる。   In such a configuration, since the first image and the second image are simultaneously captured, it is not necessary to move the log 100 by the left and right moving devices 4A and 4B and stop it twice, thereby improving work efficiency.

また、上記実施形態では、支持台3A,3Bと共に原木100を移動させる例について説明したが、これとは逆に、カメラ1A,1Bを移動させるようにしてもよい。要は、原木100とカメラ1A,1Bとが相対的に任意の距離sだけ移動する移動装置を備えた構成とすればよい。   Moreover, although the said embodiment demonstrated the example which moves the log 100 with support stand 3A, 3B, you may make it move camera 1A, 1B conversely. In short, the configuration may be such that the log 100 and the cameras 1A and 1B are relatively provided with a moving device that moves by an arbitrary distance s.

また、上記実施形態では、原木100を第1位置から第2位置まで任意の距離sだけ移動し、移動前後の2枚の画像を画像処理することにより視差dを算出する方法を示したが、本発明はこれに限定されない。すなわち、視差dを求めるのに有意な差が出る距離だけ原木100を移動させて2枚の画像を撮像すればよく、撮像のために必ずしも原木100を移動距離sだけ移動させて停止する必要はない。   In the above embodiment, the method of calculating the parallax d by moving the log 100 from the first position to the second position by an arbitrary distance s and performing image processing on the two images before and after the movement is shown. The present invention is not limited to this. That is, it is sufficient to move the log 100 by a distance that produces a significant difference in obtaining the parallax d, and to capture two images, and it is not always necessary to move the log 100 by the moving distance s and stop for imaging. Absent.

すなわち、木口外周エッジ63を検出する過程と、カメラ1A,1Bから木口101A,101Bまでの距離を算出する過程とで移動距離sの値は不必要なため、移動距離sの値を把握する必要はない。そこで、例えば、Y軸方向へ移動中の原木100の木口101A,101Bを、そのまま停止することなく移動した状態のまま、ある時間間隔で2度撮像し、その撮像した2枚の画像について画像処理をすることによって木口外周エッジ63を検出するようにしてもよい。   That is, since the value of the movement distance s is unnecessary in the process of detecting the outer edge 63 of the lip and the process of calculating the distance from the cameras 1A and 1B to the lip 101A and 101B, it is necessary to grasp the value of the movement distance s. There is no. Therefore, for example, the tree mouths 101A and 101B of the log 100 moving in the Y-axis direction are imaged twice at a certain time interval while moving without stopping, and image processing is performed on the two captured images. By doing this, the outer peripheral edge 63 may be detected.

例えば、図15のように上下移動機構76A,76Bを構成する。上下移動機構76A,76Bは、コンピュータ7内の制御部20からの移動命令信号に従って、モータ78A,78Bにより支持台3A,3Bを所定の速度v(mm/秒)でY軸方向へ移動させる。   For example, as shown in FIG. 15, the vertical movement mechanisms 76A and 76B are configured. The vertical movement mechanisms 76A and 76B move the support bases 3A and 3B in the Y-axis direction at a predetermined speed v (mm / second) by the motors 78A and 78B in accordance with a movement command signal from the control unit 20 in the computer 7.

制御部20は、この移動中にエンコーダ79A,79Bから出力される信号に基づいて、支持台3A,3Bの位置が第1位置(原木100の木口101A,101Bが撮像面の中心に位置した仮心位置)に到達したことを検知したときに、カメラ1A,1Bを制御して木口101A,101Bを撮像させる。   Based on the signals output from the encoders 79A and 79B during the movement, the control unit 20 determines that the positions of the support bases 3A and 3B are the first positions (the temporary ends in which the wood ends 101A and 101B of the log 100 are located at the center of the imaging surface). When it is detected that the center position has been reached, the cameras 1A and 1B are controlled to image the lips 101A and 101B.

その1回目の撮像後、制御部20は、所定時間t(秒)が経過したことを検知して、カメラ1A,1Bを制御して木口101A,101Bを再び撮像させる。第1位置で撮像した画像を第1画像とし、第1画像の撮像後に所定時間t(秒)を経過したときに撮像した画像を第2画像とする。   After the first imaging, the control unit 20 detects that a predetermined time t (seconds) has elapsed, controls the cameras 1A and 1B, and causes the lips 101A and 101B to image again. An image captured at the first position is defined as a first image, and an image captured when a predetermined time t (seconds) elapses after the first image is captured is defined as a second image.

ここで、支持台3A,3B(原木100)の移動速度v(mm/秒)および所定時間t(秒)について説明する。第1画像と第2画像との撮像間に支持台3A,3Bが移動する距離v×t(mm)は、上記実施形態で説明した移動距離sと同様に、2枚の画像間で視差を求めるのに有意な差が生じる距離であればよく、木口101A,101Bの画像が撮像面の範囲内であれば、特に制限はない。   Here, the moving speed v (mm / second) and the predetermined time t (second) of the support bases 3A and 3B (log 100) will be described. The distance v × t (mm) by which the support bases 3A and 3B move during the imaging of the first image and the second image is a parallax between the two images, similarly to the movement distance s described in the above embodiment. Any distance that produces a significant difference can be obtained, and there is no particular limitation as long as the images of the lips 101A and 101B are within the range of the imaging surface.

例えば、速度30mm/秒で移動する原木100の木口101A,101Bを1秒間隔で撮像すると、2回の撮像間における原木100の移動距離は30mmとなる。所望の速度vは、速くすれば作業効率は上がるが、画像の鮮明度が劣り、求める視差の精度に問題がでる可能性がある。照明装置2A,2Bによる照明の明るさ、カメラ1A,1Bの解像度、露光時間、撮像処理時間などを考慮して所望の速度v(mm/秒)と所定時間t(秒)とを設定する必要がある。   For example, if the mouths 101A and 101B of the log 100 moving at a speed of 30 mm / sec are imaged at 1 second intervals, the moving distance of the log 100 between the two imaging operations is 30 mm. If the desired speed v is increased, the working efficiency is improved, but the sharpness of the image is inferior, and there is a possibility that the required parallax accuracy may be problematic. It is necessary to set a desired speed v (mm / second) and a predetermined time t (second) in consideration of the brightness of illumination by the illumination devices 2A and 2B, the resolution of the cameras 1A and 1B, the exposure time, the imaging processing time, and the like. There is.

なお、原木100を移動させながら2回のタイミングで第1画像と第2画像とを撮像する場合、カメラ1A,1Bにより2枚の静止画を撮像する代わりに、ビデオカメラなどにより撮像した動画像から2枚のフレームを抜き出して、それぞれを第1画像および第2画像として処理する方法でもよい。具体的には、支持台3A,3Bが第1位置(仮心位置)に到達したときに動画像からフレームを抜き出し第1画像とし、そこから所定時間t(秒)後のフレームを抜き出して第2画像とするようにしてもよい。   When the first image and the second image are captured at two timings while moving the log 100, a moving image captured by a video camera or the like instead of capturing two still images by the cameras 1A and 1B. Alternatively, two frames may be extracted from and processed as a first image and a second image, respectively. Specifically, when the support bases 3A and 3B reach the first position (temporary center position), a frame is extracted from the moving image as a first image, and a frame after a predetermined time t (seconds) is extracted therefrom. Two images may be used.

その他、上記実施形態は、何れも本発明を実施するにあたっての具体化の一例を示したものに過ぎず、これによって本発明の技術的範囲が限定的に解釈されてはならないものである。すなわち、本発明はその精神、またはその主要な特徴から逸脱することなく、様々な形で実施することができる。   In addition, each of the above-described embodiments is merely an example of implementation in carrying out the present invention, and the technical scope of the present invention should not be construed in a limited manner. In other words, the present invention can be implemented in various forms without departing from the spirit or main features thereof.

1A,1B カメラ
3A,3B 支持台
4A,4B 左右移動装置
7 コンピュータ
10 画像処理プロセッサ
11 画像取得部
12 移動物体エリア抽出部
13 視差マップ作成部
14 木口領域特定部
15 木口外周エッジ特定部
16 木口距離算出部
20 制御部
30 画像メモリ
50 移動物体エリア
60 中心区域
61 木口領域
63 木口外周エッジ
100 原木
101A,101B 木口
DESCRIPTION OF SYMBOLS 1A, 1B Camera 3A, 3B Support stand 4A, 4B Left-right moving apparatus 7 Computer 10 Image processor 11 Image acquisition part 12 Moving object area extraction part 13 Parallax map creation part 14 Kipple area specific | specification part 15 Kiple outer periphery edge specific part 16 Calculation unit 20 Control unit 30 Image memory 50 Moving object area 60 Central zone 61 Kip area 63 Kip outer peripheral edge 100 Log 101A, 101B Kguchi

Claims (5)

撮像装置に対する原木の相対的な位置が上記撮像装置の光軸と直交する方向に異なる状態で上記撮像装置により上記原木の木口について撮像された2つの画像をそれぞれ第1画像および第2画像として取得する画像取得部と、
上記第1画像の各画素について、上記第1画像と上記第2画像との間で対応する画素の変位量を表す視差を算出し、当該視差を各画素の画素値として表した視差マップを作成する視差マップ作成部と、
上記視差マップ作成部により作成された上記視差マップにおいて、所定の中心区域の画素値またはその平均値と画素値の差が所定の範囲内となる画素の領域を木口領域として特定する木口領域特定部と、
上記木口領域特定部により特定された上記木口領域の外周エッジを木口外周エッジとして特定する木口外周エッジ特定部とを備えたことを特徴とする原木木口の外周エッジ検出装置。
Two images captured with respect to the mouth of the raw wood by the imaging device in a state where the relative position of the raw wood with respect to the imaging device is different in a direction orthogonal to the optical axis of the imaging device are acquired as a first image and a second image, respectively. An image acquisition unit to
For each pixel of the first image, a parallax representing the displacement amount of the corresponding pixel between the first image and the second image is calculated, and a parallax map representing the parallax as a pixel value of each pixel is created. A parallax map creation unit for
In the parallax map created by the parallax map creating unit, a lip end specifying unit that specifies a region of a pixel in which a pixel value in a predetermined central area or a difference between the average value and the pixel value falls within a predetermined range as a lip end region When,
An apparatus for detecting an edge of an edge of an original lip, comprising: a lip edge specifying part for specifying a lip edge of the lip area specified by the lip area specifying part as a lip edge.
上記第1画像と上記第2画像との差分をとることにより、上記第1画像と上記第2画像との間で位置が移動している物体の画像上のエリアを移動物体エリアとして抽出する移動物体エリア抽出部を更に備え、
上記視差マップ作成部は、上記第1画像の上記移動物体エリア内の各画素について、上記第1画像と上記第2画像との間で対応する画素の変位量を表す視差を算出し、当該視差を各画素の画素値として表した視差マップを作成することを特徴とする請求項1に記載の原木木口の外周エッジ検出装置。
Moving to extract the area on the image of the object whose position is moving between the first image and the second image as a moving object area by taking the difference between the first image and the second image An object area extraction unit;
The parallax map creation unit calculates, for each pixel in the moving object area of the first image, a parallax representing a displacement amount of a corresponding pixel between the first image and the second image, and the parallax 2. The apparatus according to claim 1, wherein a parallax map is created in which each pixel is represented as a pixel value of each pixel.
上記第1画像と上記第2画像との差分をとることにより、上記第1画像と上記第2画像との間で位置が移動している物体の画像上のエリアを移動物体エリアとして抽出する移動物体エリア抽出部を更に備え、
上記木口領域特定部は、上記視差マップ作成部により上記第1画像の全領域について作成された上記視差マップの上記移動物体エリア内において、所定の中心区域の画素値またはその平均値と画素値の差が所定の範囲内となる画素の領域を木口領域として特定することを特徴とする請求項1に記載の原木木口の外周エッジ検出装置。
Moving to extract the area on the image of the object whose position is moving between the first image and the second image as a moving object area by taking the difference between the first image and the second image An object area extraction unit;
In the moving object area of the parallax map created for the entire area of the first image by the parallax map creating unit, the lip end specifying unit is configured to calculate a pixel value of a predetermined central area or an average value and a pixel value thereof. 2. The apparatus according to claim 1, wherein an area of a pixel whose difference falls within a predetermined range is specified as a lip end area.
上記第1画像と上記第2画像との差分をとることにより、上記第1画像と上記第2画像との間で位置が移動している物体の画像上のエリアを移動物体エリアとして抽出する移動物体エリア抽出部を更に備え、
上記木口外周エッジ特定部は、上記木口領域特定部により特定された木口領域のうち、上記移動物体エリア内で特定された木口領域の外周エッジを上記木口外周エッジとして特定することを特徴とする請求項1に記載の原木木口の外周エッジ検出装置。
Moving to extract the area on the image of the object whose position is moving between the first image and the second image as a moving object area by taking the difference between the first image and the second image An object area extraction unit;
The lip outer edge specifying unit specifies, as the lip outer edge, an outer edge of the lip region specified in the moving object area among the lip region specified by the lip region specifying unit. Item 2. A device for detecting an edge of an edge of a wood log according to Item 1.
撮像装置に対する原木の相対的な位置が上記撮像装置の光軸と直交する方向に異なる状態で上記撮像装置により上記原木の木口について撮像された2つの画像をそれぞれ第1画像および第2画像として取得する第1のステップと、
上記第1画像の各画素について、上記第1画像と上記第2画像との間で対応する画素の変位量を表す視差を算出し、当該視差を各画素の画素値として表した視差マップを作成する第2のステップと、
上記第2のステップで作成された上記視差マップにおいて、所定の中心区域の画素値またはその平均値と画素値の差が所定の範囲内となる画素の領域を木口領域として特定する第3のステップと、
上記第3のステップで特定された上記木口領域の外周エッジを木口外周エッジとして特定する第4のステップとを有することを特徴とする原木木口の外周エッジ検出方法。
Two images captured with respect to the mouth of the raw wood by the imaging device in a state where the relative position of the raw wood with respect to the imaging device is different in a direction orthogonal to the optical axis of the imaging device are acquired as a first image and a second image, respectively. A first step to:
For each pixel of the first image, a parallax representing the displacement amount of the corresponding pixel between the first image and the second image is calculated, and a parallax map representing the parallax as a pixel value of each pixel is created. A second step of:
In the parallax map created in the second step, a third step of specifying, as a lip end region, a pixel area in which a pixel value in a predetermined central area or a difference between the average value and the pixel value is within a predetermined range When,
And a fourth step of identifying the outer edge of the lip region identified in the third step as a lip outer edge.
JP2010114558A 2010-05-18 2010-05-18 Peripheral edge detection device and outer edge detection method Active JP5587030B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010114558A JP5587030B2 (en) 2010-05-18 2010-05-18 Peripheral edge detection device and outer edge detection method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010114558A JP5587030B2 (en) 2010-05-18 2010-05-18 Peripheral edge detection device and outer edge detection method

Publications (2)

Publication Number Publication Date
JP2011240595A JP2011240595A (en) 2011-12-01
JP5587030B2 true JP5587030B2 (en) 2014-09-10

Family

ID=45407738

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010114558A Active JP5587030B2 (en) 2010-05-18 2010-05-18 Peripheral edge detection device and outer edge detection method

Country Status (1)

Country Link
JP (1) JP5587030B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119116066B (en) * 2024-07-22 2025-12-12 中国热带农业科学院热带生物技术研究所 A computer vision-based agarwood grading and processing device and method
CN120702360B (en) * 2025-06-26 2026-02-03 北京智大弘创科技有限公司 Whole vehicle log diameter level measurement and code spraying method, equipment and system

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS58197005A (en) * 1982-05-13 1983-11-16 橋本電機工業株式会社 Method of adjusting contour in automatic centering process of material wood
JPS59124104U (en) * 1983-02-12 1984-08-21 太田 正之 Log centering device
JPH0545136A (en) * 1991-08-19 1993-02-23 Mitsubishi Heavy Ind Ltd Visual system
JP2807137B2 (en) * 1992-12-15 1998-10-08 松下電工株式会社 3D shape detection method
US6751345B2 (en) * 2001-02-12 2004-06-15 Koninklijke Philips Electronics N.V. Method and apparatus for improving object boundaries extracted from stereoscopic images

Also Published As

Publication number Publication date
JP2011240595A (en) 2011-12-01

Similar Documents

Publication Publication Date Title
CN110595999B (en) an image acquisition system
US8180156B2 (en) Method and device for machine-cutting a plate-shaped workpiece
KR101298957B1 (en) Wood knot detecting method, device, and program
EP1995553B1 (en) System and method for identifying a feature of a workpiece
KR102841844B1 (en) Range differentiators for auto-focusing in optical imaging systems
JP5342413B2 (en) Image processing method
US20170045448A1 (en) Apparatus of Detecting Transmittance of Trench on Infrared-Transmittable Material and Method Thereof
KR102767113B1 (en) Surface detection system and method for continuous billet casting using two-dimensional and three-dimensional combined imaging
CN107463659B (en) Object searching method and device
CN113189005B (en) Portable surface defect integrated detection device and surface defect automatic detection method
JP2017040612A (en) Inspection method, inspection device, image processor, program and record medium
EP4546296A3 (en) Optical skin detection for face unlock
TW419634B (en) Automatic detection system and method using bar code positioning
WO2005050131A1 (en) Method and device for detecting shape and light-dark of object to be inspected
JP5587030B2 (en) Peripheral edge detection device and outer edge detection method
RU2435661C2 (en) Scanner system of loading device
US20210129342A1 (en) Controller, control method using controller, and control system
CN104008366A (en) 3D intelligent recognition method and system for biology
WO2016152288A1 (en) Material detection device, material detection method, and program
Sandak et al. Evaluation of surface smoothness using a light-sectioning shadow scanner
JP7481468B2 (en) Robot system and control method
JP2000193438A (en) Method and apparatus for measuring three-dimensional shape, and storage medium storing three-dimensional shape measurement program
JP2015200604A (en) Defect detection method and defect detection apparatus
CN111906043A (en) Pose detection method and system
CN121208703B (en) An automatic PCB separation and testing machine

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20130416

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20140411

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20140422

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20140723

R150 Certificate of patent or registration of utility model

Ref document number: 5587030

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250