WO2015136709A1 - 画像処理装置、画像センサ、画像処理方法 - Google Patents

画像処理装置、画像センサ、画像処理方法 Download PDF

Info

Publication number
WO2015136709A1
WO2015136709A1 PCT/JP2014/056998 JP2014056998W WO2015136709A1 WO 2015136709 A1 WO2015136709 A1 WO 2015136709A1 JP 2014056998 W JP2014056998 W JP 2014056998W WO 2015136709 A1 WO2015136709 A1 WO 2015136709A1
Authority
WO
WIPO (PCT)
Prior art keywords
model
image
reduction
reduction rate
reduction ratio
Prior art date
Application number
PCT/JP2014/056998
Other languages
English (en)
French (fr)
Inventor
嘉典 小西
Original Assignee
オムロン株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by オムロン株式会社 filed Critical オムロン株式会社
Priority to US15/121,800 priority Critical patent/US10311564B2/en
Priority to CN201480076693.0A priority patent/CN106062819B/zh
Priority to PCT/JP2014/056998 priority patent/WO2015136709A1/ja
Priority to EP14885523.2A priority patent/EP3118812A4/en
Priority to JP2016507245A priority patent/JP6278108B2/ja
Publication of WO2015136709A1 publication Critical patent/WO2015136709A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • G06T7/001Industrial image inspection using an image reference approach
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/75Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
    • G06V10/751Comparing pixel values or logical combinations thereof, or feature values having positional relevance, e.g. template matching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/24Character recognition characterised by the processing or recognition method
    • G06V30/248Character recognition characterised by the processing or recognition method involving plural approaches, e.g. verification by template match; Resolving confusion among similar patterns, e.g. "O" versus "Q"
    • G06V30/2504Coarse or fine approaches, e.g. resolution of ambiguities or multiscale approaches
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20016Hierarchical, coarse-to-fine, multiscale or multiresolution image processing; Pyramid transform
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • G06T2207/30164Workpiece; Machine component

Definitions

  • a model template is generated by reducing the model image to reduce processing time, use memory capacity, accuracy, etc., and the input image is reduced to the same reduction ratio.
  • search processing is performed (Patent Document 1). This method is particularly effective when the registration model is large. For example, the reduction rate may be determined so that the number of feature points included in the model becomes a predetermined number, or may be determined so that the area of the registration region becomes a predetermined size.
  • the preprocessing such as the reduction process of the input image is made common and the implementation is performed. By reducing the number of times, the processing speed is increased.
  • an image processing apparatus is an image processing apparatus that identifies or recognizes a plurality of models from an input image, and stores a model template obtained by reducing the model image for the plurality of models.
  • a model template obtained by reducing a model image at the same reduction ratio is stored in the storage unit, and for the at least two models, processing by the reduction unit Are shared.
  • the image reduction process is a process for the entire image, it is a process with a relatively large amount of calculation. In particular, the amount of calculation increases as the resolution of the input image increases. In the present invention, it is possible to reduce the total amount of calculation by making the model reduction rate the same and sharing the image reduction process for the models with the same reduction rate. In addition to the image reduction process, when a smoothing process, a feature amount calculation process, or the like is performed as a pre-process, these processes can be performed in common.
  • An image processing apparatus includes a model image input unit that receives input of model images for a plurality of models, a temporary reduction rate determination unit that determines a provisional reduction rate for each of the plurality of model images, and the plurality of models Based on the provisional reduction rate of the image, a reduction rate determination unit that determines a reduction rate of each model image, and generates a model template by reducing each of the plurality of model images at a corresponding reduction rate, It is also preferable to further include a model template generation unit that associates and stores the model template in the storage unit.
  • the provisional reduction ratio determination unit preferably determines a suitable reduction ratio as the provisional reduction ratio in light of a predetermined standard for each model image.
  • the higher the reduction ratio the faster the processing can be achieved.
  • the reduction ratio is too high, the accuracy of identification or recognition is reduced. Therefore, an appropriate reduction ratio considering the trade-off between processing speed and accuracy exists for each model image.
  • the provisional reduction ratio is a preferable reduction ratio in this sense.
  • the provisional reduction ratio can be determined according to a standard such that the number of feature points included in the model is a predetermined number or a standard that the area of the model image is a predetermined size. it can.
  • the reduction rate determination unit can group the plurality of model images so that the variation in the temporary reduction rate within the group is equal to or less than a predetermined threshold, and can determine the reduction rate for each group.
  • the variation in the provisional reduction ratio within the group can be represented by, for example, the standard deviation or variance of the provisional reduction ratio.
  • This grouping process (clustering process) can be performed using an arbitrary clustering algorithm such as the k-means method.
  • this grouping process may be a process of performing grouping by brute force and finding a classification that satisfies the above criteria.
  • the reduction ratio applied to the model images in each group can be determined as, for example, the average value, median value, or mode value of the provisional reduction ratios of the model images in the group.
  • the reduction ratio determination unit stores a plurality of predetermined reduction ratios, and among the plurality of predetermined reduction ratios, the reduction ratio corresponding to the provisional reduction ratio of the model image is determined as the model image. Can be determined as the reduction ratio.
  • the reduction rate corresponding to the temporary reduction rate is preferably set to a reduction rate closest to the temporary reduction rate among a plurality of predetermined reduction rates.
  • the standard of proximity can be set as appropriate, and for example, a simple difference or a square difference can be adopted.
  • the reduction ratio corresponding to the provisional reduction ratio is preferably set to a minimum reduction ratio equal to or higher than the provisional reduction ratio or a maximum reduction ratio equal to or lower than the provisional reduction ratio among a plurality of predetermined reduction ratios.
  • the present invention can be understood as an image processing apparatus having at least a part of the above configuration.
  • the present invention can also be understood as an image sensor having a camera for photographing an object and an image processing device.
  • the present invention can also be understood as an image processing apparatus for generating a model template. That is, one aspect of the present invention is an image processing apparatus that generates a model template for a plurality of models, a model image input unit that receives model images for a plurality of models, and provisional reduction for each of the plurality of model images
  • Each of the plurality of model images corresponds to a provisional reduction rate determination unit that determines a rate, a reduction rate determination unit that determines a reduction rate of each model image based on the provisional reduction rate of the plurality of model images, and It has a model template generation unit that generates a model template by reducing with a reduction rate, and an output unit that outputs the generated model template together with a corresponding reduction rate.
  • an actual reduction ratio determination method can employ a method based on grouping based on a provisional reduction ratio or a method of selecting a corresponding reduction ratio from predetermined reduction ratios.
  • the present invention can also be understood as an image processing method including at least a part of the above processing, or a program for causing a computer to execute such a method, or a computer-readable recording medium in which the program is temporarily stored. it can.
  • an image processing method including at least a part of the above processing, or a program for causing a computer to execute such a method, or a computer-readable recording medium in which the program is temporarily stored. it can.
  • a plurality of models can be identified or recognized from the input image at high speed.
  • the figure which shows the whole structure of an image sensor The figure which shows the hardware constitutions of an image sensor.
  • the flowchart which shows the detail of the search process in step S101 of FIG. The figure explaining the effect of the search process by this embodiment.
  • the present invention relates to an image identification technique for extracting an image that best matches an input image from a plurality of registered images (model images) registered in advance by template matching when an input image is given. is there.
  • This technology can be applied to object discrimination in an image sensor for FA, computer vision, machine vision, and the like, or a similar image search for detecting an image similar to a query image from a group of images in an image database.
  • the present invention is implemented in an FA image sensor that detects and discriminates each workpiece in a mixed flow line in which a plurality of types of workpieces flow. An example will be described.
  • the image sensor 1 is a system that is installed in a production line or the like and performs type discrimination of the workpiece 2 using an input image obtained by imaging a product (work 2).
  • the image sensor 1 can be mounted with various image processing functions as necessary, such as edge detection, scratch / dirt detection, and area / length / centroid measurement.
  • a PLC (Programmable Logic Controller) 4 is a device that controls a manufacturing apparatus (not shown) such as the image sensor 1, the conveyor 3, and a robot.
  • the image sensor 1 generally includes a camera 11 and an image processing device 10.
  • the camera 11 is a device for capturing the image of the workpiece 2 into the image processing apparatus 10, and for example, a CMOS (Complementary Metal-Oxide-Semiconductor) camera or a CCD (Charge-Coupled Device) camera can be suitably used.
  • the format of the input image (resolution, color / monochrome, still image / moving image, gradation, data format, etc.) is arbitrary, and may be appropriately selected according to the type of workpiece 2 and the purpose of sensing.
  • a special image such as an X-ray image or a thermo image
  • a camera that matches the image may be used.
  • the camera interface 116 is a part that mediates data transmission between the CPU 110 and the camera 11, and has an image buffer 116 a for temporarily storing image data from the camera 11.
  • the input interface 118 mediates data transmission between the CPU 110 and an input unit (mouse 13, keyboard, touch panel, jog controller, etc.).
  • the display controller 120 is connected to a display 12 such as a liquid crystal monitor, and controls display on the display 12.
  • the PLC interface 122 mediates data transmission between the CPU 110 and the PLC 4.
  • the communication interface 124 mediates data transmission between the CPU 110 and a console (or a personal computer or a server device).
  • the data reader / writer 126 mediates data transmission between the CPU 110 and the memory card 14 as a storage medium.
  • FIG. 3 shows a functional configuration related to type discrimination (object discrimination) provided by the image processing apparatus.
  • the image processing apparatus 10 includes an image input unit 130, a search unit 131, a storage unit 137, an identification unit 138, an output unit 139, a model image input unit 140, and a model template generation unit 141 as functions related to type discrimination. . These functional blocks are realized by the CPU 110 of the image processing apparatus 10 executing a computer program.
  • the storage unit 137 stores the model template generated by the model template generation unit 141.
  • the model template is generated by subjecting the model image input from the model image input unit 140 to image reduction processing at a predetermined reduction rate and extracting a feature amount from the reduced image.
  • a coarse / fine search (pyramid search) is performed, a plurality of model templates having a reduction ratio increased stepwise for one model image are generated and stored.
  • the lowest reduction ratio among the reduction ratios when generating the model template is referred to as the reduction ratio of the model template.
  • the image processing apparatus 10 captures the image of the workpiece 2 flowing on the conveyor 3 and executes an “operation mode” in which processing such as search (collation) and type determination of the workpiece 2 is performed, and prior to the operation mode, the image processing apparatus 10 It has a “registration mode” for registering models. The user can arbitrarily switch the mode.
  • the model template 137a in the storage unit 137 is generated by the model template generation unit 141 in the registration mode.
  • the image input unit 130 captures an image from the camera 11 (step S100).
  • the search part 131 detects each workpiece
  • the search unit 131 acquires the reduction rate 137b of the model template 137a stored in the storage unit 137, and repeatedly executes the processes of steps S201 to S203 below for each reduction rate.
  • the processing in steps S201 to S203 is preprocessing for search processing.
  • step S201 the image reduction unit 132 performs an image reduction process with the same reduction rate as the reduction rate of the model template on the input image.
  • step S202 the smoothing processing unit 133 applies a smoothing filter to the reduced image to remove noise.
  • step S203 the luminance gradient image generation unit 134 generates a luminance gradient image from the smoothed image.
  • the luminance gradient image generation unit 134 extracts feature points such as edges and corners from the luminance gradient image based on the luminance gradient.
  • the processing from image reduction to luminance gradient image generation is executed a plurality of times with the reduction rate being increased stepwise.
  • steps S204 to S206 is processing for actually searching for a model from the input image, and is repeatedly executed for each of a plurality of models.
  • the coarse / fine search unit 135 searches for a model using the coarse / fine search method. That is, first, a low-resolution image is roughly searched, a rough position is specified, and then detailed positioning is performed using the high-resolution image. Any number of hierarchies may be used in the coarse / fine search. According to such a density search, positioning can be performed with high speed and high accuracy.
  • the neighborhood exclusion unit 136 performs neighborhood exclusion processing. In the search process of step S204, a plurality of detection candidates may appear as a result of the search.
  • step S206 the search unit 131 outputs the position of the model in the input image obtained in this way. With the above processing, the positions of all models registered in the storage unit 137 are searched from the input image.
  • the type of each workpiece can be determined by repeating the processing in step S102 for all the workpieces detected in step S101.
  • the determination result is output to the display 12 or the PLC 4 by the output unit 139 (step S103).
  • step S301 an input of a model image to be registered is received from the model image input unit 140.
  • the model image input unit 140 captures, as a model image, an image of a region portion designated by the user from images of a plurality of types of objects (models) photographed by the camera 11 under the same conditions as in operation.
  • the temporary reduction rate determination unit 141a of the model template generation unit 141 obtains a suitable reduction rate (provisional reduction rate) for each model image. If the reduction ratio is increased, the processing speed can be increased, but the identification accuracy is lowered. On the other hand, if the reduction ratio is lowered, the identification accuracy is improved, but the effect of increasing the processing speed is limited. Therefore, the provisional reduction rate determination unit 141a obtains a reduction rate appropriate for the model image in accordance with a predetermined standard in consideration of a trade-off between speed and accuracy.
  • the provisional reduction ratio determination unit 141a may determine the provisional reduction ratio so that the number of feature amounts included in the model becomes a predetermined number, or provisionally so that the area of the registration area of the model becomes a predetermined size.
  • the reduction rate may be determined.
  • the provisional reduction rate obtained in this manner is different for each model.
  • the model template generation unit 141 sorts a plurality of models so that the provisional reduction ratios are in ascending order (S401). Then, the variable G representing the group number is initialized to 1 (S402). The following steps S403 to S408 are repeatedly executed for a plurality of models. At this time, processing is performed in order from a model with a small provisional reduction ratio.
  • the model having the smallest provisional reduction rate is added to the group G (S403), and the standard deviation of the provisional reduction rate is calculated for the added group (S404). If the calculated standard deviation is within the threshold (S405—YES), the addition of the model to the group G is permitted. That is, if the variation in the temporary reduction ratio is within an allowable range, the addition of the model to the group G is permitted. On the other hand, if the standard deviation calculated in step S404 is larger than the threshold value (S405-NO), the model is deleted from the group G without allowing the model to be added to the group G (S406). This model will be included in the new group. That is, the variable G representing the group number is incremented by 1 (S407), and this model is added to the group G (after update) (S408).
  • the grouping process of FIG. 8 will be described as an example.
  • the respective provisional reduction ratios are A: 0.3, B: 0.33, C: 0.42, D: 0.65, E: 0, 67, F. : 0.71, G: 0.75.
  • the standard deviation threshold is set to 0.05.
  • model A with the smallest provisional reduction ratio is added to group 1.
  • the standard deviation of the provisional reduction ratio in group 1 when model B is added to group 1 is calculated. As shown in FIG. 9A, since this standard deviation is 0.021 and is within the threshold value, it can be determined that the model B may be included in the group 1.
  • the standard deviation of the provisional reduction ratio in group 1 when model C is added to group 1 is calculated. As shown in FIG. 9B, this standard deviation is 0.062, which exceeds the threshold value. Therefore, it is determined that the model C is not included in the group 1.
  • Group 1 is determined to include only model A and model B, and model C is included in the new group 2.
  • the standard deviation of the provisional reduction ratio in group 2 when model D is added to group 2 is calculated.
  • this standard deviation is 0.16, which exceeds the threshold value, so that it is determined that the model D is not included in the group 2. That is, the group 2 is determined to include only the model C, and the model D is included in the new group 3. Thereafter, in the same manner as described above, a model with a small provisional reduction ratio is added to the group in order, and it is determined whether or not the standard deviation of the provisional reduction ratio within the group is within a threshold.
  • group 3 is determined as including models D, E, F, and G.
  • the seven models A to G are grouped into three groups (A, B), (C), (D, E, F, G).
  • processing is performed in order from a model with a small provisional reduction ratio, but processing may be performed in order from a model with a large provisional reduction ratio. Alternatively, the processing may be started from the largest and smallest provisional reduction ratios.
  • the method is not particularly limited as long as it is grouped so that the standard deviation of the provisional reduction rate within the group is within the threshold value. Further, although the standard deviation is adopted as a measure of variation, variance may be adopted, or a difference between the maximum value and the minimum value may be adopted.
  • step S305 the model template generation unit 141 generates a model template for each model by reducing the model image at the representative reduction rate of the group to which the model belongs.
  • a brightness gradient image is generated from the reduced model image as the model template, and the feature value is calculated and used as the model template.
  • a model template is generated based on a model image obtained by reducing the model image at a reduction rate higher than the representative reduction rate.
  • step S306 the model template generation unit 141 outputs the generated model template to the storage unit 137 together with the reduction ratio. Thereby, the model template 137a and the reduction ratio 137b are stored in the storage unit 137 in association with each other.
  • the reduction ratios of a plurality of models can be made the same within a range in which deviation from the optimum reduction ratio (provisional reduction ratio) for each model is allowable.
  • the above registration process may be executed again.
  • an image before reduction is required for all model images. Therefore, in order to be able to add a model image later, it is preferable to save the model image before reduction after the registration process.
  • Model registration processing can also be realized by methods other than those described above.
  • a modification of the model registration process a plurality of predetermined reduction ratios are stored, and any one of the predetermined reduction ratios is determined based on the temporary reduction ratio of the model. , Can be determined as the reduction rate of the model.
  • the model registration process according to this example will be described with reference to FIG.
  • the reduction ratio determining unit 141b determines a reduction ratio closest to the provisional reduction ratio among a plurality of predetermined reduction ratios as the reduction ratio of the model image. For example, it is assumed that a plurality of predetermined reduction ratios are (1.0, 0.707, 0.5, 0.354, 0.25). In such a case, if the temporary reduction ratio is 0.3, 0.25 is selected as the actual reduction ratio. Similarly, the reduction ratio 0.354 is selected for the temporary reduction ratios 0.33 and 0.42, and the reduction ratio 0 is set for the temporary reduction ratios 0.65, 0.67, 0.71, and 0.75. .707 is selected.
  • the reduction ratio determination process can be obtained by the following condition judgment.
  • r represents the provisional reduction ratio
  • step S404 the model template generation unit 141 generates a model template by reducing the model image at the determined reduction rate.
  • the model template generation unit 141 outputs the generated model template to the storage unit 137 together with the reduction ratio.
  • the reduction ratios of a plurality of models can be made the same within a range in which deviation from the optimum reduction ratio (provisional reduction ratio) for each model is allowable.
  • provisional reduction ratio provisional reduction ratio
  • a model closest to the provisional reduction ratio among a plurality of predetermined reduction ratios is determined as the model reduction ratio.
  • a simple difference is used as the distance measure. For example, even if a reduction ratio closest to the provisional reduction ratio is selected based on an arbitrary distance measure such as a square difference, a logarithmic difference, or a square root difference. Good. Moreover, you may make it select other than the nearest reduction rate. For example, the smallest reduction ratio greater than or equal to the provisional reduction ratio may be determined as the model reduction ratio, or the largest reduction ratio less than or equal to the provisional reduction ratio may be determined as the model reduction ratio. .
  • the reduction ratio is determined to be a geometric sequence (common ratio 0.707), but it is not necessarily required to be a geometric sequence.
  • the configuration of the above-described embodiment is merely a specific example of the present invention, and is not intended to limit the scope of the present invention.
  • the present invention can take various specific configurations without departing from the technical idea thereof.
  • an example in which the present invention is applied to an object discrimination apparatus that discriminates a plurality of similar object types has been described, but the scope of application of the present invention is not limited to this.
  • the present invention is applicable to any image processing apparatus that identifies or recognizes a plurality of models from an input image, and the plurality of models do not need to be similar.
  • the present invention does not limit a specific method of template matching.
  • identification may be performed based on feature amounts such as edges, corners, luminance gradient directions, luminance gradient direction histograms, or identification may be performed using pixel values themselves such as luminance and color.
  • any algorithm for speeding up such as coarse / fine search can be used.
  • the present invention can be applied to any of existing methods of template matching. Although it is necessary to change the model template creation process according to the template matching to be employed, those methods can be easily understood by those skilled in the art.
  • the model template is created in the image processing apparatus that performs the identification process.
  • the apparatus that creates the model template and the apparatus that uses the created model template may be different. Absent.
  • the present invention can be regarded as an image identification device (image processing device) for identifying an image using a model template obtained by reducing a model image at the same reduction ratio for at least two models, It can also be regarded as a model template creation device (image processing device) that creates a model template by reducing the model image at the same reduction ratio for at least two models.
  • the present invention performs template matching on an image recognition apparatus that registers an abnormal state as a model image and inspects an object, or on a specific area of an input image without performing a search. Or an image recognition apparatus that performs template matching on the entire input image having the same size as the model image.

Abstract

 画像処理装置は、複数のモデルについて、モデル画像を縮小して得られるモデルテンプレートを格納する記憶部と、入力画像を、各モデルの縮小率で縮小する縮小部と、縮小された入力画像とモデルテンプレートに基づいて、入力画像におけるモデルの位置を探索する探索部と、を有する。前記複数のモデルのうち少なくとも2つのモデルについては、同一の縮小率でモデル画像を縮小して得られたモデルテンプレートが前記記憶部に格納される。前記少なくとも2つのモデルについては、前記縮小部による処理が共通化される。これにより、入力画像から複数のモデルを高速に識別または認識可能となる。

Description

画像処理装置、画像センサ、画像処理方法
 本発明は、入力画像からモデルを識別または認識する技術に関する。
 FA(Factory Automation)分野においては、ラインを流れる計測対象物(以下、「ワーク」とも呼ぶ)を計測・監視するために、画像センサ(視覚センサ)と呼ばれるセンサデバイスが広く用いられている。画像センサは、カメラと画像処理装置から構成され、予め登録された教師物体(以下、「モデル」または「パターン」とも呼ぶ)とのマッチング処理によって画像内のワークを検出し、必要な情報の抽出・計測などを行う機能を有している。画像センサの出力は、例えば、ワークの識別、検査、仕分けなどの様々な用途に利用される。
 ところで、FA分野における最近の傾向として、一つのラインに複数種類のワークを混在して流し、種類別に異なる処理を適用する、という生産形態が増えている。例えば、アソート商品の箱詰めラインにおいては、コンベヤ上に異なる種類のワークをランダムに流し、ピックアップロボットで種類別にピックアップし正しい位置に箱詰めするという作業を行う。また、多品種少量生産のラインでは、形、色、サイズなどの仕様が少しずつ異なるシリーズ商品が同一のラインで製造され、仕様ごとに加工方法や検査内容などを違える場合がある。
 このように複数種類のワークが混在するライン(以下、「混流ライン」とも呼ぶ)においては、画像から複数のモデルを認識(および検出・検索)する必要がある。1つのモデルについて物体認識を行う場合、処理時間短縮や使用メモリ容量削減、精度向上などのために、モデル画像を縮小してモデルテンプレートを生成し、入力画像を同じ縮小率で縮小した画像上にて探索処理を実施することが知られている(特許文献1)。特に登録モデルが大きい場合には、この方法による効果が大きい。縮小率は、例えば、モデルに含まれる特徴点数が所定数になるように決定したり、登録領域の面積が所定サイズになるように決定したりするとよい。
 混流ラインでは、複数のモデルを認識するので、上記の探索処理をモデルの数だけ繰り返す必要が生じる。したがって、モデル数が増えるとそれに比例して処理時間が増大してしまうという問題がある。
 1つのモデルについて、多重解像度画像(ピラミッド画像)を用いて物体検出を行う際に、テンプレートの縮小率bとピラミッド画像の縮小率aをb=a(Nは2以上の整数)となるように設定する手法が知られている(特許文献2)。この手法によると、ピラミッド画像の枚数および照合に用いるテンプレートの数を削減できるので、検出処理が高速に行える。しかしながら、この手法は、検出すべき物体の種類が異なる場合には適用できない。
特開2010-67246号公報 特開2006-202184号公報
 本発明は、上記実情に鑑みてなされたものであり、入力画像から複数のモデルを高速に識別または認識可能な画像処理技術を提供することを目的とする。
 上記目的を達成するために本発明では、各モデルの縮小率ができるだけ同一になるように決定し、同一の縮小率のモデルについては、入力画像の縮小処理などの前処理を共通化してその実施回数を減らすことで、処理の高速化を図る。
 具体的には、本発明に係る画像処理装置は、入力画像から複数のモデルを識別または認識する画像処理装置であって、複数のモデルについて、モデル画像を縮小して得られるモデルテンプレートを格納する記憶部と、入力画像を各モデルの縮小率で縮小する縮小部と、縮小された入力画像とモデルテンプレートに基づいて、入力画像におけるモデルの位置を探索する探索部と、を有し、前記複数のモデルのうち少なくとも2つのモデルについては、同一の縮小率でモデル画像を縮小して得られたモデルテンプレートが前記記憶部に格納されており、前記少なくとも2つのモデルについては、前記縮小部による処理が共通化される、ことを特徴とする。
 画像縮小処理は、画像全体に対する処理であるため、比較的計算量の多い処理である。特に、入力画像の解像度が高いほど計算量は多くなる。本発明においては、モデルの縮小率を同一とし、縮小率を同一にしたモデルについての画像縮小処理を共通化することで、全体の計算量の削減が可能となる。また、画像縮小処理以外に平滑化処理や特徴量算出処理などを前処理として行う場合には、これらの処理も共通化して行うこともできる。
 本発明における画像処理装置は、複数のモデルについてモデル画像の入力を受け付けるモデル画像入力部と、前記複数のモデル画像のそれぞれについて、暫定縮小率を決定する暫定縮小率決定部と、前記複数のモデル画像の暫定縮小率に基づいて、各モデル画像の縮小率を決定する縮小率決定部と、前記複数のモデル画像のそれぞれを対応する縮小率で縮小してモデルテンプレートを生成し、前記縮小率と関連付けてモデルテンプレートを前記記憶部に格納するモデルテンプレート生成部と、を更に有することも好ましい。
 暫定縮小率決定部は、各モデル画像について、所定の基準に照らして好適な縮小率を暫定縮小率として決定することが好ましい。縮小率が高いほど処理の高速化が図れる一方、縮小率を高くしすぎると識別または認識の精度が落ちてしまう。したがって、処理速度と精度のトレードオフを考慮した適切な縮小率が各モデル画像について存在する。暫定縮小率はこのような意味で好適な縮小率であり、例えば、モデルに含まれる特徴点数を所定数にするといった基準や、モデル画像の面積を所定サイズにするといった基準にしたがって決定することができる。
 暫定縮小率から実際の縮小率を求めるには、例えば、次のようにすることができる。すなわち、縮小率決定部は、グループ内の暫定縮小率のばらつきが所定の閾値以下となるように、前記複数のモデル画像をグループ分けし、グループごとに縮小率を決定することができる。グループ内の暫定縮小率のばらつきは、例えば、暫定縮小率の標準偏差や分散などにより代表できる。このグループ分け処理(クラスタリング処理)は、k-means法などの任意のクラスタリングアルゴリズムを用いて行うことができる。また、このグループ分け処理は、総当たりでグループ分けを行い、上記基準を満たす分類を見つけ出す処理であってもよい。この際、各グループ内のモデル画像に適用する縮小率は、例えば、当該グループ内のモデル画像の暫定縮小率の平均値、中央値、最頻値などとして決定することができる。
 暫定縮小率から実際の縮小率を求める別の方法として、例えば、次のような方法もある。すなわち、縮小率決定部は、予め定められた複数の縮小率を記憶しており、前記予め定められた複数の縮小率のうち、モデル画像の暫定縮小率に対応する縮小率を、当該モデル画像の縮小率として決定することができる。暫定縮小率に対応する縮小率は、予め定められた複数の縮小率のうち、暫定縮小率に最も近い縮小率とすることが好ましい。ここで、近さの基準は適宜設定可能であり、例えば、単純な差や2乗の差などを採用することができる。また、暫定縮小率に対応する縮小率は、予め定められた複数の縮小率のうち、暫定縮小率以上の最小の縮小率あるいは暫定縮小率以下の最大の縮小率とすることも好ましい。
 なお、本発明は、上記構成の少なくとも一部を有する画像処理装置として捉えることができる。また、本発明は、物体を撮影するカメラと画像処理装置とを有する画像センサとして捉えることもできる。
 また、本発明は、モデルテンプレートを生成するための画像処理装置として捉えることもできる。すなわち、本発明の一態様は、複数のモデルについてモデルテンプレートを生成する画像処理装置であって、複数のモデルについてモデル画像を受け付けるモデル画像入力部と、前記複数のモデル画像のそれぞれについて、暫定縮小率を決定する暫定縮小率決定部と、前記複数のモデル画像の暫定縮小率に基づいて、各モデル画像の縮小率を決定する縮小率決定部と、前記複数のモデル画像のそれぞれを、対応する縮小率で縮小してモデルテンプレートを生成するモデルテンプレート生成部と、生成されたモデルテンプレートを、対応する縮小率とともに出力する出力部と、を有することを特徴とする。実際の縮小率の決定方法は、上述のように、暫定縮小率に基づくグループ分けによる方法や、予め定められた縮小率の中から対応する縮小率を選択する方法が採用可能である。
 また、本発明は、上記処理の少なくとも一部を含む画像処理方法、または、かかる方法をコンピュータに実行させるためのプログラムやそのプログラムを非一時的に記憶したコンピュータ読取可能な記録媒体として捉えることもできる。上記構成および処理の各々は技術的な矛盾が生じない限り互いに組み合わせて本発明を構成することができる。
 本発明によれば、入力画像から複数のモデルを高速に識別または認識することができる。
画像センサの全体構成を示す図。 画像センサのハードウェア構成を示す図。 画像識別装置の種類判別にかかわる機能構成を示す図。 稼働モードにおける種類判別処理の流れを示すフローチャート。 図4のステップS101における探索処理の詳細を示すフローチャート。 本実施形態による探索処理の効果を説明する図。 登録モードにおけるモデル登録処理の流れを示すフローチャート。 図7のステップS303におけるグループ分け処理の詳細を示すフローチャート。 グループ分け処理を説明する図。 登録モードにおけるモデル登録処理の変形例の流れを示すフローチャート。
 本発明は、入力画像が与えられたときに、テンプレートマッチングによって、予め登録された複数の登録画像(モデル画像)のなかから入力画像に最もよく合致するものを抽出する、画像識別技術に関するものである。この技術は、FA用の画像センサ、コンピュータビジョン、マシンビジョンなどにおける物体判別や、画像データベース内の画像群のなかからクエリ画像に類似する画像を検出する類似画像検索などに応用することができる。以下に述べる実施形態では、本発明の好ましい応用例の一つとして、複数種類のワークが混在して流れる混流ラインにおいて各ワークの検出および種類判別を行うFA用の画像センサに本発明を実装した例を説明する。
 (画像センサ)
 図1を参照して、本発明の実施形態に係る画像センサの全体構成および適用場面について説明する。
 画像センサ1は、生産ラインなどに設置され、製造物(ワーク2)を撮像することで得られる入力画像を用いてワーク2の種類判別などを行うシステムである。なお、画像センサ1には、種類判別のほかにも、エッジ検出、キズ・汚れ検出、面積・長さ・重心の計測など、必要に応じて様々な画像処理機能を実装可能である。
 図1に示すように、コンベヤ3上には複数種類のワーク2が混在して流れている。画像センサ1は、カメラ11から定期的にまたはPLC4から送られるトリガー信号のタイミングで画像を取り込み、画像処理装置(画像識別装置)10によって画像に含まれる各ワーク2の検出、種類判別などの処理を実行し、その結果をディスプレイ12に表示したり、外部装置(PLC4など)へと出力する。PLC(Programmable Logic Controller)4は、画像センサ1、コンベヤ3、ロボット等の製造装置(不図示)の制御を司るデバイスである。
 (画像センサのハードウェア構成)
 図2を参照して、画像センサ1のハードウェア構成を説明する。画像センサ1は、概略、カメラ11と画像処理装置10から構成される。
 カメラ11は、ワーク2の画像を画像処理装置10に取り込むためのデバイスであり、例えばCMOS(Complementary Metal-Oxide-Semiconductor)カメラやCCD(Charge-Coupled Device)カメラを好適に用いることができる。入力画像の形式(解像度、カラー/モノクロ、静止画像/動画、階調、データ形式など)は任意であり、ワーク2の種類やセンシングの目的に合わせて適宜選択すればよい。可視光像以外の特殊な画像(X線画像、サーモ画像など)や奥行き(距離)情報付きの画像を検査に利用する場合には、その画像に合わせたカメラを用いてもよい。
 画像処理装置10は、CPU(中央演算処理装置)110と、記憶部としてのメインメモリ112およびハードディスク114と、カメラインターフェイス116と、入力インターフェイス118と、表示コントローラ120と、PLCインターフェイス122と、通信インターフェイス124と、データリーダ/ライタ126とを含む。これらの各部は、バス128を介して、互いにデータ通信可能に接続される。
 カメラインターフェイス116は、CPU110とカメラ11とのあいだのデータ伝送を仲介する部分であり、カメラ11からの画像データを一時的に蓄積するための画像バッファ116aを有している。入力インターフェイス118は、CPU110と入力部(マウス13、キーボード、タッチパネル、ジョグコントローラなど)とのあいだのデータ伝送を仲介する。表示コントローラ120は、液晶モニタなどのディスプレイ12に接続され、当該ディスプレイ12での表示を制御する。PLCインターフェイス122は、CPU110とPLC4のあいだのデータ伝送を仲介する。通信インターフェイス124は、CPU110とコンソール(あるいは、パーソナルコンピュータやサーバ装置)などとのあいだのデータ伝送を仲介する。データリーダ/ライタ126は、CPU110と記憶媒体であるメモリカード14との間のデータ伝送を仲介する。
 画像処理装置10は、汎用的なアーキテクチャを有するコンピュータで構成可能であり、CPU110が、ハードディスク114またはメモリカード14に格納されたプログラム(命令コード)を読み込み、実行することで、各種機能を提供する。このようなプログラムは、メモリカード14や光ディスクなどのコンピュータ読取可能な記録媒体に格納された状態で流通する。
 汎用的なパーソナルコンピュータを画像処理装置10として利用する場合には、本実施形態で述べる物体判別機能を提供するためのアプリケーションプログラムに加えて、コンピュータの基本的な機能を提供するためのOS(オペレーション・システム)がインストールされていてもよい。この場合には、本実施形態に係るプログラムは、OSが提供するプログラムモジュールを利用することで、目的とする機能を実現してもよい。なお、本実施形態に係るプログラムは単体のアプリケーションプログラムとして提供されてもよいし、他のプログラムの一部に組み込まれるモジュールとして提供されてもよい。また、その機能の一部または全部が専用のロジック回路で代替されてもよい。
 (画像処理装置の機能構成)
 図3に、画像処理装置が提供する種類判別(物体判別)にかかわる機能構成を示す。画像処理装置10は、種類判別にかかわる機能として、画像入力部130、探索部131、記憶部137、識別部138、出力部139、モデル画像入力部140、モデルテンプレート生成部141を有している。これらの機能ブロックは、画像処理装置10のCPU110がコンピュータプログラムを実行することにより実現される。
 記憶部137には、モデルテンプレート生成部141によって生成されたモデルテンプレートが格納される。モデルテンプレートは、モデル画像入力部140から入力されたモデル画像に対して所定の縮小率の画像縮小処理を施し、縮小画像から特徴量を抽出することによって生成される。本実施形態では、粗密探索(ピラミッド探索)を行うので、1つのモデル画像について段階的に縮小率を高くした複数のモデルテンプレートが生成および格納される。なお、本明細書では、モデルテンプレートを生成する際の縮小率のうち最も低い縮小率のことを、モデルテンプレートの縮小率と称する。
 記憶部137には、モデルテンプレート137aと、当該モデルテンプレートの縮小率137bとが関連付けて格納される。記憶部137内には、判別対象の物体種類に応じた数のモデルテンプレートが格納される。なお、モデルテンプレート生成部141は、各モデルの縮小率ができるだけ同一となるように縮小率を決定する。したがって、記憶部137内には、縮小率が同一となるモデルテンプレートが少なくとも2つ(1組)以上存在する。
 (画像処理装置の動作)
 画像処理装置10は、コンベヤ3上を流れるワーク2の画像を取り込み、ワーク2の探索(照合)や種類判別などの処理を実行する「稼働モード」と、稼働モードに先立ち、画像処理装置10に対してモデルの登録を行う「登録モード」とを有している。モードの切り替えはユーザが任意に行うことができる。記憶部137内のモデルテンプレート137aは、登録モードにおいてモデルテンプレート生成部141によって生成される。
 以下、すでにモデルテンプレート137aの生成が完了しているという前提で「稼働モード」の動作について説明をしたのち、「登録モード」におけるモデル登録動作について説明する。
 (1)稼働モード
 図4のフローチャートに沿って、稼働モードにおける各機能ブロックの動作、および、種類判別処理の全体の流れについて説明する。
 PLC4からのトリガー信号が入力されると、画像入力部130がカメラ11から画像を取り込む(ステップS100)。次に、探索部131が、入力画像から個々のワーク2を検出する(ステップS101)。ステップS101の探索(照合)処理の詳細については図5を参照して説明する。探索部131は、記憶部137に格納されているモデルテンプレート137aの縮小率137bを取得し、縮小率ごとに以下のステップS201~S203の処理を繰り返し実行する。このステップS201~S203の処理は、探索処理の前処理である。
 ステップS201では、画像縮小部132が、モデルテンプレートの縮小率と同じ縮小率の画像縮小処理を入力画像に対して施す。次にステップS202において、平滑化処理部133が縮小された画像に対して平滑化フィルタを施して、ノイズ除去を行う。ステップS203では、輝度勾配画像生成部134が平滑化処理後の画像から、輝度勾配画像を生成する。輝度勾配画像生成部134は、輝度勾配画像から輝度勾配に基づいてエッジやコーナーなどの特徴点を抽出する。本実施形態では粗密探索を行うので、画像縮小から輝度勾配画像生成までの処理は縮小率を段階的に高くして複数回実行される。
 ステップS204~S206の処理は、入力画像からモデルを実際に探索する処理であり、複数のモデルのそれぞれについて繰り返し実行される。ステップS204では、粗密探索部135が、粗密探索法を用いてモデルの探索を行う。すなわち、最初に低解像度の画像を粗く探索し、大まかな位置を特定した後に、高解像度の画像を用いて詳細な位置決めを行う。粗密探索における階層数はいくつであってもよい。このような粗密探索によれば、高速かつ高精度な位置決めができる。次にステップS205で、近傍排除部136が近傍排除処理を実施する。ステップS204の探索処理において、探索の結果複数の検出候補が現れることがある。このような場合に、位置や姿勢が似た検出候補は同一とみなして、いずれか一つのみを残して他を排除することで、重複した検出候補の処理を省略する。これが近傍排除処理である。ステップS206では、探索部131が、このようにして得られた入力画像中におけるモデルの位置を出力する。以上の処理により、入力画像中から、記憶部137に登録されている全てのモデルの位置が探索される。
 図4のフローチャートの説明に戻る。ステップS102で、識別部138が、探索処理により検出されたワークを解析してワークの種類を判別する。類似するモデルの検出を行う場合、識別処理においてワークが複数のモデルと一致すると判定されることがある。識別部138は、検出されたワークが、複数のモデルのうちのいずれと最も良く合致するかを判定する。この判定方法は、種々の方法が採用可能であり、例えば、ワークとの類似度が最も高いモデルをワークの種類と判断してもよい。あるいは、検出されたワークから抽出される特徴量を、モデル種類を識別する識別器に入力して、ワークの種類を判別するようにしてもよい。
 ステップS101で検出されたすべてのワークに対し、ステップS102の処理を繰り返すことで、各ワークの種類を判別することができる。この判別結果は、出力部139によってディスプレイ12またはPLC4に出力される(ステップS103)。
 本手法による効果を、図6を参照して説明する。図6(a)は本手法の処理を模式的に説明する図であり、図6(b)は従来手法(比較例)の処理を模式的に説明する図である。従来手法では、画像縮小処理、平滑化処理、および輝度勾配画像生成処理を、モデルの数と同じ回数だけ実行する必要がある。それに対して、本手法によれば、画像縮小処理、平滑化処理、および輝度勾配画像生成処理を、モデルテンプレートの縮小率が同一の場合に共通化できる(点線部)。したがって、上記の処理をモデルの数だけ繰り返す必要がなくなり、処理の高速化が図れる。これらの処理は画像全体に対する処理であるため、比較的計算量が多く、したがってその実行回数を減らすことで効果的な高速化が図れる。例えば、図6に示すようにモデルの数が5個であり、全てのモデルの縮小率が同一である場合の処理時間について考える。探索に要する処理時間が全体で1秒であり、その半分が画像縮小処理、平滑化処理、輝度勾配画像生成処理などの前処理によって占められているものとする。
 すると、従来手法では、モデルごとに探索処理を全て実行する必要があるので、処理時間は1秒×5種類=5秒となる。一方、本手法では、前処理は1回だけ行えばよいので、0.5秒+0.5秒×5種類=3秒となる。すなわち、本手法によれば、従来手法と比較して処理時間が40%短縮できる。なお、図6の例は、全てのモデルの縮小率を同一にでき、最大の効果が得られる例を示したものであるが、少なくとも2つのモデルの縮小率が同一であれば前処理の共通化により、従来例よりも処理時間を短縮可能である。
 (2)登録モード
 次に、図7のフローチャートに沿って、登録モードにおけるモデル登録処理、特にモデルの縮小率の決定方法について説明する。なお、図7に示す処理は、例えば、画像センサ1を新たに設置したとき、ラインに流すワークの種類が変更になったとき、などに実行される。
 まず、ステップS301において、モデル画像入力部140から登録するモデルの画像の入力を受け付ける。例えば、モデル画像入力部140は、稼働時と同じ条件下でカメラ11によって撮影された複数種類の物体(モデル)の画像から、ユーザによって指定された領域部分の画像をモデル画像として取り込む。
 次に、モデルテンプレート生成部141の暫定縮小率決定部141aが、それぞれのモデル画像について、好適な縮小率(暫定縮小率)を求める。縮小率を高くすれば処理の高速化が図れるが、識別精度が低下する。一方、縮小率を低くすれば識別精度は向上するが、処理の高速化の効果が限定的である。そこで、暫定縮小率決定部141aは、速度と精度のトレードオフを考慮してモデル画像に適切な縮小率を所定の基準にしたがって求める。例えば、暫定縮小率決定部141aは、モデルに含まれる特徴量数が所定数になるように暫定縮小率を決定してもよいし、モデルの登録領域の面積が所定のサイズとなるように暫定縮小率を決定してもよい。このようにして求めた暫定縮小率は、それぞれのモデルで異なった値となることが一般的である。
 このように個々のモデルについて最適な縮小率が異なるが、モデルテンプレート生成部141は、処理速度や識別精度をなるべく低下させない範囲内で、各モデルの縮小率をできるだけ同一になるようにする。具体的には、ステップS303で、モデルテンプレート生成部141の縮小率決定部141bは、グループ内の各モデルの暫定縮小率のばらつきが十分に小さくなるように、モデルのグループ分けを行う。このグループ分けの処理は、k-means法などのクラスタリングアルゴリズムを用いて行うこともできるが、次のような簡易な手法によって実現可能である。
 ステップS303のグループ分け処理の詳細について、図8のフローチャートを参照して説明する。まず、モデルテンプレート生成部141は、暫定縮小率が昇順になるように複数のモデルをソートする(S401)。そして、グループの番号を表す変数Gを1に初期化する(S402)。以下のステップS403~S408は、複数のモデルについて繰り返し実行される。この際、暫定縮小率が小さいモデルから順番に処理される。
 まず、未処理のモデルのうち暫定縮小率が最も小さいモデルを、グループGに追加し(S403)、追加後のグループについて暫定縮小率の標準偏差を算出する(S404)。算出された標準偏差が閾値以内であれば(S405-YES)、グループGに対する当該モデルの追加を許容する。すなわち、暫定縮小率のばらつきは許容範囲内であれば、グループGへの当該モデルの追加を許容する。一方、ステップS404で算出された標準偏差が閾値よりも大きければ(S405-NO)、当該モデルのグループGへの追加は許容せず、グループGから当該モデルを削除する(S406)。このモデルは、新しいグループに含められる。すなわち、グループの番号を表す変数Gが1インクリメントされ(S407)、このモデルはグループG(更新後)に追加される(S408)。
 上記ステップS403~S408の処理を全てのモデルについて繰り返し実行することで、最終的にグループ内の暫定縮小率のばらつき(標準偏差)が閾値以内となるグループ分けが完了する。
 図9を参照して、図8のグループ分け処理を例示的に説明する。ここでは、モデルA~Gが7種類存在し、それぞれの暫定縮小率がA:0.3,B:0.33,C:0.42,D:0.65,E:0,67,F:0.71,G:0.75であると仮定する。また、標準偏差の閾値を0.05とする。
 まず、暫定縮小率が最小のモデルAがグループ1に追加される。次に、モデルBがグループ1に追加された場合のグループ1における暫定縮小率の標準偏差が計算される。図9(a)に示すように、この標準偏差は0.021であり閾値以内であるため、モデルBはグループ1に含めてよいと判断できる。次に、モデルCがグループ1に追加された場合のグループ1における暫定縮小率の標準偏差が計算される。図9(b)に示すように、この標準偏差は0.062であり閾値を超えるため、モデルCはグループ1には含めないと判断される。グループ1はモデルAおよびモデルBのみを含むものとして確定され、モデルCは新たなグループ2に含められる。次に、モデルDがグループ2に追加された場合のグループ2における暫定縮小率の標準偏差が計算される。図9(c)に示すように、この標準偏差は0.16となり閾値を超えるため、モデルDはグループ2には含めないと判断される。すなわち、グループ2はモデルCのみを含むものとして確定され、モデルDは新たなグループ3に含められる。以下、上記と同様に暫定縮小率が小さいモデルから順番にグループに追加していき、グループ内の暫定縮小率の標準偏差が閾値以内であるか否か判定する。この例では、モデルE,F,Gをグループ3に追加した場合、図9(d)(e)(f)に示すように、いずれも標準偏差は閾値以内となる。したがって、グループ3はモデルD,E,F,Gを含むものとして確定する。以上のようにして、モデルA~Gの7つのモデルは、3つのグループ(A,B),(C),(D,E,F,G)にグループ分けされる。
 なお、図8のフローチャートでは、暫定縮小率が小さいモデルから順番に処理したが、暫定縮小率が大きいモデルから順番に処理してもよい。あるいは、暫定縮小率が最大のものと最小のものから処理を開始してもよい。最終的に、グループ内での暫定縮小率の標準偏差が閾値以内となるようにグループ分けされれば、その手法は問わない。また、ばらつきの尺度として標準偏差を採用したが、分散を採用してもよいし、最大値と最小値の差などを採用してもよい。
 図7のフローチャートに戻る。グループ分けが完了すると、ステップS304で、縮小率決定部141bは、グループごとの代表縮小率を決定する。ここでは、グループ内の暫定縮小率の平均値をグループの代表縮小率とする。例えば、図9の例では図9(f)に示すように、モデルA,Bからなるグループ1の代表縮小率は0.315となり、モデルCのみからなるグループ2の代表縮小率は0.420となり、モデルD,E,F,Gからなるグループ3の代表縮小率は0.695となる。なお、代表縮小率は、グループ内の暫定縮小率の平均値ではなく、その中央値や最頻値などとしても構わない。
 ステップS305では、モデルテンプレート生成部141は、それぞれのモデルに対して、そのモデルが属するグループの代表縮小率でモデル画像を縮小してモデルテンプレートを生成する。本実施形態では、輝度勾配の特徴量を用いて識別を行うのでモデルテンプレートとして縮小後のモデル画像から輝度勾配画像を生成し特徴量を算出してモデルテンプレートとする。また、本実施形態では粗密探索を行うので、モデル画像を代表縮小率よりも高い縮小率で縮小したモデル画像にも基づいてモデルテンプレートを生成する。
 ステップS306では、モデルテンプレート生成部141は、生成したモデルテンプレートをその縮小率とともに、記憶部137へ出力する。これにより、記憶部137内に、モデルテンプレート137aとその縮小率137bが関連付けて格納される。
 以上のようにして、モデルごとの最適な縮小率(暫定縮小率)からのずれが許容できる範囲で、複数のモデルの縮小率を同一とすることができる。
 本実施形態によれば、モデル登録時における縮小率を複数のモデルについて同一にしているので、稼働時における入力画像の縮小処理や特徴量抽出処理などの前処理を共通化して高速化が図れる。また、モデルの縮小率を同一にする際にグループ内での暫定縮小率のばらつきが小さくなるように(閾値以内となるように)しているので、識別精度の低下などの影響を最小限に抑えることができる。
 なお、モデル画像を後から追加する場合には、上記の登録処理を再度実行すればよい。登録処理においては全てのモデル画像について縮小前の画像が必要となるので、後からモデル画像を追加可能とするためには、登録処理後も縮小前のモデル画像を保存しておくことが好ましい。
 (モデル登録処理(縮小率決定処理)の変形例)
 上記の説明では、モデル登録時における各モデルの縮小率決定は、暫定縮小率に基づいてモデルをグループ分けすることによって行われる。モデル登録処理、特に縮小率の決定処理は上記以外の方法によっても実現可能である。例えば、モデル登録処理の変形例として、予め定められた複数の縮小率を記憶しておき、モデルの暫定縮小率に基づいて、予め定められた複数の縮小率の中のいずれかの縮小率を、モデルの縮小率として決定することができる。以下、本例に係るモデル登録処理について図10を参照して説明する。
 まず、ステップS401において、モデル画像入力部140から登録するモデルの画像の入力を受け付ける。次に、モデルテンプレート生成部141は、それぞれのモデル画像について、以下のステップS402~S405の処理を繰り返す。ステップS402では、モデルテンプレート生成部141の暫定縮小率決定部141aが、モデル画像の好適な縮小率(暫定縮小率)を求める。この処理は上記で説明した処理と同じである。
 次に、縮小率決定部141bは、予め定められた複数の縮小率のうち、暫定縮小率に最も近い値の縮小率を、このモデル画像の縮小率として決定する。例えば、予め定められた複数の縮小率が、(1.0, 0.707, 0.5, 0.354, 0.25)であるとする。このような場合、暫定縮小率が0.3であれば、実際の縮小率として0.25が選択される。同様に、暫定縮小率0.33,0.42に対しては縮小率0.354が選択され、暫定縮小率0.65,0.67,0.71,0.75に対して縮小率0.707が選択される。
 なお、複数の縮小率が予め定められていれば、縮小率の決定処理は次のような条件判断によって求めることができる。以下で、rは暫定縮小率、Rは実際の縮小率を表す。
0.854≦r ならば R=1
0.604≦r<0.854 ならば R=0.707
0.427≦r<0.604 ならば R=0.5
0.302≦r<0.427 ならば R=0.354
r<0.302 ならば R=0.250
 ステップS404で、モデルテンプレート生成部141は、決定された縮小率でモデル画像を縮小して、モデルテンプレートを生成する。ステップS405で、モデルテンプレート生成部141は、生成されたモデルテンプレートをその縮小率とともに、記憶部137へ出力する。
 このようにしても、モデルごとの最適な縮小率(暫定縮小率)からのずれが許容できる範囲で、複数のモデルの縮小率を同一とすることができる。本手法では、登録処理を一度行った後に新しいモデルを追加する場合であっても、既存のモデルテンプレートに対する変更は生じない。したがって、モデル追加時の処理が簡素化される。また、モデルテンプレート作成後にモデル画像を保存しておく必要がないという利点もある。
 なお、ステップS403では、予め定められた複数の縮小率のうち暫定縮小率に最も近いものをモデルの縮小率として決定している。上記では単純な差を距離測度として用いているが、例えば、2乗の差、対数の差、平方根の差など任意の距離測度に基づいて、暫定縮小率に最も近い縮小率を選択してもよい。また、最も近い縮小率以外を選択するようにしてもよい。例えば、暫定縮小率以上の縮小率のうち最小のものをモデルの縮小率として決定してもよいし、暫定縮小率以下の縮小率のうち最大のものをモデルの縮小率として決定してもよい。
 また、上記の説明では、予め定められた複数の縮小率として、1から0.25の間の5個の縮小率を採用しているが、その個数や縮小率の値は適宜変更可能である。例えば、0.25より小さい値を採用することができる。また、上記の例では縮小率が等比数列(公比0.707)となるように定めているが、必ずしも等比数列になるようにする必要はない。
 (その他の変形例)
 上述した実施形態の構成は本発明の一具体例を示したものにすぎず、本発明の範囲を限定する趣旨のものではない。本発明はその技術思想を逸脱しない範囲において、種々の具体的構成を採り得るものである。例えば上記実施形態では、本発明を類似する複数の物体の種類を判別する物体判別装置に適用した例を説明したが、本発明の適用範囲はこれに限られない。本発明は、入力画像から複数のモデルを識別または認識する任意の画像処理装置に対して適用可能であり、これら複数のモデルは類似している必要はない。
 また、本発明は、テンプレートマッチングの具体的な手法を限定するものではない。例えば、識別処理において、エッジ、コーナー、輝度勾配方向、輝度勾配方向ヒストグラムなどの特徴量に基づいて識別を行ってもよいし、輝度や色など画素値そのものを用いて識別を行ってもよい。また、粗密探索など高速化のためのアルゴリズムは任意のものを採用可能である。本発明は、テンプレートマッチングの既存手法のいずれにも適用可能である。なお、採用するテンプレートマッチングに応じて、モデルテンプレート作成処理を変更する必要があるが、その方法は当業者であれば容易に理解できるであろう。
 また、上記の実施形態の説明では、識別処理を行う画像処理装置においてモデルテンプレートを作成しているが、モデルテンプレートを作成する装置と、作成されたモデルテンプレートを利用する装置は異なっていても構わない。本発明は、少なくとも2つのモデルについて同一の縮小率でモデル画像を縮小して得られたモデルテンプレートを利用して、画像の識別を行う画像識別装置(画像処理装置)として捉えることもできるし、少なくとも2つのモデルについて同一の縮小率でモデル画像を縮小してモデルテンプレートを作成するモデルテンプレート作成装置(画像処理装置)として捉えることもできる。
 また、本発明は、上記の実施形態以外にも、モデル画像として異常状態を登録して物体の検査を行う画像認識装置や、探索を行わずに入力画像の特定領域に対してテンプレートマッチングを行ったり、モデル画像と同じ大きさの入力画像全体に対してテンプレートマッチングを行ったりする画像認識装置などにも適用可能である。
1:画像センサ、2:ワーク、3:コンベヤ、4:PLC
10:画像処理装置、11:カメラ、12:ディスプレイ
130:画像入力部、131:探索部、137:記憶部
140:モデル画像入力部、141:モデルテンプレート生成部

Claims (18)

  1.  入力画像から複数のモデルを識別または認識する画像処理装置であって、
     複数のモデルについて、モデル画像を縮小して得られるモデルテンプレートを格納する記憶部と、
     入力画像を、各モデルの縮小率で縮小する縮小部と、
     縮小された入力画像とモデルテンプレートに基づいて、入力画像におけるモデルの位置を探索する探索部と、
     を有し、
     前記複数のモデルのうち少なくとも2つのモデルについては、同一の縮小率でモデル画像を縮小して得られたモデルテンプレートが前記記憶部に格納されており、
     前記少なくとも2つのモデルについては、前記縮小部による処理が共通化される、
     ことを特徴とする画像処理装置。
  2.  複数のモデルについてモデル画像の入力を受け付けるモデル画像入力部と、
     前記複数のモデル画像のそれぞれについて、暫定縮小率を決定する暫定縮小率決定部と、
     前記複数のモデル画像の暫定縮小率に基づいて、各モデル画像の縮小率を決定する縮小率決定部と、
     前記複数のモデル画像のそれぞれを対応する縮小率で縮小してモデルテンプレートを生成し、前記縮小率と関連付けてモデルテンプレートを前記記憶部に格納するモデルテンプレート生成部と、
     を更に有する、請求項1に記載の画像処理装置。
  3.  前記縮小率決定部は、
     グループ内の暫定縮小率のばらつきが所定の閾値以下となるように、前記複数のモデル画像をグループ分けし、
     グループごとに縮小率を決定する、
     請求項2に記載の画像処理装置。
  4.  前記縮小率決定部は、グループ内のモデル画像の暫定縮小率の平均値を、当該グループの縮小率として決定する、
     請求項3に記載の画像処理装置。
  5.  前記縮小率決定部は、
     予め定められた複数の縮小率を記憶しており、
     前記予め定められた複数の縮小率のうち、モデル画像の暫定縮小率に対応する縮小率を、当該モデル画像の縮小率として決定する、
     請求項2に記載の画像処理装置。
  6.  前記縮小率決定部は、前記予め定められた複数の縮小率のうち、モデル画像の暫定縮小率に近い縮小率を、当該モデル画像の縮小率として決定する、
     請求項5に記載の画像処理装置。
  7.  物体を撮影するカメラと、
     前記カメラから入力された画像から前記モデルを識別または認識し、その結果を出力する、請求項1~6のいずれか1項に記載の画像処理装置と、を有する
    ことを特徴とする画像センサ。
  8.  複数のモデルについてモデルテンプレートを生成する画像処理装置であって、
     複数のモデルについてモデル画像を受け付けるモデル画像入力部と、
     前記複数のモデル画像のそれぞれについて、暫定縮小率を決定する暫定縮小率決定部と、
     前記複数のモデル画像の暫定縮小率に基づいて、各モデル画像の縮小率を決定する縮小率決定部と、
     前記複数のモデル画像のそれぞれを、対応する縮小率で縮小してモデルテンプレートを生成するモデルテンプレート生成部と、
     生成されたモデルテンプレートを、対応する縮小率とともに出力する出力部と、
     を有する、画像処理装置。
  9.  前記縮小率決定部は、
     グループ内の暫定縮小率のばらつきが所定の閾値以下となるように、前記複数のモデル画像をグループ分けし、
     グループごとに縮小率を決定する、
     請求項8に記載の画像処理装置。
  10.  前記縮小率決定部は、グループ内のモデル画像の暫定縮小率の平均値を、当該グループの縮小率として決定する、
     請求項9に記載の画像処理装置。
  11.  前記縮小率決定部は、
     予め定められた複数の縮小率を記憶しており、
     前記予め定められた複数の縮小率のうち、モデル画像の暫定縮小率に対応する縮小率を、当該モデル画像の縮小率として決定する、
     請求項8に記載の画像処理装置。
  12.  前記縮小率決定部は、前記予め定められた複数の縮小率のうち、モデル画像の暫定縮小率に近い縮小率を、当該モデル画像の縮小率として決定する、
     請求項11に記載の画像処理装置。
  13.  入力画像から複数のモデルを識別または認識する画像処理方法であって、
     複数のモデルについてモデル画像を縮小して得られるモデルテンプレートを格納する記憶部を有するコンピュータが、
     入力画像を、各モデルの縮小率で縮小する縮小ステップと、
     縮小された入力画像とモデルテンプレートに基づいて、入力画像におけるモデルの位置を探索する探索ステップと、
     を実行し、
     前記複数種類のモデルのうち少なくとも一部については、同一の縮小率で縮小されたモデルテンプレートが前記記憶部に格納されており、
     同一の縮小率のモデルについては、前記縮小ステップの処理が共通化される、
     ことを特徴とする画像処理方法。
  14.  複数のモデルについてモデルテンプレートを生成する画像処理方法であって、
     コンピュータが、
     複数のモデルについてモデル画像を受け付けるモデル画像入力ステップと、
     前記複数のモデル画像のそれぞれについて、暫定縮小率を決定する暫定縮小率決定ステップと、
     前記複数のモデル画像の暫定縮小率に基づいて、各モデル画像の縮小率を決定する縮小率決定ステップと、
     前記複数のモデル画像のそれぞれを、対応する縮小率で縮小してモデルテンプレートを生成するモデルテンプレート生成ステップと、
     生成されたモデルテンプレートを、対応する縮小率とともに出力する出力ステップと、
     を実行する、画像処理方法。
  15.  請求項13に記載の画像処理方法の各ステップをコンピュータに実行させるためのプログラム。
  16.  請求項14に記載の画像処理方法の各ステップをコンピュータに実行させるためのプログラム。
  17.  請求項15に記載のプログラムを非一時的に記憶する、コンピュータ読取可能な記録媒体。
  18.  請求項16に記載のプログラムを非一時的に記憶する、コンピュータ読取可能な記録媒体。
PCT/JP2014/056998 2014-03-14 2014-03-14 画像処理装置、画像センサ、画像処理方法 WO2015136709A1 (ja)

Priority Applications (5)

Application Number Priority Date Filing Date Title
US15/121,800 US10311564B2 (en) 2014-03-14 2014-03-14 Image processing device, image sensor, and image processing method
CN201480076693.0A CN106062819B (zh) 2014-03-14 2014-03-14 图像处理装置、图像传感器、图像处理方法
PCT/JP2014/056998 WO2015136709A1 (ja) 2014-03-14 2014-03-14 画像処理装置、画像センサ、画像処理方法
EP14885523.2A EP3118812A4 (en) 2014-03-14 2014-03-14 Image processing device, image sensor, and image processing method
JP2016507245A JP6278108B2 (ja) 2014-03-14 2014-03-14 画像処理装置、画像センサ、画像処理方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2014/056998 WO2015136709A1 (ja) 2014-03-14 2014-03-14 画像処理装置、画像センサ、画像処理方法

Publications (1)

Publication Number Publication Date
WO2015136709A1 true WO2015136709A1 (ja) 2015-09-17

Family

ID=54071186

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2014/056998 WO2015136709A1 (ja) 2014-03-14 2014-03-14 画像処理装置、画像センサ、画像処理方法

Country Status (5)

Country Link
US (1) US10311564B2 (ja)
EP (1) EP3118812A4 (ja)
JP (1) JP6278108B2 (ja)
CN (1) CN106062819B (ja)
WO (1) WO2015136709A1 (ja)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018151830A (ja) * 2017-03-13 2018-09-27 オムロン株式会社 画像処理装置、画像処理方法及びプログラム

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6554900B2 (ja) * 2015-04-28 2019-08-07 オムロン株式会社 テンプレート作成装置及びテンプレート作成方法
JP7004145B2 (ja) * 2017-11-15 2022-01-21 オムロン株式会社 欠陥検査装置、欠陥検査方法、及びそのプログラム
CN110544253B (zh) * 2019-09-12 2023-01-10 福州大学 基于图像金字塔和列模板的织物瑕疵检测方法
US11599742B2 (en) * 2020-04-22 2023-03-07 Dell Products L.P. Dynamic image recognition and training using data center resources and data
DE102020119243A1 (de) 2020-07-21 2022-01-27 Vision Components Gesellschaft Für Bildverarbeitungssysteme Mbh Verfahren und System bzw. Vorrichtung zum Erkennen eines Objektes in einem elektronischen Bild

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05303643A (ja) * 1992-03-18 1993-11-16 Sanyo Electric Co Ltd パターンマッチング方法
JP2010118030A (ja) * 2008-11-15 2010-05-27 Keyence Corp 検出候補の近傍排除処理機能を有する画像処理装置及び画像処理プログラム並びにコンピュータで読み取り可能な記録媒体

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4561380B2 (ja) 2005-01-24 2010-10-13 コニカミノルタホールディングス株式会社 検出装置、検出方法及び検出プログラム
JP4556813B2 (ja) * 2005-09-08 2010-10-06 カシオ計算機株式会社 画像処理装置、及びプログラム
US7636478B2 (en) * 2006-07-31 2009-12-22 Mitutoyo Corporation Fast multiple template matching using a shared correlation map
JP4569670B2 (ja) * 2008-06-11 2010-10-27 ソニー株式会社 画像処理装置、画像処理方法およびプログラム
JP5271031B2 (ja) * 2008-08-09 2013-08-21 株式会社キーエンス 画像のデータ圧縮方法、画像処理におけるパターンモデルの位置決め方法、画像処理装置、画像処理プログラム及びコンピュータで読み取り可能な記録媒体
CH703478A1 (de) * 2010-07-30 2012-01-31 Medela Holding Ag Absaugpumpensystem.
JP5615088B2 (ja) * 2010-08-18 2014-10-29 キヤノン株式会社 画像処理装置及びその方法、プログラム、並びに撮像装置
WO2012073490A1 (ja) * 2010-11-30 2012-06-07 パナソニック株式会社 オブジェクト検出装置、画像分割装置、集積回路
JP5477518B1 (ja) * 2012-06-26 2014-04-23 コニカミノルタ株式会社 画像処理装置、画像処理方法および画像処理プログラム
EP2911116A4 (en) * 2012-10-18 2016-09-07 Konica Minolta Inc PICTURE PROCESSING DEVICE, PICTURE PROCESSING METHOD AND PICTURE PROCESSING PROGRAM

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05303643A (ja) * 1992-03-18 1993-11-16 Sanyo Electric Co Ltd パターンマッチング方法
JP2010118030A (ja) * 2008-11-15 2010-05-27 Keyence Corp 検出候補の近傍排除処理機能を有する画像処理装置及び画像処理プログラム並びにコンピュータで読み取り可能な記録媒体

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3118812A4 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018151830A (ja) * 2017-03-13 2018-09-27 オムロン株式会社 画像処理装置、画像処理方法及びプログラム

Also Published As

Publication number Publication date
EP3118812A1 (en) 2017-01-18
US20170024869A1 (en) 2017-01-26
CN106062819B (zh) 2019-05-10
JPWO2015136709A1 (ja) 2017-04-06
US10311564B2 (en) 2019-06-04
EP3118812A4 (en) 2017-11-22
CN106062819A (zh) 2016-10-26
JP6278108B2 (ja) 2018-02-14

Similar Documents

Publication Publication Date Title
JP6176388B2 (ja) 画像識別装置、画像センサ、画像識別方法
JP6278108B2 (ja) 画像処理装置、画像センサ、画像処理方法
US9547800B2 (en) System and a method for the detection of multiple number-plates of moving cars in a series of 2-D images
US9418313B2 (en) Method for searching for a similar image in an image database based on a reference image
US10366307B2 (en) Coarse-to-fine search method, image processing device and recording medium
US20060029276A1 (en) Object image detecting apparatus, face image detecting program and face image detecting method
US10713530B2 (en) Image processing apparatus, image processing method, and image processing program
Tippetts et al. Dense disparity real-time stereo vision algorithm for resource-limited systems
JP2006252162A (ja) パターン認識装置及びその方法
JP6997369B2 (ja) プログラム、測距方法、及び測距装置
CN109961082B (zh) 物体识别处理装置、物体识别处理方法以及存储介质
JP6095817B1 (ja) 物体検出装置
Zhu et al. Deep residual text detection network for scene text
CN114863464B (zh) 一种pid图纸图件信息的二阶识别方法
JP4721829B2 (ja) 画像検索方法及び装置
CN110704667B (zh) 一种基于语义信息的快速相似图检测方法
KR101733288B1 (ko) 방향정보를 이용한 객체 검출기 생성 방법, 이를 이용한 객체 검출 장치 및 방법
JP6393495B2 (ja) 画像処理装置および物体認識方法
EP2993623B1 (en) Apparatus and method for multi-object detection in a digital image
Al-Jaberi et al. Topological Data Analysis for Image Forgery Detection
Farfan-Escobedo et al. Towards accurate building recognition using convolutional neural networks
JP4449483B2 (ja) 画像解析装置、および画像解析方法、並びにコンピュータ・プログラム
WO2015136716A1 (ja) 画像処理装置、画像センサ、画像処理方法
Selvi et al. FPGA implementation of a face recognition system
JP2015187770A (ja) 画像認識装置、画像認識方法及びプログラム

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14885523

Country of ref document: EP

Kind code of ref document: A1

REEP Request for entry into the european phase

Ref document number: 2014885523

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 2014885523

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 2016507245

Country of ref document: JP

Kind code of ref document: A

WWE Wipo information: entry into national phase

Ref document number: 15121800

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE