JP6100602B2 - Long object number measuring device, long object number measuring method, and computer program - Google Patents
Long object number measuring device, long object number measuring method, and computer program Download PDFInfo
- Publication number
- JP6100602B2 JP6100602B2 JP2013098670A JP2013098670A JP6100602B2 JP 6100602 B2 JP6100602 B2 JP 6100602B2 JP 2013098670 A JP2013098670 A JP 2013098670A JP 2013098670 A JP2013098670 A JP 2013098670A JP 6100602 B2 JP6100602 B2 JP 6100602B2
- Authority
- JP
- Japan
- Prior art keywords
- blob
- image
- region
- long object
- separated
- 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
Links
- 238000000034 method Methods 0.000 title claims description 93
- 238000004590 computer program Methods 0.000 title claims description 5
- 238000000926 separation method Methods 0.000 claims description 168
- 238000012937 correction Methods 0.000 claims description 94
- 239000002131 composite material Substances 0.000 claims description 51
- 238000012545 processing Methods 0.000 claims description 38
- 239000000203 mixture Substances 0.000 claims description 25
- 238000003384 imaging method Methods 0.000 claims description 20
- 238000009795 derivation Methods 0.000 claims description 16
- 230000002194 synthesizing effect Effects 0.000 claims description 7
- 230000008602 contraction Effects 0.000 claims 2
- 229910000831 Steel Inorganic materials 0.000 description 279
- 239000010959 steel Substances 0.000 description 279
- 238000000605 extraction Methods 0.000 description 42
- 238000010586 diagram Methods 0.000 description 38
- 230000005484 gravity Effects 0.000 description 23
- 230000014509 gene expression Effects 0.000 description 7
- 238000003705 background correction Methods 0.000 description 6
- 238000012986 modification Methods 0.000 description 5
- 230000004048 modification Effects 0.000 description 5
- 230000015572 biosynthetic process Effects 0.000 description 4
- 238000006073 displacement reaction Methods 0.000 description 4
- 238000005286 illumination Methods 0.000 description 4
- 230000003287 optical effect Effects 0.000 description 4
- 238000003786 synthesis reaction Methods 0.000 description 4
- 238000004891 communication Methods 0.000 description 3
- 239000000284 extract Substances 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 2
- 238000002372 labelling Methods 0.000 description 2
- 239000000463 material Substances 0.000 description 2
- 230000000295 complement effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 239000011159 matrix material Substances 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
Images
Landscapes
- Image Processing (AREA)
- Image Analysis (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
Description
本発明は、長尺物本数測定装置、長尺物本数測定方法、及びコンピュータプログラムに関し、特に、長尺物の画像を撮像し、撮像した画像に基づいて長尺物の本数を測定するために用いて好適なものである。 The present invention relates to a long object number measuring device, a long object number measuring method, and a computer program, and in particular, for capturing an image of a long object and measuring the number of long objects based on the captured image. It is suitable for use.
従来から、鉄鋼業では、棒鋼や鋼管等、製造された長尺物の本数を計数することが行われている。例えば、出荷前に出荷ロットの荷揃え等のために、製造された鋼管を、同一の仕様の鋼管毎に、スタックと呼ばれる保管場所に保管することが行われている。そして、出荷する鋼管の本数の確認等のために、スタックに保管されている鋼管の本数を出荷前に測定することが必要になる。そこで、従来は、スタックに保管されている鋼管を作業員が目視で計数するようにしていた。1つのロットに含められる鋼管の数が多くなると、多数の鋼管が1つのスタックに段積みされることになるので、このように作業員が目視で鋼管を計数すると、ヒューマンエラーが発生し、出荷すべき本数の鋼管を出荷できなくなる虞がある。そこで、このような長尺物の計数を人手によらずに自動的に計数する技術が望まれていた。この種の技術として、特許文献1に記載の技術がある。 Conventionally, in the steel industry, counting the number of manufactured long objects such as steel bars and steel pipes has been performed. For example, the manufactured steel pipes are stored in a storage place called a stack for each steel pipe having the same specification for the purpose of assembling a shipping lot before shipping. In order to confirm the number of steel pipes to be shipped, etc., it is necessary to measure the number of steel pipes stored in the stack before shipping. Therefore, conventionally, an operator visually counts the steel pipes stored in the stack. If the number of steel pipes included in one lot increases, a large number of steel pipes are stacked in a single stack, so if an operator visually counts the steel pipes in this way, a human error occurs and the shipment There is a risk that the required number of steel pipes cannot be shipped. Therefore, there has been a demand for a technique for automatically counting such a long object without manually. As this type of technology, there is a technology described in Patent Document 1.
特許文献1に記載の技術では、まず、照明されている状態で棒鋼材の端面を撮像した端面画像と、棒鋼材の側面を撮像した側面画像とを取得し、端面画像に基づいて、棒鋼材が積み重なっているか否かを判定する。そして、棒鋼材が積み重なっている場合には、端面画像に基づく棒鋼材の計数値と、側面画像に基づく計数値とのうち、大きい方を棒鋼材の本数とする。 In the technique described in Patent Document 1, first, an end surface image obtained by imaging the end surface of the steel bar and a side image obtained by imaging the side surface of the steel bar in an illuminated state are acquired, and the steel bar material is obtained based on the end surface image. It is determined whether or not they are stacked. When the steel bars are stacked, the larger one of the count values of the steel bars based on the end face images and the count values based on the side images is set as the number of the steel bars.
前述したように、1つのロットに含められる長尺物の数が多くなると、多数の長尺物が段積みされることになる。そして、例えば、端部にソケットが形成されているソケット付きの鋼管を段積みする場合には、先端部を揃えた状態で段積みすることができず、例えば、先端部の位置が上下の段のソケットの根元付近の位置になるように、1段おきに先端部が後退した状態で段積みされる(図1(a)を参照)。
このようにして段積みされた場合に、特許文献1に記載の技術で端面画像を撮像すると、撮像装置における撮像範囲に死角が生じることや、後退している鋼管に照明が届かないことにより、鋼管を認識することができない虞がある。
以上のように、段積みされている複数の長尺物の一部の先端が他の長尺物よりも後退した状態であっても、当該段積みされている複数の長尺物の本数を正確に測定する技術が望まれている。
As described above, when the number of long objects included in one lot increases, a large number of long objects are stacked. And, for example, when stacking steel pipes with sockets with sockets formed at the ends, they cannot be stacked with the tips aligned, for example, the positions of the tips are the upper and lower steps. Are stacked with the tip portion retracted every other step (see FIG. 1 (a)) so as to be located near the base of the socket.
When stacked in this way, when taking an end face image with the technique described in Patent Document 1, a blind spot occurs in the imaging range in the imaging device, or the illumination does not reach the retreating steel pipe, There is a possibility that the steel pipe cannot be recognized.
As described above, even if the tip of some of the stacked long objects is in a state of being retracted from the other long objects, the number of the stacked long objects A technique for measuring accurately is desired.
本発明は、以上の事情に鑑みてなされたものであり、段積みされている複数の長尺物の一部の先端が他の長尺物よりも後退した状態であっても、当該段積みされている複数の長尺物の本数を自動的に且つ正確に測定できるようにすることを目的とする。 The present invention has been made in view of the above circumstances, and even when the tips of some of the plurality of long objects stacked are retracted from other long objects, the stacking is performed. It is an object to enable automatic and accurate measurement of the number of a plurality of long objects.
本発明の長尺物本数測定装置は、段積みされている複数の長尺物の端面を含む領域が、相互に間隔を有する複数の位置でそれぞれ撮像されることにより得られた複数の元画像を画像処理した結果に基づいて前記複数の長尺物の本数を測定する長尺物測定装置であって、前記複数の位置のうち相互に間隔を有して隣接する位置で撮像された2つの前記元画像に、前記複数の長尺物の少なくとも一部が共通して含まれるように、前記複数の位置でそれぞれ撮像された複数の前記元画像を取得する元画像取得手段と、前記元画像取得手段により取得された前記複数の元画像のそれぞれから、前記長尺物の端面に対応するブロブである長尺物対応ブロブであって相互に分離された長尺物対応ブロブにより表現された2値化画像である領域分離2値化画像を作成する領域分離2値化画像作成手段と、前記領域分離2値化画像導出手段により導出された前記領域分離2値化画像のうち、相互に間隔を有して隣接する位置で撮像された2つの前記元画像から得られた2つの前記領域分離2値化画像に含まれる長尺物対応ブロブを比較した結果に基づいて、当該2つの領域分離2値化画像における位置合わせの基準となる長尺物対応ブロブをそれぞれ決定する合成位置決定手段と、前記合成位置決定手段により決定された長尺物対応ブロブに基づいて、前記相互に間隔を有して隣接する位置で撮像された2つの前記元画像から得られた2つの前記領域分離2値化画像をそれぞれ合成した合成画像を作成する画像合成手段と、前記画像合成手段により作成された合成画像に基づいて、前記複数の長尺物の本数を決定する本数決定手段と、前記本数決定手段により決定された前記複数の長尺物の本数を識別するための情報を出力する出力手段と、を有することを特徴とする。 The long object number measuring apparatus according to the present invention includes a plurality of original images obtained by imaging regions including end surfaces of a plurality of stacked long objects at a plurality of positions spaced from each other. A long object measuring apparatus for measuring the number of the plurality of long objects based on the result of image processing of the two, wherein two images taken at adjacent positions with a space between each other among the plurality of positions Original image acquisition means for acquiring a plurality of the original images respectively captured at the plurality of positions so that at least a part of the plurality of long objects is included in the original image in common; and the original image Each of the plurality of original images acquired by the acquisition means is represented by a long object corresponding blob that is a blob corresponding to the end surface of the long object and is separated from each other. Area-separated binary image that is a binary image Between the region-separated binarized image creating unit for creating the image and the region-separated binarized image derived by the region-separated binarized image deriving unit. Based on the result of comparing the long object corresponding blobs included in the two region-separated binarized images obtained from the two original images, it becomes a reference for alignment in the two region-separated binarized images Based on the combined position determining means for determining the long object corresponding blob and the long object corresponding blob determined by the combined position determining means, two images captured at adjacent positions with a space between each other Based on the synthesized image created by the image synthesizing unit, an image synthesizing unit for synthesizing the two region-separated binary images obtained from the original image, and the plurality of long objects And the number determining means for determining the number, and having and an output means for outputting information for identifying the number of said plurality of elongated article which is determined by the number determining means.
本発明の長尺物本数測定方法は、段積みされている複数の長尺物の端面を含む領域が、相互に間隔を有する複数の位置でそれぞれ撮像されることにより得られた複数の元画像を画像処理した結果に基づいて前記複数の長尺物の本数を測定する長尺物測定方法であって、前記複数の位置のうち相互に間隔を有して隣接する位置で撮像された2つの前記元画像に、前記複数の長尺物の少なくとも一部が共通して含まれるように、前記複数の位置でそれぞれ撮像された複数の前記元画像を取得する元画像取得工程と、前記元画像取得工程により取得された前記複数の元画像のそれぞれから、前記長尺物の端面に対応するブロブである長尺物対応ブロブであって相互に分離された長尺物対応ブロブにより表現された2値化画像である領域分離2値化画像を作成する領域分離2値化画像作成工程と、前記領域分離2値化画像導出工程により導出された前記領域分離2値化画像のうち、相互に間隔を有して隣接する位置で撮像された2つの前記元画像から得られた2つの前記領域分離2値化画像に含まれる長尺物対応ブロブを比較した結果に基づいて、当該2つの領域分離2値化画像における位置合わせの基準となる長尺物対応ブロブをそれぞれ決定する合成位置決定工程と、前記合成位置決定工程により決定された長尺物対応ブロブに基づいて、前記相互に間隔を有して隣接する位置で撮像された2つの前記元画像から得られた2つの前記領域分離2値化画像をそれぞれ合成した合成画像を作成する画像合成工程と、前記画像合成工程により作成された合成画像に基づいて、前記複数の長尺物の本数を決定する本数決定工程と、前記本数決定工程により決定された前記複数の長尺物の本数を識別するための情報を出力する出力工程と、を有することを特徴とする。 In the method for measuring the number of long objects of the present invention, a plurality of original images obtained by imaging regions including end faces of a plurality of stacked long objects at a plurality of positions having a space between each other. A long object measuring method for measuring the number of the plurality of long objects based on the result of image processing, wherein two images taken at adjacent positions with a space between each other among the plurality of positions An original image acquisition step of acquiring a plurality of the original images respectively captured at the plurality of positions so that at least a part of the plurality of long objects is included in the original image in common; and the original image Each of the plurality of original images acquired in the acquisition step is represented by a long object corresponding blob that is a blob corresponding to the end face of the long object and is separated from each other. Area-separated binary image that is a binary image The region-separated binarized image creating step for creating the image and the region-separated binarized image derived by the region-separated binarized image deriving step were captured at positions adjacent to each other with an interval between them. Based on the result of comparing the long object corresponding blobs included in the two region-separated binarized images obtained from the two original images, it becomes a reference for alignment in the two region-separated binarized images Based on the combined position determining step for determining each long object corresponding blob and the long object corresponding blob determined by the combined position determining step, two images captured at adjacent positions with a space between each other An image composition step for creating a composite image obtained by combining the two region-separated binary images obtained from the original image, and the plurality of long objects based on the composite image created by the image composition step A number determining step of determining the number, and having and an output step of outputting the information for identifying the number of said plurality of elongated article which is determined by the number determining step.
本発明のコンピュータプログラムは、前記長尺物本数測定装置の各手段としてコンピュータを機能させることを特徴とする。 The computer program according to the present invention causes a computer to function as each means of the long object number measuring apparatus.
本発明によれば、相互に間隔を有して隣接する位置で撮像された2つの元画像に、段積みされている複数の長尺物の少なくとも一部が共通して含まれるように、複数の位置でそれぞれ撮像された複数の元画像のそれぞれから、相互に分離された長尺物対応ブロブにより表現された2値化画像である領域分離2値化画像を作成する。そして、相互に隣接する位置にある2つの領域分離2値化画像に含まれる長尺物対応ブロブを比較した結果に基づいて、当該2つの領域分離2値化画像における位置合わせの基準となる長尺物対応ブロブをそれぞれ決定し、決定した長尺物対応ブロブに基づいて、当該2つの領域分離2値化画像をそれぞれ合成した合成画像を作成し、作成した合成画像に基づいて、前記段積みされている複数の長尺物の本数を決定する。したがって、段積みされている複数の長尺物の一部の先端が他の長尺物よりも後退した状態であっても、当該段積みされている複数の長尺物の本数を自動的に且つ正確に測定することができる。 According to the present invention, a plurality of original images captured at positions adjacent to each other with a space between each other are included so that at least a part of the plurality of stacked long objects is included in common. A region-separated binarized image that is a binarized image expressed by a long object corresponding blob separated from each other is created from each of a plurality of original images respectively captured at the positions. Then, based on the result of comparing the long object corresponding blobs included in the two region separation binarized images at positions adjacent to each other, the length serving as a reference for alignment in the two region separation binarized images Each blob corresponding to the scale is determined, and based on the determined long blob corresponding to the long object, a composite image is generated by combining the two region-separated binary images, and the stacking is performed based on the generated composite image. Determine the number of multiple long objects. Therefore, even when the tips of some of the stacked long objects are retracted from the other long objects, the number of the stacked long objects is automatically determined. And it can measure accurately.
以下、図面を参照しながら、本発明の一実施形態を説明する。尚、各図では、表記の都合上、一部の構成を簡略化又は省略化している。また、各図に示しているX、Y、Z座標は、各図の方向の関係を示すものであり、X、Y、Z座標の原点は、必ずしも各図に示す位置にはない。
<第1の実施形態>
まず、第1の実施形態について説明する。
(長尺物の配置と長尺物を撮像するための装置の構成)
図1は、計数の対象となる複数の鋼管10と、当該複数の鋼管の端面の画像を撮像するための3つのカメラ20a〜20c(撮像装置)と、当該複数の鋼管10の端面を照明するための照明装置30a〜30fの配置の一例を示す図である。具体的に図1(a)は、複数の鋼管10及びカメラ20a〜20cをその側方向(X軸に沿う方向)から見た図であり、図1(b)は、カメラ20a〜20c及び照明装置30a〜30fをその正面から見た図であり、図1(c)は、複数の鋼管10の端面をその正面から見た図である。
Hereinafter, an embodiment of the present invention will be described with reference to the drawings. In each drawing, some components are simplified or omitted for convenience of description. In addition, the X, Y, and Z coordinates shown in each figure indicate the relationship in the direction of each figure, and the origin of the X, Y, and Z coordinates is not necessarily at the position shown in each figure.
<First Embodiment>
First, the first embodiment will be described.
(Arrangement of long object and configuration of device for imaging long object)
1 illuminates a plurality of
図1(a)、(c)に示すように、複数の鋼管10は、スタックにおいて、バンド40により束ねられている。
また、図1(a)に示すように、複数の鋼管10は、少なくとも一端部にソケットが形成されたソケット付きの鋼管であり、それぞれ同一の仕様のものである。また、図1(a)に示すように、下から偶数段目にある鋼管10の端部であって、ソケットが形成されている側の端部の位置が、その上下の段の鋼管10(下から奇数段目にある鋼管10)のソケットの根元付近の位置になるように、1段おきに端部が後退した状態で複数の鋼管10が段積みされている。本実施形態では、このようにして段積みされた複数の鋼管10の、ソケットが形成されている側の端面の画像をカメラ20a〜20cで撮像する。
As shown to Fig.1 (a), (c), the some
Moreover, as shown to Fig.1 (a), the
本実施形態では、カメラ20a〜20cは、同一の仕様のデジタルスチルカメラである。図1(a)、図1(b)に示すように、カメラ20a〜20cは、Y軸方向(高さ方向)において略等間隔で並べられている。すなわち、カメラ20a〜20cのX軸方向及びZ軸方向の位置は略同じ位置であるが、カメラ20a〜20cのY軸方向の位置(高さ位置)は、カメラ20aが最も高く、カメラ20cが最も低くなるようにしている。また、相互に隣接するカメラ20(例えばカメラ20a、20b)の撮像範囲は、少なくとも一段の鋼管10が共通して含まれるように、相互に共通する領域を有する。
図1(a)に示すように、カメラ20a〜20c(のレンズ)は、複数の鋼管10の端面とZ軸方向において間隔を有して正対しており、複数の鋼管10のうち撮像範囲内にある鋼管10の端面のカラー静止画像を撮像する。
以下の説明では、カメラ20a〜20cにより撮像された「鋼管10の端面の画像」を必要に応じて「元画像」と称する。
In the present embodiment, the
As shown in FIG. 1A, the
In the following description, “an image of the end face of the
照明装置30a、30bは、それぞれカメラ20aの左、右から、少なくともカメラ20aの撮像範囲内にある鋼管10の端面を可及的に一様に照明できる位置に配置される。同様に、照明装置30c、30d・30e、30fは、それぞれカメラ20b・20cの左、右から、少なくともカメラ20b・20cの撮像範囲内にある鋼管10の端面を可及的に一様に照明できる位置に配置される。
The
(長尺物本数測定装置の構成)
図2は、長尺物本数測定装置100の機能的な構成の一例を示すブロック図である。
長尺物本数測定装置100は、照明装置30a〜30fにより照明された複数の鋼管10の端面を、当該端面と正対する位置からカメラ20a〜20cによって撮像されることにより得られた画像(元画像)を画像処理して、複数の鋼管10の本数を自動的に計数するものである。
図2に示す長尺物本数測定装置100は、例えば、CPU、ROM、RAM、HDD、及び各種のインターフェースを備えたコンピュータ(例えばPC)を用いることにより実現することができる。以下に、長尺物本数測定装置100が有する機能の一例を説明する。尚、長尺物本数測定装置100とカメラ20a〜20cは、USBケーブル等により、相互に通信可能に接続されている。
(Configuration of long object number measuring device)
FIG. 2 is a block diagram illustrating an example of a functional configuration of the long object number measuring apparatus 100.
The long object number measuring apparatus 100 is an image (original image) obtained by imaging the end faces of the plurality of
2 can be realized by using, for example, a computer (for example, a PC) provided with a CPU, a ROM, a RAM, an HDD, and various interfaces. Below, an example of the function which long object number measuring device 100 has is explained. The long object number measuring apparatus 100 and the
[鋼管抽出部101]
鋼管抽出部101は、各カメラ20a〜20cで撮像された元画像のそれぞれに対して画像処理を行って、鋼管10の夫々に対応する領域が相互に分離されて表現された2値化画像である領域分離2値化画像を作成する。
図1に示すように、本実施形態では、計数対象の鋼管10の形状は、パイプ状である。そこで、本実施形態では、鋼管抽出部101は、本出願人が提案した特願2012−187969号明細書に記載の技術を利用して、各カメラ20a〜20cで撮像された元画像から、鋼管10の本数をカメラ20a〜20c毎に個別に計数する。以下に、特願2012−187969号明細書に記載の技術に基づいた鋼管抽出部101の構成及び処理の一例について説明する。
[Steel pipe extraction unit 101]
The steel
As shown in FIG. 1, in this embodiment, the shape of the
図3は、鋼管抽出部101の詳細な機能構成の一例を示すブロック図である。尚、鋼管抽出部101は、例えば、CPU、ROM、RAM、ユーザインターフェース、及び通信インターフェースを用いることにより実現される。
鋼管情報取得部101aは、スタックに保管されるべき鋼管10の管理本数と、当該鋼管10のパイプ径(ここでは、パイプ径が鋼管10の内径であるとする)とを含む鋼管情報を、上位コンピュータ200から取得する。このとき、鋼管情報取得部101aは、上位コンピュータ200に要求を行うことにより鋼管情報を取得しても、要求を行わずに上位コンピュータ200から鋼管情報を取得してもよい。この他、バーコードリーダにより読み取ったQRコード(登録商標)(2次元バーコード)に含まれる鋼管情報を取得してもよい。
元画像取得部101bは、カメラ20a〜20cで撮像された元画像を個別に取得する。
FIG. 3 is a block diagram illustrating an example of a detailed functional configuration of the steel
The steel pipe information acquisition unit 101a displays the steel pipe information including the management number of the
The original image acquisition unit 101b individually acquires original images captured by the
図4は、元画像が処理される様子の一例を概念的に示す図である。以下に、元画像取得部101bにより取得された元画像の処理の一例を説明する。カメラ20a〜20cで撮像された元画像のそれぞれに対して、以下の処理が個別に行われる。尚、図4以降では、便宜上、画像に対するX、Y座標が、それぞれ水平方向、高さ方向に一致するように示しているが、必ずしもこのようになるものではない。また、図4以降の画像を示す図は、実際に得られた画像ではなく、説明のために、図面化したものであり、説明に必要な部分を必要に応じてデフォルメして示す。
FIG. 4 is a diagram conceptually illustrating an example of how an original image is processed. Hereinafter, an example of processing of the original image acquired by the original image acquisition unit 101b will be described. The following processing is performed individually for each of the original images captured by the
シェーディング補正部101cは、元画像取得部101bにより読み出された元画像に対してシェーディング補正を行い、元画像の濃度レベルのむらを補正し、高精細な元画像を得るためのものである。尚、シェーディング補正は、公知の技術で実現できるので、ここでは、その詳細な説明を省略する。 The shading correction unit 101c performs shading correction on the original image read by the original image acquisition unit 101b, corrects unevenness in the density level of the original image, and obtains a high-definition original image. Since shading correction can be realized by a known technique, detailed description thereof is omitted here.
2値化部101dは、シェーディング補正部101cでシェーディング補正が行われた元画像に対して2値化処理を行い、当該元画像を2値化する。例えば、2値化部101dは、元画像において、諧調が閾値以上である画素には論理「1」を、当該閾値未満である画素には論理「0」を割り当てる。鋼管10は、鋼材で形成されているため、鋼管10からの反射光は、その周囲からの反射光よりも高い輝度を有する。したがって、閾値を適切に設定することによって、元画像において、鋼管10の領域については論理「1」が、その他の領域については論理「0」が、それぞれ割り当てられることになる。尚、以下の説明では、2値化された元画像を、必要に応じて、2値化元画像と称する。図4(a)は、2値化元画像410の一例を示す図である。尚、ここでは、表記の都合上、図1に示した鋼管の一部についての2値化元画像410を示している。
図4(a)において、黒で塗り潰されている領域が、論理「0」が割り当てられた領域であることを示し、白抜きの領域が、論理「1」が割り当てられた領域であることを示している。尚、このような2値化処理は、公知の技術で実現できるので、ここでは、その詳細な説明を省略する。
The
In FIG. 4A, an area filled in black indicates that the logic “0” is allocated, and a white area indicates that the logic “1” is allocated. Show. Since such binarization processing can be realized by a known technique, detailed description thereof is omitted here.
ブロブ処理部101eは、2値化元画像410において、諧調が前記閾値未満の「連続する複数の画素」(すなわち、論理「0」が割り当てられている「連続する複数の画素」)で構成される閉領域(ブロブ)を導出し、各ブロブに対してラベリング処理(番号の割り振り)を行う。ブロブ処理部101eは、例えば、隣接する画素に割り当てられた論理が共に「0」である場合、当該画素は、同じブロブに含まれるものとしてブロブを導出する。このとき、ブロブ処理部101eは、ブロブの中に含まれる「論理「1」が割り当てられた画素」の数が閾値以下の場合、当該画素の論理を「1」から「0」に変更するようにするようにしてもよい。尚、ブロブ処理は、公知の技術で実現できるので、ここでは、その詳細な説明を省略する。
図4(a)に示す例では、鋼管の中空部分に対応するブロブ411a〜411pと、鋼管10の隙間部分に対応するブロブ412a〜412nと、背景部分に対応するブロブ413と、が導出される。
The
In the example shown in FIG. 4A, blobs 411a to 411p corresponding to the hollow portion of the steel pipe,
鋼管候補抽出部101fは、ブロブ処理部101eで導出された各ブロブ411、412、413から、鋼管10の中空部分のブロブとは異なるブロブを排除し、鋼管10の中空部分の候補となるブロブを鋼管の候補として抽出する。このようにするための具体例を示すと、鋼管候補抽出部101fは、まず、鋼管情報取得部101aで取得された鋼管情報に含まれているパイプ径を直径とする円の面積を導出し、導出した面積に所定の2つの倍率K1、K2(K1<1、K2>1)を乗算した値を第1、第2の閾値として導出する。また、鋼管候補抽出部101fは、ブロブ処理部101eで導出された各ブロブ411、412、413の面積を導出する。そして、鋼管候補抽出部101fは、面積が、第1の閾値以上、第2の閾値以下のブロブを鋼管の候補として設定する。
The steel pipe
図4(b)に示す例では、鋼管の中空部分に対応するブロブ411a〜411pが鋼管の候補として抽出された様子を示している。
図4に示す例では、ブロブ411nの形状及び大きさが、その他のブロブ411a〜411m、411o〜411pのものと異なることを示している。
鋼管判定部101gは、鋼管候補抽出部101fで設定された鋼管の候補(ブロブ411a〜411p)が、所望の鋼管10であるか否かを判定する。具体的に本実施形態では、鋼管の候補のそれぞれについて、以下の処理を行うようにしている。
図5は、鋼管の候補が鋼管10であるか否かを判定するための第1の処理の一例を概念的に説明する図である。図5では、鋼板の候補としてブロブ411aを例に挙げて説明する。
まず、鋼管判定部101gは、所定の2次元直交座標系(前述したように本実施形態では、地面に対して水平な方向の軸をX軸とし、地面に対して垂直な方向(高さ方向)の軸をY軸とする)を設定する。次に、鋼管判定部101gは、鋼管の候補のブロブ411aの重心Oを、2次元直交座標系の所定の座標(例えば原点)に配置する。次に、鋼管判定部101gは、ブロブ411aの中心Oを通り、且つ、X軸に平行な直線501を設定する(図5(a)を参照)。
The example shown in FIG. 4B shows a state where
In the example shown in FIG. 4, the shape and size of the
The steel
FIG. 5 is a diagram conceptually illustrating an example of a first process for determining whether or not a steel pipe candidate is the
First, the steel
次に、鋼管判定部101gは、論理「0」が割り当てられている画素が、直線501上に存在しているか否かを判定する。この判定の結果、論理「0」が割り当てられている画素が、直線501上に存在している場合、鋼管判定部101gは、直線501を、Y軸の正の方向に1画素分移動する。次に、鋼管判定部101gは、移動した直線501に、論理「0」が割り当てられている画素が存在しているか否かを判定する。このような直線501の移動と判定とを繰り返し行う(図5(b)を参照)。そして、鋼管判定部101gは、論理「0」が割り当てられている画素が、直線501に存在しなくなったところで直線501を固定する(図5(c)を参照)。
Next, the steel
鋼管判定部101gは、以上と同様の処理を、Y軸の負の方向についても行い、直線502を設定する。そして、論理「0」が割り当てられている画素が存在しなくなったところで直線502を固定する(図5(d)を参照)。
次に、鋼管判定部101gは、ブロブaの重心Oを通り、且つ、Y軸に平行な直線を設定し、以上の処理と同様の処理を行う。この処理は、前述した処理の説明において、例えば、「Y軸」を「X軸」に置き換えることで実現できるので、この処理の詳細な説明を省略する。
以上の処理により、図5(d)に示すように、ブロブ411aに対して4つの接線(直線501〜504)が得られる。そして、鋼管判定部101gは、図5(e)に示すように、これら4つ接線で囲まれる矩形を、ブロブ411aに対して外接する矩形510として導出し、この矩形510のX軸方向(横)の長さa1とY軸方向(縦)の長さb1とを導出する。
The steel
Next, the steel
With the above processing, as shown in FIG. 5D, four tangent lines (
図6は、鋼管の候補が所望の鋼管10であるか否かを判定するための第2、第3の処理の一例を概念的に説明する図である。図6でも、図5と同様に、鋼管の候補としてブロブ411aを例に挙げて説明する。鋼管判定部101gは、第1の処理が終わった後に、第2の処理、第3の処理を行う。
第1の処理(図5を参照)では、ブロブ411aに対する4つの接線(直線501〜504)として、所定の2次元直交座標系のX軸及びY軸に平行な方向の接線を導出するようにした。これに対し、第2の処理では、図6(a)に示すように、鋼管判定部101gは、所定の2次元直交座標系のX軸及びY軸に平行な直線のそれぞれを、所定の方向(図6では時計回りの方向)に22[°]傾けた直線601又は602に平行な4つの直線を、ブロブ411aに対する4つの接線として導出する。そして、鋼管判定部101gは、これら4つ接線で囲まれる矩形を、ブロブ411aに対して外接する矩形610として導出し、この矩形610について、X軸方向に対して所定の方向に22[°]傾いた辺(横)の長さa2と、Y軸方向に対して所定の方向に22°傾いた辺(横)の長さb2とを導出する。
FIG. 6 is a diagram conceptually illustrating an example of the second and third processes for determining whether or not a steel pipe candidate is a desired
In the first process (see FIG. 5), as four tangents (
また、第3の処理では、図6(b)に示すように、鋼管判定部101gは、所定の2次元直交座標系のX軸及びY軸に平行な直線のそれぞれを、所定の方向(図6では時計回りの方向)に44[°]傾けた直線603又は604に平行な4つの直線を、ブロブ411aに対する4つの接線として導出する。そして、鋼管判定部101gは、これら4つ接線で囲まれる矩形を、ブロブ411aに対して外接する矩形620として導出し、この矩形620について、X軸方向に対して所定の方向に44[°]傾いた辺(横)の長さa3と、Y軸方向に対して所定の方向に44[°]傾いた辺(横)の長さb3とを導出する。
以上のような第2、第3の処理は、それぞれ、鋼管の候補のブロブ411aの重心Oを、前述した2次元直交座標系の所定の座標(例えば原点)に配置した後、前述した第1の処理の説明において、例えば、「X軸の方向」を「X軸方向に対して時計回りの方向に22[°]、44[°]傾いた方向」とし、「Y軸の方向」を「Y軸方向に対して時計回りの方向に22[°]、44[°]傾いた方向」とすることで実現できるので、これら第2、第3の処理の詳細な説明を省略する。
以上のようにして、鋼管の候補となるブロブ411aに対して外接する複数の矩形510、610、620を導出することができる。尚、以下の説明では、X軸、Y軸に対する角度を、必要に応じて、傾き角度と称する。
Further, in the third process, as shown in FIG. 6B, the steel
The second and third processes as described above are performed by arranging the center of gravity O of the steel
As described above, a plurality of
図7は、他の鋼管の候補と形状及び大きさが異なるブロブ411nに対して、第1〜第3の処理を行い、ブロブ411jに対して外接する複数の矩形710、720、730を導出した結果の一例を概念的に示す図である。
鋼管の候補となるブロブ411が真円に近ければ、図5(e)、図6に示すように、当該ブロブ411に対して外接する複数の矩形の各辺の長さは、それ程変わらない。一方、鋼管の候補となるブロブ411が真円からずれるようになると、図7に示すように、当該ブロブ411に対して外接する複数の矩形の各辺の長さは、矩形毎に異なることになる。
FIG. 7 shows a plurality of
If the
鋼管判定部101gは、以上のようにして得られた複数の矩形(例えば、矩形510、610、620、710〜730)の2辺(横・縦)の長さa1、a2、a3・b1、b2、b3が、以下の鋼管判定条件式((1)式〜(8)式)を満たす場合に、当該複数の矩形の元となるブロブ411が所望の鋼管10に対応するものであると判定し、そのブロブ411の情報を記憶する。尚、本実施形態では、鋼管判定条件式は、予め設定されているものとする。
a1×0.8<b1<a1×1.2 ・・・(1)
b1×0.8<a1<b1×1.2 ・・・(2)
a2×0.8<b2<a2×1.2 ・・・(3)
b2×0.8<a2<b2×1.2 ・・・(4)
a3×0.8<b3<a3×1.2 ・・・(5)
b3×0.8<a3<b3×1.2 ・・・(6)
{(a1+b1)/2]2×π×0.8<{(a2+b2)/2]2×π<{(a1+b1)/2]2×π×1.2 ・・・(7)
{(a1+b1)/2]2×π×0.8<{(a3+b3)/2]2×π<{(a1+b1)/2]2×π×1.2 ・・・(8)
尚、図4に示す例では、ブロブ411a〜411m、411o〜411pについては、鋼管判定条件式を満たし、その他のブロブ411nについては、鋼管判定条件式を満たさないものとする(図5〜図7を参照)。
The steel
a1 × 0.8 <b1 <a1 × 1.2 (1)
b1 × 0.8 <a1 <b1 × 1.2 (2)
a2 × 0.8 <b2 <a2 × 1.2 (3)
b2 × 0.8 <a2 <b2 × 1.2 (4)
a3 × 0.8 <b3 <a3 × 1.2 (5)
b3 × 0.8 <a3 <b3 × 1.2 (6)
{(A1 + b1) / 2] 2 × π × 0.8 <{(a2 + b2) / 2] 2 × π <{(a1 + b1) / 2] 2 × π × 1.2 (7)
{(A1 + b1) / 2] 2 × π × 0.8 <{(a3 + b3) / 2] 2 × π <{(a1 + b1) / 2] 2 × π × 1.2 (8)
In the example shown in FIG. 4, the steel pipe determination conditional expression is satisfied for the
領域分離2値化画像作成部101hは、2値化部101dで得られた2値化元画像410から、ブロブ処理部101eで得られたブロブ411、412、413のうち、鋼管判定部101gで所望の鋼管10であると判定されたブロブを抽出して領域分離2値化画像を作成する。
図8は、領域分離2値化画像の一例を示す図である。前述したように、図4に示す例では、ブロブ411a〜411pのうち、ブロブ411a〜411m、411o〜411pが所望の鋼管に対応するものとなる。そこで、領域分離2値化画像作成部101hは、2値化元画像410のブロブ411a〜411m、411o〜411pの領域の画素に論理「1」をその他の領域の画素に論理「0」を割り当てて、領域分離2値化画像810を生成する。このようにして、複数の鋼管10の1つ1つに対応するブロブが、相互に分離された状態になる。以下の説明では、このような複数の鋼管10の1つ1つに対応するブロブを必要に応じて鋼管対応ブロブ(長尺物対応ブロブ)と称する。
The region separation binarized image creation unit 101h uses the steel
FIG. 8 is a diagram illustrating an example of a region separation binarized image. As described above, in the example shown in FIG. 4, among the
本実施形態では、3つのカメラ20a〜20cによりそれぞれ1つずつ元画像が得られるので、3つの領域分離2値化画像810が得られる。図9は、カメラ20a〜20cにより得られた元画像から作成された領域分離2値化画像810a、810b、810cの一例を示す図である。
図9(a)に示す領域分離2値化画像810aは、カメラ20aにより得られた元画像から作成されたものであり、図9(b)に示す領域分離2値化画像810bは、カメラ20bにより得られた元画像から作成されたものであり、図9(c)に示す領域分離2値化画像810cは、カメラ20cにより得られた元画像から作成されたものである。尚、図8は、図9(c)に示すものと同じである。すなわち、図4〜図8は、カメラ20cにより得られた元画像に対する処理を説明するものである。尚、領域分離2値化画像810a、810b、810cと、それらの基となる元画像の撮像範囲はそれぞれ同じである。また、ここでも、表記の都合上、図1に示した鋼管の一部についての領域分離2値化画像810を示している。また、図9以降では、表記の都合上、2値化画像についても輪郭のみを示す。
In the present embodiment, since one original image is obtained by each of the three
The area separation
[間隔導出部102]
図2の説明に戻り、間隔導出部102は、領域分離2値化画像810において、X軸方向に並ぶn個以上の鋼管対応ブロブの間隔であって、相互に隣接する鋼管対応ブロブの間隔の、当該n個以上の鋼管対応ブロブのX軸方向の全体の長さに対する割合(間隔割合)を導出する。以下に、間隔導出部102の具体的な処理の一例を説明する。間隔導出部102は、鋼管抽出部101により得られた全ての領域分離2値化画像810に対して以下の処理を個別に行う。
[Interval Deriving Unit 102]
Returning to the description of FIG. 2, in the region separation
まず、間隔導出部102は、領域分離2値化画像810に含まれる鋼管対応ブロブから、X軸方向に並んでいるn個以上の鋼管対応ブロブからなるブロブ群を設定する。
図10は、ブロブ群を設定する方法の一例を説明する図である。ここでは、図9(a)に示す領域分離2値化画像810aからブロブ群を抽出する場合を例に挙げて説明する。
間隔導出部102は、領域分離2値化画像810aに含まれる全ての鋼管対応ブロブ1001a〜1001qのY軸方向の最大値1002a〜1002qと最小値1003a〜1003qを導出する。
First, the interval deriving unit 102 sets a blob group including n or more steel pipe-corresponding blobs arranged in the X-axis direction from the steel pipe-corresponding blobs included in the region separation
FIG. 10 is a diagram for explaining an example of a method for setting a blob group. Here, a case where a blob group is extracted from the region-separated
The interval deriving unit 102 derives the
次に、間隔導出部102は、Y軸方向の最大値1002と最小値1003の双方が所定の範囲内で一致する鋼管対応ブロブ1001を選択する。次に、間隔導出部102は、抽出した鋼管対応ブロブ1001の数がn個以上であるか否かを判定する。この判定の結果、抽出した鋼管対応ブロブ1001の数がn個以上である場合、間隔導出部102は、抽出した鋼管対応ブロブ1001を同一のブロブ群に属するものとする。一方、抽出した鋼管対応ブロブ1001の数がn個以上でない場合、間隔導出部102は、抽出した鋼管対応ブロブ1001が何れのブロブ群にも属さないようにする。ブロブ群とする鋼管対応ブロブ1001の数がnを「3」とした場合、図10に示す例では、鋼管対応ブロブ1001a〜1001fが第1のブロブ群に属し、鋼管対応ブロブ1001g〜1001kが第2のブロブ群に属し、鋼管対応ブロブ1001l〜1001qが第3のブロブ群に属する。
Next, the interval deriving unit 102 selects the steel pipe-corresponding
次に、間隔導出部102は、同一のブロブ群に属する鋼管対応ブロブのうち、X軸方向の両端にある2つの鋼管対応ブロブの重心を導出する。図11は、X軸方向の両端にある2つの鋼管対応ブロブの重心の一例を示す図である。ここでは、図10に示す鋼管対応ブロブ1001l〜1001qから設定されたブロブ群を例に挙げて説明する。図11に示す例では、第1のブロブ群の両端の鋼管対応ブロブ1001a、1001fの重心1101a、1101fと、第2のブロブ群の両端の鋼管対応ブロブ1001g、1001kの重心1101g、1101kと、第3のブロブ群の両端の鋼管対応ブロブ1001l、1001qの重心1101l、1101qと、が導出される。
Next, the space | interval derivation | leading-out part 102 derives | leads-out the gravity center of two steel pipe corresponding blobs in the both ends of a X-axis direction among the steel pipe corresponding blobs which belong to the same blob group. FIG. 11 is a diagram illustrating an example of the center of gravity of two steel pipe-corresponding blobs at both ends in the X-axis direction. Here, the blob group set from the steel pipe corresponding blobs 1001l to 1001q shown in FIG. 10 will be described as an example. In the example shown in FIG. 11, the gravity centers 1101a and 1101f of the steel
次に、間隔導出部102は、各ブロブ群の両端の2つの鋼管対応ブロブの重心を相互に接続する直線を導出する。図11に示す例では、第1のブロブ群に対して直線1102aが導出され、第2のブロブ群に対して直線1102bが導出され、第3のブロブ群に対して直線1102cが導出される。
次に、間隔導出部102は、各ブロブ群の両端の2つの鋼管対応ブロブの重心を相互に接続する直線と、X軸方向とのなす角度θを導出する。図12は、各ブロブ群の両端の2つの鋼管対応ブロブの重心を相互に接続する直線と、X軸方向とのなす角度θの一例を示す図である。ここでは、図11に示す第1のブロブ群を例に挙げて説明する。尚、説明の都合上、図12では、第1のブロブ群の両端の2つの鋼管対応ブロブ1001a、1001fの重心1101a、1101fを相互に接続する直線1102aを水平方向(X軸方向)に対して大きく傾けて示す。
Next, the space | interval derivation | leading-out part 102 derives | leads-out the straight line which mutually connects the gravity center of the two steel pipe corresponding blobs of the both ends of each blob group. In the example shown in FIG. 11, a
Next, the space | interval derivation | leading-out part 102 derives | leads-out the angle (theta) which the straight line which mutually connects the gravity center of the two steel pipe corresponding blobs of the both ends of each blob group, and an X-axis direction. FIG. 12 is a diagram illustrating an example of an angle θ formed by a straight line connecting the centers of gravity of two steel pipe-corresponding blobs at both ends of each blob group and the X-axis direction. Here, the first blob group shown in FIG. 11 will be described as an example. For convenience of explanation, in FIG. 12, a
図12に示すように、本実施形態では、角度θは、X軸方向を基準として、紙面に向かって反時計回りの方向に値が増加するものとする。図11に示す例では、3つのブロブ群があるので、このような角度θが3つ導出される。
そして、間隔導出部102は、各ブロブ群の両端の2つの鋼管対応ブロブの重心を相互に接続する直線と、X軸方向とのなす角度θの算術平均値を、各ブロブ群のX軸方向に対する傾きとして導出する。図11に示す例では、3つのブロブ群があり、角度θが3つ導出されるので、これら3つの角度の算術平均値が導出される。
As shown in FIG. 12, in this embodiment, the angle θ is assumed to increase in a counterclockwise direction toward the paper surface with respect to the X-axis direction. In the example shown in FIG. 11, since there are three blob groups, three such angles θ are derived.
And the space | interval derivation | leading-out part 102 calculates | requires the arithmetic average value of angle (theta) which the straight line which mutually connects the gravity center of the two steel pipe corresponding blobs of the both ends of each blob group, and an X-axis direction, X-axis direction of each blob group Derived as the slope with respect to. In the example shown in FIG. 11, there are three blob groups, and three angles θ are derived. Therefore, an arithmetic average value of these three angles is derived.
次に、間隔導出部102は、各ブロブ群のX軸方向に対する傾き(角度)の値が0°になるように、各ブロブ群を回動させて、各ブロブ群の傾きを補正する。第1のブロブ群のX軸方向に対する傾きが、図12に示す角度θである場合、間隔導出部102は、図12の紙面に向かって時計回りに角度θだけ各ブロブ群(第1〜第3のブロブ群)を回動させる。このような傾きを補正することによって、各領域分離2値化画像810a〜810c(カメラ20a〜20cにより得られる元画像)のX−Y座標の座標軸のずれを補正することができる。以下の説明では、このようにして補正がされた領域分離2値化画像を必要に応じて補正後領域分離2値化画像と称する。
Next, the interval deriving unit 102 corrects the inclination of each blob group by rotating each blob group so that the value of the inclination (angle) of each blob group with respect to the X-axis direction is 0 °. When the inclination of the first blob group with respect to the X-axis direction is an angle θ shown in FIG. 12, the interval deriving unit 102 rotates each blob group (first to first) by an angle θ clockwise toward the paper surface of FIG. 12. 3 blob groups). By correcting such an inclination, it is possible to correct a shift in the coordinate axes of the XY coordinates of the region-separated
次に、間隔導出部102は、傾きが補正された後の各ブロブ群の間隔割合を導出する。図13は、傾きが補正された後の各ブロブ群の間隔割合を導出する方法の一例を説明する図である。ここでは、図11に示す第1のブロブ群の傾きが補正された場合を例に挙げて説明する。
まず、間隔導出部102は、第1のブロブ群のX軸方向における両端の鋼管対応ブロブ1001a、1001fの重心1101a、1101fの長さWを導出する。次に、間隔導出部102は、第1のブロブ群のX軸方向における両端以外の鋼管対応ブロブ1001b〜1001eの重心1101b〜1101eを導出する。次に、間隔導出部102は、第1のブロブ群の相互に隣接する2つの鋼管対応ブロブ1001の間隔D1〜D5を導出する。そして、間隔導出部102は、各間隔D1〜D5を長さWで割ることにより、間隔割合(=D1/W、D2/W、D3/W、D4/W、D5/W)を導出する。
間隔導出部102は、例えば、CPU、ROM、及びRAMを用いることにより実現される。尚、間隔割合の単位は百分率[%]であっても無次元[−]であってもよい。
Next, the interval deriving unit 102 derives the interval ratio of each blob group after the inclination is corrected. FIG. 13 is a diagram for explaining an example of a method for deriving the interval ratio of each blob group after the inclination is corrected. Here, a case where the inclination of the first blob group shown in FIG. 11 is corrected will be described as an example.
First, the interval deriving unit 102 derives the length W of the
The interval deriving unit 102 is realized by using, for example, a CPU, a ROM, and a RAM. The unit of the interval ratio may be percentage [%] or dimensionless [−].
[合成位置決定部103]
合成位置判定部103は、相互に隣接する2つの補正後領域分離2値化画像(ブロブ群の傾きが補正された領域分離2値化画像)を合成する位置を決定する。
図14は、相互に隣接する2つの補正後領域分離2値化画像を合成する位置を決定する方法の一例を説明する図である。図14に示す補正後領域分離2値化画像1410aは、図9(a)に示す領域分離2値化画像810a(カメラ20aにより得られた元画像)に対応し、補正後領域分離2値化画像1410bは、図9(b)に示す領域分離2値化画像810b(カメラ20bにより得られた元画像)に対応する。ここでは、図14に示す補正後領域分離2値化画像1410a、1410bを合成する位置を決定する場合を例に挙げて説明する。尚、図14の補正後領域分離2値化画像1410bの破線は、X軸方向に並ぶn個以上の鋼管対応ブロブが並んでいないため、間隔導出部102によりブロブ群として設定されなかった鋼管対応ブロブを仮想的に表す。
[Composition Position Determination Unit 103]
The composite position determination unit 103 determines a position where two post-correction region separation binarized images adjacent to each other (region separation binarized image in which the inclination of the blob group is corrected) are to be combined.
FIG. 14 is a diagram illustrating an example of a method for determining a position where two post-correction region separation binarized images adjacent to each other are combined. A post-correction region separation
合成位置決定部103は、補正後領域分離2値化画像1410aに含まれるブロブ群の1つと補正後領域分離2値化画像1410bに含まれるブロブ群の1つとの組み合わせを選択し、それらのブロブ群に属する鋼管対応ブロブの数が同じであるか否かを判定する。この判定を、補正後領域分離2値化画像1410aに含まれるブロブ群と補正後領域分離2値化画像1410bに含まれるブロブ群との全ての組み合わせについて行う。
そして、この判定を、補正後領域分離2値化画像1410aに含まれるブロブ群と補正後領域分離2値化画像1410bに含まれるブロブ群との全ての組み合わせについて行っても、鋼管対応ブロブの数が同じブロブ群の組み合わせがない場合、合成位置決定部103は、補正後領域分離2値化画像1410a、1410bを合成することができないと判定する。
The composite position determination unit 103 selects a combination of one of the blob groups included in the post-correction region separation
Even if this determination is made for all combinations of the blob group included in the corrected region separation
図14に示す例では、補正後領域分離2値化画像1410aに含まれるブロブ群1411a、1411cに属する鋼管対応ブロブの数と、補正後領域分離2値化画像1410bに含まれるブロブ群1412bに属する鋼管対応ブロブの数と、が一致する。また、補正後領域分離2値化画像1410aに含まれるブロブ群1411bに属する鋼管対応ブロブの数と、補正後領域分離2値化画像1410bに含まれるブロブ群1412aに属する鋼管対応ブロブの数が一致する。
In the example shown in FIG. 14, the number of blob-corresponding blobs belonging to the
このように、鋼管対応ブロブの数が同じブロブ群の組み合わせがあった場合、合成位置決定部103は、当該ブロブ群の間隔割合が所定の範囲内で一致するか否かを判定する。この判定の結果、鋼管対応ブロブの数が同じ2つのブロブ群の間隔割合が所定の範囲内で一致する場合、合成位置決定部103は、当該ブロブ群の組み合わせを、位置合わせ候補のブロブ群として一時的に記憶する。例えば、相互に対応する位置の間隔割合の差の2乗の総和が所定の範囲内にある場合に、間隔割合が所定の範囲内で一致すると判定することができる。 As described above, when there is a combination of blob groups having the same number of blobs corresponding to the steel pipe, the composite position determination unit 103 determines whether or not the interval ratios of the blob groups match within a predetermined range. As a result of this determination, when the interval ratio between two blob groups having the same number of steel pipe-corresponding blobs matches within a predetermined range, the composite position determination unit 103 sets the blob group combination as a blob group as a registration candidate. Memorize temporarily. For example, when the sum of the squares of the difference of the interval ratios at the positions corresponding to each other is within a predetermined range, it can be determined that the interval ratios match within the predetermined range.
以上の判定を、鋼管対応ブロブの数が同じブロブ群の組み合わせの全てについて行った結果、鋼管対応ブロブの数が同じブロブ群の組み合わせの全てにおいて、間隔割合が所定の範囲内で一致しない場合(位置合わせ候補のブロブ群が得られなかった場合)、合成位置決定部103は、補正後領域分離2値化画像1410a、1410bを合成することができないと判定する。
一方、位置合わせ候補のブロブ群の組み合わせが1つだけ得られた場合、合成位置決定部103は、当該ブロブ群の組み合わせを、位置合わせを行うブロブ群として決定する。
As a result of performing the above determination for all combinations of blob groups having the same number of blobs corresponding to steel pipes, in the case of all combinations of blob groups having the same number of blobs corresponding to steel pipes, when the interval ratio does not match within a predetermined range ( When a blob group of alignment candidates is not obtained), the synthesis position determination unit 103 determines that the post-correction region
On the other hand, when only one combination of alignment candidate blob groups is obtained, the combined position determination unit 103 determines the blob group combination as a blob group to be aligned.
また、位置合わせ候補のブロブ群の組み合わせが複数得られた場合、合成位置決定部103は、補正後領域分離2値化画像1410aに含まれる位置合わせ候補のブロブ群から、2つのブロブ群(ブロブ群のペア)を選択すると共に、当該ブロブ群のペアに対応するブロブ群を、補正後領域分離2値化画像1410bに含まれる位置合わせ候補のブロブ群から選択する。
そして、合成位置決定部103は、補正後領域分離2値化画像1410aに含まれる位置合わせ候補のブロブ群から選択した2つのブロブ群のペアのY軸方向の間隔を導出する。同様に、合成位置決定部103は、補正後領域分離2値化画像1410bに含まれる位置合わせ候補のブロブ群から選択した2つのブロブ群のペアのY軸方向の間隔を導出する。そして、合成位置決定部103は、導出したY軸方向の間隔が所定の範囲内で一致するか否かを判定する。
このような判定を、補正後領域分離2値化画像1410a、1410bに含まれる位置合わせ候補のブロブ群から選択し得るブロブ群のペアの全ての組み合わせについて行う。そして、全ての組み合わせについてこのような判定を行った結果、全ての組み合わせにおいてY軸方向の間隔が所定の範囲内で一致する場合、合成位置決定部103は、位置合わせ候補のブロブ群を、位置合わせを行うブロブ群として決定し、そうでない場合、合成位置決定部103は、補正後領域分離2値化画像1410a、1410bを合成することができないと判定する。
尚、Y軸方向の間隔としては、例えば、補正後領域分離2値化画像1410a、1410bにおける、ブロブ群の両端の2つの鋼管対応ブロブの重心を相互に接続する直線(図11の直線1102a、1102b、1102cを参照)の間隔を採用することができる。
When a plurality of combinations of alignment candidate blobs are obtained, the composite position determination unit 103 selects two blob groups (blob) from the alignment candidate blob groups included in the corrected region-separated
Then, the composite position determination unit 103 derives an interval in the Y-axis direction between a pair of two blob groups selected from the blob groups of alignment candidates included in the post-correction region separation
Such a determination is performed for all combinations of pairs of blob groups that can be selected from the blob groups of alignment candidates included in the post-correction region
As the interval in the Y-axis direction, for example, in the corrected region
図14に示す例では、補正後領域分離2値化画像1410aに含まれるブロブ群1411cの間隔割合と、補正後領域分離2値化画像1410bに含まれるブロブ群1412bの間隔割合は、所定の範囲内で一致するが、補正後領域分離2値化画像1410aに含まれるブロブ群1411aの間隔割合と、補正後領域分離2値化画像1410bに含まれるブロブ群1412bの間隔割合は、所定の範囲内で一致しないものとする。また、補正後領域分離2値化画像1410aに含まれるブロブ群1411bの間隔割合と、補正後領域分離2値化画像1410bに含まれるブロブ群1412aの間隔割合が所定の範囲内で一致するものとする。尚、本発明者らの知見によれば、段数が異なる鋼管においては、ほとんどの場合、鋼管のX軸方向の間隔は異なるので、ほとんどの場合、以上のように、異なる段のブロブ群の間隔割合は、所定の範囲内で一致しないものとなる(無視できない程度に異なる値になる)。
In the example shown in FIG. 14, the interval ratio of the
そうすると、図14の両矢印線で示すように、補正後領域分離2値化画像1410aに含まれるブロブ群1411cと、補正後領域分離2値化画像1410bに含まれるブロブ群1412bとが、位置合わせ候補のブロブ群の一つになる。さらに、補正後領域分離2値化画像1410aに含まれるブロブ群1411bと、補正後領域分離2値化画像1410bに含まれるブロブ群1412aとが、位置合わせ候補のブロブ群の他の一つになる。
Then, as shown by the double arrow line in FIG. 14, the
ここでは、位置合わせ候補のブロブ群の組み合わせ(ブロブ群1411c、1412b、ブロブ群1411b、1412a)が2つ得られる。したがって、合成位置決定部103は、補正後領域分離2値化画像1410aに含まれる位置合わせ候補のブロブ群1411c、1412bのY軸方向の間隔と、補正後領域分離2値化画像1410bに含まれる位置合わせ候補のブロブ群1411b、1412aのY軸方向の間隔と、を導出する。そして、合成位置決定部103は、これら2つのY軸方向の間隔が所定の範囲内で一致するか否かを判定する。これら2つのY軸方向の間隔が所定の範囲内で一致する場合、合成位置決定部103は、ブロブ群1411c、1412b、ブロブ群1411b、1412aを、位置合わせを行うブロブ群として決定する。
以上の処理を、図9(b)に示す領域分離2値化画像810b(カメラ20bにより得られた元画像)に対応する補正後領域分離2値化画像1410bと、図9(c)に示す領域分離2値化画像810c(カメラ20cにより得られた元画像)に対応する補正後領域分離2値化画像1410bについても行う。
合成位置決定部103は、例えば、CPU、ROM、及びRAMを用いることにより実現される。
Here, two combinations of blob groups as alignment candidates (
The above-described processing is shown in FIG. 9C, a corrected region separation
The composite position determination unit 103 is realized by using, for example, a CPU, a ROM, and a RAM.
[画像合成部104]
画像合成部104は、合成位置決定部103により決定された、位置合わせを行うブロブ群の位置に基づいて、相互に隣接する補正後領域分離2値化画像を合成する。
図15は、補正後領域分離2値化画像を合成して表示する方法の一例を説明する図である。
図15において、補正後領域分離2値化画像1410a、1410b、1410cは、図9(a)、図9(b)、図9(c)に示す領域分離2値化画像810a、810b、810c(カメラ20a、20b、20cにより得られた元画像)に対応する。すなわち、補正後領域分離2値化画像1410a、1410bが相互に隣接するものであり、補正後領域分離2値化画像1410b、1410cが相互に隣接するものである。ここでは、これらの補正後領域分離2値化画像1410a、1410b、1410cを合成する場合を例に挙げて説明する。
[Image composition unit 104]
The
FIG. 15 is a diagram for explaining an example of a method for combining and displaying the corrected region-separated binary image.
In FIG. 15, the post-correction region
まず、画像合成部104は、補正後領域分離2値化画像1410a、1410bを、基準となる補正後領域分離2値化画像1410bの大きさに合わせて拡縮する。
本実施形態では、画像合成部104は、補正後領域分離2値化画像1410bに含まれるブロブ群のうち、合成位置決定部103により決定された位置合わせを行うブロブ群のX軸方向における両端の鋼管対応ブロブの重心の長さ(図13の長さWを参照)の算術平均値を導出する。以下の説明では、この長さを必要に応じて基準長さと称する。
同様に、画像合成部104は、補正後領域分離2値化画像1410a、1410cに含まれるブロブ群のうち、合成位置決定部103により決定された位置合わせを行うブロブ群のX軸方向における両端の鋼管対応ブロブの重心の長さの算術平均値をそれぞれ導出する。以下の説明では、この長さを必要に応じて比較対象長さと称する。
First, the
In the present embodiment, the
Similarly, the
そして、画像合成部104は、補正後領域分離2値化画像1410aにおける比較対象長さと基準長さとの比に応じて、補正後領域分離2値化画像1410bの大きさに合うように、補正後領域分離2値化画像1410aの大きさを拡縮する。
同様に、画像合成部104は、補正後領域分離2値化画像1410cにおける比較対象長さと基準長さとの比に応じて、補正後領域分離2値化画像1410bの大きさに合うように、補正後領域分離2値化画像1410cの大きさを拡縮する。
このように補正後領域分離2値化画像1410a、1410cの大きさを補正後領域分離2値化画像1410bの大きさに合うように拡縮することにより、カメラ20a、20b、20cのZ軸方向の位置のずれ等を補正することができる。
Then, the
Similarly, the
In this way, the size of the post-correction region
次に、画像合成部104は、大きさが拡縮された補正後領域分離2値化画像1410aと、基準となる補正後領域分離2値化画像1410bとを、それらの位置合わせを行うブロブ群の位置が可及的に近くなるように合成する(図15の最上段の左図と中央図を参照)。同様に、画像合成部104は、大きさが拡縮された補正後領域分離2値化画像1410cと、基準となる補正後領域分離2値化画像1410bとを、それらの位置合わせを行うブロブ群の位置が可及的に近くなるように合成する(図15の最上段の右図と中央図を参照)。こうして補正後領域分離2値化画像1410a〜1410cが1つの合成画像1510となる(図15の中段の図を参照)。
画像合成部104は、例えば、CPU、ROM、及びRAMを用いることにより実現される。
Next, the
The
[本数決定部105]
本数決定部105は、画像合成部104で得られた合成画像1510に基づいて、鋼管の本数を決定する。
合成画像1510は、3つの補正後領域分離2値化画像1410a〜1410cを合成したものであるので、同じ鋼管に対応する複数の鋼管対応ブロブが存在することがある。そこで、本数決定部105は、合成画像1510に含まれる鋼管対応ブロブのうち、所定の割合以上、相互に重複している鋼管対応ブロブを、1つを残して削除する。このときに残す鋼管対応ブロブは、例えば、3つの補正後領域分離2値化画像1410a〜1410cに対して予め定められた優先順に従って決めることができる。ここでは、基準となる補正後領域分離2値化画像1410bにおける鋼管対応ブロブを優先的に残すようにする。そして、本数決定部105は、最終的に合成画像1510に残っている鋼管対応ブロブの数を、鋼管10の本数として決定する。
本数決定部105は、例えば、CPU、ROM、及びRAMを用いることにより実現される。
[Number determination unit 105]
The
Since the composite image 1510 is a composite of the three corrected region
The
[出力画像作成部106]
出力画像作成部106は、本数決定部105により鋼管の数を決定する際に使用された鋼管対応ブロブを、カメラ20bで撮像された元画像に合成した画像と、本数決定部105で決定された鋼管10の本数とを含む出力画像1520を表示するための表示データを作成する。鋼管対応ブロブが所定の色で着色されるようにする(図15の最下段に示す黒塗りの部分と「22」と示されている部分を参照)。
また、出力画像作成部106は、合成位置決定部103により、補正後領域分離2値化画像を合成することができないと判定されると、鋼管10の本数を計数することができなかった旨の情報を表示するための表示データを作成する。
出力画像作成部106は、例えば、CPU、ROM、及びRAMを用いることにより実現される。
[出力画像出力部107]
出力画像出力部107は、出力画像作成部106により作成された表示データを、表示装置に出力する。これにより、長尺物本数測定装置100に接続された表示装置(コンピュータディスプレイ)に鋼管10の本数を含む出力画像が表示される。
出力画像出力部107は、例えば、CPU、ROM、RAM、及び通信インターフェースを用いることにより実現される。
[Output Image Creation Unit 106]
The output image creating unit 106 is determined by the
Further, if the output image creation unit 106 determines that the post-correction region separation binary image cannot be synthesized by the synthesis position determination unit 103, the output image creation unit 106 cannot count the number of the
The output image creation unit 106 is realized by using, for example, a CPU, a ROM, and a RAM.
[Output Image Output Unit 107]
The output image output unit 107 outputs the display data created by the output image creation unit 106 to the display device. Thereby, an output image including the number of the
The output image output unit 107 is realized by using, for example, a CPU, a ROM, a RAM, and a communication interface.
(動作フローチャート)
次に、図16のフローチャートを参照しながら、長尺物本数測定装置100の動作の一例を説明する。尚、ここでは、長尺物本数測定装置100は、カメラ20a〜20cで撮像された元画像と、鋼管情報を既に取得しているものとして説明を行う。
まず、ステップS1601において、鋼管抽出部101は、カメラ20a〜20cで撮像された3つの元画像の1つを選択する。
次に、ステップS1602において、鋼管抽出部101は、ステップS1601で選択した元画像から、領域分離2値化画像810a、810b又は810cを作成する(図9を参照)。
(Operation flowchart)
Next, an example of the operation of the long object number measuring apparatus 100 will be described with reference to the flowchart of FIG. Here, the description will be made assuming that the long object number measuring apparatus 100 has already acquired the original image captured by the
First, in step S1601, the steel
Next, in step S1602, the steel
次に、ステップS1603において、鋼管抽出部101は、カメラ20a〜20cで撮像された3つの元画像の全てを選択したか否かを判定する。この判定の結果、カメラ20a〜20cで撮像された3つの元画像の全てを選択していない場合には、ステップS1601に戻り、カメラ20a〜20cで撮像された3つの元画像の全てから、領域分離2値化画像810a、810b、810cを作成するまで、ステップS1601〜S1603の処理を繰り返し行う。
そして、カメラ20a〜20cで撮像された3つの元画像の全てを選択すると、ステップS1604に進む。ステップS1604に進むと、間隔導出部102は、3つの領域分離2値化画像810a、810b、810cの1つを選択する。
Next, in step S1603, the steel
When all three original images captured by the
次に、ステップS1605において、間隔導出部102は、領域分離2値化画像810に含まれる鋼管対応ブロブに基づいて、X軸方向に並んでいるn個以上の鋼管対応ブロブからなるブロブ群を設定する。
次に、ステップS1606において、間隔導出部102は、各ブロブ群のX軸方向に対する傾きを導出する。ここでは、各ブロブ群の両端の2つの鋼管対応ブロブの重心を相互に接続する直線と、X軸方向とのなす角度θの算術平均値を、各ブロブ群のX軸方向に対する傾きとする(図12を参照)。
Next, in step S1605, the interval deriving unit 102 sets a blob group composed of n or more steel pipe-corresponding blobs arranged in the X-axis direction based on the steel pipe-corresponding blobs included in the region-separated
Next, in step S1606, the interval deriving unit 102 derives the inclination of each blob group with respect to the X-axis direction. Here, the arithmetic average value of the angle θ formed by the straight line connecting the gravity centers of the two steel pipe-corresponding blobs at both ends of each blob group and the X-axis direction is defined as the inclination of each blob group with respect to the X-axis direction ( (See FIG. 12).
次に、ステップS1607において、間隔導出部107は、各ブロブ群のX軸方向に対する傾き(角度)の値が0°になるように、各ブロブ群を回動させて、各ブロブ群のX軸方向に対する傾きを補正する。
次に、ステップS1608において、間隔導出部107は、傾きが補正された後の各ブロブ群の間隔割合を導出する。ここでは、各間隔D1〜D5を長さWで割った値(=D1/W、D2/W、D3/W、D4/W、D5/W)を間隔割合とする(図13を参照)。
次に、ステップS1609において、間隔導出部107は、3つの領域分離2値化画像810a、810b、810cの全てを選択したか否かを判定する。この判定の結果、3つの領域分離2値化画像810a、810b、810cの全てを選択していない場合には、ステップS1604に戻る。そして、3つの領域分離2値化画像810a、810b、810cの全てについて、各ブロブ群の間隔割合を導出するまで、ステップS1604〜S1609の処理を繰り返し行う。
Next, in step S1607, the interval deriving unit 107 rotates each blob group so that the value of the inclination (angle) of each blob group with respect to the X-axis direction becomes 0 °, and the X-axis of each blob group. Correct the tilt with respect to the direction.
In step S1608, the interval deriving unit 107 derives the interval ratio of each blob group after the inclination is corrected. Here, values obtained by dividing the intervals D1 to D5 by the length W (= D1 / W, D2 / W, D3 / W, D4 / W, D5 / W) are set as the interval ratio (see FIG. 13).
Next, in step S1609, the interval deriving unit 107 determines whether or not all three region-separated
そして、3つの領域分離2値化画像810a、810b、810cの全てを選択すると、ステップS1610に進む。ステップS1610に進むと、合成位置決定部103は、補正後領域分離2値化画像1410a、1410b、1410c(傾きが補正された後の領域分離2値化画像)のうち、相互に隣接する2つの補正後領域分離2値化画像(例えば、補正後領域分離2値化画像1410a、1410b)の組み合わせを1つ選択する。
次に、ステップS1611において、合成位置決定部103は、ステップS1610で選択した2つの補正後領域分離2値化画像のうち、一方の補正後領域分離2値化画像(例えば、補正後領域分離2値化画像1410a)に含まれるブロブ群を1つ選択する。
次に、ステップS1612において、合成位置決定部103は、ステップS1610で選択した2つの補正後領域分離2値化画像のうち、他方の補正後領域分離2値化画像(例えば、補正後領域分離2値化画像1410b)に含まれるブロブ群を1つ選択する。
When all of the three region-separated
Next, in step S <b> 1611, the composite position determination unit 103 selects one post-correction region separation binarized image (for example, post-correction region separation 2) among the two post-correction region separation binarized images selected in step S <b> 1610. One blob group included in the
Next, in step S <b> 1612, the composite position determination unit 103 selects the other corrected region separation binarized image (for example, corrected region separation 2) among the two corrected region separation binarized images selected in step S <b> 1610. One blob group included in the
次に、図16−2のステップS1613において、合成位置決定部103は、ステップS1611、S1612で選択したブロブ群に属する鋼管対応ブロブの数が同じであるか否かを判定する。この判定の結果、ステップS1611、S1612で選択したブロブ群に属する鋼管対応ブロブの数が同じでない場合には、ステップS1614、S1615を省略して後述するステップS1616に進む。
一方、ステップS1611、S1612で選択したブロブ群に属する鋼管対応ブロブの数が同じである場合には、ステップS1614に進む。ステップS1614に進むと、ステップS1611、S1612で選択したブロブ群の間隔割合が所定の範囲内で一致するか否かを判定する。この判定の結果、ステップS1611、S1612で選択したブロブ群の間隔割合が所定の範囲内で一致しない場合には、ステップS1615を省略して後述するステップS1616に進む。
Next, in step S1613 of FIG. 16-2, the composite position determination unit 103 determines whether or not the number of steel pipe-corresponding blobs belonging to the blob group selected in steps S1611 and S1612 is the same. As a result of this determination, if the number of steel pipe-corresponding blobs belonging to the blob group selected in steps S1611, S1612 is not the same, steps S1614, S1615 are omitted, and the process proceeds to step S1616 described later.
On the other hand, if the number of steel pipe-corresponding blobs belonging to the blob group selected in steps S1611, S1612 is the same, the process proceeds to step S1614. In step S1614, it is determined whether or not the blob group interval ratio selected in steps S1611, S1612 matches within a predetermined range. As a result of the determination, if the interval ratio of the blob group selected in steps S1611, S1612 does not match within a predetermined range, step S1615 is omitted and the process proceeds to step S1616 described later.
一方、ステップS1611、S1612で選択したブロブ群の間隔割合が所定の範囲内で一致する場合には、ステップS1615に進む。ステップS1615に進むと、合成位置決定部103は、ステップS1611、S1612で選択したブロブ群の組み合わせを位置合わせ候補のブロブ群として一時的に記憶する。そして、ステップS1616に進む。
ステップS1616に進むと、合成位置決定部103は、ステップS1610で選択した2つの補正後領域分離2値化画像のうち、他方の補正後領域分離2値化画像に含まれるブロブ群の全てを選択したか否かを判定する。この判定の結果、ステップS1610で選択した2つの補正後領域分離2値化画像のうち、他方の補正後領域分離2値化画像に含まれるブロブ群の全てを選択していない場合には、図16−1のステップS1612に戻る。
On the other hand, if the interval ratios of the blob groups selected in steps S1611, S1612 match within a predetermined range, the process proceeds to step S1615. In step S1615, the composite position determination unit 103 temporarily stores the blob group combination selected in steps S1611 and S1612 as a blob group of alignment candidates. Then, the process proceeds to step S1616.
In step S1616, the composite position determination unit 103 selects all the blob groups included in the other corrected region separation binarized image from the two corrected region separation binarized images selected in step S1610. Determine whether or not. As a result of this determination, if all of the blob groups included in the other corrected region separation binarized image selected in step S1610 are not selected, The process returns to step S1612 of 16-1.
そして、一方の補正後領域分離2値化画像のブロブ群の1つと、他方の補正後領域分離2値化画像のブロブ群の全てとのそれぞれの組み合わせが、位置合わせ候補のブロブ群になるか否かを判定するまで、ステップS1612〜ステップS1616の処理を繰り返し行う。そして、ステップS1610で選択した2つの補正後領域分離2値化画像のうち、他方の補正後領域分離2値化画像に含まれるブロブ群の全てを選択すると、ステップS1617に進む。
ステップS1617に進むと、合成位置決定部103は、ステップS1610で選択した2つの補正後領域分離2値化画像のうち、一方の補正後領域分離2値化画像に含まれるブロブ群の全てを選択したか否かを判定する。この判定の結果、ステップS1610で選択した2つの補正後領域分離2値化画像のうち、一方の補正後領域分離2値化画像に含まれるブロブ群の全てを選択していない場合には、図16−1のステップS1611に戻る。そして、一方の補正後領域分離2値化画像のブロブ群と、他方の補正後領域分離2値化画像のブロブ群の全ての組み合わせが、位置合わせ候補のブロブ群になるか否かを判定するまで、ステップS1611〜ステップS1617の処理を繰り返し行う。そして、ステップS1610で選択した2つの補正後領域分離2値化画像のうち、一方の補正後領域分離2値化画像に含まれるブロブ群の全てを選択すると、ステップS1618に進む。
Then, whether each blob group of one post-correction region separation binarized image and all of the blob groups of the other post-correction region separation binarized image becomes a blob group of registration candidates. Until the determination is made, the processing from step S1612 to step S1616 is repeated. When all the blob groups included in the other corrected region separation binarized image selected from the two corrected region separation binarized images selected in step S1610 are selected, the process proceeds to step S1617.
In step S1617, the composite position determination unit 103 selects all of the blob groups included in one post-correction region separation binarized image from the two post-correction region separation binarized images selected in step S1610. Determine whether or not. As a result of this determination, if not all of the blob groups included in one post-correction region separation binarized image are selected from the two post-correction region separation binarized images selected in step S1610, FIG. The process returns to step S1611 of 16-1. Then, it is determined whether or not all combinations of the blob group of one post-correction region separation binarized image and the blob group of the other post-correction region separation binarized image become a blob group of alignment candidates. Until then, the processing of step S1611 to step S1617 is repeated. When all the blob groups included in one post-correction region separation binarized image are selected from the two post-correction region separation binarized images selected in step S1610, the process proceeds to step S1618.
ステップS1618に進むと、合成位置決定部103は、位置合わせ候補のブロブ群の組み合わせがあるか否かを判定する。この判定の結果、位置合わせ候補のブロブ群の組み合わせが1つもない場合には、補正後領域分離2値化画像を合成することができず、鋼管10の本数を計数することができない。そこで、ステップS1619において、出力画像作成部106は、鋼管10の本数を計数することができなかった旨の情報を表示するための表示データを作成する。そして、出力画像出力部107は、当該表示データを、表示装置に出力してエラー表示を行う。そして、図16のフローチャートによる処理を終了する。
一方、位置合わせ候補のブロブ群の組み合わせがある場合には、ステップS1620に進む。ステップS1620に進むと、合成位置決定部103は、位置合わせ候補のブロブ群の組み合わせが複数あるか否かを判定する。この判定の結果、位置合わせ候補のブロブ群の組み合わせが複数ある場合には、後述するステップS1631に進む。
In step S1618, the composite position determination unit 103 determines whether there is a combination of alignment candidate blobs. As a result of this determination, if there is no combination of alignment candidate blobs, the post-correction region separation binarized image cannot be synthesized, and the number of
On the other hand, if there is a combination of alignment candidate blobs, the process advances to step S1620. In step S1620, the composite position determination unit 103 determines whether there are a plurality of combinations of alignment candidate blobs. As a result of the determination, if there are a plurality of combinations of alignment candidate blobs, the process proceeds to step S1631 described later.
一方、位置合わせ候補のブロブ群の組み合わせが複数ない場合には、位置合わせ候補のブロブ群の組み合わせは1つである。そこで、ステップS1621に進み、合成位置決定部103は、当該位置合わせ候補のブロブ群の組み合わせを、位置合わせを行うブロブ群として決定する。
次に、図16−3のステップS1622において、合成位置決定部103は、補正後領域分離2値化画像1410a、1410b、1410cのうち、相互に隣接する2つの補正後領域分離2値化画像の組み合わせを全て選択したか否かを判定する。この判定の結果、相互に隣接する2つの補正後領域分離2値化画像の組み合わせを全て選択していない場合には、図16−1のステップS1610に戻る。そして、相互に隣接する2つの補正後領域分離2値化画像の組み合わせの全てについて、位置合わせを行うブロブ群を決定するまで、ステップS1610〜S1622の処理を繰り返し行う。
On the other hand, when there are not a plurality of alignment candidate blob group combinations, the number of alignment candidate blob groups is one. Therefore, the process proceeds to step S1621, and the composite position determination unit 103 determines a combination of the blob groups of the alignment candidates as a blob group to be aligned.
Next, in step S1622 in FIG. 16C, the composite position determination unit 103 selects two corrected region separation binarized images adjacent to each other among the corrected region
そして、相互に隣接する2つの補正後領域分離2値化画像の組み合わせを全て選択すると、ステップS1623に進む。ステップS1623に進むと、画像合成部104は、基準となる補正後領域分離2値化画像1410b以外の補正後領域分離2値化画像1410a、1410bの1つを選択する。
次に、ステップS1624において、画像合成部104は、ステップS1523で選択した領域分離2値化画像1410a又は1410bを、基準となる補正後領域分離2値化画像1410bの大きさに合わせて拡縮する。
When all the combinations of two post-correction region separation binary images adjacent to each other are selected, the process proceeds to step S1623. In step S 1623, the
Next, in step S1624, the
次に、ステップS1625において、画像合成部104は、基準となる補正後領域分離2値化画像1410b以外の補正後領域分離2値化画像1410a、1410bの全てを選択したか否かを判定する。この判定の結果、基準となる補正後領域分離2値化画像1410b以外の補正後領域分離2値化画像1410a、1410bの全てを選択していない場合には、ステップS1623に戻る。そして、基準となる補正後領域分離2値化画像1410b以外の補正後領域分離2値化画像1410a、1410bの全てを、基準となる補正後領域分離2値化画像1410bの大きさに合わせて拡縮するまで、ステップS1623〜S1625の処理を繰り返し行う。
そして、基準となる補正後領域分離2値化画像1410b以外の補正後領域分離2値化画像1410a、1410bの全てを選択すると、ステップS1626に進む。ステップS1626に進むと、画像合成部104は、大きさが拡縮された補正後領域分離2値化画像1410a、1410bと基準となる補正後領域分離2値化画像1410bとを、それらの位置合わせを行うブロブ群の位置が可及的に近くなるようにそれぞれ合成して合成画像1510を作成する(図15の最上段及び中段の図を参照)。
Next, in step S1625, the
When all of the post-correction region
次に、ステップS1627において、本数決定部105は、合成画像1510に含まれる鋼管対応ブロブのうち、所定の割合以上、相互に重複している鋼管対応ブロブを、1つを残して削除する。
次に、ステップS1628において、本数決定部105は、最終的に合成画像1510に残っている鋼管対応ブロブの数を、鋼管10の本数として決定する。
次に、ステップS1629において、出力画像作成部106は、本数決定部105により鋼管の数を決定する際に使用された鋼管対応ブロブを、カメラ20bで撮像された元画像に合成した画像と、本数決定部105で決定された鋼管10の本数とを含む出力画像1520を表示するための表示データを作成する。
そして、ステップS1630において、出力画像出力部107は、ステップS1629で作成された表示データを、表示装置に出力する(図15の最下段の図を参照)。そして、図16のフローチャートによる処理を終了する。
Next, in step S <b> 1627, the
Next, in step S1628, the
Next, in step S <b> 1629, the output image creating unit 106 combines the steel pipe-corresponding blob used when the
In step S1630, the output image output unit 107 outputs the display data created in step S1629 to the display device (see the lowermost diagram in FIG. 15). And the process by the flowchart of FIG. 16 is complete | finished.
前述したように、図16−2のステップS1620において、位置合わせ候補のブロブ群の組み合わせが複数ある場合には、ステップS1631に進む。
ステップS1631に進むと、合成位置決定部103は、ステップS1610で選択された2つの補正後領域分離2値化画像のうち、一方の補正後領域分離2値化画像に含まれる位置合わせ候補のブロブ群から、2つのブロブ群(ブロブ群のペア)を選択する。
次に、ステップS1632において、合成位置決定部103は、ステップS1610で選択された2つの補正後領域分離2値化画像のうち、他方の補正後領域分離2値化画像に含まれる位置合わせ候補のブロブ群から、ステップS1631に対応する2つのブロブ群(ブロブ群)を選択する。
As described above, in step S1620 of FIG. 16B, if there are a plurality of combinations of alignment candidate blobs, the process proceeds to step S1631.
In step S1631, the composite position determination unit 103 selects the alignment candidate blobs included in one post-correction region separation binarized image of the two post-correction region separation binarized images selected in step S1610. From the group, select two blob groups (a pair of blob groups).
Next, in step S1632, the composite position determination unit 103 determines the registration candidate included in the other corrected region separation binarized image among the two corrected region separation binarized images selected in step S1610. From the blob group, two blob groups (blob group) corresponding to step S1631 are selected.
次に、ステップS1633において、合成位置決定部103は、ステップS1631で選択した2つのブロブ群のY軸方向の間隔と、ステップS1632で選択した2つのブロブ群のY軸方向の間隔とを導出する。
次に、図16−3のステップS1634において、合成位置決定部103は、ステップS1631で選択した2つのブロブ群のY軸方向の間隔と、ステップS1632で選択した2つのブロブ群のY軸方向の間隔とが所定の範囲内で一致するか否かを判定する。この判定の結果、ステップS1631で選択した2つのブロブ群のY軸方向の間隔と、ステップS1632で選択した2つのブロブ群のY軸方向の間隔とが所定の範囲内で一致しない場合には、ステップS1635に進む。ステップS1635に進むと、出力画像作成部106は、鋼管10の本数を計数することができなかった旨の情報を表示するための表示データを作成する。そして、出力画像出力部107は、当該表示データを、表示装置に出力してエラー表示を行う。そして、図16のフローチャートによる処理を終了する。
Next, in step S1633, the composition position determination unit 103 derives the interval between the two blob groups selected in step S1631 in the Y-axis direction and the interval between the two blob groups selected in step S1632 in the Y-axis direction. .
Next, in step S1634 of FIG. 16-3, the composite position determination unit 103 determines the interval between the two blob groups selected in step S1631 in the Y-axis direction and the Y-axis direction of the two blob groups selected in step S1632. It is determined whether or not the interval matches within a predetermined range. As a result of the determination, if the interval between the two blob groups selected in step S1631 in the Y-axis direction and the interval between the two blob groups selected in step S1632 do not match within a predetermined range, The process proceeds to step S1635. In step S1635, the output image creation unit 106 creates display data for displaying information indicating that the number of
一方、ステップS1631で選択した2つのブロブ群のY軸方向の間隔と、ステップS1632で選択した2つのブロブ群のY軸方向の間隔とが所定の範囲内で一致する場合には、ステップS1636に進む。ステップS1636に進むと、合成位置決定部103は、ステップS1610で選択された2つの補正後領域分離2値化画像のうち、一方の補正後領域分離2値化画像に含まれる位置合わせ候補のブロブ群から、2つのブロブ群の組み合わせを全て選択したか否かを判定する。
この判定の結果、ステップS1610で選択された2つの補正後領域分離2値化画像のうち、一方の補正後領域分離2値化画像に含まれる位置合わせ候補のブロブ群から、2つのブロブ群の組み合わせを全て選択していない場合には、図16−2のステップS1631に戻る。そして、一方の補正後領域分離2値化画像に含まれる位置合わせ候補の2つのブロブ群の全ての組み合わせと、それらの組み合わせに対応する2つのブロブ群であって、他方の補正後領域分離2値化画像に含まれる位置合わせ候補の2つのブロブ群の全ての組み合わせと、のそれぞれについてY軸方向の間隔が所定の範囲内で一致するか否かを判定するまで、ステップS1631〜S1636の処理を繰り返し行う。
On the other hand, if the interval between the two blob groups selected in step S1631 in the Y-axis direction and the interval between the two blob groups selected in step S1632 match within a predetermined range, the process proceeds to step S1636. move on. In step S1636, the composite position determination unit 103 selects the alignment candidate blobs included in one post-correction region separation binarized image of the two post-correction region separation binarized images selected in step S1610. It is determined whether all combinations of two blob groups have been selected from the group.
As a result of this determination, among the two corrected region separation binarized images selected in step S1610, from the blob group of alignment candidates included in one of the corrected region separation binarized images, two blob groups are obtained. If not all combinations have been selected, the process returns to step S1631 in FIG. Then, all combinations of two blob groups of alignment candidates included in one post-correction region separation binarized image and two blob groups corresponding to these combinations, the other post-correction region separation 2 Processing in steps S1631 to S1636 until it is determined whether or not the intervals in the Y-axis direction for all combinations of two blob groups of alignment candidates included in the binarized image match within a predetermined range. Repeat.
そして、一方の補正後領域分離2値化画像に含まれる位置合わせ候補のブロブ群から、2つのブロブ群の組み合わせを全て選択すると、ステップS1637に進む。ステップS1637に進むと、合成位置決定部103は、位置合わせ候補のブロブ群の全てを、位置合わせを行うブロブ群として決定する。そして、前述したステップS1622に進む。 When all the combinations of two blob groups are selected from the blob groups of alignment candidates included in one post-correction region separation binary image, the process proceeds to step S1637. In step S1637, the composite position determination unit 103 determines all blob groups that are alignment candidates as blob groups to be aligned. Then, the process proceeds to step S1622 described above.
(まとめ)
以上のように本実施形態では、カメラ20a〜20cで撮像された元画像のそれぞれに対して画像処理を行って、鋼管10の夫々に対応する領域が相互に分離されて表現された2値化画像である補正後領域分離2値化画像1410a〜1410cを作成する。そして、補正領域分離2値化画像1410a〜1410cのうち、相互に隣接する領域分離2値化画像から、相互に対応するブロブ群1411b、1412a等を導出し、当該ブロブ群同士が合うように、領域分離2値化画像1410a〜1410cを合成して合成画像1510を作成する。この合成画像1510に基づいて鋼管10の本数を決定する。したがって、カメラ20a〜20cの死角となる領域を、他のカメラ20a〜20cで得られる元画像で補うことができると共に、カメラ20a〜20cで得られた元画像において照明が十分に当たらずに十分な輝度が得られていない元画像の領域を、他のカメラ20a〜20cで得られる元画像で補うことができる。したがって、段積みされている複数の鋼管の一部の先端が他の鋼管よりも後退した状態であっても、当該段積みされている複数の鋼管の本数を自動的に且つ正確に測定することができる。
(Summary)
As described above, in this embodiment, image processing is performed on each of the original images captured by the
また、本実施形態では、領域分離2値化画像810a〜810cにおけるブロブ群の傾きを補正した補正後領域分離2値化画像1410a〜1410cを作成すると共に、補正領域分離2値化画像1410bの大きさに合うように補正領域分離2値化画像1410a、1410cを拡縮した。したがって、カメラ20a〜20cの配置や光学系のずれに基づく画像のずれを補正することができる。したがって、当該段積みされている複数の鋼管の本数をより正確に測定することができる。
In this embodiment, post-correction region
(変形例)
本実施形態では、本数決定部105により鋼管の数を決定する際に使用された鋼管対応ブロブを、カメラ20bで撮像された元画像に合成する場合を例に挙げて説明した(ステップS1629)。しかしながら、必ずしもこのようにする必要はない。その一例を以下に説明する。
(Modification)
In the present embodiment, the case where the steel pipe corresponding blob used when the
図17は、本数決定部105により鋼管の数を決定する際に使用された鋼管対応ブロブを、元画像に合成する方法の変形例を示す図である。
まず、本数決定部105は、前述したように、画像合成部104で得られた合成画像1510に含まれる鋼管対応ブロブのうち、所定の割合以上、相互に重複している鋼管対応ブロブを、1つを残して削除する。
FIG. 17 is a diagram showing a modification of the method for synthesizing the steel pipe-corresponding blob used when the
First, as described above, the
次に、本数決定部105は、鋼管対応ブロブを削除した合成画像に含まれる鋼管対応ブロブのそれぞれを、それらの重心の位置を変えずに同じ割合で拡大させる(図17の最上段の図の矢印線を参照)。本数決定部105は、このような鋼管対応ブロブの拡大を、他の鋼管対応ブロブの何れかと接触するまで行う(図17の中段の図の矢印線を参照)。
次に、本数決定部105は、拡大し終えた鋼管対応ブロブに外接する矩形を導出し、導出した矩形を、その重心の位置を変えずに所定の長さだけ拡大させる(図17の最下段の図の破線を参照)。
次に、本数決定部105は、合成画像をY軸方向において3等分した3つの領域のうち、最も上にある領域1710aに対応する座標を、矩形内の鋼管対応ブロブの位置から割り出し、割り出した座標の範囲にある部分を、最も上に配置されたカメラ20aで撮像された元画像から抽出する。同様に、本数決定部105は、真ん中にある領域1710bに対応する座標を、矩形内の鋼管対応ブロブの位置から割り出し、割り出した座標の範囲にある部分を、真ん中に配置されたカメラ20bで撮像された元画像から抽出し、さらに、最も下にある領域1710cに対応する座標を、矩形内の鋼管対応ブロブの位置から割り出し、割り出した座標の範囲にある部分を、最も下に配置されたカメラ20cで撮像された元画像から抽出する。そして、本数決定部105は、抽出した画像を張り合わせ、当該張り合わせた画像に、本数決定部105により鋼管の数を決定する際に使用された鋼管対応ブロブを合成する。以上のようにして、鋼管対応ブロブを元画像に合成してもよい。
Next, the
Next, the
Next, the
また、本実施形態では、領域分離2値化画像810a〜810cにおけるブロブ群の傾きを補正した補正後領域分離2値化画像1410a〜1410cを作成すると共に、補正領域分離2値化画像1410bの大きさに合うように補正領域分離2値化画像1410a、1410cを拡縮した。しかしながら、カメラ20a〜20cの配置や光学系のずれがない(Y軸方向の位置以外のカメラ20a〜20cの条件が完全に同じであると見なせる)場合には、これらの処理は必ずしも行う必要はない。
In this embodiment, post-correction region
また、本実施形態では、3つのカメラ20a〜20cをY軸方向(高さ方向)に並べ、Y軸方向で画像を合成する場合を例に挙げて説明した。しかしながら、複数のカメラをX軸方向に並べ、X軸方向で画像を合成してもよい。このようにする場合、X軸とY軸を逆にして考えれば、本実施形態と同様にして実現することができる。また、複数のカメラをX軸方向とY軸方向の双方に並べ(すなわち、複数のカメラをマトリックス状に並べ)、X軸方向及びY軸方向の双方で画像を合成してもよい。
In the present embodiment, the case where the three
また、本実施形態では、3つのカメラ20a〜20cを用いる場合を例に挙げて説明した。しかしながら、必ずしもこのようにする必要はない。例えば、1つのカメラを用いてもよい。このようにした場合には、当該カメラを、各カメラ20a〜20cの位置に移動させ、それぞれの位置おいて、元画像を撮像することができる。
In the present embodiment, the case where the three
また、本実施形態では、相互に隣接する2つの鋼管対応ブロブ1001の間隔D1〜D5を、X軸方向における両端の鋼管対応ブロブ1001a、1001fの重心1101a、1101fの長さWで割った値を、間隔情報とした場合を例に挙げて説明した。しかしながら、必ずしもこのようにする必要はない。例えば、カメラ20a〜20cの配置や光学系のずれがない(Y軸方向の位置以外のカメラ20a〜20cの条件が完全に同じであると見なせる)場合には、間隔D1〜D5そのものを間隔情報としてもよいし、長さWを間隔情報としてもよい。
Further, in the present embodiment, a value obtained by dividing the distances D1 to D5 between two steel pipe-corresponding
また、本実施形態では、地面に対して水平な直線又は地面に対して垂直な直線に平行な「ブロブ411の4つの接線」により囲まれる矩形と、当該直線を時計回りの方向に22[°]、44[°]傾けた直線に平行な「ブロブ411の4つの接線」により囲まれる2つの矩形と、を求めるようにした。しかしながら、ブロブ411の4つの接線の決め方は、このようなものに限定されない。
また、パイプ判定条件式は、前述したもの((1)式〜(8)式)に限定されない。
In this embodiment, a rectangle surrounded by “four tangents of the
Further, the pipe determination conditional expression is not limited to the above-described expression (expressions (1) to (8)).
また、ブロブ411を固定した状態で、ブロブ411の径を複数の箇所で求め、それらの径が、所定の範囲内に入るか否かを判定するようにしていれば、必ずしも、ブロブ411に対して外接する矩形を導出する必要はない。
また、前述したように、ブロブの中から、鋼管10とは明らかに異なるものを排除するのが好ましいが、必ずしも鋼管10とは明らかに異なるものを排除する必要はない。このようにした場合には、鋼管候補抽出部101f、鋼管判定部101g、及び領域分離2値化画像作成部101hが不要になり、ブロブ処理部101eで得られた結果から、領域分離2値化画像が得られる。
In addition, if the diameter of the
Further, as described above, it is preferable to exclude those that are clearly different from the
<第2の実施形態>
次に、本発明の第2の実施形態について説明する。前述した第1の実施形態では、計数対象の鋼管10がパイプ状である場合を例に挙げて説明した。これに対し、本実施形態では、端面が開口していない状態であり且つ所定の色で着色されている状態の長尺物である場合を例に挙げて説明する。このようなものの一例として、端面にキャップがつけられた鋼管や、端面が地色と異なる所定の色で着色された棒鋼等がある。
<Second Embodiment>
Next, a second embodiment of the present invention will be described. In the first embodiment described above, the case where the
このようにする場合には、特願2012−187969号明細書に記載の技術を用いて鋼管抽出部101を構成することは容易でない。そこで、本実施形態では、本出願人が提案した特願2012−173112号明細書の技術を用いて鋼管抽出部101を構成する場合を例に挙げて説明する。このように本実施形態と第1の実施形態とは、鋼管抽出部101の構成及び処理が主として異なる。したがって、本実施形態の説明において、第1の実施形態と同一の部分については、図1〜図17に付した符号と同一の符号を付す等して詳細な説明を省略する。
In this case, it is not easy to configure the steel
図18は、鋼管抽出部1801の詳細な機能構成の一例を示すブロック図である。鋼管抽出部1801は、第1の実施形態の鋼管抽出部101に置き替わるものである。尚、鋼管抽出部101は、例えば、CPU、ROM、RAM、ユーザインターフェース、及び通信インターフェースを用いることにより実現される。以下に、特願2012−173112号明細書に記載の技術に基づいた鋼管抽出部1801の構成及び処理の一例について説明する。尚、ここでは、計数の対象となる鋼管が、端面に赤色のキャップがつけられた鋼管である場合を例に挙げて説明する。
FIG. 18 is a block diagram illustrating an example of a detailed functional configuration of the steel pipe extraction unit 1801. The steel pipe extraction unit 1801 is replaced with the steel
端面色情報取得部1801aは、計数対象となる長尺物(鋼管10)の端面の色を示す情報を、上位コンピュータ200から取得する。尚、以下の説明では、「計数対象となる長尺物(鋼管20)の端面の色を示す情報」を必要に応じて「端面色情報」と称する。端面色情報取得部1801aは、上位コンピュータ200に要求を行うことにより端面色情報を取得しても、要求を行わずに上位コンピュータ200から端面色情報を取得してもよい。この他、バーコードリーダにより読み取ったQRコード(2次元バーコード)に含まれる端面色情報を取得してもよい。
前述したように、本実施形態では、キャップの色は赤色である。よって、端面色情報取得部1801aは、端面色情報として赤色であることを示す情報を取得する。
The end surface color information acquisition unit 1801a acquires information indicating the color of the end surface of the long object (steel pipe 10) to be counted from the host computer 200. In the following description, “information indicating the color of the end face of the long object (steel pipe 20) to be counted” is referred to as “end face color information” as necessary. The end face color information acquisition unit 1801a may acquire end face color information by making a request to the host computer 200 or may acquire end face color information from the host computer 200 without making a request. In addition, end face color information included in a QR code (two-dimensional barcode) read by a barcode reader may be acquired.
As described above, in the present embodiment, the color of the cap is red. Therefore, the end face color information acquisition unit 1801a acquires information indicating red as the end face color information.
色空間要素選択部1801bは、端面色情報取得部1801aにより取得された端面色情報により特定される色に対応する「色空間の要素」を色空間要素選択テーブルから選択する。
図19は、色空間要素選択テーブルの一例を示す図である。
図19に示すように、色空間要素選択テーブル1900には、色と、第1の色空間要素と、第2の色空間要素とが相互に関連付けられて登録されている。
The color space
FIG. 19 is a diagram illustrating an example of a color space element selection table.
As shown in FIG. 19, the color, the first color space element, and the second color space element are registered in the color space element selection table 1900 in association with each other.
色空間要素選択テーブル1900における「色」は、端面色情報により特定される色を指す。よって、色空間要素選択テーブル1900における「色」として、端面色情報により特定される色として想定される色が予め設定される。
また、「第1の色空間要素」、「第2の色空間要素」は、後述するようにして元画像取得部1801cにより取得される画像から選択する「色空間の要素」を示す。
「第1の色空間要素」としては、鋼管の端面(キャップ)の領域の色(端面色情報により特定される色)である場合と、鋼管(キャップ)の背景の色である場合とで(可及的に大きく)異なる値をとる要素が予め設定される。
「第2の色空間要素」としては、鋼管の端面(キャップ)の領域の色(端面色情報により特定される色)であるときの値と、それらの間の隙間の領域の色(ここでは黒色)であるときの値との差が第1の色空間要素におけるものよりも大きくなる要素が予め設定される。また、「第2の色空間要素」としては、鋼管の端面(キャップ)の色のムラによって値が大きく変化しない要素が好ましい。
“Color” in the color space element selection table 1900 indicates a color specified by the end face color information. Therefore, a color assumed as a color specified by the end face color information is set in advance as “color” in the color space element selection table 1900.
Also, “first color space element” and “second color space element” indicate “color space elements” selected from images acquired by the original
The “first color space element” includes a case where the color is the color of the end face (cap) region of the steel pipe (the color specified by the end face color information) and the case where the color is the background color of the steel pipe (cap) ( Elements having different values (as large as possible) are preset.
As the “second color space element”, the value when the color of the end face (cap) region of the steel pipe (the color specified by the end face color information) and the color of the gap region between them (here, Elements in which the difference from the value at the time of (black) is larger than that in the first color space element are preset. The “second color space element” is preferably an element whose value does not change greatly due to unevenness in the color of the end face (cap) of the steel pipe.
図19に示す色空間要素選択テーブル1900では、端面色情報により特定される色が赤色である場合には、第1の色空間要素として、CIE Lab色空間のa*が選択され、第2の色空間要素として、RGB色空間のRが選択される。また、端面色情報により特定される色が緑色である場合には、第1の色空間要素として、CIE Lab色空間のa*が選択され、第2の色空間要素として、RGB色空間のGが選択される。また、端面色情報により特定される色が黄色である場合には、第1の色空間要素として、HSV色空間のV(明度)が選択され、第2の色空間要素として、RGB色空間のRが選択される。また、端面色情報により特定される色が白色である場合には、第1の色空間要素として、HSV色空間のV(明度)が選択され、第2の色空間要素として、RGB色空間のRが選択される。
前述したように、本実施形態では、キャップの色が赤色であるので、端面色情報により特定される色は赤色である。よって、色空間要素選択部1801bは、色空間要素選択テーブル1900から、第1の色空間要素としてCIE Lab色空間のa*を、第2の色空間要素としてRGB色空間のRを、それぞれ選択する。
In the color space element selection table 1900 shown in FIG. 19, when the color specified by the end face color information is red, a * of the CIE Lab color space is selected as the first color space element, and the second R of the RGB color space is selected as the color space element. When the color specified by the end face color information is green, a * in the CIE Lab color space is selected as the first color space element, and G in the RGB color space is selected as the second color space element. Is selected. When the color specified by the end face color information is yellow, V (brightness) of the HSV color space is selected as the first color space element, and the RGB color space is selected as the second color space element. R is selected. When the color specified by the end face color information is white, V (brightness) of the HSV color space is selected as the first color space element, and the RGB color space is selected as the second color space element. R is selected.
As described above, in this embodiment, since the cap color is red, the color specified by the end face color information is red. Therefore, the color space
元画像取得部1801cは、カメラ20a〜20cで撮像された元画像を個別に取得する。本実施形態では、元画像は、RGB色空間で表現される画像であるものとする。
The original
第1のグレースケール画像作成部1801dは、元画像取得部1801cにより取得された元画像のそれぞれの画素のデータから、色空間要素選択部1801bにより選択された第1の色空間要素の値を導出し、それぞれの画素が、当該第1の色空間要素の値に応じた画素値を有するグレースケールの画像を作成する。第1のグレースケール画像作成部1801dにより作成されるグレースケールの画像を、以下の説明では必要に応じて「第1のグレースケール画像」と称する。
The first grayscale image creation unit 1801d derives the value of the first color space element selected by the color space
図20は、第1のグレースケール画像の一例を示す図である。
前述したように、第1の色空間要素は、鋼管の端面(キャップ)の領域の色(端面色情報により特定される色)である場合と、鋼管(キャップ)の背景の色である場合とで異なる値をとる要素である。よって、図20に示すように、赤色であるキャップの領域(キャップが写し出されている領域)の画素値が、他の赤色以外の色の領域の画素値と(大きく)異なる第1のグレースケール画像2000が得られる。
FIG. 20 is a diagram illustrating an example of the first grayscale image.
As described above, the first color space element is the color of the end face (cap) region of the steel pipe (the color specified by the end face color information) and the background color of the steel pipe (cap). Is an element that takes different values. Therefore, as shown in FIG. 20, the first gray scale in which the pixel value of the red cap region (the region where the cap is projected) is (largely) different from the pixel values of the other non-red color regions. An
グレースケール2値化画像作成部1801eは、第1のグレースケール画像作成部1801dにより作成された第1のグレースケール画像の各画素の画素値を、予め設定された閾値に基づいて2値化する。具体例を説明すると、色空間要素選択部1801bにより選択された第1の色空間要素に応じて、グレースケール2値化画像作成部1801eは、第1のグレースケール画像の各画素について、画素値が所定の範囲内(又は所定の範囲外)である画素に論理「1」を割り当て、画素値が当該所定の範囲外(又は所定の範囲内)である画素に論理「0」を割り当てることにより第1のグレースケール画像を2値化することができる。本実施形態では、端面色情報により特定される色(ここでは赤色)に応じた画素値を有する画素に可及的に論理「1」が割当てられ、それ以外の色に応じた画素値を有する画素に可及的に論理「0」が割当てられるようにするための閾値が、オペレータによる操作に基づいて予め設定されている。以下の説明では、グレースケール2値化画像作成部1801eにより作成される2値化された画像を、必要に応じて「グレースケール2値化画像」と称する。
The grayscale binarized image creation unit 1801e binarizes the pixel value of each pixel of the first grayscale image created by the first grayscale image creation unit 1801d based on a preset threshold value. . To describe a specific example, in accordance with the first color space element selected by the color space
図21は、グレースケール2値化画像の一例を示す図である。図21に示すグレースケール2値化画像2100は、図20に示した第1のグレースケール画像2000から得られたものである。
図21に示すように、グレースケール2値化画像600では、概ね、キャップの領域に論理「1」が割当てられ(図21のグレーで塗りつぶされている領域を参照)、且つ、それ以外の領域に論理「0」が割当てられる(図21の白色の領域を参照)。
尚、2値化処理の前にシェーディング補正を行うようにしてもよい。
FIG. 21 is a diagram illustrating an example of a grayscale binarized image. A grayscale
As shown in FIG. 21, in the grayscale binarized image 600, logic “1” is generally assigned to the cap area (see the area painted in gray in FIG. 21), and other areas. Is assigned a logic “0” (see the white area in FIG. 21).
Note that shading correction may be performed before the binarization process.
隙間補完後2値化画像作成部1801fは、グレースケール2値化画像作成部1801eにより作成されたグレースケール2値化画像において、画素値が「1」である領域に囲まれている「画素値が「0」である領域」の画素値を「1」に変更する。
以下の説明では、隙間補完後2値化画像作成部1801fにより画素値が変更されたグレースケール2値化画像を、必要に応じて「隙間補完後2値化画像」と称する。
図22は、隙間補完後2値化画像の一例を示す図である。図22に示す隙間補完後2値化画像2200は、図21に示したグレースケール2値化画像2100から得られたものである。
図22に示すように、図21に示したグレースケール2値化画像2200において、グレーで塗りつぶされている領域(画素値が「1」の領域)に囲まれている白色の領域(画素値が「0」の領域)がグレーで塗りつぶされる(画素値が「0」から「1」に変更される)。このようにすることによって、端面色情報により特定される色(ここでは赤色)が存在する領域(すなわちキャップが存在する一纏まりの領域)を他の領域と明確に区別することができる。
The binarized image creation unit 1801f after gap complementing is a “pixel value” surrounded by an area having a pixel value of “1” in the grayscale binarized image created by the grayscale binarized image creation unit 1801e. The pixel value of “region where is“ 0 ”” is changed to “1”.
In the following description, the grayscale binarized image whose pixel value has been changed by the gap-compensated binarized image creation unit 1801f is referred to as a “gap-compensated binarized image” as necessary.
FIG. 22 is a diagram illustrating an example of the binarized image after gap complementation. A gap-compensated
As shown in FIG. 22, in the grayscale
第2のグレースケール画像作成部1801gは、元画像取得部1801cにより取得された元画像のそれぞれの画素のデータから、色空間要素選択部1801bにより選択された第2の色空間要素の値を導出し、それぞれの画素が、当該第2の色空間要素の値に応じた画素値を有するグレースケールの画像を作成する。第2のグレースケール画像作成部1801gにより作成されるグレースケールの画像を、以下の説明では必要に応じて「第2のグレースケール画像」と称する。
The second grayscale
図23は、第2のグレースケール画像の一例を示す図である。
前述したように、第2の色空間要素は、色のムラによって値が大きく変化せず、且つ、鋼管の端面(キャップ)の領域の色(端面色情報により特定される色)であるときの値と、それらの間の隙間の領域の色(ここでは黒色)であるときの値との差が第1の色空間要素におけるものよりも大きくなる要素である。よって、図23に示すように、第2のグレースケール画像2300では、元画像に対し、赤色であるキャップの領域の画素値の差が小さくなり(色むらが低減され)、且つ、キャップの領域の画素値とそれらの隙間の領域の画素値との差が大きくなる。
FIG. 23 is a diagram illustrating an example of the second grayscale image.
As described above, the value of the second color space element does not change greatly due to color unevenness, and is the color of the end face (cap) region of the steel pipe (the color specified by the end face color information). It is an element in which the difference between the value and the value when the color is the color of the gap region between them (here, black) is larger than that in the first color space element. Therefore, as shown in FIG. 23, in the
計数対象領域抽出画像作成部1801hは、第2のグレースケール画像作成部1801gにより作成された第2のグレースケール画像から、領域補完後2値化画像作成部106により作成された隙間補完後2値化画像の画素値が「1」である領域を抽出する。以下の説明では、このようにして計数対象領域抽出画像作成部1801hにより得られる画像を、必要に応じて「計数対象領域抽出画像」と称する。
図24は、計数対象領域抽出画像2400の一例を示す図である。図24に示す計数対象領域抽出画像2400は、図22に示した隙間補完後2値化画像2200と、図23に示した第2のグレースケール画像2300とから得られたものである。
The count target region extraction
FIG. 24 is a diagram illustrating an example of the count target
前述したように、第2のグレースケール画像2300では、第1のグレースケール画像2000に比べて、赤色であるキャップの領域の画素値の差が小さくなり、且つ、キャップの領域の画素値とそれらの隙間の領域の画素値との差が大きくなる。よって、第2のグレースケール画像2300から、計数対象領域抽出画像2400に基づき、キャップの領域を抽出すると、キャップの領域を、当該キャップを際立たせた状態で抽出することができる。
As described above, in the
計数対象領域2値化画像作成部1801iは、計数対象領域抽出画像作成部1801hにより作成された計数対象領域抽出画像2400の各画素の画素値を、予め設定された閾値に基づいて2値化する。具体的に説明すると、色空間要素選択部1801bにより選択された第2の色空間要素に応じて、計数対象領域2値化画像作成部1801iは、計数対象領域抽出画像の各画素について、画素値が所定の範囲内(又は所定の範囲外)である画素に論理「1」を割り当て、画素値が当該所定の範囲外(又は所定の範囲内)である画素に論理「0」を割り当てることにより計数対象領域抽出画像を2値化することができる。本実施形態では、端面色情報により特定される色(ここでは赤色)に応じた画素値を有する画素に可及的に論理「1」が割当てられ、それ以外の色に応じた画素値を有する画素に可及的に論理「0」が割当てられるようにするための閾値が、オペレータによる操作に基づいて予め設定されている。以下の説明では、計数対象領域2値化画像作成部1801iにより作成される2値化された画像を、必要に応じて「計数対象領域2値化画像」と称する。
図25は、計数対象領域2値化画像の一例を示す図である。図25に示す計数対象領域2値化画像2500は、図24に示した計数対象領域抽出画像2400から得られたものである。前述したように、計数対象領域抽出画像2500では、キャップの領域の画素値の差が小さくなり、且つ、キャップの領域の画素値とそれらの隙間の領域の画素値との差が大きくなる。よって、計数対象領域抽出画像2500を2値化すると、キャップの領域と、それらの間の領域とを明確に区別することができる。
The counting target region binarized image creation unit 1801i binarizes the pixel value of each pixel of the counting target
FIG. 25 is a diagram illustrating an example of the count target region binarized image. The count target area
領域分離部1801jは、計数対象領域2値化画像作成部1801iにより作成された計数対象領域2値化画像の画素値が「1」である画素と、当該画素に対し縦、横及び斜めの何れかで隣接する画素であって、画素値が「1」である画素とを1つの領域とすることを計数対象領域2値化画像のそれぞれの画素について行うことにより得られた領域を縮小させることにより、計数対象領域2値化画像を複数の領域(個々のキャップの領域)に分離する。 The region separation unit 1801j includes a pixel whose pixel value of the counting target region binarized image created by the counting target region binarized image creating unit 1801i is “1”, and any of vertical, horizontal, and diagonal to the pixel. The region obtained by performing each pixel of the count target region binarized image to set a pixel having a pixel value of “1” as one region. Thus, the count target area binarized image is separated into a plurality of areas (individual cap areas).
図26は、計数対象領域2値化画像2500を複数の領域に分離する様子の一例を概念的に示す図である。
まず、領域分離部1801jは、画素値が「1」である画素と、当該画素に対し縦、横及び斜めの何れかで隣接する画素であって、画素値が「1」である画素とを1つの領域とすることを計数対象領域2値化画像のそれぞれの画素について行う。これにより、画素値が「1」である画素により構成される閉領域であって、当該外縁の画素に接する画素の少なくとも1つが、画素値が「0」である画素となる閉領域(所謂ブロブ)が導出される。図25に示す例では、計数対象領域2値化画像2500において、グレーで表示されている領域が導出される。
FIG. 26 is a diagram conceptually illustrating an example of a state where the count target region
First, the region separation unit 1801j includes a pixel having a pixel value “1” and a pixel adjacent to the pixel in any one of vertical, horizontal, and diagonal directions, and the pixel value is “1”. One pixel is set for each pixel of the binarized image to be counted. As a result, a closed region composed of pixels having a pixel value of “1”, and at least one of the pixels in contact with the outer edge pixel becomes a pixel having a pixel value of “0” (so-called blob). ) Is derived. In the example shown in FIG. 25, a region displayed in gray in the count target region
次に、領域分離部1801jは、導出した閉領域の外縁の画素に対し、当該外縁の画素を接点とする接線に垂直な方向であって、当該閉領域が存在している方向に、所定の画素数分だけ離隔した位置を、当該閉領域の外縁の位置に変更することを、当該閉領域の外縁の画素について行う(図26の一番上の図において塗りつぶされている領域の外縁に付されている矢印線を参照)。ここで、導出した閉領域の外縁の位置の変更は、変更前の閉領域の外縁の画素と変更後の閉領域の外側との間に位置する画素の画素値を「1」から「0」に変更することにより行うことができる。 Next, the region separation unit 1801j performs predetermined processing on the outer edge pixel of the derived closed region in a direction perpendicular to a tangent line with the outer edge pixel as a contact and in the direction in which the closed region exists. Changing the position separated by the number of pixels to the position of the outer edge of the closed area is performed for the pixels of the outer edge of the closed area (attached to the outer edge of the filled area in the uppermost diagram of FIG. 26). See the arrow line). Here, the derived change in the position of the outer edge of the closed region is performed by changing the pixel value of the pixel located between the outer edge pixel of the closed region before the change and the outside of the closed region after the change from “1” to “0”. This can be done by changing to
このような処理と共に、領域分離部1801jは、導出した閉領域の内縁の画素に対し、当該外縁の画素を接点とする接線に垂直な方向であって、当該閉領域が存在している方向に、所定の画素数分だけ離隔した位置を、当該閉領域の内縁の位置に変更することを、当該閉領域の内縁の画素について行う(図26の一番上の図において塗りつぶされている領域の内縁に付されている矢印線を参照)。ここで、閉領域の内縁の位置の変更は、変更前の閉領域の外縁の画素と変更後の閉領域の外側との間に位置する画素の画素値を「1」から「0」に変更することにより行うことができる。また、変更前の閉領域の内縁と変更後の閉領域の内縁との間隔(画素数)と、変更前の閉領域の外縁と変更後の閉領域の外縁との間隔(画素数)は(すなわち、前記所定の画素数は)、同じ値となる。 Along with such processing, the region separation unit 1801j is in a direction perpendicular to the tangent line with the outer edge pixel as a contact point with respect to the inner edge pixel of the derived closed region, and in the direction in which the closed region exists. Then, changing the position separated by a predetermined number of pixels to the position of the inner edge of the closed area is performed for the pixels of the inner edge of the closed area (the area of the area filled in in the top diagram of FIG. 26). (See arrow line on inner edge). Here, the change of the position of the inner edge of the closed region is performed by changing the pixel value of the pixel located between the outer edge pixel of the closed region before the change and the outside of the closed region after the change from “1” to “0”. This can be done. Further, the interval (number of pixels) between the inner edge of the closed region before the change and the inner edge of the closed region after the change, and the interval (number of pixels) between the outer edge of the closed region before the change and the outer edge of the closed region after the change are ( That is, the predetermined number of pixels) has the same value.
尚、例えば、ある鋼管がずれた状態で段積みされている場合には、カメラ20により撮像される鋼管の端面側において、当該鋼管が他の鋼管と接触していないこと(又は少しの領域でしか接触していないこと)が生じ得る。そうすると、計数対象領域2値化画像作成部1801iにより作成された計数対象領域2値化画像において、内縁が存在しない閉領域が孤立して存在することがある。このような場合、当該内縁が存在しない閉領域については、例えば、当該閉領域の外縁の位置だけを前述したようにして変更することができる。 For example, when a certain steel pipe is stacked in a shifted state, the steel pipe is not in contact with another steel pipe on the end surface side of the steel pipe imaged by the camera 20 (or in a small region). Only contact). Then, in the counting target region binarized image created by the counting target region binarized image creating unit 1801i, there may be an isolated closed region that does not have an inner edge. In such a case, for the closed region where the inner edge does not exist, for example, only the position of the outer edge of the closed region can be changed as described above.
以上のような処理を、図26に示すように段階的に行うことにより、1つの閉領域となっているキャップの領域を(図26の一番上に示す図を参照)、個々のキャップの領域に分離することができる(図26の一番下に示す図を参照)。 By performing the above processing step by step as shown in FIG. 26, the cap region that is one closed region (see the diagram shown at the top of FIG. 26) can be obtained. It can be separated into regions (see the diagram at the bottom of FIG. 26).
ブロブ処理部1801kは、領域分離部1801jにより個々のキャップの領域が分離された計数対象領域2値化画像から、画素値が「1」である画素により構成される閉領域であって、当該外縁の画素に接する画素の少なくとも1つが、画素値が「0」である画素となる閉領域(所謂ブロブ)を導出する。具体的に説明すると、ブロブ処理部1801kは、領域分離部1801jにより個々のキャップの領域が分離された計数対象領域2値化画像において、画素値が「1」である画素と、当該画素に対し縦、横及び斜めの何れかで隣接する画素であって、画素値が「1」である画素とを1つの領域とすることを、領域分離2値化画像のそれぞれの画素について行うことにより、ブロブを導出する。
次に、ブロブ処理部1801kは、導出した各ブロブに対してラベリング処理(番号の割り振り)を行う。
The blob processing unit 1801k is a closed region including pixels whose pixel value is “1” from the binarized image to be counted in which individual cap regions are separated by the region separation unit 1801j, and the outer edge At least one of the pixels in contact with this pixel derives a closed region (so-called blob) in which the pixel value is “0”. Specifically, the blob processing unit 1801k includes a pixel having a pixel value “1” in the binarized image to be counted in which the cap regions are separated by the region separating unit 1801j, and the pixel By making each pixel of a region-separated binarized image a pixel adjacent in any one of vertical, horizontal and diagonal and having a pixel value “1” as one region, Deriving a blob.
Next, the blob processing unit 1801k performs labeling processing (number allocation) on each derived blob.
領域分離2値化画像作成部1801lは、領域分離部1801jにより個々のキャップの領域が分離された計数対象領域2値化画像から、ブロブ処理部1801kで得られたブロブを抽出して領域分離2値化画像を作成する。
図27は、領域分離2値化画像の一例を示す図である。この領域分離2値化画像2700により、個々のキャップの領域(16個の領域)が他のキャップの領域と分離され明確に区別される(すなわち、個々のキャップの領域(16個の領域)が単独で存在するようになる)。領域分離2値化画像2700においてグレーで示しているブロブが鋼管対応ブロブになる。
以上のようにして鋼管対応ブロブが得られた後の処理は、第1の実施形態と同じであるので、その詳細な説明を省略する。
そして、以上のようにして鋼管抽出部1801を構成することにより、計数の対象となる鋼管の端面が開口していない場合であっても、第1の実施形態と同様の効果を得ることができる。
The region separation binarized image creating unit 1801l extracts the blob obtained by the blob processing unit 1801k from the binarized image to be counted from which the individual cap regions are separated by the region separation unit 1801j, and performs region separation 2 Create a valued image.
FIG. 27 is a diagram illustrating an example of a region separation binarized image. By this region separation
Since the process after the blob corresponding to the steel pipe is obtained as described above is the same as that in the first embodiment, detailed description thereof is omitted.
And by comprising the steel pipe extraction part 1801 as mentioned above, even if it is a case where the end surface of the steel pipe used as the object of counting is not open, the effect similar to 1st Embodiment can be acquired. .
(変形例)
本実施形態では、本数を計測する対象となる長尺物の端面の形状が円形である場合を例に挙げて説明した。しかしながら、本数を計測する対象となる長尺物の端面の形状は、撮像を行う端面側において、相互に隣接する長尺物の間の少なくとも一部に隙間が形成されるように段積みされる長尺物であればよい。本数を計測する対象となる長尺物の端面の形状は、例えば、楕円形、多角形、段付鋼管のようなレモン型の形状等であってもよい。
また、第1の色空間要素、第2の色空間要素は、前述したものに限定されない。長尺物の端面の色に応じて、例えば、CIE 1976 L*u*v*色空間の要素や、CIE XYZ色空間の要素を第1の色空間要素、第2の色空間要素として採用することができる。
(Modification)
In this embodiment, the case where the shape of the end surface of the long object to be measured is circular is described as an example. However, the shape of the end face of the long object whose number is to be measured is stacked so that a gap is formed in at least a part between the adjacent long objects on the end face side where imaging is performed. What is necessary is just a long thing. The shape of the end surface of the long object that is the object of measuring the number may be, for example, an elliptical shape, a polygonal shape, a lemon-shaped shape such as a stepped steel pipe, or the like.
Further, the first color space element and the second color space element are not limited to those described above. Depending on the color of the end face of the long object, for example, an element in the CIE 1976 L * u * v * color space or an element in the CIE XYZ color space is adopted as the first color space element or the second color space element. be able to.
また、本実施形態のように、グレースケール2値化画像において、画素値が「1」である領域に囲まれている「画素値が「0」である領域」の画素値を「1」に変更して隙間補完後2値化画像を作成すれば、第2のグレースケール画像から抽出する領域を、キャップの領域に、より確実に一致させることができるので好ましい。しかしながら、必ずしも隙間補完後2値化画像を作成する必要はない。 Further, as in this embodiment, in the grayscale binarized image, the pixel value of the “region where the pixel value is“ 0 ”” surrounded by the region where the pixel value is “1” is set to “1”. It is preferable to change and create a binarized image after gap complementation, because the region extracted from the second grayscale image can be more reliably matched with the cap region. However, it is not always necessary to create a binarized image after gap compensation.
また、本実施形態では、第1のグレースケール画像と第2のグレースケール画像とを作成し、第1のグレースケール画像からグレースケール2値化画像を、グレースケール2値化画像から隙間補完後2値化画像を、それぞれ作成し、隙間補完後2値化画像に基づいて定められる領域を第2のグレースケール画像から抽出して計数対象領域抽出画像を作成した。しかしながら、第1の色空間要素と第2の色空間要素とが同じ要素になる場合には、グレースケール2値化画像した段階で、計数対象領域2値化画像と同等の2値化画像を得ることができる。よって、このような場合には、第2のグレースケール画像、隙間補完後2値化画像、及び計数対象領域抽出画像は不要となる。
また、本実施形態においても第1の実施形態で説明した種々の変形例を採用することができる。
In the present embodiment, a first grayscale image and a second grayscale image are created, a grayscale binarized image is created from the first grayscale image, and a gap is compensated from the grayscale binarized image. A binarized image was created, and a region defined based on the binarized image after gap complementation was extracted from the second grayscale image to create a count target region extracted image. However, when the first color space element and the second color space element are the same element, a binarized image equivalent to the count target region binarized image is obtained at the stage of the grayscale binarized image. Can be obtained. Therefore, in such a case, the second gray scale image, the binarized image after gap interpolation, and the count target region extraction image are not necessary.
Also in the present embodiment, various modifications described in the first embodiment can be employed.
尚、以上説明した本発明の実施形態は、コンピュータがプログラムを実行することによって実現することができる。また、前記プログラムを記録したコンピュータ読み取り可能な記録媒体及び前記プログラム等のコンピュータプログラムプロダクトも本発明の実施形態として適用することができる。記録媒体としては、例えば、フレキシブルディスク、ハードディスク、光ディスク、光磁気ディスク、CD−ROM、磁気テープ、不揮発性のメモリカード、ROM等を用いることができる。
また、以上説明した本発明の実施形態は、何れも本発明を実施するにあたっての具体化の例を示したものに過ぎず、これらによって本発明の技術的範囲が限定的に解釈されてはならないものである。すなわち、本発明はその技術思想、またはその主要な特徴から逸脱することなく、様々な形で実施することができる。
The embodiment of the present invention described above can be realized by a computer executing a program. Further, a computer-readable recording medium in which the program is recorded and a computer program product such as the program can also be applied as an embodiment of the present invention. As the recording medium, for example, a flexible disk, a hard disk, an optical disk, a magneto-optical disk, a CD-ROM, a magnetic tape, a nonvolatile memory card, a ROM, or the like can be used.
In addition, the embodiments of the present invention described above are merely examples of implementation in carrying out the present invention, and the technical scope of the present invention should not be construed as being limited thereto. Is. That is, the present invention can be implemented in various forms without departing from the technical idea or the main features thereof.
10 鋼管
20 カメラ
30 照明装置
40 バンド
100 長尺物本数測定装置
101、1801 鋼管抽出部
102 間隔導出部
103 合成位置決定部
104 画像合成部
105 本数決定部
106 出力画像作成部
107 出力画像出力
410 2値化元画像
411 ブロブ
810 領域分離2値化画像
1410 補正後領域分離2値化画像
1411、1412 ブロブ群
1510 合成画像
1520 出力画像
DESCRIPTION OF
Claims (15)
前記複数の位置のうち相互に間隔を有して隣接する位置で撮像された2つの前記元画像に、前記複数の長尺物の少なくとも一部が共通して含まれるように、前記複数の位置でそれぞれ撮像された複数の前記元画像を取得する元画像取得手段と、
前記元画像取得手段により取得された前記複数の元画像のそれぞれから、前記長尺物の端面に対応するブロブである長尺物対応ブロブであって相互に分離された長尺物対応ブロブにより表現された2値化画像である領域分離2値化画像を作成する領域分離2値化画像作成手段と、
前記領域分離2値化画像導出手段により導出された前記領域分離2値化画像のうち、相互に間隔を有して隣接する位置で撮像された2つの前記元画像から得られた2つの前記領域分離2値化画像に含まれる長尺物対応ブロブを比較した結果に基づいて、当該2つの領域分離2値化画像における位置合わせの基準となる長尺物対応ブロブを、前記領域分離2値化画像作成手段により作成された前記領域分離2値化画像のそれぞれについて決定する合成位置決定手段と、
前記合成位置決定手段により決定された長尺物対応ブロブを位置合わせの基準として、前記相互に間隔を有して隣接する位置で撮像された2つの前記元画像から得られた2つの前記領域分離2値化画像を、前記領域分離2値化画像作成手段により作成された前記領域分離2値化画像のそれぞれについて合成した合成画像を作成する画像合成手段と、
前記画像合成手段により作成された前記合成画像に基づいて、前記複数の長尺物の本数を決定する本数決定手段と、
前記本数決定手段により決定された前記複数の長尺物の本数を識別するための情報を出力する出力手段と、を有することを特徴とする長尺物本数測定装置。 Based on the result of image processing of a plurality of original images obtained by imaging regions including end surfaces of a plurality of stacked long objects at a plurality of positions that are spaced apart from each other. A long object measuring apparatus for measuring the number of long objects,
The plurality of positions so that at least a part of the plurality of long objects is included in common in two original images captured at positions adjacent to each other at a distance among the plurality of positions. Original image acquisition means for acquiring a plurality of the original images respectively captured at
Represented by long object-corresponding blobs that are blobs corresponding to the end surfaces of the long object and are separated from each other from the plurality of original images acquired by the original image acquiring means. Region-separated binary image creating means for creating a region-separated binary image that is a binarized image;
Of the region-separated binary images derived by the region-separated binary image deriving means, the two regions obtained from two original images captured at positions adjacent to each other with an interval between them Based on the comparison result of the long object-corresponding blobs included in the separated binarized images, the long object-corresponding blob, which is a reference for alignment in the two region-separated binarized images, is converted into the region-separated binarization. Combined position determining means for determining each of the region-separated binary images created by the image creating means;
Using the long object-corresponding blob determined by the composite position determining means as a reference for alignment, the two region separations obtained from the two original images captured at adjacent positions with a gap between each other Image synthesizing means for creating a synthesized image obtained by synthesizing the binarized image with respect to each of the area separated binarized images created by the area separated binarized image creating means;
Number determining means for determining the number of the plurality of long objects based on the composite image created by the image combining means;
An output unit that outputs information for identifying the number of the plurality of long objects determined by the number determination unit;
前記合成位置決定手段は、
前記領域分離2値化画像導出手段により導出された前記領域分離2値化画像に含まれる長尺物対応ブロブの位置に基づいて、前記所定の方向に一列に並ぶ複数の長尺物対応ブロブからなるブロブ群を設定する設定手段と、
前記ブロブ群のそれぞれについて、前記ブロブ群に含まれる長尺物対応ブロブの数を導出するブロブ数導出手段と、
前記ブロブ群のそれぞれについて、前記ブロブ群の前記所定の方向の長さ、又は、前記ブロブ群に含まれる長尺物対応ブロブのうち相互に隣接する2つの長尺物対応ブロブの間隔を導出する長さ・間隔導出手段と、
前記ブロブ数導出手段により導出された前記ブロブの数と、前記長さ・間隔導出手段により導出された前記長さ又は前記間隔と、を、相互に間隔を有して隣接する位置で撮像された2つの前記元画像から得られた2つの前記領域分離2値化画像に含まれるブロブ群同士で比較した結果に基づいて、当該2つの領域分離2値化画像の位置合わせの基準となる長尺物対応ブロブをそれぞれ決定するブロブ決定手段と、を更に有することを特徴とする請求項1に記載の長尺物本数測定装置。 The two original images captured at positions adjacent to each other with a space between each other include in common an image of at least one long object arranged in a predetermined direction among the plurality of long objects. And
The synthetic position determining means includes
Based on the positions of the long object-corresponding blobs included in the region-separated binary image derived by the region-separated binary image deriving means, from a plurality of long object-corresponding blobs arranged in a row in the predetermined direction Setting means for setting the blob group,
Blob number deriving means for deriving the number of long object corresponding blobs included in the blob group for each of the blob groups;
For each of the blob groups, the length of the blob group in the predetermined direction or the interval between two long object-corresponding blobs adjacent to each other among the long object-corresponding blobs included in the blob group is derived. A length / interval derivation means;
The number of the blobs derived by the blob number deriving unit and the length or the interval derived by the length / interval deriving unit were imaged at positions adjacent to each other with an interval therebetween. Based on the result of comparison between the blob groups included in the two region-separated binarized images obtained from the two original images, a long length serving as a reference for alignment of the two region-separated binarized images The long object number measuring apparatus according to claim 1, further comprising a blob determining unit that determines the blob corresponding to each object.
前記ブロブ群の前記所定の方向に対する傾きを導出する傾き導出手段と、
前記ブロブ群が前記所定の方向を向くように、前記傾き導出手段により導出された前記傾きに基づいて、前記ブロブ群の位置を補正する位置補正手段と、を更に有し、
前記長さ・間隔導出手段は、前記位置補正手段により位置が補正された前記ブロブ群のそれぞれについて、前記ブロブ群の前記所定の方向の長さ、又は、前記ブロブ群に含まれるブロブのうち相互に隣接する2つの長尺物対応ブロブの間隔を導出することを特徴とする請求項2又は3に記載の長尺物本数測定装置。 The synthetic position determining means includes
An inclination deriving means for deriving an inclination of the blob group with respect to the predetermined direction;
Position correction means for correcting the position of the blob group based on the inclination derived by the inclination derivation means so that the blob group faces the predetermined direction;
The length / interval deriving unit is configured to determine, for each of the blob groups whose positions have been corrected by the position correcting unit, the length of the blob group in the predetermined direction or a blob included in the blob group. The long object count measuring apparatus according to claim 2 or 3, wherein an interval between two long object-corresponding blobs adjacent to the head is derived.
前記複数の元画像のうち、基準となる元画像から得られた前記領域分離2値化画像の大きさに合うように、当該領域分離2値化画像と異なる前記領域分離2値化画像の大きさを変更する拡縮手段を更に有し、
前記相互に間隔を有して隣接する位置で撮像された2つの前記元画像から得られた2つの前記領域分離2値化画像の少なくとも何れか1つの大きさが前記拡縮手段により変更された場合には、当該大きさが変更された領域分離2値化画像を用いて前記合成を行うことを特徴とする請求項1〜6の何れか1項に記載の長尺物本数測定装置。 The image composition means includes
Of the plurality of original images, the size of the region-separated binary image different from the region-separated binary image so as to match the size of the region-separated binary image obtained from the reference original image. Further having an expansion / contraction means for changing the thickness,
When the size of at least one of the two region-separated binary images obtained from the two original images captured at positions adjacent to each other with a gap is changed by the enlargement / reduction unit The long object count measuring apparatus according to claim 1, wherein the composition is performed using a region-separated binary image whose size has been changed.
前記複数の位置のうち相互に間隔を有して隣接する位置で撮像された2つの前記元画像に、前記複数の長尺物の少なくとも一部が共通して含まれるように、前記複数の位置でそれぞれ撮像された複数の前記元画像を取得する元画像取得工程と、
前記元画像取得工程により取得された前記複数の元画像のそれぞれから、前記長尺物の端面に対応するブロブである長尺物対応ブロブであって相互に分離された長尺物対応ブロブにより表現された2値化画像である領域分離2値化画像を作成する領域分離2値化画像作成工程と、
前記領域分離2値化画像導出工程により導出された前記領域分離2値化画像のうち、相互に間隔を有して隣接する位置で撮像された2つの前記元画像から得られた2つの前記領域分離2値化画像に含まれる長尺物対応ブロブを比較した結果に基づいて、当該2つの領域分離2値化画像における位置合わせの基準となる長尺物対応ブロブを、前記領域分離2値化画像作成工程により作成された前記領域分離2値化画像のそれぞれについて決定する合成位置決定工程と、
前記合成位置決定工程により決定された長尺物対応ブロブを位置合わせの基準として、前記相互に間隔を有して隣接する位置で撮像された2つの前記元画像から得られた2つの前記領域分離2値化画像を、前記領域分離2値化画像作成工程により作成された前記領域分離2値化画像のそれぞれについて合成した合成画像を作成する画像合成工程と、
前記画像合成工程により作成された前記合成画像に基づいて、前記複数の長尺物の本数を決定する本数決定工程と、
前記本数決定工程により決定された前記複数の長尺物の本数を識別するための情報を出力する出力工程と、を有することを特徴とする長尺物本数測定方法。 Based on the result of image processing of a plurality of original images obtained by imaging regions including end surfaces of a plurality of stacked long objects at a plurality of positions that are spaced apart from each other. A long object measuring method for measuring the number of long objects,
The plurality of positions so that at least a part of the plurality of long objects is included in common in two original images captured at positions adjacent to each other at a distance among the plurality of positions. An original image acquisition step of acquiring a plurality of the original images respectively captured in
From each of the plurality of original images acquired by the original image acquisition step, a long object corresponding blob that is a blob corresponding to an end surface of the long object and expressed by long object corresponding blobs separated from each other A region separation binarized image creating step for creating a region separation binarized image which is a binarized image;
Of the region-separated binary images derived by the region-separated binary image derivation step, the two regions obtained from the two original images captured at positions adjacent to each other with an interval therebetween Based on the comparison result of the long object-corresponding blobs included in the separated binarized images, the long object-corresponding blob, which is a reference for alignment in the two region-separated binarized images, is converted into the region-separated binarization. A composite position determination step for determining each of the region-separated binarized images created by the image creation step;
Using the long object-corresponding blob determined in the composite position determination step as a reference for alignment, the two regions separated from the two original images captured at adjacent positions with a space between each other An image composition step of creating a composite image obtained by combining the binarized image with respect to each of the region-separated binary image created by the region-separated binary image creation step;
A number determining step for determining the number of the plurality of long objects based on the combined image created by the image combining step;
An output step of outputting information for identifying the number of the plurality of long objects determined by the number determination step.
前記合成位置決定工程は、
前記領域分離2値化画像導出工程により導出された前記領域分離2値化画像に含まれる長尺物対応ブロブの位置に基づいて、前記所定の方向に一列に並ぶ複数の長尺物対応ブロブからなるブロブ群を設定する設定工程と、
前記ブロブ群のそれぞれについて、前記ブロブ群に含まれる長尺物対応ブロブの数を導出するブロブ数導出工程と、
前記ブロブ群のそれぞれについて、前記ブロブ群の前記所定の方向の長さ、又は、前記ブロブ群に含まれる長尺物対応ブロブのうち相互に隣接する2つの長尺物対応ブロブの間隔を導出する長さ・間隔導出工程と、
前記ブロブ数導出工程により導出された前記ブロブの数と、前記長さ・間隔導出工程により導出された前記長さ又は前記間隔と、を、相互に間隔を有して隣接する位置で撮像された2つの前記元画像から得られた2つの前記領域分離2値化画像に含まれるブロブ群同士で比較した結果に基づいて、当該2つの領域分離2値化画像の位置合わせの基準となる長尺物対応ブロブをそれぞれ決定するブロブ決定工程と、を更に有することを特徴とする請求項8に記載の長尺物本数測定方法。 The two original images captured at positions adjacent to each other with a space between each other include in common an image of at least one long object arranged in a predetermined direction among the plurality of long objects. And
The synthetic position determining step includes
Based on the positions of the long object-corresponding blobs included in the region-separated binary image derived by the region-separated binary image deriving step, the plurality of long object-corresponding blobs arranged in a row in the predetermined direction. A setting step for setting a blob group,
For each blob group, a blob number derivation step for deriving the number of long object-corresponding blobs included in the blob group;
For each of the blob groups, the length of the blob group in the predetermined direction or the interval between two long object-corresponding blobs adjacent to each other among the long object-corresponding blobs included in the blob group is derived. A length / interval derivation process;
The number of the blobs derived by the blob number deriving step and the length or the interval derived by the length / interval deriving step were imaged at adjacent positions with an interval therebetween. Based on the result of comparison between the blob groups included in the two region-separated binarized images obtained from the two original images, a long length serving as a reference for alignment of the two region-separated binarized images The long object count measuring method according to claim 8, further comprising a blob determining step for respectively determining an object corresponding blob.
前記ブロブ群の前記所定の方向に対する傾きを導出する傾き導出工程と、
前記ブロブ群が前記所定の方向を向くように、前記傾き導出工程により導出された前記傾きに基づいて、前記ブロブ群の位置を補正する位置補正工程と、を更に有し、
前記長さ・間隔導出工程は、前記位置補正工程により位置が補正された前記ブロブ群のそれぞれについて、前記ブロブ群の前記所定の方向の長さ、又は、前記ブロブ群に含まれるブロブのうち相互に隣接する2つの長尺物対応ブロブの間隔を導出することを特徴とする請求項9又は10に記載の長尺物本数測定方法。 The synthetic position determining step includes
An inclination derivation step for deriving an inclination of the blob group with respect to the predetermined direction;
A position correction step of correcting the position of the blob group based on the inclination derived by the inclination derivation step so that the blob group faces the predetermined direction;
The length / interval derivation step includes, for each of the blob groups whose positions have been corrected by the position correction step, the length of the blob group in the predetermined direction, or the blob group included in the blob group. The method for measuring the number of long objects according to claim 9 or 10, wherein an interval between two long object-corresponding blobs adjacent to the head is derived.
前記複数の元画像のうち、基準となる元画像から得られた前記領域分離2値化画像の大きさに合うように、当該領域分離2値化画像と異なる前記領域分離2値化画像の大きさを変更する拡縮工程を更に有し、
前記相互に間隔を有して隣接する位置で撮像された2つの前記元画像から得られた2つの前記領域分離2値化画像の少なくとも何れか1つの大きさが前記拡縮工程により変更された場合には、当該大きさが変更された領域分離2値化画像を用いて前記合成を行うことを特徴とする請求項8〜13の何れか1項に記載の長尺物本数測定方法。 The image composition step includes
Of the plurality of original images, the size of the region-separated binary image different from the region-separated binary image so as to match the size of the region-separated binary image obtained from the reference original image. Further having an expansion / contraction process for changing the thickness,
When the size of at least one of the two region-separated binary images obtained from the two original images captured at positions adjacent to each other with a gap is changed by the scaling process The method for measuring the number of long objects according to any one of claims 8 to 13, wherein the composition is performed using a region-separated binary image whose size has been changed.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2013098670A JP6100602B2 (en) | 2013-05-08 | 2013-05-08 | Long object number measuring device, long object number measuring method, and computer program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2013098670A JP6100602B2 (en) | 2013-05-08 | 2013-05-08 | Long object number measuring device, long object number measuring method, and computer program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2014219842A JP2014219842A (en) | 2014-11-20 |
JP6100602B2 true JP6100602B2 (en) | 2017-03-22 |
Family
ID=51938224
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2013098670A Active JP6100602B2 (en) | 2013-05-08 | 2013-05-08 | Long object number measuring device, long object number measuring method, and computer program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6100602B2 (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP6127188B1 (en) * | 2016-08-04 | 2017-05-10 | 株式会社Sayコンピュータ | Counting method and counting device |
JP6853031B2 (en) * | 2016-12-16 | 2021-03-31 | 日鉄テックスエンジ株式会社 | Information processing equipment, information processing system, information processing method, and program |
JP6729351B2 (en) * | 2016-12-26 | 2020-07-22 | 日本製鉄株式会社 | How to check the number of tubes |
JP7465152B2 (en) * | 2019-06-05 | 2024-04-10 | Jfeプラントエンジ株式会社 | Counting device and counting method |
JP7324956B1 (en) * | 2023-03-15 | 2023-08-10 | 株式会社 日立産業制御ソリューションズ | Object recognition device and object recognition method |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS5116092B2 (en) * | 1971-09-01 | 1976-05-21 | ||
JP2005078105A (en) * | 2003-08-29 | 2005-03-24 | Daido Steel Co Ltd | Method and apparatus for counting bar material |
JP5077093B2 (en) * | 2008-06-23 | 2012-11-21 | 大同特殊鋼株式会社 | Round bar number counting device and round bar number counting method |
JP5933199B2 (en) * | 2011-07-07 | 2016-06-08 | アンリツインフィビス株式会社 | X-ray inspection equipment |
-
2013
- 2013-05-08 JP JP2013098670A patent/JP6100602B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2014219842A (en) | 2014-11-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6100602B2 (en) | Long object number measuring device, long object number measuring method, and computer program | |
US7456842B2 (en) | Color edge based system and method for determination of 3D surface topology | |
EP3563345B1 (en) | Automatic detection, counting, and measurement of lumber boards using a handheld device | |
CN103581496B (en) | For the camera arrangement and method of detection object stream | |
JP5538868B2 (en) | Image processing apparatus, image processing method and program | |
US20220027654A1 (en) | Point cloud data processing apparatus, point cloud data processing method, and program | |
KR20110059506A (en) | System and method for obtaining camera parameters from multiple images and computer program products thereof | |
CN113688846B (en) | Object size recognition method, readable storage medium, and object size recognition system | |
JP5530752B2 (en) | Instrument reading device, method, program, and computer-readable medium storing the software | |
US20180184012A1 (en) | Image processing apparatus, control method, and storage medium | |
JPWO2018147059A1 (en) | Image processing apparatus, image processing method, and program | |
US11216905B2 (en) | Automatic detection, counting, and measurement of lumber boards using a handheld device | |
JP6150675B2 (en) | Position information display system and method | |
JP2009289066A (en) | Position specification method and color specification method and id creation method | |
JP6433810B2 (en) | Bonding wire detection method and bonding wire detection device | |
JP5788367B2 (en) | Long object number measuring device, long object number measuring method, and computer program | |
JP2015035799A (en) | Information processing apparatus, imaging apparatus, information processing system, information processing method, and program | |
US20200286248A1 (en) | Structured light subpixel accuracy isp pipeline/fast super resolution structured light | |
US8718320B1 (en) | Codification of a time series of images | |
JP2020182127A (en) | Calibration device, calibration system, and calibration method of display device | |
JP2017102841A (en) | Two-dimensional code, two-dimensional code analysis method, two-dimensional code analyzer, and two-dimensional code analyzing program | |
JP4675055B2 (en) | Marker processing method, marker processing apparatus, program, and recording medium | |
EP4109413A1 (en) | Point cloud data processing device, point cloud data processing method, and program | |
JP2015045998A (en) | Image cutout device, image cutout program, member group for image processing, and set for cutting out image | |
JP3823559B2 (en) | How to convert 3D distance data |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20160323 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20170113 |
|
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: 20170131 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20170223 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 6100602 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
S533 | Written request for registration of change of name |
Free format text: JAPANESE INTERMEDIATE CODE: R313533 |
|
R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
S533 | Written request for registration of change of name |
Free format text: JAPANESE INTERMEDIATE CODE: R313533 |
|
R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
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 |
|
S111 | Request for change of ownership or part of ownership |
Free format text: JAPANESE INTERMEDIATE CODE: R313117 |
|
R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |