JP2010004904A - Button front/back determination method - Google Patents
Button front/back determination method Download PDFInfo
- Publication number
- JP2010004904A JP2010004904A JP2008163954A JP2008163954A JP2010004904A JP 2010004904 A JP2010004904 A JP 2010004904A JP 2008163954 A JP2008163954 A JP 2008163954A JP 2008163954 A JP2008163954 A JP 2008163954A JP 2010004904 A JP2010004904 A JP 2010004904A
- Authority
- JP
- Japan
- Prior art keywords
- button
- image
- imaging
- captured image
- camera
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Landscapes
- Image Processing (AREA)
- Image Analysis (AREA)
- Sewing Machines And Sewing (AREA)
Abstract
Description
本発明は、カメラでボタンを撮像し、その撮像画像からボタンの表裏を判定するボタンの表裏判定方法に関する。 The present invention relates to a button front / back determination method for imaging a button with a camera and determining the front / back of the button from the captured image.
衣類等の被縫製物にボタンを縫い付けるボタン付けミシンでは、ボタン保持部が被縫製物の近傍でボタンを保持して縫いを行う。このとき、ボタン保持部にはボタン供給装置によって逐次ボタンが供給されるが、ボタン保持部にボタンが供給されるときにボタンの表裏が正しい向きとなっている必要がある。このため、ボタンの表裏を判定する機構が必要とされているが、従来の機構としてはボタンの一方の面(例えば裏)が凸状となっているボタンの場合に、ボタンの搬送経路に設けられた選別板により凸面が上向きに搬送されているボタンのみを搬送経路からボタンを落下させることでボタンの表裏判定を行うボタン選別装置が知られている(例えば特許文献1)。
しかしながら、従来のボタン選別装置では一方の面が凸面であるといったような顕著な物理的特徴による表裏判定を行えるボタンにのみ適用可能であり、表と裏の形状に大きな差がないボタンの表裏を判定することはできないといった問題点があった。また、適用可能なボタンであってもボタンの大きさや種類によって選別板の微調整を行う必要があり、煩雑な作業を伴うといった問題点があった。加えて、当該微調整には熟練を要し、誰でも行えるものではなかった。 However, in the conventional button selection device, it can be applied only to buttons that can perform front / back determination based on remarkable physical characteristics such as one side being convex, and the front and back of a button that does not have a large difference in shape between the front and back sides. There was a problem that it could not be judged. Further, even if the button is applicable, it is necessary to finely adjust the sorting plate depending on the size and type of the button, and there is a problem in that it involves complicated work. In addition, the fine adjustment required skill and could not be performed by anyone.
そこで、ボタンをカメラ等の撮像装置で撮像し、画像認識処理を用いてボタンの表裏を判定する方法が検討されている。画像認識処理によるボタンの表裏判定を行う場合、テンプレートマッチングによる方法が考えられる。テンプレートマッチングを用いてボタンの表裏を判定する場合、ボタンが所定の向き(例えば表面が上)となるよう配置された状態で所定の方向(例えば上方)から撮像した撮像画像である判定元画像をあらかじめ用意し、供給するボタンを所定の方向から撮像した画像と判定元画像とを比較してその近似の度合いによって供給するボタンの表裏を判定する。また、テンプレートマッチングは画像の近似の度合いによって是非の判定を行うので、同時にボタンの種類の同非も判定される。一定以上近似していれば供給するボタンの表面は同種種類であり、かつ、正しい向きと判定され、そうでなければエラー即ち当該ボタンは裏面が上、あるいは異なるボタンであると判定される。 In view of this, a method of taking an image of a button with an imaging device such as a camera and determining the front and back of the button using image recognition processing has been studied. A template matching method is conceivable when performing button front / back determination by image recognition processing. When determining the front and back of a button using template matching, a determination source image that is a captured image captured from a predetermined direction (for example, upward) in a state where the button is arranged in a predetermined direction (for example, the surface is upward) The prepared button is compared with an image obtained by imaging the button to be supplied from a predetermined direction and the determination source image, and the front and back of the button to be supplied is determined according to the degree of approximation. In addition, since template matching makes a determination based on the degree of approximation of an image, the type of button is also determined at the same time. If it is approximated by a certain level or more, the surface of the button to be supplied is of the same kind and is determined to be in the correct orientation. Otherwise, an error, that is, the button is determined to be on the back or on a different button.
しかしながら、判定元画像を撮像した後に時間が経過することで、判定元画像を撮像した際にボタンに照射されていた照明等の諸条件と、表裏を判定される対象となるボタンに対する照明等の諸条件とが変化すると、同種の種類のボタンであって、かつ、表裏が正しい向きのボタンであっても、画像の近似の度合いが一定以上とならずにエラーとなることがあるといった問題点があった。 However, as time elapses after the determination source image is captured, various conditions such as the illumination applied to the button when the determination source image is captured, and the illumination for the button for which the front and back are to be determined, etc. If the conditions change, even if the buttons are of the same type and the front and back are in the correct orientation, the degree of image approximation may not exceed a certain level and an error may occur. was there.
本発明は、上述の問題点に鑑み、より好適にボタンの表裏判定を行えるボタンの表裏判定方法を提供することを目的とする。 In view of the above-described problems, an object of the present invention is to provide a button front / back determination method that can perform button front / back determination more suitably.
請求項1記載の発明は、カメラでボタンを撮像し、その撮像画像からボタンの表裏を判定するボタンの表裏判定方法において、表又は裏の基準となるボタンを前記カメラで撮像する第1の撮像工程と、表裏を判定する対象となるボタンを撮像する第2の撮像工程と、前記第1の撮像工程で得られた撮像画像と前記第2の撮像工程で得られた撮像画像とから前記第2の撮像画像に写ったボタンの表裏を判定する判定工程と、を有し、前記第1の撮像工程は、前記第2の撮像工程と同時又は前記第2の撮像工程の直前に行うことを特徴とする。 According to the first aspect of the present invention, in the button front / back determination method for imaging a button with a camera and determining the front / back of the button from the captured image, the first imaging for imaging a button serving as a front / back reference with the camera. A second imaging step for imaging a button to be used for determining front and back, a captured image obtained in the first imaging step, and a captured image obtained in the second imaging step. A determination step of determining the front and back of the button shown in the two captured images, wherein the first imaging step is performed simultaneously with the second imaging step or immediately before the second imaging step. Features.
請求項2記載の発明は、請求項1に記載のボタンの表裏判定方法において、前記第1の撮像工程は、前記第2の撮像工程を行うのと同時又は前記第2の撮像工程を行う直前に毎回行うことを特徴とする。 According to a second aspect of the present invention, in the button front / back determination method according to the first aspect, the first imaging step is performed simultaneously with the second imaging step or immediately before the second imaging step. This is performed every time.
請求項3記載の発明は、請求項1又は2に記載のボタンの表裏判定方法において、表又は裏の基準となるボタンと表裏を判定する対象となるボタンとを並べて配置し、ひとつのカメラで当該表又は裏の基準となるボタンと表裏を判定する対象となるボタンを同時に撮像することを特徴とする。 According to a third aspect of the present invention, in the button front / back determination method according to the first or second aspect, a button serving as a front or back reference and a button serving as a target for front / back determination are arranged side by side, and a single camera is used. The button which becomes the reference | standard of the said front or back and the button used as the object which determines the front and back is imaged simultaneously.
請求項4記載の発明は、請求項1又は2に記載のボタンの表裏判定方法において、前記第1の撮像工程と前記第2の撮像工程は、異なるカメラによって行われることを特徴とする。 According to a fourth aspect of the present invention, in the button front / back determination method according to the first or second aspect, the first imaging step and the second imaging step are performed by different cameras.
請求項5記載の発明は、請求項1に記載のボタンの表裏判定方法において、前記第1の撮像工程で得られた撮像画像と前記第2の撮像工程で得られた撮像画像とが所定以上近似していた場合、当該第2の撮像工程で得られた撮像画像を次の第1の撮像工程の撮像画像とすることを特徴とする。 According to a fifth aspect of the present invention, in the button front / back determination method according to the first aspect, the captured image obtained in the first imaging step and the captured image obtained in the second imaging step are not less than a predetermined value. When approximated, the captured image obtained in the second imaging step is used as the captured image in the next first imaging step.
請求項6記載の発明は、請求項1から5のいずれか一項に記載のボタンの表裏判定方法において、前記第1の撮像工程及び前記第2の撮像工程は、前記ボタンを側方から撮像することを特徴とする。 According to a sixth aspect of the present invention, in the button front / back determination method according to any one of the first to fifth aspects, the first imaging step and the second imaging step capture the button from the side. It is characterized by doing.
請求項7記載の発明は、請求項1から6のいずれか一項に記載のボタンの表裏判定方法において、前記第1の撮像工程で得られた撮像画像の一部又は一部を加工した画像を用いてボタンの表裏の判定を行うことを特徴とする。
なお、「所定以上近似」とは、第1の撮像画像に写った表又は裏の基準となるボタンと、第2の撮像画像に写った表裏を判定するボタンとが共に同じ面(表又は裏)を撮像されていると判定工程で判定される程度に近似していることを指す。
The invention according to claim 7 is an image obtained by processing a part or part of the captured image obtained in the first imaging step in the button front / back determination method according to any one of claims 1 to 6. It is characterized by determining the front and back of the button using.
Note that “approximate more than a predetermined value” means that the front or back reference button shown in the first captured image and the button for determining the front and back shown in the second captured image are both the same side (front or back). ) Is approximated to the extent that it is determined in the determination step.
請求項1記載の発明によれば、第1の撮像工程は第2の撮像工程と同時又は第2の撮像工程の直前に行う。つまり、表裏を判定したいボタンがある場合、表裏を判定したいボタンの撮像と同時またはその直前に表又は裏の基準となるボタンの撮像を行える。よって、表裏を判定したいボタンの判定元画像があらかじめ用意されていなくてもよく、表裏を判定したいボタンの撮像と同様の要領で表又は裏の基準となるボタンの撮像を行えば事足りる。
また、第1の撮像工程は第2の撮像工程と同時又は第2の撮像工程の直前に行うので、第1の撮像工程と第2の撮像工程の照明等の条件を同様とすることで、第1の撮像工程で得られる撮像画像と第2の撮像工程で得られる撮像画像の照明等の条件を同様にすることが可能となる。つまり、表又は裏の基準となるボタンの撮像画像と、表裏を判定する対象となるボタンの撮像画像との間に照明等の条件による類似度の剥離を防止することが可能となる。従って、判定元画像を撮像した際にボタンに照射されていた照明等の諸条件が変化すると、同種かつ表裏が正しい向きのボタンであっても画像の近似の度合いが一定以上とならずにエラーとなることがあるといった従来の問題点を解消することができ、より好適にボタンの表裏判定を行える。
According to the first aspect of the present invention, the first imaging step is performed simultaneously with the second imaging step or immediately before the second imaging step. That is, when there is a button for which the front / back is to be determined, the button for the front / back reference can be imaged simultaneously with or just before the button for which the front / back is to be determined. Therefore, it is not necessary to prepare in advance a determination source image of a button whose front / back is to be determined, and it is sufficient if the front / back reference button is imaged in the same manner as that for the button whose front / back is to be determined.
In addition, since the first imaging step is performed simultaneously with the second imaging step or immediately before the second imaging step, by making the conditions such as illumination in the first imaging step and the second imaging step the same, Conditions such as illumination of the captured image obtained in the first imaging step and the captured image obtained in the second imaging step can be made the same. That is, it is possible to prevent separation of similarity due to conditions such as illumination between the captured image of the button serving as the front or back reference and the captured image of the button serving as a target for determining the front and back. Therefore, if the conditions such as the illumination that was applied to the button when the judgment source image was captured change, even if the button is the same type and the front and back are in the correct orientation, the degree of image approximation does not exceed a certain level and an error occurs. Therefore, it is possible to eliminate the conventional problem that sometimes occurs, and it is possible to more suitably determine the front and back of the button.
請求項2記載の発明によれば、第1の撮像工程は、第2の撮像工程を行うのと同時又は第2の撮像工程を行う直前に毎回行う。つまり、表裏を判定する対象となるボタンの撮像が行われるたびに、表又は裏の基準となるボタンの撮像をその都度行う。よって、第1の撮像工程と第2の撮像工程との間の時間経過は極めて短くなり、各ボタンの照明条件等がほぼ同一となる。従って、判定元画像を撮像した際にボタンに照射されていた照明等の諸条件が変化すると、同種かつ表裏が正しい向きのボタンであっても画像の近似の度合いが一定以上とならずにエラーとなることがあるといった従来の問題点を解消することができ、より好適にボタンの表裏判定を行える。 According to the second aspect of the present invention, the first imaging step is performed at the same time as the second imaging step or immediately before the second imaging step. That is, each time a button that is a target for determining front and back is imaged, a button that is a front or back reference is imaged each time. Therefore, the time lapse between the first imaging step and the second imaging step is extremely short, and the illumination conditions and the like of each button are almost the same. Therefore, if the conditions such as the illumination that was applied to the button when the judgment source image was captured change, even if the button is the same type and the front and back are in the correct orientation, the degree of image approximation does not exceed a certain level and an error occurs. Therefore, it is possible to eliminate the conventional problem that sometimes occurs, and it is possible to more suitably determine the front and back of the button.
請求項3記載の発明によれば、表又は裏の基準となるボタンと表裏を判定する対象となるボタンとを並べて配置して撮像する。よって、各ボタンの撮像時の照明等の条件をほぼ同一とすることが可能となる。従って、判定元画像を撮像した際にボタンに照射されていた照明等の諸条件が変化すると、同種かつ表裏が正しい向きのボタンであっても画像の近似の度合いが一定以上とならずにエラーとなることがあるといった従来の問題点を解消することができ、より好適にボタンの表裏判定を行える。
また、表又は裏の基準となるボタンと表裏を判定する対象となるボタンとを並べて配置して撮像するので、1台のカメラで基準となるボタンと表裏を判定する対象のボタンの両方をその撮像範囲に含めて同時に撮像することが容易となる。このとき、当該1台のカメラで得られた撮像画像のうち基準となるボタンが写った領域と表裏を判定する対象のボタンが写った領域との比較処理を行えばボタンの表裏判定が行える。従って、第1の撮像工程と第2の撮像工程とを個別に行う場合に比してその工程が短縮され、より円滑にボタンの表裏判定を行える。
According to the third aspect of the present invention, the front or back reference button and the button for determining the front and back are arranged side by side and imaged. Therefore, it is possible to make the conditions such as illumination at the time of imaging each button substantially the same. Therefore, if the conditions such as the illumination that was applied to the button when the judgment source image was captured change, even if the button is the same type and the front and back are in the correct orientation, the degree of image approximation does not exceed a certain level and an error occurs. Therefore, it is possible to eliminate the conventional problem that sometimes occurs, and it is possible to more suitably determine the front and back of the button.
In addition, since the front and back reference buttons and the front and back determination target buttons are arranged side by side and imaged, both the reference button and the front and back determination target buttons are displayed with one camera. It becomes easy to include images within the imaging range at the same time. At this time, the front / back determination of the button can be performed by performing a comparison process between a region in which the reference button is captured and a region in which the target button to be determined is captured in the captured image obtained by the one camera. Therefore, the process is shortened as compared with the case where the first imaging process and the second imaging process are performed separately, and the button front / back determination can be performed more smoothly.
請求項4記載の発明によれば、第1の撮像工程と第2の撮像工程は、異なるカメラによって行われる。これによって、表又は裏の基準となるボタンを撮像するカメラと、表裏を判定する対象となるボタンを撮像するカメラとが異なるものとなるので、同一のカメラで各ボタンを撮像する場合に比して、表又は裏の基準となるボタンと表裏を判定するボタンの配置関係の自由度が大幅に向上する。 According to the fourth aspect of the present invention, the first imaging step and the second imaging step are performed by different cameras. As a result, the camera that captures the front or back reference button is different from the camera that captures the button for which the front and back are to be determined. Thus, the degree of freedom of the arrangement relationship between the front / back reference button and the front / back determination button is greatly improved.
請求項5記載の発明によれば、第1の撮像工程で得られた撮像画像と第2の撮像工程で得られた撮像画像とが所定以上近似していた場合、当該第2の撮像工程で得られた撮像画像を次の第1の撮像工程の撮像画像とする。つまり、第1の撮像画像に写った表又は裏の基準となるボタンと、第2の撮像画像に写った表裏を判定するボタンとが共に同じ面(表又は裏)を撮像されていると判定工程で判定される程度に近似している場合、第2の撮像工程で得られた撮像画像を、その次に「表裏を判定する対象となるボタン」の撮像画像に対する「表又は裏の基準となるボタン」の撮像画像として扱う。これによって、表裏を判定するボタンが表又は裏の基準となるボタンと同じ面を向いている場合は、次に表裏を判定する対象となるボタンを撮像する第2の撮像工程の際に同時またはその直前に行う第1の撮像工程をその前に行った第2の撮像工程に置き換えることが可能となる。よって、第1の撮像工程を個別に行う回数を低減させることができ、より円滑にボタンの表裏判定を行える。 According to the fifth aspect of the present invention, when the captured image obtained in the first imaging step and the captured image obtained in the second imaging step are approximated by a predetermined value or more, the second imaging step Let the obtained captured image be a captured image in the next first imaging step. That is, it is determined that the front or back reference button shown in the first captured image and the button for determining the front and back shown in the second captured image are both picked up on the same surface (front or back). When approximate to the extent determined in the process, the captured image obtained in the second imaging process is the “front or back reference” for the captured image of the “button to be judged front and back” It is treated as a captured image of a button. As a result, when the button for judging the front and back faces the same surface as the front or back reference button, either simultaneously or during the second imaging step for imaging the button for which the front and back are judged. It becomes possible to replace the first imaging process performed immediately before with the second imaging process performed before that. Therefore, the number of times of performing the first imaging step can be reduced, and the button front / back determination can be performed more smoothly.
請求項6記載の発明によれば、第1の撮像工程及び第2の撮像工程は、ボタンを側方から撮像する。ところで、ボタンの表裏判定の際には、第1の撮像工程で得られた表又は裏の基準となるボタンの撮像画像と、第2の撮像工程で得られた表裏を判定する対象となるボタンの撮像画像との比較処理を行う。このとき、一般的にボタンは表又は裏面の面積よりもその側方の面積の方が小さい。従って、ボタンを側方から見た場合にその表裏を判定可能な視覚的特徴がある場合は、ボタンを側方から撮像することで、表又は裏面の一方を当該面に対向して撮像する場合に比して表裏判定のために必要な撮像画像の面積を小さくすることが可能となる。よって、第1の撮像工程の撮像画像と第2の撮像工程の撮像画像との比較処理に要する時間を短縮でき、より好適にボタンの表裏判定を行える。 According to invention of Claim 6, a 1st imaging process and a 2nd imaging process image a button from the side. By the way, when determining the front and back of a button, a button that is a target for determining a front and back image obtained in the first imaging process and a front and back image obtained in the second imaging process. Comparison processing with the captured image is performed. At this time, the button generally has a smaller area on the side than the area of the front or back surface. Therefore, when there is a visual feature that allows the front and back to be determined when the button is viewed from the side, the button is imaged from the side, and one of the front and back surfaces is imaged facing the surface. Compared to the above, it is possible to reduce the area of the captured image necessary for front / back determination. Therefore, the time required for the comparison process between the captured image of the first imaging process and the captured image of the second imaging process can be shortened, and the button front / back determination can be performed more preferably.
請求項7記載の発明によれば、第1の撮像工程で得られた撮像画像の一部又は一部を加工した画像を用いてボタンの表裏の判定を行う。例えば、ボタンの表又は裏を判定するのに十分な視覚的差異がボタンの一部に含まれている場合は、第1の撮像工程で撮像した画像から当該一部の撮像画像を得て、第2の撮像工程で得られた撮像画像に当該一部に対応する部分が含まれるかどうかを判別すればよい。従って、ボタン全体を撮像画像に含める場合に比して表裏判定のために必要な撮像画像の面積を小さくすることが可能となる。よって、第1の撮像工程の撮像画像と第2の撮像工程の撮像画像との比較処理に要する時間を短縮でき、より好適にボタンの表裏判定を行える。
また、ボタンは縫い付けのためのボタン穴を有する場合が多い。ボタン穴はボタンの向きによってその位置関係を変ずるので、ボタン穴の位置関係の差異が撮像画像に写ったボタンの差異となって現れる。よって、第1の撮像工程で得られたボタンの撮像画像と第2の撮像工程で得られたボタンの撮像画像との間でボタン穴の位置関係に差異があった場合、同種のボタンかつ当該ボタンの同じ面が撮像されていた場合であっても、表裏判定の比較処理においてボタン穴の位置関係の差異によって異なる面(あるいは異なるボタン)と判定されてしまう可能性がある。このとき、例えばボタン穴を塞ぐ加工を各撮像画像に施すことによって、ボタン穴の位置関係の差異による比較処理の誤判定を防止することが可能となる。よって、より好適にボタンの表裏判定を行える。また、画像の加工以外にも、ボタン穴を含まないボタンの一部の画像を用いてボタンの表裏判定を行うことによっても同様の効果が得られる。
According to the seventh aspect of the present invention, the front and back of the button is determined using an image obtained by processing a part or part of the captured image obtained in the first imaging step. For example, if a part of the button contains a visual difference sufficient to determine the front or back of the button, obtain the part of the captured image from the image captured in the first imaging step, What is necessary is just to discriminate | determine whether the part corresponding to the said part is contained in the captured image obtained at the 2nd imaging process. Therefore, it is possible to reduce the area of the captured image necessary for front / back determination as compared with the case where the entire button is included in the captured image. Therefore, the time required for the comparison process between the captured image of the first imaging process and the captured image of the second imaging process can be shortened, and the button front / back determination can be performed more preferably.
Further, the button often has a button hole for sewing. Since the positional relationship of the button hole changes depending on the direction of the button, the difference in the positional relationship between the button holes appears as the difference in the buttons shown in the captured image. Therefore, when there is a difference in the positional relationship of the button holes between the captured image of the button obtained in the first imaging process and the captured image of the button obtained in the second imaging process, Even when the same surface of the button is imaged, there is a possibility that it is determined as a different surface (or a different button) due to the difference in the positional relationship between the button holes in the comparison process of front and back determination. At this time, for example, by applying processing for closing the button hole to each captured image, it is possible to prevent erroneous determination of the comparison process due to the difference in the positional relationship between the button holes. Therefore, the front / back determination of the button can be performed more preferably. In addition to the processing of the image, the same effect can be obtained by determining the front and back of the button using a partial image of the button that does not include the button hole.
(発明の全体構成)
以下、図を参照して本発明の実施の形態を詳細に説明する。
本発明によるボタンの表裏判定方法は、ボタン付けミシンのボタン供給装置によって供給されるボタンの表裏を判定する方法である。ボタンの表裏判定は、ボタン供給装置がボタン付けミシンにおいて被縫製物の近傍でボタンを保持するボタン保持部にボタンを搬送するよりも前に行われる。これによって、ボタン保持部には所定の種類の、かつ、常に所定の向きのボタンが供給され、誤った種類のボタンや誤った向きのボタンが供給されることで縫い品質が低下することがなくなり、縫い品質が大幅に向上する。
図1は本発明によるボタンの表裏判定方法で用いるボタン画像認識装置1の主要構成を示すブロック図である。ボタン画像認識装置1は、表裏判定の基準となるボタンB1及び表裏判定を行う対象となるボタンB2を撮像するカメラ2と、ボタンB1、B2の撮像時に各ボタンを照らす照明3と、ボタン画像認識装置1の各種処理内容を表示するモニタ4と、ボタンB1、B2の画像からボタンB2の表裏を判定する画像処理装置10とを備える。なお、ボタンB1は「表又は裏の基準となるボタン」であり、ボタンB2は「表裏を判定する対象となるボタン」である。
(Overall structure of the invention)
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
The button front / back determination method according to the present invention is a method for determining the front / back of a button supplied by a button supply device of a button sewing machine. The front / back determination of the button is performed before the button supply device transports the button to the button holding unit that holds the button in the vicinity of the sewing product in the button sewing machine. As a result, buttons of a predetermined type and always in a predetermined direction are supplied to the button holding unit, and a wrong type of button or a button with an incorrect direction is supplied, so that the sewing quality does not deteriorate. , The sewing quality is greatly improved.
FIG. 1 is a block diagram showing a main configuration of a button image recognition apparatus 1 used in a button front / back determination method according to the present invention. The button image recognition apparatus 1 includes a button B1 that is a reference for front / back determination and a
カメラ2は、ボタンB1,B2の上方からボタンB1,B2を含む範囲を1回の撮像で撮像可能となるよう設けられ、ボタンB1,B2を撮像してその撮像画像Gを画像処理装置10に入力する。なお、カメラ2によって入力される撮像画像Gはアナログ画像データであり、画像処理装置10に入力されるとA/Dコンバータ15(後述)によってデジタル画像データに変換される。
照明3は、ボタンB1の上方であってカメラ2によるボタンB1,B2の撮像範囲を遮らない位置に設けられ、少なくともカメラ2によるボタンB1,B2の撮像の際にボタンB1,B2に光を照射する。このとき、照明3はその照射光によるカメラ2の撮像画像Gの明暗がボタンB1,B2でほぼ同等となるよう設けられていることが望ましい。
モニタ4は、ボタン画像認識装置1の各種情報を表示する。その表示内容については後述する。
The
The illumination 3 is provided above the button B1 and at a position that does not block the imaging range of the buttons B1 and B2 by the
The
画像処理装置10は、ボタン画像認識装置1の各部の制御に関する各種処理を行うCPU11と、CPU11によって呼び出される各種プログラム及びデータ等を書き換え不能に記憶するROM12と、CPU11の各種処理において一時的に生じる各種データの格納領域となるRAM13と、CPU11によって呼び出される各種プログラム及びデータ等を書き換え可能に記憶するEEPROM14と、カメラ2によって入力されたアナログ画像データをデジタル画像データに変換するA/Dコンバータ15と、を備えている。ROM12、RAM13,EEPROM14及びA/Dコンバータ15はバスを介してCPU11に接続されている。また、A/Dコンバータ15はカメラ2と接続されており、画像処理装置10に入力されたカメラ2の撮像画像GはまずA/Dコンバータ15に入力される。
CPU11は、ROM12又はEEPROM14から各種プログラム及びデータ等を呼び出して実行処理し、ボタン画像認識装置1の各部を制御する。特に、ROM12にはカメラ2によって撮像されたボタンB1,B2の撮像画像からボタンB2の表裏判定及び表裏判定に関る各種処理を行うための画像処理プログラム12aが記憶されている。なお、以降特に記載がない場合、ボタン画像認識装置1の各種動作制御はCPU11によるソフトウェア制御によって行われている。
A/Dコンバータ15は、カメラ2が撮像した撮像画像G(アナログ画像データ)をデジタル画像データに変換してCPU11に入力する。CPU11はデジタル画像データに変換された撮像画像GからボタンB2の表裏を判定する。なお、以後の記載においては特筆しない限り「撮像画像G」はカメラ2によって撮像された画像データ全般をいい、特にアナログ画像データとデジタル画像データの区別は行わない。
The
The
The A /
次に、ボタンB1、B2について詳説する。図2はボタンB1(B2)の表面及び裏面を示す説明図である。図2(a)はボタンB1(B2)の表面を、図2(b)はボタンB1(B2)の裏面を示す。
ボタンB1は、その一方の面(例えば表面)がカメラ2側つまり上方に、他方の面(例えば裏面)がボタンB1が配置される面側つまり下方となるよう配置される。ボタンB1はオペレータの手によってカメラ2の下方の所定位置となるよう配置され、配置後にその位置が変わることはない。
ボタンB2は、ボタン供給装置(図示略)が備える図示しないボタン搬送部(例えばボタンB2を図2の上下方向に沿って搬送するベルトコンベヤ等)によってカメラ2の下方を通るよう搬送されている。なお、ボタンB2はボタン供給装置によってボタン付けミシン(図示略)のボタン保持部(図示略)に逐次供給される縫いつけ用ボタンであり、ボタン搬送部はボタン保持部に供給される前の複数のボタンが蓄積されているボタン蓄積部(図示略)から一つずつボタンB2をカメラ2の下方を通るよう搬送する。つまり、ボタンB2は特定のひとつのボタンではなく逐次搬送される複数のボタンのうちの一つである。つまり、ボタン画像認識装置1はカメラ2の下方に据え置かれたボタンB1を基準としてボタン付けミシンに逐次供給されるボタンB2の表裏を判定する装置である。
Next, the buttons B1 and B2 will be described in detail. FIG. 2 is an explanatory diagram showing the front and back surfaces of the button B1 (B2). 2A shows the front surface of the button B1 (B2), and FIG. 2B shows the back surface of the button B1 (B2).
The button B1 is disposed such that one surface (for example, the front surface) is on the
The button B2 is conveyed so as to pass below the
なお、ボタンB1とボタンB2とは同種のボタンである。従って、ボタンB1とボタンB2との表裏及び穴の位置関係が一致する場合、カメラ2に撮像されるボタンB1とボタンB2とはほぼ同種のボタンとして写る。また、図1に示すように、ボタンB1,B2はその側方から見た場合には表面が直線状となり、裏面はなだらかな楕円の半円状となる形状である。また、図2(a)に示すように、ボタンB1(B2)の表面には凹部Cが設けられており、カメラ2によって上方から撮像された場合、表面が上向きの場合には凹部の内外の段差によるコントラストC1が生じる。一方、図2(b)に示すように、裏面が上向きの場合には段差CがないのでコントラストC1は生じない。つまり、ボタンB1、B2は上方または側方からの撮像画像Gに写った当該ボタンの形状から表裏のいずれが上向き(あるいは下向き)であるかを認識可能となっている。
また、ボタン搬送部によって搬送されるボタンB2の向きは一定しない。例えば、図2に示すボタンB2はボタンB1と同様に一方の面(例えば表面)が上方となっているが、他方の面(例えば裏面)が上方となることもある。また、ボタン穴の位置関係も図2に示すボタンB2のようになるとは限らず、ボタンB1のボタン穴の配置に対して傾いていることもある。
Note that the button B1 and the button B2 are the same type of buttons. Therefore, when the front / back and hole positional relationship between the button B1 and the button B2 match, the button B1 and the button B2 captured by the
Further, the direction of the button B2 transported by the button transport unit is not constant. For example, the button B2 shown in FIG. 2 has one surface (for example, the front surface) upward like the button B1, but the other surface (for example, the back surface) may be upward. Further, the positional relationship of the button holes is not necessarily the same as that of the button B2 shown in FIG. 2, and may be inclined with respect to the arrangement of the button holes of the button B1.
(ボタン画像認識装置の動作)
次に、ボタン画像認識装置1の動作における各工程について詳説する。図3はボタン画像認識装置1の動作を示すフローチャートである。
図3に示すように、ボタン画像認識装置1は、カメラ2によってボタンB1,B2を撮像するボタン撮像工程(ステップS1)、ボタン撮像工程で得られた撮像画像Gの画質を改善するためノイズ除去などの各種処理を行う画質改善工程(ステップS2)、画質改善後の撮像画像GからボタンB2の表裏を判定する表裏判定工程(ステップS3)、ボタンB2の表裏判定の結果通知をモニタ4による表示等によって行う結果通知工程(ステップS4)を順次行う。以下、工程順に詳説する。なお、ステップS2〜S4の各工程はCPU11がROM12の画像処理プログラム12aを呼び出して実行処理することで行われる。
(Operation of button image recognition device)
Next, each step in the operation of the button image recognition apparatus 1 will be described in detail. FIG. 3 is a flowchart showing the operation of the button image recognition apparatus 1.
As shown in FIG. 3, the button image recognition apparatus 1 performs noise removal to improve the image quality of the captured image G obtained by the button imaging process (step S1) and the button imaging process in which the
(ボタン撮像工程)
まず、ステップS1のボタン撮像工程について詳説する。図4はカメラ2によるボタンB1、B2の撮像画像Gを示す説明図である。
ボタン搬送部によって搬送されるボタンB2のうちひとつがカメラ2の撮像範囲内に入り、かつ、図4に示す撮像画像Gの左右方向にボタンB2がボタンB1と並ぶよう位置したときにカメラ2によって撮像される。つまり、「表又は裏の基準となるボタン」であるボタンB1と、「表裏を判定する対象となるボタン」であるボタンB2とは同時に撮像されている。よって、表又は裏の基準となるボタンB1を撮像する「第1の撮像工程」と、表裏を判定する対象となるボタンB2を撮像する「第2の撮像工程」は同時に行われている。ボタンB2の位置は図示しないセンサー等によって検知され、CPU11は当該センサー等による入力に基づいてカメラ2を動作させることで撮像工程を行う。当該撮像工程によって得られた撮像画像Gは図4に示すようにボタンB1とボタンB2とがほぼ横並びに写る画像となる。また、このとき、横並びに並んだボタンB1とボタンB2のそれぞれの照明3に対する距離はほぼ同一となる。撮像画像Gは画像処理装置10に入力され、A/Dコンバータ15によってデジタル画像データに変換されてCPU11に入力される。なお、以後の工程においては当該デジタル画像データを「撮像画像G」と記載する。
なお、カメラ2の撮像範囲とボタンB1,B2との位置関係は、図4に示すように、ボタンB1とボタンB2との間に位置してカメラ2の撮像範囲を二分する中間線Pの位置がボタンB1とボタンB2とのほぼ中間位置となることが望ましい。また、ボタン撮像工程完了時にCPU11は入力された撮像画像Gをモニタ4に出力してもよい。
(Button imaging process)
First, the button imaging process in step S1 will be described in detail. FIG. 4 is an explanatory diagram showing captured images G of the buttons B 1 and
When one of the buttons B2 conveyed by the button conveying unit is within the imaging range of the
As shown in FIG. 4, the positional relationship between the imaging range of the
(画質改善工程)
次に、ステップS2の画質改善工程について詳説する。画質改善工程では、CPU11はA/Dコンバータ15から入力された撮像画像Gに対してノイズ除去処理(例えばフィルタ処理等)を行う。当該ノイズ除去処理の詳細は周知のノイズ除去処理と同様であるのでその詳細は省略する。ノイズ除去処理後、CPU11は当該デジタル画像データをRAM13に格納する。
(Image quality improvement process)
Next, the image quality improving process in step S2 will be described in detail. In the image quality improvement process, the
(表裏判定工程)
次に、ステップS3の表裏判定工程について詳説する。表裏判定工程は、撮像画像Gに写ったボタンB1を含む画像領域に基づくパターンマッチングをボタンB2が写った画像領域に対して行う。
図5はパターンマッチングの仕組みを示す説明図である。
パターンマッチングを行う場合、まずCPU11は撮像画像Gに対してボタンB1を含む画像領域P1とボタンB2を含む画像領域P2とに分割する処理(画像分割)を行う。画像分割は、上述の中間線Pを境に撮像画像Gを二分することで行われる。
次に、CPU11は画像領域P1に対して輪郭検出処理を行ってボタンB1が写っている画像領域を割り出し、ボタンB1とその周囲を含むテンプレート画像領域T1を設定し、テンプレート画像領域T1内の画素数及び画素の明暗あるいは色分布に関する情報を取得してRAM13に格納する処理(テンプレート画像領域取得)を行う。
次に、CPU11は画像領域P2に対して輪郭検出処理を行ってボタンB2が写っている画像領域を割り出し、ボタンB2とその周囲を含む判定画像領域T2を設定し、判定画像領域T2内の画素数及び画素の明暗あるいは色分布に関する情報を取得してRAM13に格納する処理(判定画像領域取得)を行う。このとき、判定画像領域T2の縦横の画素数は少なくともテンプレート画像領域T1以上となるように設定する。
(Front and back judgment process)
Next, the front / back determination process in step S3 will be described in detail. In the front / back determination step, pattern matching based on the image region including the button B1 captured in the captured image G is performed on the image region including the button B2.
FIG. 5 is an explanatory diagram showing the mechanism of pattern matching.
When performing pattern matching, first, the
Next, the
Next, the
次に、CPU11はテンプレート画像領域T1と判定画像領域T2の画素の明暗あるいは色分布に関する情報から類似度の判定(パターンマッチング)を行う。この判定は、判定画像領域T2からテンプレート画像領域T1と同じ縦横の画素数の領域を逐次抜粋して判定する逐次処理により行う。
なお、「逐次処理」とは、まず判定対象となる画像領域(判定画像領域T2)の左上端から比較元となる画像領域(テンプレート画像領域T1)と同じ縦横の画素数となる画像領域の画素の明暗あるいは色分布に関する情報のみをテンプレート画像領域T1と比較判定して類似度を算出する。図5は、このようすをイメージで示しており、判定画像領域T2に破線で示すテンプレート画像領域T1を左上端が一致するように重ねた状態で、テンプレート画像領域T1と重なる位置の判定画像領域T2の画素の情報が各画素毎に全て比較される。次に、判定対象となる画像領域の右に1画素分ずれた位置から比較元となる画像領域と同じ縦横の画像領域について判定をし、その後さらに右に1画素分ずれた位置から…といったように、左上端から順に1画素づつずらして判定する。左右方向に比較元となる画像領域分の画素がなくなるほど右にずれた位置となった場合、次は下方向に1画素ずれた位置であってその左端の画素から比較元となる画像領域と同じ縦横の画像領域に対して行い、以後は右に1画素ずつずらしていく。つまり、判定対象となる画像領域内を比較元となる画像領域を順次ずらしながら重なる部分の類似度を算出する処理を行う。
上述のパターンマッチングにおいて、類似度が所定の閾値以上となった場合、ボタンB2はボタンB1と同種であると判定される。つまり、ボタンB2はボタンB1と同様に一方の面(例えば表面)が上向きとなっていると判定される。一方、類似度が所定の閾値未満となった場合、ボタンB2はボタンB1と異なると判定される。つまり、ボタンB2はボタンB1と異なり他方の面(例えば裏面)が上向きとなっていると判定される。あるいは、ボタン付けミシンのボタン保持部に逐次供給される複数のボタンの中にボタンB1と異なる種類のボタンが混入していた場合、当該異なる種類のボタンが撮像された場合にもやはり類似度が閾値未満となる可能性が高いので、ボタンB2はボタンB1と異なると判定される。なお、所定の閾値はEEPROM14に記憶されている。
Next, the
Note that “sequential processing” refers to pixels in an image area having the same number of vertical and horizontal pixels as the comparison source image area (template image area T1) from the upper left end of the determination target image area (determination image area T2). Only the information relating to the light and dark or color distribution is compared with the template image region T1, and the similarity is calculated. FIG. 5 shows this in an image, and a determination image region T2 at a position overlapping with the template image region T1 in a state where the template image region T1 indicated by a broken line is overlapped with the determination image region T2 so that the upper left ends coincide with each other. All the pixel information is compared for each pixel. Next, a determination is made for an image area having the same height and width as the comparison source image area from a position shifted by one pixel to the right of the image area to be determined, and then from a position shifted by one pixel to the right. Next, the determination is made by shifting one pixel at a time from the upper left end. If the position is shifted to the right so that there are no more pixels in the image area to be compared in the left-right direction, the next position is a position shifted by one pixel in the downward direction and the image area to be compared from the leftmost pixel. This is performed on the same vertical and horizontal image areas, and thereafter, the pixels are shifted to the right by one pixel. That is, a process of calculating the similarity of overlapping portions while sequentially shifting the image area to be compared within the image area to be determined.
In the above-described pattern matching, when the similarity is equal to or greater than a predetermined threshold, the button B2 is determined to be the same type as the button B1. That is, it is determined that one surface (for example, the front surface) of the button B2 is facing upward, like the button B1. On the other hand, when the similarity is less than the predetermined threshold, it is determined that the button B2 is different from the button B1. That is, unlike the button B1, the button B2 is determined to have the other surface (for example, the back surface) facing upward. Alternatively, when a button of a different type from the button B1 is mixed in a plurality of buttons sequentially supplied to the button holding unit of the button-attached sewing machine, the similarity is also obtained when the different type of button is imaged. Since there is a high possibility of being less than the threshold value, it is determined that the button B2 is different from the button B1. The predetermined threshold value is stored in the
なお、パターンマッチングは、上述の逐次処理において類似度が所定の閾値以上となった時点でボタンB1とボタンB2とが同種であると判定してパターンマッチングを終了してもよいし、判定対象となる画像領域の左上端から右下端まで逐次処理を完了させて、その中で最大の類似度と所定の閾値とを比較してもよい。前者の場合、閾値が一定以上となった時点でパターンマッチングが終了するので比較的当該処理が早く終了できる。後者の場合、類似度と所定の閾値との比較処理が1回で済む。以下、図6及び図7を用いて上述の2通りの処理について詳説する。
まず、表裏判定工程において、パターンマッチングで類似度が所定の閾値以上となった時点で処理を終了する場合を示すフローチャートを図6に示す。まずCPU11は上述の画像分割(ステップS11)、テンプレート画像領域取得(ステップS12)、判定画像領域取得(ステップS13)を順次行い、その後判定対象となる画像領域T2の左上端の画素から順にテンプレート画像領域T1を重ねた状態で比較するパターンマッチングの逐次処理を行う(ステップS14)。なお、ステップS14における逐次処理は、逐次処理全体のうち判定画像領域T2内のある位置にテンプレート画像領域T1が重ねられた状態でのテンプレート画像領域T1の全画素分の比較処理1回の類似度算出処理を指す。次にCPU11はステップS14で得られた類似度が所定の閾値未満であるかどうか判定し(ステップS15)、類似度が閾値未満でない場合即ち類似度が閾値以上となった場合(ステップS15:NO)、ボタンB2はボタンB1と同種かつ同じ向きであると判定される(ステップS16)。一方、ステップS15で類似度が閾値未満だった場合(ステップS15:YES)、CPU11は判定画像領域T2の右下端まで逐次処理が終了したか判定する(ステップS17)。逐次処理が右下端まで終了した場合(ステップS17:YES)、ボタンB2はボタンB1と異なる面が上向きあるいはボタンB1とは異なるボタンであると判定する(ステップS18)。逐次処理が右下端まで終了していない場合(ステップS17:NO)、ステップS14に戻りテンプレート画像領域T1を次の位置にずらして逐次処理を実行する。
In the pattern matching, the pattern matching may be terminated by determining that the button B1 and the button B2 are of the same type when the similarity is equal to or higher than a predetermined threshold in the sequential processing described above. The processing may be completed sequentially from the upper left corner to the lower right corner of the image area, and the maximum similarity may be compared with a predetermined threshold value. In the former case, since the pattern matching ends when the threshold value becomes a certain level or more, the processing can be ended relatively quickly. In the latter case, the comparison process between the similarity and the predetermined threshold value is only required once. Hereinafter, the above-described two processes will be described in detail with reference to FIGS. 6 and 7.
First, FIG. 6 is a flowchart showing a case where the process is terminated when the similarity is equal to or higher than a predetermined threshold in the pattern matching in the front / back determination step. First, the
次に、最大の類似度と所定の閾値との比較を行う場合を示すフローチャートを図7に示す。なお、ステップS11〜S14は上述に示す処理と同様なので詳説を省略する。
ステップS14の処理の後、CPU11はステップS14で得られた類似度がそれまで現在の判定対称ボタンB2で得られた最大の類似度を越えるかどうか判定する(ステップS21)。超えた場合(ステップS21:YES)、ステップS14で得られた類似度を現在のボタンB2における当該パターンマッチングの最大類似度としてRAM13に格納し(ステップS22)、判定画像領域T2の右下端まで逐次処理が終了したか判定する(ステップS23)。一方、ステップS14で得られた類似度がそれまでの最大の類似度を超えていなかった場合(ステップS21:NO)、ステップS23へと移行する。
ステップS23において、逐次処理が右下端まで終了した場合(ステップS23:YES)、CPU11はRAM13に格納された当該パターンマッチングの最大類似度が所定の閾値未満かどうか判定する(ステップS24)。類似度が閾値未満でない場合即ち類似度が閾値以上となった場合(ステップS24:NO)、ボタンB2はボタンB1と同種かつ同じ向きであると判定される(ステップS25)。一方、ステップS15で類似度が閾値未満だった場合(ステップS24:YES)、ボタンB2はボタンB1と異なる面が上向きあるいはボタンB1とは異なるボタンであると判定する(ステップS26)。また、ステップS23において逐次処理が右下端まで終了していない場合(ステップS23:NO)、ステップS14に戻る。
Next, FIG. 7 shows a flowchart showing a case where the maximum similarity is compared with a predetermined threshold. Since steps S11 to S14 are the same as the above-described processes, detailed description thereof is omitted.
After the process in step S14, the
In step S23, when the sequential processing is completed to the lower right end (step S23: YES), the
なお、パターンマッチングで類似度が所定の閾値以上となった時点で処理を終了するか、最大の類似度と所定の閾値とを比較するかの選択は、図示しない設定スイッチを操作することで選択可能となっている。
また、上述の判定画像領域取得(ステップS13)を省略して画像領域P2全体に対してテンプレート画像領域T1によるパターンマッチングを行ってもよい。その場合、上述の図6及び図7を用いた説明における「判定画像領域T2」は「画像領域P2」と読み替える。
The selection of whether to end the process when the similarity reaches or exceeds the predetermined threshold in pattern matching or to compare the maximum similarity with the predetermined threshold is made by operating a setting switch (not shown). It is possible.
Alternatively, the above-described determination image region acquisition (step S13) may be omitted, and pattern matching using the template image region T1 may be performed on the entire image region P2. In this case, “determination image region T2” in the description using FIGS. 6 and 7 described above is read as “image region P2”.
(結果通知工程)
次に、図3のステップS4に示す結果通知工程について詳説する。結果通知工程では、CPU11はボタンB2の表裏判定の結果をモニタ4に表示する。
なお、本実施の形態では結果通知をモニタ4による表示で行っているが、他の表示手段や報知手段によってもよい。例えば、ボタンB2がボタンB1と異なる面が上向きあるいはボタンB1とは異なるボタンであると判定された場合にはブザーを鳴らしてオペレータに知らせるようにしてもよい。
(Result notification process)
Next, the result notification process shown in step S4 of FIG. 3 will be described in detail. In the result notifying step, the
In the present embodiment, the result notification is performed by display on the
なお、表裏判定工程においてボタンB2がボタンB1と異なる面が上向きあるいはボタンB1とは異なるボタンであると判定された場合、CPU11はボタン搬送部の動作を停止させて当該ボタンB2がボタン付けミシンのボタン保持部に供給されないようにするための判定信号を出力してもよい。また、ボタンB2がボタンB1と異なる面が上向きあるいはボタンB1とは異なるボタンであると判定された場合に当該ボタンB2を自動的にふるい落としてボタン保持部に搬送させない構成を設け、ボタン保持部に供給されるボタンがボタンB1と同種かつ同種の向きであるボタンB2のみとなるように判定結果に基づく判定信号を出力してもよい。
If it is determined in the front / back determination step that the button B2 is a button whose face is different from the button B1 or is different from the button B1, the
(ボタン画像認識装置の動作)
ボタン画像認識装置1は、ボタンB2が一つずつ搬送されてボタンB1とほぼ横並びに位置し、かつボタンB1、B2が共にカメラ2の撮像範囲内となる度に上述の図3に示すステップS1〜S4の処理を行う。つまり、ステップS1のボタン撮像工程におけるボタンB1、B2の撮像はボタンB2が入れ替わる度に毎回行われる。従って、表又は裏の基準となるボタンB1を撮像する「第1の撮像工程」は、表裏を判定する対象となるボタンB2を撮像する「第2の撮像工程」が行われるのと同時に毎回行われる。
また、ステップS3の表裏判定処理は、上述の図5又は図7に示すフローチャートに従って、設定スイッチによって設定された側の処理が行われる。
(Operation of button image recognition device)
Step S1 shown in FIG. 3 described above is performed each time the button image recognition device 1 is transported one by one, and is positioned side by side with the button B1, and the buttons B1 and B2 are both within the imaging range of the
Further, the front / back determination processing in step S3 is performed on the side set by the setting switch according to the flowchart shown in FIG. 5 or FIG.
(作用効果)
上述の実施の形態によれば、ボタン撮像工程にてボタンB1を撮像する「第1の撮像工程」とボタンB2を撮像する「第2の撮像工程」とを同時に行う。よって、表裏を判定したいボタンB2の判定元画像となるテンプレート画像領域T1に相当する画像があらかじめボタン画像認識装置1のROM12又はEEPROM14に記憶されていなくてもよく、表裏を判定したいボタンB2の撮像と同様の要領でボタンB1の撮像を行えば事足りる。
また、第1の撮像工程は第2の撮像工程と同時に行うので、ボタンB1,B2に対する照明3の光の照射の具合をほぼ同様とすることで、テンプレート画像領域T1と判定画像領域T2又はボタンB2を含む画像領域P2の照明等の条件を同様にすることが可能となる。従って、判定元画像を撮像した際にボタンに照射されていた照明等の諸条件が変化すると、同種かつ表裏が正しい向きのボタンであっても画像の近似の度合いが一定以上とならずにエラーとなることがあるといった従来の問題点を解消することができ、より好適にボタンの表裏判定を行える。
(Function and effect)
According to the above-described embodiment, the “first imaging process” for imaging the button B1 and the “second imaging process” for imaging the button B2 are simultaneously performed in the button imaging process. Therefore, the image corresponding to the template image region T1 that is the determination source image of the button B2 for which the front and back are to be determined may not be stored in advance in the
In addition, since the first imaging step is performed simultaneously with the second imaging step, the template image region T1 and the determination image region T2 or the button can be made by making the irradiation of the light of the illumination 3 to the buttons B1 and B2 substantially the same. It is possible to make the conditions such as illumination of the image region P2 including B2 the same. Therefore, if the conditions such as the illumination that was applied to the button when the judgment source image was captured change, even if the button is the same type and the front and back are in the correct orientation, the degree of image approximation does not exceed a certain level and an error occurs. Therefore, it is possible to eliminate the conventional problem that sometimes occurs, and it is possible to more suitably determine the front and back of the button.
さらに、カメラ2による撮像時にはボタンB1とボタンB2とが並んで配置される位置関係のときに撮像する。よって、各ボタンの撮像時の照明3の光の照射の具合をほぼ同一とすることが可能となる。従って、判定元画像を撮像した際にボタンに照射されていた照明等の諸条件が変化すると、同種かつ表裏が正しい向きのボタンであっても画像の近似の度合いが一定以上とならずにエラーとなることがあるといった従来の問題点を解消することができ、より好適にボタンの表裏判定を行える。
さらに、1台のカメラ2でボタンB1とボタンB2とを撮像するので、1台のカメラ2の動作制御によって第1の撮像工程と第2の撮像工程を同時に行える。従って、第1の撮像工程と第2の撮像工程とを個別に行う場合に比してその工程が短縮され、より円滑にボタンの表裏判定を行える。
Further, when the image is taken by the
Furthermore, since the button B1 and the button B2 are imaged by one
さらに、ボタンB1の撮像は、ボタンB2が入れ替わる度に毎回行う。よって、各ボタンの照明条件等がほぼ同一となる。従って、判定元画像を撮像した際にボタンに照射されていた照明等の諸条件が変化すると、同種かつ表裏が正しい向きのボタンであっても画像の近似の度合いが一定以上とならずにエラーとなることがあるといった従来の問題点を解消することができ、より好適にボタンの表裏判定を行える。 Further, the imaging of the button B1 is performed every time the button B2 is replaced. Therefore, the illumination conditions and the like of each button are almost the same. Therefore, if the conditions such as the illumination that was applied to the button when the judgment source image was captured change, even if the button is the same type and the front and back are in the correct orientation, the degree of image approximation does not exceed a certain level and an error occurs. Therefore, it is possible to eliminate the conventional problem that sometimes occurs, and it is possible to more suitably determine the front and back of the button.
(その他)
なお、上述の実施の形態におけるボタン画像認識装置1では、カメラ2はボタンB1,B2の両方を含む1枚の撮像画像Gを撮像するよう設けられているが、他の形態を取ってもよい。以下、図8及び図9を用いて他の形態の例について詳説する。
例えば、カメラを2つ設けてもよい。図8は2つのカメラ2A,2Bを用いてボタンB1,B2を撮像する場合を示す説明図である。図8(a)はカメラ2A,2BとボタンB1,B2の配置の関係を、図8(b)はカメラ2Aによる撮像画像G1を、図8(c)はカメラ2Bによる撮像画像G2を示す。図8に示すように、2つのカメラ2A,2Bを用いてボタンB1,B2を撮像する場合、カメラ2Aでその撮像範囲にボタンB1を含む撮像画像G1を、カメラ2Bでその撮像範囲にボタンB2を含む撮像画像G2を撮像する。つまり、ボタンB1を撮像するカメラ2AとボタンB2を撮像するカメラ2Bとは異なるカメラとなる。この場合、ボタンB1とボタンB2を並べて配置しなくてもよくなり、ボタン画像認識装置の設計の自由度が高まる。なお、2つのカメラ2A,2Bを用いる場合、カメラ2Aの撮像画像G1の範囲からボタンB1を含むテンプレート画像領域T1を取得し、カメラ2Bの撮像画像G2の範囲又はカメラ2Bの撮像画像G2の範囲から取得されたボタンB2を含む判定画像領域T2に対してテンプレートマッチングを行う。この場合、上述の実施の形態の効果に加えて、一つのカメラ2で各ボタンを撮像する場合に比して、ボタンB1とボタンB2の配置関係の自由度が大幅に向上する。
(Other)
In the button image recognition apparatus 1 in the above-described embodiment, the
For example, two cameras may be provided. FIG. 8 is an explanatory diagram showing a case where the buttons B1 and B2 are imaged using two
また、ボタンB1,B2の側方にカメラ2を設けて撮像してもよい。図9はボタンB1,B2の側方にカメラ2を設けた場合を示す説明図である。図9(a)はカメラ2とボタンB1,B2の配置の関係を、図9(b)はカメラ2による撮像画像G3を示す。図9(a)に示すように、ボタンB1,B2の側方にカメラを設けた場合、ボタンB1,B2は表又は裏面の面積よりもその側方の面積の方が小さいので、ボタンB1,B2を側方から撮像することで、上方から撮像する場合に比してテンプレート画像領域T1及び判定画像領域T2の画素数を小さくすることが可能となる。よって、テンプレートマッチングに要する時間を短縮でき、より好適にボタンの表裏判定を行える。
なお、2つのカメラ2A,2Bを用いてその一方がボタンB1を,他方がボタンB2を側方から撮像するようにしてもよい。この場合、さらに上述の異なるカメラを用いてボタンB1,B2を撮像する場合の効果も得られる。
Moreover, you may image by providing the
Two
また、カメラ2の撮像範囲にひとつのボタンが収まる配置としてもよい。この場合、逐次供給されるボタンB2がカメラ2によって撮像されることとなる。ただし、最初の1回目の画像撮像時にはボタン搬送部に手動でボタンB1を所定位置に置き、ボタンB1をカメラ2で撮像するようにする。このとき、ボタンB1は一方の面(例えば表面)を上向きにする。ボタンB1は逐次搬送されるボタンB2と同種であり、かつ、一方の面が上向きであるので、そのままボタン付けミシンのボタン保持部に供給してしまってもよいし、撮像後に取り除いてもよい。CPU11は、ボタンB1の撮像画像からボタンB1を含むテンプレート画像領域T1を取得し、RAM13に格納する。
その後、ボタンB2が逐次供給されるが、カメラ2はまずボタンB1の撮像後最初にボ撮像範囲に入ったボタンB2を撮像する。その後、CPU11は、RAM13に格納されたテンプレート画像領域T1によって、ボタンB2の撮像画像又はボタンB2の撮像画像の範囲から取得されたボタンB2を含む判定画像領域T2に対してテンプレートマッチングを行う。その結果、類似度が所定の閾値以上となってボタンB2がボタンB1と同種、かつ、ボタンB2の向きがボタンB1と同一であった場合には、CPU11は当該ボタンB2の判定画像領域T2をRAM13に格納して、その次に撮像されるボタンB2に対するテンプレート画像領域T1として用いる。つまり、ボタンB1を撮像した「第1の撮像工程」で得られた撮像画像からのテンプレート画像領域T1と、ボタンB2を撮像した「第2の撮像工程」で得られた撮像画像又はボタンB2の撮像画像の範囲から取得されたボタンB2を含む判定画像領域T2とが所定以上近似していた場合、当該第2の撮像工程で得られた撮像画像を次の第1の撮像工程の撮像画像とする。このとき、テンプレート画像領域T1とボタンB2の撮像領域全体とのパターンマッチングを行っていた場合は、ボタンB2の画像領域に対して輪郭検出処理等を行ってボタンB2の撮像領域からテンプレート画像領域T1として用いるための画像領域決定処理を行う必要がある。また、ボタンB2が所定以上近似していなかった場合は、その時の第1の撮像工程の撮像画像によるテンプレート画像領域T1を次のボタンB2の表裏判定に引き続き用いる。
Alternatively, an arrangement in which one button fits in the imaging range of the
After that, the button B2 is sequentially supplied, but the
この場合、一度ボタンB2の表裏判定が始まれば以降はボタンB2の撮像のみを行えばよい。従って、毎回ボタンB1の撮像も行う場合に比してカメラ2の撮像範囲が小さくてもよいので、テンプレートマッチングにおける各種画像処理の負荷が軽減される。よって、より円滑にボタンの表裏判定を行える。
加えて、ボタンB1を配置するためのスペースが必要なく、ボタン画像認識装置1をコンパクトにできる。
なお、カメラ2は、各ボタンの上方から撮像する配置でもよいし、側方から撮像する配置でもよい。
In this case, once the front / back determination of the button B2 is started, only the button B2 needs to be imaged thereafter. Therefore, since the imaging range of the
In addition, there is no need for a space for arranging the button B1, and the button image recognition apparatus 1 can be made compact.
The
また、テンプレート画像領域T1はボタンB1の一部であってもよいし、テンプレート画像領域T1にあらかじめ加工を加えてもよい。図10はテンプレート画像領域T1の他の実施例を示す説明図である。図10(a)はボタン穴を除いた領域を用いる例、図10(b)はボタンB1の一部を用いる例、図10(c)はボタンB1のボタン穴を画像加工により塞いだ例を示す。
例えば、図10(a)に示すように、ボタンB2の回転によりボタンの位置関係が変化し、撮像画像に写るボタンの視覚的特徴が変わりうる画像領域T3を除いた範囲をテンプレート画像領域T1としてもよい。また、図10(b)に示すように、ボタンB1の一部をテンプレート画像領域T1としてもよい。また、図10(c)に示すように、テンプレート画像領域T1内の画像領域T3の画素を当該ボタン穴の周囲のボタンB1の画素の明暗あるいは色分布と同様の画素に置き換えることでボタン穴を塞いでしまってもよい。なお、ボタンB1の一部をテンプレート画像領域T1とする場合、当該テンプレート領域にボタンB1、B2の表裏が識別可能な視覚的特徴を有する部分(例えば凹部Cによる段差のコントラストC1)が含まれている必要がある。
これによって、例えば図10(a)、(b)に示す範囲をテンプレート画像領域T1とした場合は、ボタンB1全体をテンプレート画像領域T1に含める場合に比して画素数を小さくすることが可能となる。よって、テンプレートマッチングに要する負荷を軽減すると共にその処理時間を短縮でき、より好適にボタンの表裏判定を行える。
また、ボタンB1とボタンB2との間でボタン穴の位置関係に差異があった場合、表裏判定のテンプレートマッチングにおいてボタン穴の位置関係の差異によって類似度が所定の閾値以上とならずに異なる面(あるいは異なるボタン)と判定されてしまう可能性がある。そこで、図10(a)〜(c)に示すテンプレート画像領域T1を用いることで、ボタン穴の位置関係の差異によるテンプレートマッチングの類似度の低減を防止することが可能となる。よって、より好適にボタンの表裏判定を行える。
Further, the template image area T1 may be a part of the button B1, or the template image area T1 may be processed in advance. FIG. 10 is an explanatory view showing another embodiment of the template image region T1. 10A shows an example using an area excluding the button hole, FIG. 10B shows an example using a part of the button B1, and FIG. 10C shows an example where the button hole of the button B1 is closed by image processing. Show.
For example, as shown in FIG. 10A, a range excluding an image region T3 in which the positional relationship of the button changes due to the rotation of the button B2 and the visual characteristics of the button shown in the captured image can be changed is defined as a template image region T1. Also good. Further, as shown in FIG. 10B, a part of the button B1 may be a template image region T1. Further, as shown in FIG. 10C, the button hole is replaced by replacing the pixel in the image region T3 in the template image region T1 with a pixel similar to the brightness or color distribution of the pixel of the button B1 around the button hole. You may close it. When a part of the button B1 is used as the template image region T1, the template region includes a portion having a visual feature that allows the front and back of the buttons B1 and B2 to be identified (for example, a contrast C1 of a step due to the recess C). Need to be.
Accordingly, for example, when the range shown in FIGS. 10A and 10B is the template image region T1, the number of pixels can be reduced as compared with the case where the entire button B1 is included in the template image region T1. Become. Therefore, the load required for template matching can be reduced and the processing time can be shortened, and the button front / back determination can be performed more suitably.
In addition, when there is a difference in the positional relationship between the button holes between the button B1 and the button B2, the similarity is different because the difference in the positional relationship between the button holes in the front / back determination template matching does not exceed the predetermined threshold. (Or a different button) may be determined. Therefore, by using the template image region T1 shown in FIGS. 10A to 10C, it is possible to prevent the similarity of template matching from being reduced due to the difference in the positional relationship between the button holes. Therefore, the front / back determination of the button can be performed more preferably.
また、ボタンB1,B2は上述の実施の形態に示す形状に限らないことは言うまでもない。ただし、カメラによる撮像をボタンの一方の面に対して行う場合はボタンの表裏が視覚的に識別可能である必要がある。また、カメラによる撮像をボタンの側方から行う場合はボタンを側方から見た場合に表裏が識別可能である必要がある。
また、過去に撮像された撮像画像のテンプレート画像領域T1をEEPROM14に記憶しておき、その都度撮像されるテンプレート画像領域T1と平均化する処理を行ってその平均化後の画像と表裏を判定する対象となるボタンB2を含む判定画像領域T2とのパターンマッチングを行うようにしてもよい。また、平均化を行わずとも、その都度撮像されるボタンB1のテンプレート画像領域T1とボタンB2を含む判定画像領域T2とのパターンマッチングに加えて過去のテンプレート画像領域T1とボタンB2を含む判定画像領域T2とのパターンマッチングをさらに行うようにしてもよい。
また、本発明によるボタンの表裏判定方法を実施可能な構成であれば、当該方法を実施するための構成は上述の実施の形態に限定されないことは言うまでもない。例えば、カメラ2による各ボタンの撮像とA/Dコンバータ15による撮像画像のアナログ/デジタル変換はイメージセンサ(例えばCCDイメージセンサ、CMOSイメージセンサ等)によるデジタル画像イメージの取得に置き換えてもよい。
Needless to say, the buttons B1 and B2 are not limited to the shapes shown in the above embodiments. However, when imaging with the camera is performed on one side of the button, the front and back of the button must be visually identifiable. In addition, when imaging with the camera is performed from the side of the button, it is necessary to be able to identify the front and back when the button is viewed from the side.
Further, the template image region T1 of the captured image captured in the past is stored in the
Further, it goes without saying that the configuration for carrying out the method is not limited to the above-described embodiment as long as the method for determining the front and back of the button according to the present invention can be implemented. For example, the imaging of each button by the
2 カメラ
10 画像処理装置
11 CPU
14 EEPROM
B1,B2 ボタン
2
14 EEPROM
B1, B2 buttons
Claims (7)
表又は裏の基準となるボタンを前記カメラで撮像する第1の撮像工程と、
表裏を判定する対象となるボタンを撮像する第2の撮像工程と、
前記第1の撮像工程で得られた撮像画像と前記第2の撮像工程で得られた撮像画像とから前記第2の撮像画像に写ったボタンの表裏を判定する判定工程と、を有し、
前記第1の撮像工程は、前記第2の撮像工程と同時又は前記第2の撮像工程の直前に行うことを特徴とするボタンの表裏判定方法。 In the button front / back determination method for imaging a button with a camera and determining the front / back of the button from the captured image,
A first imaging step of imaging the front or back reference button with the camera;
A second imaging step of imaging a button to be subject to front / back determination;
A determination step of determining the front and back of the button reflected in the second captured image from the captured image obtained in the first imaging step and the captured image obtained in the second imaging step;
The button front / back determination method, wherein the first imaging step is performed simultaneously with the second imaging step or immediately before the second imaging step.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008163954A JP5084634B2 (en) | 2008-06-24 | 2008-06-24 | Button front / back judgment method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008163954A JP5084634B2 (en) | 2008-06-24 | 2008-06-24 | Button front / back judgment method |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2010004904A true JP2010004904A (en) | 2010-01-14 |
JP5084634B2 JP5084634B2 (en) | 2012-11-28 |
Family
ID=41586086
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2008163954A Expired - Fee Related JP5084634B2 (en) | 2008-06-24 | 2008-06-24 | Button front / back judgment method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5084634B2 (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2014030496A (en) * | 2012-08-01 | 2014-02-20 | Juki Corp | Method for detecting button direction, device for detecting button direction, and device for feeding button |
JP2014057764A (en) * | 2012-09-19 | 2014-04-03 | Juki Corp | Method for determining button front and reverse sides, apparatus for determining button front and reverse sides and apparatus for supplying button |
WO2017056677A1 (en) * | 2015-09-30 | 2017-04-06 | ブラザー工業株式会社 | Sewing machine and recording medium on which program is recorded |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS6159245A (en) * | 1984-08-30 | 1986-03-26 | Miyuuchiyuaru:Kk | Method for inspecting outer surface of solid preparation |
JPS63212393A (en) * | 1987-02-27 | 1988-09-05 | ジューキ株式会社 | Apparatus for stitch direction of button |
JPH10194435A (en) * | 1997-01-16 | 1998-07-28 | Juki Corp | Button selecting device |
JP2002274641A (en) * | 2001-03-16 | 2002-09-25 | Mitsubishi Electric Engineering Co Ltd | Small work delivery control device |
-
2008
- 2008-06-24 JP JP2008163954A patent/JP5084634B2/en not_active Expired - Fee Related
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS6159245A (en) * | 1984-08-30 | 1986-03-26 | Miyuuchiyuaru:Kk | Method for inspecting outer surface of solid preparation |
JPS63212393A (en) * | 1987-02-27 | 1988-09-05 | ジューキ株式会社 | Apparatus for stitch direction of button |
JPH10194435A (en) * | 1997-01-16 | 1998-07-28 | Juki Corp | Button selecting device |
JP2002274641A (en) * | 2001-03-16 | 2002-09-25 | Mitsubishi Electric Engineering Co Ltd | Small work delivery control device |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2014030496A (en) * | 2012-08-01 | 2014-02-20 | Juki Corp | Method for detecting button direction, device for detecting button direction, and device for feeding button |
JP2014057764A (en) * | 2012-09-19 | 2014-04-03 | Juki Corp | Method for determining button front and reverse sides, apparatus for determining button front and reverse sides and apparatus for supplying button |
WO2017056677A1 (en) * | 2015-09-30 | 2017-04-06 | ブラザー工業株式会社 | Sewing machine and recording medium on which program is recorded |
US10450682B2 (en) | 2015-09-30 | 2019-10-22 | Brother Kogyo Kabushiki Kaisha | Sewing machine and non-transitory computer-readable medium |
Also Published As
Publication number | Publication date |
---|---|
JP5084634B2 (en) | 2012-11-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11422356B2 (en) | Information processing apparatus, imaging control method, program, digital microscope system, display control apparatus, display control method, and program including detection of a failure requiring reimaging | |
US7686457B2 (en) | Projection image display apparatus and multi-projection system | |
US8036463B2 (en) | Character extracting apparatus, method, and program | |
JP5564349B2 (en) | Image processing apparatus and appearance inspection method | |
US20070172122A1 (en) | Image processing apparatus, image processing method, and program | |
KR101762037B1 (en) | Test system for conveyed objects and conveying apparatus | |
JP2007286846A5 (en) | ||
JP5084634B2 (en) | Button front / back judgment method | |
JP2005265661A (en) | Image processing method and image processing device | |
US20080063271A1 (en) | Character extracting apparatus, method, and program | |
WO2011024287A1 (en) | Information processing apparatus, information processing system, information processing method, and computer program for executing information processing method | |
JP6825454B2 (en) | Item number counting device | |
JP2010078562A (en) | Device and method for recognizing buttons | |
JP6623545B2 (en) | Inspection system, inspection method, program, and storage medium | |
JP2009116419A (en) | Outline detection method and outline detection device | |
JP2010273319A (en) | Imaging apparatus, microscope system, and white balance adjustment method | |
WO2009128223A1 (en) | Imaging position determination method and imaging position determination device | |
JP2000266514A (en) | Method and device for inspecting metallic sheet | |
JP2009250777A (en) | Surface inspection device and surface inspection method | |
JP2001175866A (en) | Device and method for image process inspection | |
JP2013101698A (en) | Image pickup device and program | |
JP3415307B2 (en) | Appearance inspection device | |
CN109870293A (en) | The detection method and detection device of display panel | |
JP2009162524A (en) | Inspection apparatus | |
JP2003323621A (en) | Image processor and protrusion detecting method for the image processor and its program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20110613 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20120713 |
|
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: 20120807 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20120904 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 5084634 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20150914 Year of fee payment: 3 |
|
LAPS | Cancellation because of no payment of annual fees |