JP5788367B2 - 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
- JP5788367B2 JP5788367B2 JP2012173112A JP2012173112A JP5788367B2 JP 5788367 B2 JP5788367 B2 JP 5788367B2 JP 2012173112 A JP2012173112 A JP 2012173112A JP 2012173112 A JP2012173112 A JP 2012173112A JP 5788367 B2 JP5788367 B2 JP 5788367B2
- Authority
- JP
- Japan
- Prior art keywords
- color
- image
- grayscale
- face
- group
- 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 26
- 238000004590 computer program Methods 0.000 title claims description 5
- 229910000831 Steel Inorganic materials 0.000 claims description 72
- 239000010959 steel Substances 0.000 claims description 72
- 238000000605 extraction Methods 0.000 claims description 30
- 238000000926 separation method Methods 0.000 claims description 24
- 238000003384 imaging method Methods 0.000 claims description 21
- 230000008569 process Effects 0.000 claims description 9
- 230000008859 change Effects 0.000 description 18
- 238000010586 diagram Methods 0.000 description 16
- 238000012545 processing Methods 0.000 description 11
- 238000005259 measurement Methods 0.000 description 6
- 238000004891 communication Methods 0.000 description 3
- 230000000295 complement effect Effects 0.000 description 3
- 230000008878 coupling Effects 0.000 description 2
- 238000010168 coupling process Methods 0.000 description 2
- 238000005859 coupling reaction Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000002372 labelling Methods 0.000 description 2
- 238000003705 background correction Methods 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
- 238000005286 illumination Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
Images
Landscapes
- Image Processing (AREA)
- Image Analysis (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. When 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 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
特許文献1に記載の技術では、まず、棒鋼材の端面を撮像した端面画像と、棒鋼材の側面を撮像した側面画像とを取得し、端面画像に基づいて、棒鋼材が積み重なっているか否かを判定する。そして、棒鋼材が積み重なっている場合には、端面画像に基づく棒鋼材の計数値と、側面画像に基づく計数値とのうち、大きい方を棒鋼材の本数とする。
In the technique described in
前述したように、1つのロットに含められる長尺物の数が多くなると、多数の長尺物が段積みされることになる。しかしながら、特許文献1に記載の技術では、棒鋼材が段積みされている場合には、棒鋼材を正確に計数することができないという問題があった。
また、段積みされている長尺物は、通常、相互に隣接している長尺物の少なくとも1つと接触している。このため、特許文献1に記載の技術では、段積みされている長尺物の端面の撮像画像から、個々の長尺物を抽出することができない。特に、端面が開口していない状態の長尺物については、当該端面を照明したときの当該端面における輝度差が小さいため、段積みされている長尺物が1つの大きな領域として認識されてしまう。よって、端面が開口していない状態の複数の長尺物が段積みされている場合に、当該複数の長尺物の端面の撮像画像から、個々の長尺物を抽出する技術が望まれている。
As described above, when the number of long objects included in one lot increases, a large number of long objects are stacked. However, the technique described in
In addition, the stacked long objects are usually in contact with at least one of the adjacent long objects. For this reason, with the technique described in
また、出荷後に鋼管の中に異物が混入することを防止すること等の理由から、鋼管の端面に、顧客から指定された色で着色されたキャップが付けられることがある。また、ロットを識別すること等の理由から、棒鋼の端面が着色されていることがある。このように、端面が着色された状態の長尺物の端面の画像を撮像した場合、特許文献1に記載の技術では、当該長尺物の端面の色と、その背景の色との関係によっては、当該長尺物を認識することができない。
以上のように、端面が開口していない状態であり且つ着色されている状態の複数の長尺物が段積みされている場合に、当該複数の長尺物の端面の撮像画像から、個々の長尺物を抽出して、それらの本数を測定する技術が望まれている。
In addition, a cap colored with a color designated by the customer may be attached to the end surface of the steel pipe in order to prevent foreign matters from entering the steel pipe after shipment. In addition, the end face of the steel bar may be colored for reasons such as identifying a lot. Thus, when the image of the end surface of the long object in which the end surface is colored is captured, according to the technique described in
As described above, when a plurality of long objects in a state where the end surfaces are not open and colored are stacked, individual images are taken from the captured images of the end surfaces of the plurality of long objects. A technique for extracting long objects and measuring their number is desired.
本発明は、以上の事情に鑑みてなされたものであり、端面が開口していない状態であり且つ着色されている状態の複数の長尺物が段積みされている場合であっても、当該段積みされている複数の長尺物の本数を自動的に且つ正確に測定できるようにすることを目的とする。 The present invention has been made in view of the above circumstances, even when a plurality of elongated objects in a state where the end face is not open and colored are stacked. It is an object to enable automatic and accurate measurement of the number of a plurality of long objects stacked.
本発明の長尺物本数測定装置は、端面が開口していない状態であり且つ所定の色で着色されている状態である複数の長尺物の本数であって、相互に隣接する長尺物の少なくとも一部の領域に隙間が形成されるように段積みされている複数の長尺物の本数を測定する長尺物本数測定装置であって、前記複数の長尺物の端面を撮像することにより得られたカラー画像である元画像を取得する元画像取得手段と、前記元画像取得手段により取得された元画像から、前記端面の色に応じて予め設定された第1の色空間要素の値を導出し、それぞれの画素が、当該第1の色空間要素の値に応じた画素値を有する第1のグレースケール画像を作成する第1のグレースケール画像作成手段と、前記第1のグレースケール画像作成手段により作成された第1のグレースケール画像を2値化してグレースケール2値化画像を作成するグレースケール2値化画像作成手段と、前記グレースケール2値化画像作成手段により作成されたグレースケール2値化画像に基づいて、前記端面の色に対応する画素値を有する一纏まりの領域を識別し、識別した一纏まりの領域の外縁と内縁の位置を、それぞれ当該一纏まりの領域が存在している方向に移動させることにより、当該一纏まりの領域を複数の領域に分離する領域分離手段と、前記領域分離手段により分離された領域の数に基づいて、前記複数の長尺物を計数する計数手段と、前記計数手段により計数された前記複数の長尺物の数を含む情報を出力する出力手段と、を有し、前記第1の色空間要素は、前記段積みされている複数の長尺物の端面の色である場合と、前記段積みされている複数の長尺物の端面の背景の色である場合とで異なる値をとる要素であることを特徴とする。 The long object number measuring device of the present invention is the number of a plurality of long objects in which the end face is not open and is colored in a predetermined color, and is adjacent to each other. A long object number measuring apparatus for measuring the number of a plurality of long objects stacked so that a gap is formed in at least a part of a region, and imaging an end face of the plurality of long objects An original image acquisition unit that acquires an original image that is a color image obtained by the above, and a first color space element that is preset according to the color of the end face from the original image acquired by the original image acquisition unit A first grayscale image creating means for creating a first grayscale image in which each pixel has a pixel value corresponding to the value of the first color space element; The first created by the gray scale image creating means Based on the grayscale binarized image creating means for binarizing the grayscale image to create a grayscale binarized image, and the grayscale binarized image created by the grayscale binarized image creating means, By identifying a group of areas having pixel values corresponding to the color of the end face, and moving the outer edge and the inner edge of the identified group of areas in the direction in which the group of areas exists. A region separating unit that separates the group of regions into a plurality of regions, a counting unit that counts the plurality of long objects based on the number of regions separated by the region separating unit, and the counting unit. Output means for outputting information including the counted number of the plurality of long objects, and the first color space element is a color of the end faces of the plurality of long objects stacked. And wherein the coupling and an element varies accordingly in the case of the color of the background of the end faces of the plurality of elongated article being stacked the stage.
本発明の長尺物本数測定方法は、端面が開口していない状態であり且つ所定の色で着色されている状態である複数の長尺物の本数であって、相互に隣接する長尺物の少なくとも一部の領域に隙間が形成されるように段積みされている複数の長尺物の本数を測定する長尺物本数測定方法であって、前記複数の長尺物の端面を撮像することにより得られたカラー画像である元画像を取得する元画像取得工程と、前記元画像取得工程により取得された元画像から、前記端面の色に応じて予め設定された第1の色空間要素の値を導出し、それぞれの画素が、当該第1の色空間要素の値に応じた画素値を有する第1のグレースケール画像を作成する第1のグレースケール画像作成工程と、前記第1のグレースケール画像作成工程により作成された第1のグレースケール画像を2値化してグレースケール2値化画像を作成するグレースケール2値化画像作成工程と、前記グレースケール2値化画像作成工程により作成されたグレースケール2値化画像に基づいて、前記端面の色に対応する画素値を有する一纏まりの領域を識別し、識別した一纏まりの領域の外縁と内縁の位置を、それぞれ当該一纏まりの領域が存在している方向に移動させることにより、当該一纏まりの領域を複数の領域に分離する領域分離工程と、前記領域分離工程により分離された領域の数に基づいて、前記複数の長尺物を計数する計数工程と、前記計数工程により計数された前記複数の長尺物の数を含む情報を出力する出力工程と、を有し、前記第1の色空間要素は、前記段積みされている複数の長尺物の端面の色である場合と、前記段積みされている複数の長尺物の端面の背景の色である場合とで異なる値をとる要素であることを特徴とする。 The method for measuring the number of long objects of the present invention is the number of a plurality of long objects that are in a state where the end face is not open and is colored in a predetermined color, and are adjacent to each other. A method for measuring the number of a plurality of long objects stacked so that a gap is formed in at least a part of a region, wherein the end faces of the plurality of long objects are imaged. An original image acquisition step of acquiring an original image which is a color image obtained by the above, and a first color space element set in advance according to the color of the end face from the original image acquired by the original image acquisition step A first grayscale image creating step of creating a first grayscale image in which each pixel has a pixel value corresponding to the value of the first color space element; The first created by the grayscale image creation process Based on the grayscale binarized image creating step for binarizing the grayscale image to create a grayscale binarized image, and the grayscale binarized image created by the grayscale binarized image creating step, By identifying a group of areas having pixel values corresponding to the color of the end face, and moving the outer edge and the inner edge of the identified group of areas in the direction in which the group of areas exists. A region separation step of separating the group of regions into a plurality of regions, a counting step of counting the plurality of long objects based on the number of regions separated by the region separation step, and the counting step. An output step for outputting information including the counted number of the plurality of long objects, wherein the first color space element is a color of an end face of the plurality of long objects stacked. And wherein the coupling and an element varies accordingly in the case of the color of the background of the end faces of the plurality of elongated article being stacked the stage.
本発明のコンピュータプログラムは、前記長尺物本数測定装置の各手段としてコンピュータを機能させることを特徴とする。 The computer program according to the present invention causes a computer to function as each means of the long object number measuring apparatus.
本発明によれば、段積みされている複数の長尺物の端面を撮像することにより得られたカラー画像である元画像から、端面の色であるときの値が可及的に大きくなる又は小さくなる要素である第1の色空間要素の値に応じた画素値を有する第1のグレースケール画像を生成し、当該第1のグレースケール画像を2値化してグレースケール2値化画像を生成する。そして、当該グレースケール2値化画像に基づいて、端面の色に対応する画素値を有する一纏まりの領域を識別し、識別した一纏まりの領域の外縁と内縁の位置を、それぞれ当該一纏まりの領域が存在している方向に移動させることにより、当該一纏まりの領域を複数の領域に分離し、分離した領域の数に基づいて、複数の長尺物を計数する。したがって、端面が開口していない状態であり且つ着色されている状態の長尺物が段積みされている場合であっても、当該段積みされている長尺物の本数を自動的に且つ正確に測定することができる。 According to the present invention, from the original image, which is a color image obtained by imaging the end faces of a plurality of stacked long objects, the value at the end face color becomes as large as possible. A first grayscale image having a pixel value corresponding to a value of a first color space element that is a smaller element is generated, and the first grayscale image is binarized to generate a grayscale binarized image To do. Then, based on the grayscale binarized image, a group of areas having pixel values corresponding to the color of the end face is identified, and the positions of the outer edge and the inner edge of the identified group of areas are respectively determined. By moving the region in the direction in which the region exists, the group of regions is separated into a plurality of regions, and a plurality of long objects are counted based on the number of separated regions. Therefore, even when a long object having an end face that is not open and colored is stacked, the number of the stacked long objects is automatically and accurately determined. Can be measured.
以下、図面を参照しながら、本発明の一実施形態を説明する。尚、各図では、表記の都合上、一部の構成を簡略化又は省略化している。
(撮像される長尺物の配置と長尺物を撮像するための装置の構成)
図1は、スタック10に保管されている複数の鋼管20a〜20tと、当該複数の鋼管20a〜20tの端面の画像を撮像するための撮像装置30と、当該複数の鋼管20a〜20tの端面を照明するための照明装置41、42の配置の一例を示す図である。図1(a)は、スタック10をその上方から見た図であり、図1(b)、図1(c)は、それぞれ図1(a)に示すA方向(鋼管20の端面方向)、B方向(鋼管20の側面方向)から見た図である。
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.
(Arrangement of long object to be imaged and configuration of apparatus for imaging long object)
FIG. 1 shows a plurality of steel pipes 20a to 20t stored in a
図1に示す例では、鋼管20a〜20tは、同一の仕様のものある。また、鋼管20a〜20tのそれぞれの端部には、同じ色で着色されたキャップ50a〜50tが取り付けられている。このように、本実施形態では、鋼管20a〜20tの端面は、キャップ50a〜50tにより閉塞されている。また、本実施形態では、キャップ50a〜50tの色が赤色であるとする。
本実施形態では、撮像装置30は、デジタルスチルカメラであり、スタック10に段積みで保管されている全ての鋼管20a〜20tの端面のカラー静止画像を、鋼管20a〜20tの端面と略正対する位置から撮像する。前述したように、鋼管20a〜20tのそれぞれの端部には、同じ色で着色されたキャップ50a〜50tが取り付けられている。よって、鋼管20a〜20tの端面の画像を撮像することは、鋼管20a〜20tの端面に位置するキャップ50a〜50tを撮像することと等価となる。以下の説明では、撮像装置30により撮像された「鋼管20a〜20tの端面(キャップ50a〜50t)の画像」を必要に応じて「元画像」と称する。
In the example shown in FIG. 1, the steel pipes 20a to 20t have the same specifications. Moreover, the
In the present embodiment, the
照明装置41、42は、それぞれ撮像装置30の左、右から、スタック10に保管されている全ての鋼管20a〜20tの端面(キャップ50a〜50t)を可及的に一様に照明できる位置に配置されている。
The illuminating
(長尺物本数測定装置の構成)
図2は、長尺物本数測定装置100の機能的な構成の一例を示すブロック図である。
長尺物本数測定装置100は、照明装置41、42により照明された複数の鋼管20a〜20tの端面(キャップ50a〜50t)を、当該端面と正対する位置から撮像装置30によって撮像されることにより得られた画像(元画像)を画像処理して、複数の鋼管20a〜20tを自動的に計数するものである。
図2に示す長尺物本数測定装置100は、例えば、CPU、ROM、RAM、HDD、及び各種のインターフェースを備えたコンピュータ(例えばPC)を用いることにより実現することができる。以下に、長尺物本数測定装置100が有する機能の一例を説明する。尚、長尺物本数測定装置100と撮像装置30は、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 captures images of the end surfaces (
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 device 100 and the
(端面色情報取得部101)
端面色情報取得部101は、オペレータによる操作に基づいて、計数対象となる長尺物(鋼管20)の端面の色を示す情報を、上位コンピュータ200に要求し、上位コンピュータ200から取得する。尚、以下の説明では、「計数対象となる長尺物(鋼管20)の端面の色を示す情報」を必要に応じて「端面色情報」と称する。
(End color information acquisition unit 101)
The end face color information acquisition unit 101 requests the
尚、端面色情報取得部101は、上位コンピュータ200が自発的に送信した端面色情報を取得してもよい。このようにした場合、端面色情報取得部101は、端面色情報と、スタック10を識別する情報との一組の情報を取得する。そして、端面色情報取得部101は、取得した当該一組の情報を記憶しておき、オペレータによる操作に基づいて入力されたスタックの情報に合致した端面色情報を読み出す。
この他、端面色情報取得部101は、オペレータによる操作に基づいて、端面色情報を直接取得してもよい(すなわち、オペレータが端面色情報を指定してもよい)。
Note that the end face color information acquisition unit 101 may acquire end face color information spontaneously transmitted by the
In addition, the end face color information acquisition unit 101 may directly acquire end face color information based on an operation by the operator (that is, the operator may specify the end face color information).
前述したように、本実施形態では、キャップ50の色は赤色である。よって、端面色情報取得部101は、端面色情報として赤色であることを示す情報を取得する。
端面色情報取得部101は、例えば、CPU、ROM、RAM、ユーザインターフェース、及び通信インターフェースを用いることにより実現できる。
As described above, in this embodiment, the color of the cap 50 is red. Therefore, the end face color information acquisition unit 101 acquires information indicating red as the end face color information.
The end face color information acquisition unit 101 can be realized by using, for example, a CPU, a ROM, a RAM, a user interface, and a communication interface.
(色空間要素選択部102)
色空間要素選択部102は、端面色情報取得部101により取得された端面色情報により特定される色に対応する「色空間の要素」を色空間要素選択テーブルから選択する。
図3は、色空間要素選択テーブルの一例を示す図である。
図3に示すように、色空間要素選択テーブル300には、色と、第1の色空間要素と、第2の色空間要素とが相互に関連付けられて登録されている。
(Color space element selection unit 102)
The color space
FIG. 3 is a diagram illustrating an example of a color space element selection table.
As shown in FIG. 3, the color, the first color space element, and the second color space element are registered in the color space element selection table 300 in association with each other.
色空間要素選択テーブル300における「色」は、端面色情報により特定される色を指す。よって、色空間要素選択テーブル300における「色」として、端面色情報により特定される色として想定される色が予め設定される。
また、「第1の色空間要素」、「第2の色空間要素」は、後述するようにして元画像取得部103により取得される画像から選択する「色空間の要素」を示す。
「第1の色空間要素」としては、鋼管20の端面(キャップ50)の領域の色(端面色情報により特定される色)である場合と、鋼管20(キャップ50)の背景の色である場合とで(可及的に大きく)異なる値をとる要素が予め設定される。
「第2の色空間要素」としては、鋼管20の端面(キャップ50)の領域の色(端面色情報により特定される色)であるときの値と、それらの間の隙間の領域の色(ここでは黒色)であるときの値との差が第1の色空間要素におけるものよりも大きくなる要素が予め設定される。また、「第2の色空間要素」としては、鋼管20の端面(キャップ50)の色のムラによって値が大きく変化しない要素が好ましい。
“Color” in the color space element selection table 300 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 300.
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” is the color of the region of the end face (cap 50) of the steel pipe 20 (the color specified by the end face color information) and the background color of the steel pipe 20 (cap 50). Elements that take different values depending on the case (as large as possible) are preset.
As the “second color space element”, the value when the color is the color of the region of the end face (cap 50) of the steel pipe 20 (the color specified by the end face color information) and the color of the region of the gap between them ( In this case, an element whose difference from the value when it is black) is larger than that in the first color space element is preset. The “second color space element” is preferably an element whose value does not change greatly due to unevenness of the color of the end face (cap 50) of the
図3に示す色空間要素選択テーブル300では、端面色情報により特定される色が赤色である場合には、第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が選択される。
前述したように、本実施形態では、キャップ50の色が赤色であるので、端面色情報により特定される色は赤色である。よって、色空間要素選択部102は、色空間要素選択テーブル300から、第1の色空間要素としてCIE Lab色空間のa*を、第2の色空間要素としてRGB色空間のRを、それぞれ選択する。
色空間要素選択部102は、例えば、CPU、ROM、RAM、及びHDDを用いることにより実現できる。
In the color space element selection table 300 shown in FIG. 3, 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 the present embodiment, since the color of the cap 50 is red, the color specified by the end face color information is red. Therefore, the color space
The color space
(元画像取得部103)
元画像取得部103は、撮像装置30で撮像された元画像を入力して記憶する。本実施形態では、撮像装置30で元画像が撮像されると、元画像のデータが元画像取得部103に自動的に入力されるものとする。ただし、必ずしもこのようにする必要はなく、撮像装置30は、元画像取得部103からの要求に応じて元画像のデータを元画像取得部103に送信するようにしてもよい。
図4は、元画像の一例を示す図である。前述したように元画像400はカラー画像である。また、本実施形態では、元画像は、RGB色空間で表現される画像であるものとする。
元画像取得部103は、例えば、CPU、RAM、ROM、HDD、及び通信インターフェースを用いることにより実現できる。
(Original image acquisition unit 103)
The original
FIG. 4 is a diagram illustrating an example of an original image. As described above, the
The original
(第1のグレースケール画像作成部104)
第1のグレースケール画像作成部104は、元画像取得部103により取得された元画像のそれぞれの画素のデータから、色空間要素選択部102により選択された第1の色空間要素の値を導出し、それぞれの画素が、当該第1の色空間要素の値に応じた画素値を有するグレースケールの画像を作成する。第1のグレースケール画像作成部104により作成されるグレースケールの画像を、以下の説明では必要に応じて「第1のグレースケール画像」と称する。
(First grayscale image creation unit 104)
The first grayscale image creation unit 104 derives the value of the first color space element selected by the color space
図5は、第1のグレースケール画像の一例を示す図である。図5に示す第1のグレースケール画像500は、図4に示した元画像400から得られたものである。
前述したように、第1の色空間要素は、鋼管20の端面(キャップ50)の領域の色(端面色情報により特定される色)である場合と、鋼管20(キャップ50)の背景の色である場合とで異なる値をとる要素である。よって、図5に示すように、赤色であるキャップ50の領域(キャップ50が写し出されている領域)の画素値が、他の赤色以外の色の領域の画素値と(大きく)異なる第1のグレースケール画像500が得られる。
第1のグレースケール画像作成部104は、例えば、CPU、RAM、ROM、及びHDDを用いることにより実現できる。
FIG. 5 is a diagram illustrating an example of the first grayscale image. The first
As described above, the first color space element is the color of the region of the end face (cap 50) of the steel pipe 20 (the color specified by the end face color information) and the background color of the steel pipe 20 (cap 50). It is an element that takes a different value in the case of. Therefore, as shown in FIG. 5, the pixel value of the red cap 50 region (the region where the cap 50 is projected) is different from the pixel values of the other non-red color regions. A
The first grayscale image creation unit 104 can be realized by using, for example, a CPU, RAM, ROM, and HDD.
(グレースケール2値化画像作成部105)
グレースケール2値化画像作成部105は、第1のグレースケール画像作成部104により作成された第1のグレースケール画像の各画素の画素値を、予め設定された閾値に基づいて2値化する。具体例を説明すると、グレースケール2値化画像作成部105は、第1のグレースケール画像の各画素について、画素値が閾値以上(又は閾値未満)である画素に論理「1」を割り当て、画素値が当該閾値未満(又は閾値以上)である画素に論理「0」を割り当てることにより第1のグレースケール画像を2値化する。また、色空間要素選択部102により選択された第1の色空間要素に応じて、グレースケール2値化画像作成部105は、第1のグレースケール画像の各画素について、画素値が所定の範囲内(又は所定の範囲外)である画素に論理「1」を割り当て、画素値が当該所定の範囲外(又は所定の範囲内)である画素に論理「0」を割り当てることにより第1のグレースケール画像を2値化することもできる。本実施形態では、端面色情報により特定される色(ここでは赤色)に応じた画素値を有する画素に可及的に論理「1」が割当てられ、それ以外の色に応じた画素値を有する画素に可及的に論理「0」が割当てられるようにするための閾値が、オペレータによる操作に基づいて予め設定されている。以下の説明では、グレースケール2値化画像作成部105により作成される2値化された画像を、必要に応じて「グレースケール2値化画像」と称する。
(Grayscale binary image creation unit 105)
The grayscale binarized
図6は、グレースケール2値化画像の一例を示す図である。図6に示すグレースケール2値化画像600は、図5に示した第1のグレースケール画像500から得られたものである。
図6に示すように、グレースケール2値化画像600では、概ね、キャップ50の領域に論理「1」が割当てられ(図6のグレーで塗りつぶされている領域を参照)、且つ、それ以外の領域に論理「0」が割当てられる(図6の白色の領域を参照)。
グレースケール2値化画像作成部105は、例えば、CPU、RAM、ROM、及びユーザインターフェースを用いることにより実現できる。尚、2値化処理の前にシェーディング補正を行うようにしてもよい。
FIG. 6 is a diagram illustrating an example of a grayscale binarized image. A grayscale
As shown in FIG. 6, in the grayscale
The grayscale binarized
(隙間補完後2値化画像作成部106)
隙間補完後2値化画像作成部106は、グレースケール2値化画像作成部105により作成されたグレースケール2値化画像において、画素値が「1」である領域に囲まれている「画素値が「0」である領域」の画素値を「1」に変更する。本実施形態では、隙間補完後2値化画像作成部106は、グレースケール2値化画像において、画素値が「1」である画素と、当該画素に対し縦、横及び斜めの何れかで隣接する画素であって、画素値が「1」である画素とを1つの領域とすることを、グレースケール2値化画像のそれぞれの画素について行う。隙間補完後2値化画像作成部106は、このようにして得られた領域の内側にある画素の画素値を全て「1」にする。
(Binary image creation unit 106 after gap compensation)
The binarized image creation unit 106 after gap complementation includes a “pixel value” surrounded by an area having a pixel value “1” in the grayscale binarized image created by the grayscale binarized
ただし、必ずしもこのようにする必要はない。例えば、次のようにしてもよい。すなわち、グレースケール2値化画像において、画素値が「0」である画素と、当該画素に対し縦、横及び斜めの何れかで隣接する画素であって、画素値が「0」である画素とを1つの領域とすることを、グレースケール2値化画像のそれぞれの画素について行い、このようにして得られた領域のうち、外縁の全ての画素が、画素値が「1」の画素と接している領域の画素値を全て「1」にするようにしてもよい。 However, this is not always necessary. For example, it may be as follows. That is, in a grayscale binarized image, a pixel having a pixel value “0” and a pixel adjacent to the pixel in any one of vertical, horizontal, and diagonal directions, and having a pixel value “0” For each pixel of the grayscale binarized image, and all the pixels at the outer edge of the region obtained in this way are pixels having a pixel value of “1”. All the pixel values in the contact area may be set to “1”.
以下の説明では、隙間補完後2値化画像作成部106により画素値が変更されたグレースケール2値化画像を、必要に応じて「隙間補完後2値化画像」と称する。
図7は、隙間補完後2値化画像の一例を示す図である。図7に示す隙間補完後2値化画像700は、図6に示したグレースケール2値化画像600から得られたものである。
図7に示すように、図6に示したグレースケール2値化画像600において、グレーで塗りつぶされている領域(画素値が「1」の領域)に囲まれている白色の領域(画素値が「0」の領域)がグレーで塗りつぶされる(画素値が「0」から「1」に変更される)。このようにすることによって、端面色情報により特定される色(ここでは赤色)が存在する領域(すなわちキャップ50が存在する一纏まりの領域)を他の領域と明確に区別することができる。
隙間補完後2値化画像作成部106は、例えば、CPU、RAM、及びROMを用いることにより実現できる。
In the following description, a grayscale binarized image whose pixel value has been changed by the gap-compensated binarized image creation unit 106 is referred to as a “gap-compensated binarized image” as necessary.
FIG. 7 is a diagram illustrating an example of a binarized image after gap complementation. A
As shown in FIG. 7, in the grayscale
The post-gap complement binarized image creation unit 106 can be realized by using, for example, a CPU, a RAM, and a ROM.
(第2のグレースケール画像作成部107)
第2のグレースケール画像作成部107は、元画像取得部103により取得された元画像のそれぞれの画素のデータから、色空間要素選択部102により選択された第2の色空間要素の値を導出し、それぞれの画素が、当該第2の色空間要素の値に応じた画素値を有するグレースケールの画像を作成する。第2のグレースケール画像作成部107により作成されるグレースケールの画像を、以下の説明では必要に応じて「第2のグレースケール画像」と称する。
(Second grayscale image creation unit 107)
The second grayscale
図8は、第2のグレースケール画像の一例を示すである。図8に示す第2のグレースケール画像800は、図4に示した元画像400から得られたものである。
前述したように、第2の色空間要素は、色のムラによって値が大きく変化せず、且つ、鋼管20の端面(キャップ50)の領域の色(端面色情報により特定される色)であるときの値と、それらの間の隙間の領域の色(ここでは黒色)であるときの値との差が第1の色空間要素におけるものよりも大きくなる要素である。よって、図8に示すように、第2のグレースケール画像800では、元画像400に対し、赤色であるキャップ50の領域の画素値の差が小さくなり(色むらが低減され)、且つ、キャップ50の領域の画素値とそれらの隙間の領域の画素値との差が大きくなる。
第2のグレースケール画像作成部107は、例えば、CPU、RAM、ROM、及びHDDを用いることにより実現できる。
FIG. 8 shows an example of the second grayscale image. A second
As described above, the value of the second color space element is a color of the region of the end surface (cap 50) of the steel pipe 20 (the color specified by the end surface color information) that does not change greatly due to color unevenness. This is an element in which the difference between the time 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. 8, in the second
The second grayscale
(計数対象領域抽出画像作成部108)
計数対象領域抽出画像作成部108は、第2のグレースケール画像作成部107により作成された第2のグレースケール画像から、領域補完後2値化画像作成部106により作成された隙間補完後2値化画像の画素値が「1」である領域を抽出する。以下の説明では、このようにして計数対象領域抽出画像作成部108により得られる画像を、必要に応じて「計数対象領域抽出画像」と称する。
図9は、計数対象領域抽出画像900の一例を示す図である。図9に示す計数対象領域抽出画像900は、図7に示した隙間補完後2値化画像700と、図8に示した第2のグレースケール画像800とから得られたものである。
(Counter area extraction image creation unit 108)
The counting target region extraction
FIG. 9 is a diagram illustrating an example of the count target
前述したように、第2のグレースケール画像800では、第1のグレースケール画像500に比べて、赤色であるキャップ50の領域の画素値の差が小さくなり、且つ、キャップ50の領域の画素値とそれらの隙間の領域の画素値との差が大きくなる。よって、第2のグレースケール画像800から、計数対象領域抽出画像900に基づき、キャップ50の領域を抽出すると、キャップ50の領域を、当該キャップ50を際立たせた状態で抽出することができる。
計数対象領域抽出画像作成部108は、例えば、CPU、RAM、ROM、及びHDDを用いることにより実現できる。
As described above, the second
The count target region extraction
(計数対象領域2値化画像作成部109)
計数対象領域2値化画像作成部109は、計数対象領域抽出画像作成部108により作成された計数対象領域抽出画像の各画素の画素値を、予め設定された閾値に基づいて2値化する。具体的に説明すると、計数対象領域2値化画像作成部109は、計数対象領域抽出画像の各画素について、画素値が閾値以上(又は未満)である画素に論理「1」を割り当て、画素値が当該閾値未満(又は以上)である画素に論理「0」を割り当てることにより計数対象領域抽出画像を2値化する。また、色空間要素選択部102により選択された第2の色空間要素に応じて、計数対象領域2値化画像作成部109は、計数対象領域抽出画像の各画素について、画素値が所定の範囲内(又は所定の範囲外)である画素に論理「1」を割り当て、画素値が当該所定の範囲外(又は所定の範囲内)である画素に論理「0」を割り当てることにより計数対象領域抽出画像を2値化することもできる。本実施形態では、端面色情報により特定される色(ここでは赤色)に応じた画素値を有する画素に可及的に論理「1」が割当てられ、それ以外の色に応じた画素値を有する画素に可及的に論理「0」が割当てられるようにするための閾値が、オペレータによる操作に基づいて予め設定されている。以下の説明では、計数対象領域2値化画像作成部109により作成される2値化された画像を、必要に応じて「計数対象領域2値化画像」と称する。
図10は、計数対象領域2値化画像の一例を示す図である。図10に示す計数対象領域2値化画像1000は、図9に示した計数対象領域抽出画像900から得られたものである。前述したように、計数対象領域抽出画像900では、キャップ50の領域の画素値の差が小さくなり、且つ、キャップ50の領域の画素値とそれらの隙間の領域の画素値との差が大きくなる。よって、計数対象領域抽出画像900を2値化すると、キャップ50の領域と、それらの間の領域とを明確に区別することができる。
計数対象領域2値化画像作成部109は、例えば、CPU、RAM、ROM、及びHDDを用いることにより実現できる。
(Counting target region binarized image creation unit 109)
The count target area binarized image creating unit 109 binarizes the pixel value of each pixel of the count target area extracted image created by the count target area extracted
FIG. 10 is a diagram illustrating an example of the count target region binarized image. A count target area
The count target area binarized image creation unit 109 can be realized by using, for example, a CPU, a RAM, a ROM, and an HDD.
(領域分離部110)
領域分離部110は、計数対象領域2値化画像作成部109により作成された計数対象領域2値化画像の画素値が「1」である画素と、当該画素に対し縦、横及び斜めの何れかで隣接する画素であって、画素値が「1」である画素とを1つの領域とすることを計数対象領域2値化画像のそれぞれの画素について行うことにより得られた領域を縮小させることにより、計数対象領域2値化画像を複数の領域(個々のキャップ50の領域)に分離する。以下の説明では、複数の領域に分離された状態の計数対象領域2値化画像を、必要に応じて「領域分離2値化画像」と称する。
図11は、領域分離2値化画像の一例を示す図である。図11に示す領域分離2値化画像1100は、図10に示した計数対象領域2値化画像1000から得られたものである。
(Region separation unit 110)
The region separating unit 110 includes a pixel whose pixel value is “1” in the counting target region binarized image created by the counting target region binarized image creating unit 109 and any of vertical, horizontal, and diagonal with respect 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 (areas of individual caps 50). In the following description, the count target area binarized image that is separated into a plurality of areas is referred to as an “area separated binarized image” as necessary.
FIG. 11 is a diagram illustrating an example of a region separation binarized image. An area separation
図12は、計数対象領域2値化画像を複数の領域に分離する様子の一例を概念的に示す図である。
まず、領域分離部110は、画素値が「1」である画素と、当該画素に対し縦、横及び斜めの何れかで隣接する画素であって、画素値が「1」である画素とを1つの領域とすることを計数対象領域2値化画像のそれぞれの画素について行う。これにより、画素値が「1」である画素により構成される閉領域であって、当該外縁の画素に接する画素の少なくとも1つが、画素値が「0」である画素となる閉領域(所謂ブロブ)が導出される。図10に示す例では、計数対象領域2値化画像1000において、グレーで表示されている領域が導出される。
FIG. 12 is a diagram conceptually illustrating an example of a state where the count target region binarized image is separated into a plurality of regions.
First, the region separation unit 110 calculates a pixel having a pixel value “1” and a pixel adjacent to the pixel in any one of vertical, horizontal, and diagonal directions and having a pixel value “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 illustrated in FIG. 10, a region displayed in gray in the count target region
次に、領域分離部110は、導出した閉領域の外縁の画素に対し、当該外縁の画素を接点とする接線に垂直な方向であって、当該閉領域が存在している方向に、所定の画素数分だけ離隔した位置を、当該閉領域の外縁の位置に変更することを、当該閉領域の外縁の画素について行う(図12の一番上の図において塗りつぶされている領域の外縁に付されている矢印線を参照)。ここで、導出した閉領域の外縁の位置の変更は、変更前の閉領域の外縁の画素と変更後の閉領域の外側との間に位置する画素の画素値を「1」から「0」に変更することにより行うことができる。 Next, the region separation unit 110 performs a predetermined process on a pixel at the outer edge of the derived closed region in a direction perpendicular to a tangent line with the pixel on the outer edge 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 region is performed for the pixels of the outer edge of the closed region (attached to the outer edge of the filled region in the top diagram of FIG. 12). 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
このような処理と共に、領域分離部110は、導出した閉領域の内縁の画素に対し、当該外縁の画素を接点とする接線に垂直な方向であって、当該閉領域が存在している方向に、所定の画素数分だけ離隔した位置を、当該閉領域の内縁の位置に変更することを、当該閉領域の内縁の画素について行う(図12の一番上の図において塗りつぶされている領域の内縁に付されている矢印線を参照)。ここで、閉領域の内縁の位置の変更は、変更前の閉領域の外縁の画素と変更後の閉領域の外側との間に位置する画素の画素値を「1」から「0」に変更することにより行うことができる。また、変更前の閉領域の内縁と変更後の閉領域の内縁との間隔(画素数)と、変更前の閉領域の外縁と変更後の閉領域の外縁との間隔(画素数)は(すなわち、前記所定の画素数は)、同じ値となる。 Along with such processing, the region separation unit 110 is directed to the inner edge pixel of the derived closed region in a direction perpendicular to a tangent line having the outer edge pixel as a contact, 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 the top diagram of FIG. 12). (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がずれた状態で段積みされている場合には、撮像装置30により撮像される鋼管20の端面側において、当該鋼管20が他の鋼管20と接触していないこと(又は少しの領域でしか接触していないこと)が生じ得る。そうすると、計数対象領域2値化画像作成部109により作成された計数対象領域2値化画像において、内縁が存在しない閉領域が孤立して存在することがある。このような場合、当該内縁が存在しない閉領域については、例えば、当該閉領域の外縁の位置だけを前述したようにして変更することができる。
For example, when a
以上のような処理を、図12に示すように段階的に行うことにより、1つの閉領域となっているキャップ50の領域を(図12の一番上に示す図を参照)、個々のキャップ50の領域に分離することができる(図12の一番下に示す図を参照)。
以上のようにして、図11に示す領域分離2値化画像1100が作成される。この領域分離2値化画像1100により、個々のキャップ50の領域(20個の領域)が他のキャップ50の領域と明確に区別される(すなわち、個々のキャップ50の領域(20個の領域)が単独で存在するようになる)。
領域分離部110は、例えば、CPU、RAM、及びROMを用いることにより実現できる。
By performing the above processing step by step as shown in FIG. 12, the region of the cap 50 which is one closed region (see the diagram shown at the top of FIG. 12) It can be divided into 50 regions (see the diagram shown at the bottom of FIG. 12).
As described above, the region
The area separation unit 110 can be realized by using, for example, a CPU, a RAM, and a ROM.
(ブロブ処理部111)
ブロブ処理部111は、領域分離部110により作成された領域分離2値化画像から、画素値が「1」である画素により構成される閉領域であって、当該外縁の画素に接する画素の少なくとも1つが、画素値が「0」である画素となる閉領域(所謂ブロブ)を導出する。具体的に説明すると、ブロブ処理部111は、領域分離部110により作成された領域分離2値化画像において、画素値が「1」である画素と、当該画素に対し縦、横及び斜めの何れかで隣接する画素であって、画素値が「1」である画素とを1つの領域とすることを、領域分離2値化画像のそれぞれの画素について行うことにより、ブロブを導出する。
(Blob processing unit 111)
The
次に、ブロブ処理部111は、導出した各ブロブに対してラベリング処理(番号の割り振り)を行う。図11に示す例では、導出した各ブロブに対して20個の番号が個別に割り振られる。
ブロブ処理部111は、例えば、CPU、RAM、及びROMを用いることにより実現できる。
Next, the
The
(本数導出部112)
本数導出部112は、ブロブ処理部111により各ブロブに対して割り振られた番号の総数を、計測対象物の本数として導出する。図11に示す例では、(スタック10において段積みされた)鋼管20の本数として「20」が導出される。
本数導出部112は、例えば、CPU、RAM、及びROMを用いることにより実現できる。
(Number deriving unit 112)
The number deriving unit 112 derives the total number of numbers assigned to each blob by the
The number deriving unit 112 can be realized by using, for example, a CPU, a RAM, and a ROM.
(出力画像作成部113)
出力画像作成部113は、本数導出部112により導出された計測対象物(ここでは鋼管20)の本数を含む画像を表示するための表示データを作成する。
本実施形態では、出力画像作成部113は、元画像取得部103により取得された元画像と、本数導出部112により導出された鋼管20の本数とを含む画像を表示するための表示データを作成する。さらに、本実施形態では、元画像におけるキャップ50の部分の領域を所定の色で塗りつぶした状態で元画像を表示する。このために、出力画像作成部113は、以下の処理を行う。
(Output Image Creation Unit 113)
The output
In the present embodiment, the output
まず、出力画像作成部113は、領域分離部110により作成された領域分離2値化画像(図11を参照)の画素値が「1」の閉領域(所謂ブロブ)を抽出する。次に、出力画像作成部113は、抽出した閉領域の外縁の画素に対し、当該外縁の画素を接点とする接線に垂直な方向であって、当該閉領域が存在していない方向に、所定の画素数分だけ離隔した位置を、当該閉領域の外縁の位置に変更することを、当該閉領域の外縁の画素について行う。ここで、抽出した閉領域の外縁の位置の変更は、変更前の閉領域の外縁の画素と変更後の閉領域の外側との間に位置する画素の画素値を「0」から「1」に変更することにより行うことができる。また、所定の画素数は、領域分離部110における閉領域の外縁・内縁の位置の変更分の1/n倍(nは1以上の数、例えば、「1.25」)した画素数(前記所定の間隔(画素数)×1/n)である。尚、このようにして得られた所定の画素数が整数でない場合には、例えば、小数点以下の値を切り捨てたり切り上げたりすることにより、前記所定の画素数を整数にする。これにより、領域分離部110により作成された個々の閉領域(所謂ブロブ)の大きさを、個々の閉領域が相互に隣接しない範囲で拡大することができる。
First, the output
次に、出力画像作成部113は、元画像のデータと、元画像取得部103により取得された元画像の領域のうち、以上のようにして得られた領域が所定の色に変更されるようにすることを示す情報を、表示データに含める。更に、出力画像作成部113は、本数導出部112により導出された鋼管20の本数を示す情報が、所定の領域に所定の態様で表示されるようにすることを示す情報も表示データに含める。
出力画像作成部113は、例えば、CPU、RAM、及びROMを用いることにより実現できる。
Next, the output
The output
(出力画像出力部114)
出力画像出力部114は、出力画像作成部113により作成された表示データを、表示装置に出力する。これにより、長尺物本数測定装置100に接続された表示装置(コンピュータディスプレイ)に鋼管20の本数を含む出力画像が表示される。
図13は、出力画像の一例を示す図である。図13に示す出力画像1300は、図4に示した元画像に基づいて得られたものである。
前述したように、出力画像1300には、キャップ50の領域が所定の色に変更された状態の元画像と、鋼管20の本数の情報が表示される。図13に示す出力画像1300では、鋼管20の本数が左上の領域に表示され(図13において「20」と示されている領域を参照)、キャップ50の領域が緑色に変更された状態で元画像が表示される。尚、キャップ50の領域が所定の色に変更された状態にするのは、キャップ50の領域をオペレータに識別させ易くするためである。
出力画像作成部113は、例えば、CPU、RAM、ROM、HDD、及び通信インターフェースを用いることにより実現できる。
(Output image output unit 114)
The output image output unit 114 outputs the display data created by the output
FIG. 13 is a diagram illustrating an example of an output image. An
As described above, the
The output
(動作フローチャート)
次に、図14のフローチャートを参照しながら、長尺物本数測定装置100の動作の一例を説明する。
まず、ステップS1401において、端面色情報取得部101は、端面色情報を取得する。前述したように、端面色情報は、計数対象となる長尺物(鋼管20)の端面の色を示す情報である。
次に、ステップS1402において、色空間要素選択部102は、ステップS1401で取得された端面色情報により特定される色に対応する「第1の色空間要素と第2の色空間要素」を色空間要素選択テーブル300から選択する。
(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.
First, in step S1401, the end face color information acquisition unit 101 acquires end face color information. As described above, the end face color information is information indicating the color of the end face of the long object (steel pipe 20) to be counted.
Next, in step S1402, the color space
次に、ステップS1403において、元画像取得部103は、撮像装置30で撮像された元画像を取得する(図4を参照)。前述したように、元画像は、段積みされている鋼管20の端面(キャップ50)の画像である。
次に、ステップS1404において、第1のグレースケール画像作成部104は、ステップS1403で取得された元画像のそれぞれの画素のデータが、ステップS1402で選択された第1の色空間要素の値に応じた画素値になるように各画素値を変更して第1のグレースケールの画像を作成する(図5を参照)。
Next, in step S1403, the original
Next, in step S1404, the first grayscale image creation unit 104 determines that the data of each pixel of the original image acquired in step S1403 corresponds to the value of the first color space element selected in step S1402. The first grayscale image is created by changing each pixel value so that the pixel value becomes the same (see FIG. 5).
次に、ステップS1405において、グレースケール2値化画像作成部105は、ステップS1404で作成された第1のグレースケール画像の各画素の画素値を、予め設定された閾値に基づいて2値化してグレースケール2値化画像を作成する(図6を参照)。
次に、ステップS1406において、隙間補完後2値化画像作成部106は、ステップS1405で作成されたグレースケール2値化画像において、画素値が「1」である領域に囲まれている「画素値が「0」である領域」の画素値を「1」に変更して隙間補完後2値化画像を作成する(図7を参照)。
Next, in step S1405, the grayscale binarized
Next, in step S1406, the gap-compensated binarized image creation unit 106 creates a “pixel value” surrounded by an area having a pixel value “1” in the grayscale binarized image created in step S1405. The pixel value of “region where is“ 0 ”” is changed to “1” to create a binarized image after gap interpolation (see FIG. 7).
次に、ステップS1407において、第2のグレースケール画像作成部107は、ステップS1403で取得された元画像のそれぞれの画素のデータが、ステップS1402で選択された第2の色空間要素の値に応じた画素値になるように各画素値を変更して第2のグレースケールの画像を作成する(図8を参照)。
尚、ステップS1407の処理は、ステップS1403の処理が終了してから、ステップS1408の処理が開始するまでの間であれば、いつ行ってもよい。
次に、ステップS1408において、計数対象領域抽出画像作成部108は、ステップS1407で作成された第2のグレースケール画像から、ステップS1406で作成された隙間補完後2値化画像の画素値が「1」である領域を抽出して計数対象領域抽出画像を作成する(図9を参照)。
Next, in step S1407, the second grayscale
Note that the process of step S1407 may be performed at any time from the end of the process of step S1403 to the start of the process of step S1408.
Next, in step S1408, the count target region extraction
次に、ステップS1409において、計数対象領域2値化画像作成部109は、ステップS1408で作成された計数対象領域抽出画像の各画素の画素値を、予め設定された閾値に基づいて2値化して計数対象領域2値化画像を作成する(図10を参照)。
次に、ステップS1410において、領域分離部110は、ステップS1409で作成された計数対象領域2値化画像の画素値が「1」である画素と、当該画素に対し縦、横及び斜めの何れかで隣接する画素であって、画素値が「1」である画素とを1つの領域とすることを当該計数対象領域2値化画像のそれぞれの画素について行うことにより得られた領域を縮小させることにより領域分離2値化画像1100を作成する(図11、図12を参照)。
Next, in step S1409, the count target region binarized image creating unit 109 binarizes the pixel value of each pixel of the count target region extracted image created in step S1408 based on a preset threshold value. A count target area binarized image is created (see FIG. 10).
Next, in step S1410, the region separation unit 110 selects a pixel whose pixel value is “1” in the count target region binarized image created in step S1409 and any of vertical, horizontal, and diagonal with respect to the pixel. The region obtained by performing each pixel of the count target region binarized image to make a pixel adjacent to each other and having a pixel value “1” as one region is reduced. Thus, a region-separated
次に、ステップS1411において、ブロブ処理部111は、ステップS1410で作成された領域分離2値化画像から、画素値が「1」である画素により構成される閉領域であって、当該外縁の画素に接する画素の少なくとも1つが、画素値が「0」である画素となる閉領域(所謂ブロブ)を導出し、各ブロブに対してラベリング処理(番号の割り振り)を行う。
次に、ステップS1412において、本数導出部112は、ステップS1411で各ブロブに対して割り振られた番号の総数を、計測対象物の本数として導出する。
Next, in step S1411, the
Next, in step S1412, the number deriving unit 112 derives the total number of numbers assigned to each blob in step S1411 as the number of measurement objects.
次に、ステップS1413において、出力画像作成部113は、ステップS1403で取得された元画像と、ステップS1410で作成された領域分離2値化画像と、ステップS1412で導出された計測対象物の本数とに基づいて、計測対象物の本数を含む画像を表示するための表示データを作成する。
最後に、ステップS1414において、出力画像出力部114は、ステップS1413で作成された表示データを、表示装置に表示する(図13を参照)。
Next, in step S1413, the output
Finally, in step S1414, the output image output unit 114 displays the display data created in step S1413 on the display device (see FIG. 13).
(まとめ)
以上のように本実施形態では、元画像から、CIE Lab色空間のa*の値に応じた画素値を有する第1のグレースケールの画像と、RGB色空間のRの値に応じた画素値を有する第2のグレースケールの画像とを作成する。そして、第1のグレースケールの画像を2値化したグレースケール2値化画像を作成し、当該グレースケール2値化画像を用いて、鋼管20の端面(キャップ50)の領域を、第2のグレースケールの画像から抽出し計数対象領域2値化画像を作成する。そして、計数対象領域2値化画像の画素値が「1」である一纏まりの領域の外縁と内縁を当該領域が存在している方向に移動させることにより、計数対象領域2値化画像における、個々のキャップ50の領域を分離する。このように、CIE Lab色空間のa*の値に応じた画素値を有する第1のグレースケールの画像を作成することにより、キャップ50を表す画素の画素値と背景を表す画素の画素値とに差をつけることができ、キャップ50が存在している領域を正確に識別することができる。また、計数対象領域2値化画像の画素値が「1」である一纏まりの領域の外縁と内縁を当該領域の内側に移動させることにより、段積みされている長尺物が存在している領域を分離することができる。よって、端面が開口していない状態であり且つ着色されている状態の複数の長尺物が段積みされている場合であっても、当該段積みされている複数の長尺物の本数を自動的に且つ正確に測定することができる。
(Summary)
As described above, in the present embodiment, from the original image, the first grayscale image having a pixel value corresponding to the value of a * in the CIE Lab color space, and the pixel value corresponding to the R value in the RGB color space. And a second gray scale image. And the gray scale binarized image which binarized the 1st gray scale image is created, The area | region of the end surface (cap 50) of the
(変形例)
本実施形態では、本数を計測する対象となる長尺物が、端面にキャップが付けられた鋼管である場合を例に挙げて説明した。しかしながら、本数を計測する対象となる長尺物は、端面が開口していない状態であり、且つ、長尺物(の地色)と異なる所定の色で着色されている状態の長尺物であればよい。本数を計測する対象となる長尺物は、例えば、端面が地色と異なる所定の色で着色された棒鋼等であってもよい。
また、本実施形態では、本数を計測する対象となる長尺物の端面の形状が円形である場合を例に挙げて説明した。しかしながら、本数を計測する対象となる長尺物の端面の形状は、撮像を行う端面側において、相互に隣接する長尺物の間の少なくとも一部に隙間が形成されるように段積みされる長尺物であればよい。本数を計測する対象となる長尺物の端面の形状は、例えば、楕円形、多角形等であってもよい。
また、第1の色空間要素、第2の色空間要素は、前述したものに限定されない。長尺物の端面の色に応じて、例えば、CIE 1976 L*u*v*色空間の要素や、CIE XYZ色空間の要素を第1の色空間要素、第2の色空間要素として採用することができる。
(Modification)
In this embodiment, the case where the long object used as the object which measures a number is the steel pipe with which the cap was attached to the end surface was mentioned as an example, and was demonstrated. However, the long object for which the number is to be measured is a long object in which the end face is not open and is colored in a predetermined color different from the long object (ground color). I just need it. The long object that is the object of measuring the number may be, for example, a steel bar whose end face is colored with a predetermined color different from the ground color.
Moreover, in this embodiment, the case where the shape of the end surface of the elongate object used as the object which measures the number was circular was mentioned as an example, and was demonstrated. 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 face of the long object that is the object of measuring the number may be, for example, an ellipse or a polygon.
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のグレースケール画像から抽出する領域を、キャップ50の領域に、より確実に一致させることができるので好ましい。しかしながら、必ずしも隙間補完後2値化画像を作成する必要はない。例えば、端面の色のムラが小さい場合には、グレースケール2値化画像600における、画素値が「1」である一纏まりの領域は明瞭であるので、このような場合には、当該一纏まりの領域を、第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 region of the cap 50. However, it is not always necessary to create a binarized image after gap compensation. For example, when the color unevenness of the end face is small, a group of regions having a pixel value of “1” in the grayscale
また、本実施形態では、第1のグレースケール画像と第2のグレースケール画像とを作成し、第1のグレースケール画像からグレースケール2値化画像を、グレースケール2値化画像から隙間補完後2値化画像を、それぞれ作成し、隙間補完後2値化画像に基づいて定められる領域を第2のグレースケール画像から抽出して計数対象領域抽出画像を作成した。しかしながら、少なくとも、第2のグレースケール画像、隙間補完後2値化画像、及び計数対象領域抽出画像については必ずしも作成する必要はない。鋼管20の端面(キャップ50)の領域の色(端面色情報により特定される色)である場合と、鋼管20(キャップ50)の背景の色である場合とで(可及的に大きく)異なる値をとり、鋼管20の端面(キャップ50)の領域の色であるときの値と、それらの間の隙間の領域の色であるときの値との差が大きく、且つ、色のムラによって値が大きく変化しない要素として1つの要素を選択できる場合には、第1の色空間要素と第2の色空間要素とを同じ要素にすることができる。すなわち、第1の色空間要素と第2の色空間要素とが同じ要素になる場合には、グレースケール2値化画像した段階で、計数対象領域2値化画像と同等の2値化画像を得ることができる。よって、このような場合には、第2のグレースケール画像、隙間補完後2値化画像、及び計数対象領域抽出画像は不要となる。また、このことから明らかなように、本実施形態のようにして第1のグレースケール画像と第2のグレースケール画像を生成する場合には、第1の色空間要素と第2の色空間要素とが異なる要素であるのことが好ましい。
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, it is not always necessary to create at least the second gray scale image, the binarized image after gap interpolation, and the count target region extraction image. The color of the region of the end face (cap 50) of the steel pipe 20 (the color specified by the end face color information) differs from the case of the background color of the steel pipe 20 (cap 50) (as large as possible). The difference between the value when the color is in the region of the end face (cap 50) of the
尚、以上説明した本発明の実施形態は、コンピュータがプログラムを実行することによって実現することができる。また、前記プログラムを記録したコンピュータ読み取り可能な記録媒体及び前記プログラム等のコンピュータプログラムプロダクトも本発明の実施形態として適用することができる。記録媒体としては、例えば、フレキシブルディスク、ハードディスク、光ディスク、光磁気ディスク、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 撮像装置
41、42 照明装置
50 キャップ
100 長尺物本数測定装置
200 上位コンピュータ
300 色空間要素選択テーブル
400 元画像
500 第1のグレースケール画像
600 グレースケール2値化画像
700 隙間補完後2値化画像
800 第2のグレースケール画像
900 計数対象領域抽出画像
1000 計数対象領域2値化画像
1100 領域分離2値化画像
1300 出力画像
DESCRIPTION OF
Claims (11)
前記複数の長尺物の端面を撮像することにより得られたカラー画像である元画像を取得する元画像取得手段と、
前記元画像取得手段により取得された元画像から、前記端面の色に応じて予め設定された第1の色空間要素の値を導出し、それぞれの画素が、当該第1の色空間要素の値に応じた画素値を有する第1のグレースケール画像を作成する第1のグレースケール画像作成手段と、
前記第1のグレースケール画像作成手段により作成された第1のグレースケール画像を2値化してグレースケール2値化画像を作成するグレースケール2値化画像作成手段と、
前記グレースケール2値化画像作成手段により作成されたグレースケール2値化画像に基づいて、前記端面の色に対応する画素値を有する一纏まりの領域を識別し、識別した一纏まりの領域の外縁と内縁の位置を、それぞれ当該一纏まりの領域が存在している方向に移動させることにより、当該一纏まりの領域を複数の領域に分離する領域分離手段と、
前記領域分離手段により分離された領域の数に基づいて、前記複数の長尺物を計数する計数手段と、
前記計数手段により計数された前記複数の長尺物の数を含む情報を出力する出力手段と、を有し、
前記第1の色空間要素は、前記段積みされている複数の長尺物の端面の色である場合と、前記段積みされている複数の長尺物の端面の背景の色である場合とで異なる値をとる要素であることを特徴とする長尺物本数測定装置。 The number of a plurality of long objects in which the end face is not open and is colored with a predetermined color, and a gap is formed in at least a partial region of the long objects adjacent to each other. A long object number measuring device for measuring the number of a plurality of long objects stacked in a stack,
Original image acquisition means for acquiring an original image which is a color image obtained by imaging the end faces of the plurality of long objects;
A value of a first color space element set in advance according to the color of the end face is derived from the original image acquired by the original image acquisition unit, and each pixel has a value of the first color space element. First grayscale image creating means for creating a first grayscale image having a pixel value according to
Grayscale binarized image creating means for binarizing the first grayscale image created by the first grayscale image creating means to create a grayscale binarized image;
Based on the grayscale binarized image created by the grayscale binarized image creating means, a group of regions having pixel values corresponding to the color of the end face is identified, and an outer edge of the identified group of regions And a region separating means for separating the group of regions into a plurality of regions by moving the positions of the inner edges in a direction in which the group of regions exists,
Counting means for counting the plurality of long objects based on the number of areas separated by the area separating means;
Output means for outputting information including the number of the plurality of long objects counted by the counting means,
When the first color space element is a color of an end face of the plurality of stacked long objects and a color of a background of the end faces of the plurality of long objects stacked A device for measuring the number of long objects characterized by having different values.
前記グレースケール2値化画像作成手段により作成されたグレースケール2値化画像に基づいて、前記端面の色に対応する画素値を有する領域を、前記第2のグレースケール画像作成手段により作成された第2のグレースケール画像から抽出して計数対象領域抽出画像を作成する計数対象領域抽出画像作成手段と、
前記計数対象領域抽出画像作成手段により作成された計数対象領域抽出画像を2値化して計数対象領域2値化画像を作成する計数対象領域2値化画像作成手段と、を更に有し、
前記領域分離手段は、前記計数対象領域2値化画像作成手段により作成された計数対象領域2値化画像から、前記端面の色に対応する画素値を有する一纏まりの領域を識別し、識別した一纏まりの領域の外縁と内縁の位置を、それぞれ当該一纏まりの領域が存在している方向に移動させることにより、当該一纏まりの領域を複数の領域に分離し、
前記第2の色空間要素は、前記段積みされている複数の長尺物の端面の色である場合の値と、それらの間の隙間の領域の色である場合の値との差が前記第1の色空間要素におけるものよりも大きくなる要素であることを特徴とする請求項1又は2に記載の長尺物本数測定装置。 A value of a second color space element set in advance according to the color of the end face is derived from the original image acquired by the original image acquisition unit, and each pixel has a value of the second color space element. Second grayscale image creating means for creating a second grayscale image having pixel values according to
Based on the grayscale binarized image created by the grayscale binarized image creating means, an area having a pixel value corresponding to the color of the end face is created by the second grayscale image creating means. Counting target area extraction image creating means for creating a counting target area extraction image by extracting from the second grayscale image;
Counting object area binarized image creating means for binarizing the counting object area extraction image created by the counting object area extraction image creating means to create a counting object area binarized image;
The region separation unit identifies and identifies a group of regions having pixel values corresponding to the color of the end face from the count target region binarized image created by the count target region binarized image creation unit. By separating the positions of the outer edge and inner edge of the group of areas in the direction in which the group of areas exists, the group of areas is separated into a plurality of areas,
The second color space element has a difference between a value when the color is an end face color of the plurality of stacked long objects and a value when the color is a color of a gap between them. The long object number measuring apparatus according to claim 1, wherein the element is larger than that in the first color space element.
前記計数対象領域抽出画像作成手段は、前記隙間補完後2値化画像作成手段により作成された隙間補完後2値化画像における、前記端面の色に対応する画素値を有する領域を、前記第2のグレースケール画像作成手段により作成された第2のグレースケール画像から抽出して計数対象領域抽出画像を作成することを特徴とする請求項3に記載の長尺物本数測定装置。 In the grayscale binarized image created by the grayscale binarized image creating means, the color of the end face among the pixel values of a group of pixels having pixel values not corresponding to the color of the end face. After gap complementation 2 for creating a binarized image after gap complementation by changing pixel values of a region surrounded by a group of pixels having corresponding pixel values to pixel values corresponding to the color of the end face It further has a value image creating means,
The counting target region extraction image creation unit is configured to extract a region having a pixel value corresponding to the color of the end face in the binarized image after gap complementation created by the gap complemented binary image creation unit. The long object count measuring apparatus according to claim 3, wherein a count target region extraction image is created by extracting from the second grayscale image created by the grayscale image creation means.
前記複数の長尺物の端面を撮像することにより得られたカラー画像である元画像を取得する元画像取得工程と、
前記元画像取得工程により取得された元画像から、前記端面の色に応じて予め設定された第1の色空間要素の値を導出し、それぞれの画素が、当該第1の色空間要素の値に応じた画素値を有する第1のグレースケール画像を作成する第1のグレースケール画像作成工程と、
前記第1のグレースケール画像作成工程により作成された第1のグレースケール画像を2値化してグレースケール2値化画像を作成するグレースケール2値化画像作成工程と、
前記グレースケール2値化画像作成工程により作成されたグレースケール2値化画像に基づいて、前記端面の色に対応する画素値を有する一纏まりの領域を識別し、識別した一纏まりの領域の外縁と内縁の位置を、それぞれ当該一纏まりの領域が存在している方向に移動させることにより、当該一纏まりの領域を複数の領域に分離する領域分離工程と、
前記領域分離工程により分離された領域の数に基づいて、前記複数の長尺物を計数する計数工程と、
前記計数工程により計数された前記複数の長尺物の数を含む情報を出力する出力工程と、を有し、
前記第1の色空間要素は、前記段積みされている複数の長尺物の端面の色である場合と、前記段積みされている複数の長尺物の端面の背景の色である場合とで異なる値をとる要素であることを特徴とする長尺物本数測定方法。 The number of a plurality of long objects in which the end face is not open and is colored with a predetermined color, and a gap is formed in at least a partial region of the long objects adjacent to each other. A long object number measuring method for measuring the number of a plurality of long objects stacked in such a manner,
An original image acquisition step of acquiring an original image that is a color image obtained by imaging the end surfaces of the plurality of long objects;
A value of a first color space element set in advance according to the color of the end face is derived from the original image acquired by the original image acquisition step, and each pixel has a value of the first color space element. A first grayscale image creating step of creating a first grayscale image having a pixel value according to
A grayscale binarized image creating step of binarizing the first grayscale image created by the first grayscale image creating step to create a grayscale binarized image;
Based on the grayscale binarized image created by the grayscale binarized image creating step, a group of regions having pixel values corresponding to the color of the end face is identified, and an outer edge of the identified group of regions And a region separation step of separating the group of regions into a plurality of regions by moving the positions of the inner edges in the direction in which the group of regions exists,
A counting step of counting the plurality of long objects based on the number of regions separated by the region separation step;
An output step of outputting information including the number of the plurality of long objects counted in the counting step,
When the first color space element is a color of an end face of the plurality of stacked long objects and a color of a background of the end faces of the plurality of long objects stacked A method for measuring the number of long objects, which is an element having different values.
前記グレースケール2値化画像作成工程により作成されたグレースケール2値化画像に基づいて、前記端面の色に対応する画素値を有する領域を、前記第2のグレースケール画像作成工程により作成された第2のグレースケール画像から抽出して計数対象領域抽出画像を作成する計数対象領域抽出画像作成工程と、
前記計数対象領域抽出画像作成工程により作成された計数対象領域抽出画像を2値化して計数対象領域2値化画像を作成する計数対象領域2値化画像作成工程と、を更に有し、
前記領域分離工程は、前記計数対象領域2値化画像作成工程により作成された計数対象領域2値化画像から、前記端面の色に対応する画素値を有する一纏まりの領域を識別し、識別した一纏まりの領域の外縁と内縁の位置を、それぞれ当該一纏まりの領域が存在している方向に移動させることにより、当該一纏まりの領域を複数の領域に分離し、
前記第2の色空間要素は、前記段積みされている複数の長尺物の端面の色である場合の値と、それらの間の隙間の領域の色である場合の値との差が前記第1の色空間要素におけるものよりも大きくなる要素であることを特徴とする請求項6又は7に記載の長尺物本数測定方法。 A value of a second color space element set in advance according to the color of the end face is derived from the original image acquired by the original image acquisition step, and each pixel has a value of the second color space element. A second grayscale image creating step of creating a second grayscale image having a pixel value according to
Based on the grayscale binarized image created by the grayscale binarized image creating step, an area having a pixel value corresponding to the color of the end face was created by the second grayscale image creating step. A counting target region extraction image creating step of creating a counting target region extraction image by extracting from the second grayscale image;
A counting target region binarized image creating step of binarizing the counting target region extracting image created by the counting target region extracting image creating step to create a counting target region binarized image;
The region separation step identifies and identifies a group of regions having pixel values corresponding to the color of the end face from the count target region binarized image created by the count target region binarized image creation step. By separating the positions of the outer edge and inner edge of the group of areas in the direction in which the group of areas exists, the group of areas is separated into a plurality of areas,
The second color space element has a difference between a value when the color is an end face color of the plurality of stacked long objects and a value when the color is a color of a gap between them. The method for measuring the number of long objects according to claim 6 or 7, wherein the element is larger than that in the first color space element.
前記計数対象領域抽出画像作成工程は、前記隙間補完後2値化画像作成工程により作成された隙間補完後2値化画像における、前記端面の色に対応する画素値を有する領域を、前記第2のグレースケール画像作成工程により作成された第2のグレースケール画像から抽出して計数対象領域抽出画像を作成することを特徴とする請求項8に記載の長尺物本数測定方法。 In the grayscale binarized image created by the grayscale binarized image creating step, the color of the end face among the pixel values of a group of pixels having pixel values not corresponding to the color of the end face. After gap complementation 2 for creating a binarized image after gap complementation by changing pixel values of a region surrounded by a group of pixels having corresponding pixel values to pixel values corresponding to the color of the end face It further has a value image creation process,
In the counting target region extraction image creation step, a region having a pixel value corresponding to the color of the end face in the binarized image after gap complementation created by the gap complemented binary image creation step 9. The method for measuring the number of long objects according to claim 8, wherein a count target region extraction image is created by extracting from the second gray scale image created by the gray scale image creation step.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2012173112A JP5788367B2 (en) | 2012-08-03 | 2012-08-03 | Long object number measuring device, long object number measuring method, and computer program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2012173112A JP5788367B2 (en) | 2012-08-03 | 2012-08-03 | Long object number measuring device, long object number measuring method, and computer program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2014032553A JP2014032553A (en) | 2014-02-20 |
JP5788367B2 true JP5788367B2 (en) | 2015-09-30 |
Family
ID=50282328
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2012173112A Active JP5788367B2 (en) | 2012-08-03 | 2012-08-03 | Long object number measuring device, long object number measuring method, and computer program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5788367B2 (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104992222B (en) * | 2015-07-21 | 2017-09-29 | 梧州学院 | A kind of fast automatic method of counting of jewel based on image |
CN107730448B (en) * | 2017-10-31 | 2020-11-27 | 北京小米移动软件有限公司 | Beautifying method and device based on image processing |
CN108109133B (en) * | 2017-10-31 | 2021-10-12 | 青岛大学 | Silkworm egg automatic counting method based on digital image processing technology |
CN108010076B (en) * | 2017-11-23 | 2020-03-31 | 南通大学 | End face appearance modeling method for intensive industrial bar image detection |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS5228583B2 (en) * | 1972-06-10 | 1977-07-27 | ||
JPS5315864A (en) * | 1976-07-28 | 1978-02-14 | Mitsubishi Electric Corp | Automatic counting system for round particles |
JPH04238592A (en) * | 1991-01-23 | 1992-08-26 | Kobe Steel Ltd | Automatic bundled bar steel tally device |
JP3022145B2 (en) * | 1994-04-08 | 2000-03-15 | 三洋電機株式会社 | Tablet inspection apparatus and tablet inspection method provided with image recognition means |
US7570786B2 (en) * | 2004-08-30 | 2009-08-04 | Antoun Ateya | Automatic digital object counting and verification system and associated method |
JP2007206843A (en) * | 2006-01-31 | 2007-08-16 | Central Res Inst Of Electric Power Ind | Method and device for counting moving body underwater or on water surface and its program |
JP5077093B2 (en) * | 2008-06-23 | 2012-11-21 | 大同特殊鋼株式会社 | Round bar number counting device and round bar number counting method |
-
2012
- 2012-08-03 JP JP2012173112A patent/JP5788367B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2014032553A (en) | 2014-02-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9807280B2 (en) | Image processing apparatus, method, and storage medium | |
JP5207719B2 (en) | Label with color code, color code extraction means, and three-dimensional measurement system | |
EP3563345B1 (en) | Automatic detection, counting, and measurement of lumber boards using a handheld device | |
WO2018179559A1 (en) | Defect detection system for aircraft component and defect detection method for aircraft component | |
JP5788367B2 (en) | Long object number measuring device, long object number measuring method, and computer program | |
US20120207379A1 (en) | Image Inspection Apparatus, Image Inspection Method, And Computer Program | |
CN107609546A (en) | A kind of caption recognition methods and device | |
JP5337563B2 (en) | Form recognition method and apparatus | |
CN101261682B (en) | Image processing apparatus, image processing method | |
CN103852034B (en) | A kind of method for measuring perendicular | |
CN105991882B (en) | Image processing apparatus and method for detecting area | |
KR101549495B1 (en) | An apparatus for extracting characters and the method thereof | |
US11216905B2 (en) | Automatic detection, counting, and measurement of lumber boards using a handheld device | |
US9628659B2 (en) | Method and apparatus for inspecting an object employing machine vision | |
JP6395895B1 (en) | Video inspection recognition device | |
JP6100602B2 (en) | Long object number measuring device, long object number measuring method, and computer program | |
JP2010008159A (en) | Visual inspection processing method | |
US11367266B2 (en) | Image recognition system, image recognition method, and storage medium | |
JP5887242B2 (en) | Image processing apparatus, image processing method, and program | |
JP5825226B2 (en) | Pipe number counting method, pipe number counting device, and computer program | |
CN110084117B (en) | Document table line detection method and system based on binary image segmentation projection | |
JP2011087144A (en) | Telop character area detection method, telop character area detection device, and telop character area detection program | |
JP2012185810A (en) | Image processing system and image processing program | |
KR101015646B1 (en) | Face detecting apparatus and face detection using the same | |
KR101012729B1 (en) | The system for extracting character using marker |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A711 | Notification of change in applicant |
Free format text: JAPANESE INTERMEDIATE CODE: A712 Effective date: 20140116 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20140210 |
|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20140919 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20150611 |
|
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: 20150630 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20150729 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 5788367 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
S533 | Written request for registration of change of name |
Free format text: JAPANESE INTERMEDIATE CODE: R313533 |
|
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 |
|
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 |