JP2009043184A - Image processing method and image processor - Google Patents

Image processing method and image processor Download PDF

Info

Publication number
JP2009043184A
JP2009043184A JP2007210237A JP2007210237A JP2009043184A JP 2009043184 A JP2009043184 A JP 2009043184A JP 2007210237 A JP2007210237 A JP 2007210237A JP 2007210237 A JP2007210237 A JP 2007210237A JP 2009043184 A JP2009043184 A JP 2009043184A
Authority
JP
Japan
Prior art keywords
model
edge
image
reference
error
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.)
Pending
Application number
JP2007210237A
Other languages
Japanese (ja)
Inventor
Shiro Fujieda
紫朗 藤枝
Original Assignee
Omron Corp
オムロン株式会社
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 Omron Corp, オムロン株式会社 filed Critical Omron Corp
Priority to JP2007210237A priority Critical patent/JP2009043184A/en
Publication of JP2009043184A publication Critical patent/JP2009043184A/en
Application status is Pending legal-status Critical

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To prevent a contour pattern other than a recognition target including contour patterns similar to the pattern of the recognition target from being erroneously recognized. <P>SOLUTION: An image of a model of a recognition target object is displayed, and a designation area 21 is set so as to include contour patterns similar to the recognition target pattern and patterns other than the recognition target within this display window. A gray level image in the area 21 is registered as an error model image in accordance with this setting, edge pixels which do not correspond to a reference edge model registered in advance are specified among edge pixels in the error model image, and an error edge model representing the positions and density inclination direction of the edge pixels is registered. During pattern recognition, nonconincidence to both the reference edge model and the error edge model is calculated, and the value of the former nonconincidence is adjusted to be larger as the latter nonconincidence gets smaller. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

  The present invention relates to image processing for determining whether or not a specific contour pattern is included in a grayscale image. In particular, the present invention relates to an image processing method and an image processing apparatus that perform the above-described determination by collating a combination of a position of an edge pixel in an image and a density gradient direction with previously registered model data.

  The applicant has recently created model data representing the position and density gradient direction of each edge pixel for a reference model image generated by imaging a model of the recognition target pattern with a specific contour pattern as a recognition target. And a method for discriminating the presence / absence and position of the recognition target pattern with the maximum similarity to the model data (see Patent Document 1).

  In the method specifically described in Patent Document 1, for each pixel constituting the reference model image, angle data (edge code) indicating the density gradient direction and the magnitude (edge strength) of the density gradient direction are calculated, These calculated values are registered in association with the coordinates. Then, the degree of inconsistency between the edge code in the mask and the registered edge code is calculated in units of pixels for each scanning position while scanning the image to be processed in the matching area (mask) having a size corresponding to the reference model image. The sum of the calculated values is used as the degree of inconsistency with respect to the entire model data. Further, the position of the mask when the degree of mismatch with respect to the entire model data becomes the minimum value is specified as the region most similar to the recognition target pattern.

  Note that in the invention described in Patent Document 1, when calculating the mismatch degree of the edge code in pixel units, the calculation result corresponding to the pixel whose edge strength on the reference model image side is smaller than a predetermined threshold is zero. (See paragraphs 0050 and 0053). As a result, only the pixels corresponding to the recognition target pattern can be compared, and the presence of the recognition target pattern can be determined without being affected by the background pattern, noise, or other edges that are not the recognition target. can do.

JP 2002-230549 A

  As described above, in the matching process using the edge code, if there is an edge corresponding to the recognition target pattern in the processing target image, the edge corresponding to the recognition target pattern is present even if there is an edge that is not the detection target. Can be detected with high accuracy. However, when processing an image that includes a contour pattern similar to the recognition target pattern but also includes a contour pattern that is different from the recognition target pattern, there is a possibility that a portion similar to the recognition target pattern may be erroneously detected. is there.

  FIG. 11 shows images of alphabet letters “P” and “R” as examples of images that are susceptible to this type of misperception. In the figure, the upper row is a gray image obtained by imaging a printed matter of each character, and the lower row is an edge image obtained by performing edge extraction processing on these gray images. Further, the portion indicated by the alternate long and short dash line in the “R” edge image is an edge that is not included in the “P” image (hereinafter referred to as “non-corresponding edge” in this example).

  Here, when the “P” image is used as a reference model image and the above-described edge code mismatch degree is obtained for the “R” image, the edges other than the non-corresponding edges correspond to the “P” pattern. The degree of mismatch is very low. As a result, the “R” pattern may be erroneously recognized as the “P” pattern.

  The present invention has been made paying attention to the above-mentioned problems, and performs image processing that includes a contour pattern similar to the pattern to be recognized but does not cause a false recognition of a contour pattern outside the recognition target. The task is to improve accuracy.

  The image processing method according to the present invention provides a reference edge model that represents a position of an edge pixel and a density gradient direction with respect to a reference model image generated by capturing a model of the recognition target pattern using a specific contour pattern as a recognition target. Is registered, and it is determined whether or not the recognition target pattern is included in the grayscale image to be checked based on the similarity of the grayscale image to be checked with the reference edge model.

  This method is characterized in that at least one grayscale image including an edge not included in the reference image is prepared, and for each prepared image, an edge included in the image but not included in the reference model image The recognition target pattern based on both the similarity to the reference edge model and the similarity to the error edge model for the point where the data representing the pixel position and the density gradient direction are registered as an error edge model and the grayscale image to be collated The point is to determine whether or not.

  In the above method, for example, an image of an object composed of a contour pattern similar to the recognition target pattern and a contour pattern other than the recognition target pattern is included in the edge pixels that are included in this image but are not included in the reference model image. The position and density gradient direction are obtained, and data representing these are registered as an error edge model. According to this registration, when an image including the same contour pattern used for registration of the error edge model is collated with two types of models, both the similarity to the reference edge model and the similarity to the error edge model are obtained. High value.

  On the other hand, when a correct recognition target pattern is a collation target, the similarity to the reference edge model is high, but the similarity to the error edge model is not so high.

  Thus, the degree of similarity to the error edge model differs between the case where the correct recognition target pattern is to be collated and the case where a non-recognition contour pattern including a contour pattern similar to this pattern is to be collated. Become. Therefore, when the similarity to the reference edge model shows a high value, it is accurately determined whether or not the recognition target pattern is included in the image to be collated based on the similarity value to the error edge model Is possible.

  Note that the similarity may be calculated as a mismatch. Further, the grayscale image prepared for creating the error edge model is not limited to including the recognition target pattern and the non-recognition pattern, and may include only the non-recognition pattern. Alternatively, a part of the recognition target pattern and a pattern other than the recognition target pattern may be included.

  In a preferred aspect of the above method, the similarity to the reference edge model is adjusted so that the similarity to the error edge model increases and becomes lower than that before the change, and the adjusted similarity is used for the matching target. It is determined whether a recognition target pattern is included in the image. In this way, when an image including a contour pattern similar to that included in the image used to create the error edge model is to be collated, a value having a high similarity to the reference edge model is set. Even if it shows, it can adjust so that the similarity with respect to a reference | standard edge model may become low significantly with the similarity with an error edge model, and it can prevent that a misrecognition arises.

  In the method according to another preferred aspect, in the process of registering the error edge model, an area having the highest similarity to the reference edge model is extracted from the prepared grayscale image, and does not correspond to the reference edge model in this area. An edge pixel is specified, and data representing its position and density gradient direction is registered as an error edge model.

  According to the above processing, the edge pixel that does not correspond to the reference edge model is identified using the image of the region with the highest area relative to the reference edge model among the images prepared for registration of the error edge model. Edge pixels that are not included in the reference model image can be identified with high accuracy, and the accuracy of the error edge model can be increased. In addition, since the error edge model and the reference edge model can be made the same size, the matching target areas of both models can be completely matched, and the discrimination accuracy can be improved.

  An image processing apparatus to which the above method is applied creates a first model for creating a reference edge model indicating a position of an edge pixel and a density gradient direction for a reference model image generated using a model of a pattern to be recognized. Means: accepts at least one grayscale image including edges not included in the reference model image, and determines the position and density gradient direction of edge pixels included in the received image but not included in the reference model image for each received image; Second model creating means for creating an error edge model to be represented; model storage means for storing a reference edge model and an error edge model; accepting an input of a grayscale image to be collated; And similarity calculation means for individually calculating the similarity to the error edge model; similarity calculation means Comprising the means of the; based on each degree of similarity more calculating, determining means for determining whether or not contain recognition target pattern grayscale image to be collated. The above-described image processing method can be executed by these means, and it is possible to prevent a pattern that is similar to a recognition target pattern but is not a recognition target from being misidentified.

  In the image processing apparatus according to a preferred aspect, the discrimination unit scans a matching area having a size corresponding to the reference edge model on a grayscale image having a size larger than each edge model, and sets a matching area setting position. Each time the change is made, the similarity calculation means calculates two types of similarity, and the similarity to the reference edge model changes so that the similarity to the error edge model increases and becomes lower than before the change. Then, it is determined whether or not the recognition target pattern is included in the image in the collation region using the adjusted similarity.

  According to the above aspect, when an image having a size larger than each model is set as a collation target, it is possible to accurately determine a region most suitable for the recognition target pattern. If the image in the matching area becomes the same as the image used for registering the error edge model, the similarity can be adjusted to a low value, and this matching area is misidentified as the position of the recognition target pattern. Can be prevented.

  The image processing apparatus according to a more preferable aspect further includes a display unit for image display and an operation unit for setting operation. The second model creating means displays a predetermined grayscale image on the display unit, and in response to the region designating operation performed on the display image by the operation unit, the image in the designated region is converted to the error edge model. The image with the highest similarity to the reference edge model is identified from the received image, and the data representing the position and density gradient direction of edge pixels that do not correspond to the reference edge model within the identified region is identified. Create as an edge model.

According to the above aspect, the user selects an image including a pattern to be prevented from being misidentified, and designates an area including an object in the image displayed on the display unit, so that the image in the area is an error edge model. Is accepted as an image for creation. Further, a region having the highest similarity to the reference edge model is automatically extracted from the image, and an error edge model is created based on edge pixels not corresponding to the reference edge model in the region.
In this way, it is possible to automatically register an appropriate error edge model simply by selecting a registration target image and specifying an area including a contour pattern to be prevented from being misidentified. The operation of is very easy and the convenience is enhanced.

  In a further preferred aspect, the second model creating means displays the edge pixels corresponding to the reference edge model and the edge pixels not corresponding to the reference edge model in different display forms for the region having the highest similarity to the reference edge model. Means for displaying on the display unit are included. According to this aspect, the user can easily confirm which part of the pattern in the designated area corresponds to the reference edge model and which part is adopted in the error edge model.

  In a further preferred aspect, the second model creation means receives an operation of designating a part of the edge pixels displayed on the display unit as edge pixels not corresponding to the reference edge model, and deletes the information of the designated edge pixels. Or create a disabled error edge model.

For example, if an image for creating an error edge model contains edges other than the pattern to be mistaken, such as noise and background pattern edges, the information on these edges will also be included in the error edge model. In such an error edge model, the accuracy of extracting a pattern to be mistaken is lowered.
In the above aspect, the accuracy of the error edge model can be improved by the operation of designating a portion that does not need to be registered as the error edge model from those displayed as edge pixels not corresponding to the reference edge model. Pattern extraction accuracy can be ensured.

  According to the above-described image processing method and image processing apparatus, it is possible to prevent a non-recognition contour pattern having a contour shape similar to the recognition target pattern from being misidentified as a recognition target. On the other hand, if the image includes a correct recognition target pattern, the presence of the recognition target pattern can be recognized even if a pattern other than the recognition target due to noise or the like is included. Therefore, the accuracy of pattern recognition can be greatly increased.

FIG. 1 shows a configuration example of an image processing apparatus to which the present invention is applied.
The image processing apparatus 1 inputs and processes the grayscale image generated by the camera 2 to determine whether or not a specific contour pattern is included in the field of view of the camera 2, The position is measured. For example, it is used for the purpose of recognizing the position and posture of a workpiece on a production line in a factory or determining the suitability of a contour pattern such as characters on an inspection line.

  The image processing apparatus 1 according to this embodiment includes a control unit 10, an image input unit 11, an image memory 12, an operation unit 13, a display unit 14, an output unit 15, and the like. The image input unit 11 includes an interface circuit for capturing a grayscale image signal from the camera 2 and an A / D conversion circuit for digitally converting the grayscale image signal. The image memory 12 stores grayscale image data to be processed (hereinafter referred to as “processing target image”) digitally converted by the image input unit 11 and an edge image generated by edge extraction processing on the processing target image. Is done.

  The control unit 10 is mainly composed of a CPU 101, and includes a ROM 102, a RAM 103, and a flash disk 104 (a disk device using a flash memory) as storage devices. The ROM 102 stores a program related to the basic operation of the CPU 101, and the flash disk 104 stores an OS (operation system), an image processing program, and a program for configuring a GUI (graphical user interface). Is done. Further, the flash disk 104 is used as a memory for registering various setting data (including model images and edge models) used for recognition processing.

  The CPU 101 executes a series of image processing (pattern recognition processing) for recognizing the contour pattern based on the program and various data in the flash disk 104, and the degree of similarity of the processing target image with respect to the recognition target pattern and the similarity thereof. The position (matching position) of the pattern to be calculated is calculated. These calculation results are displayed on the display unit 14 and also output to an external device (not shown) via the output unit 15.

  In the image processing apparatus 1 configured as described above, in addition to registering a model image for a pattern to be recognized in advance, a model that may be misidentified as a pattern to be recognized (hereinafter referred to as “misidentification candidate pattern”) is also used. The image can be registered. These model images are set by displaying a grayscale image to be registered on the display unit 14, accepting a user's region designation operation, and cutting out an image in the designated region. Hereinafter, the model image of the pattern to be recognized is referred to as a “reference model image”, and the model image of the misidentification candidate pattern is referred to as an “error model image”.

  For each model image, the CPU 101 calculates an angle (edge code) indicating the direction of the density gradient and the magnitude (edge strength) of the density gradient for each constituent pixel of the image, and model data reflecting the processing result. Create The created model data is registered in the flash disk 104 together with the model image.

  Model data created from the reference model image (hereinafter referred to as “reference edge model”) represents information relating to an edge (hereinafter referred to as “reference edge”) representing a contour pattern appearing in the reference model image.

  On the other hand, model data created from an error model image (hereinafter referred to as “error edge model”) represents information relating to an edge (hereinafter referred to as “error edge”) representing a contour pattern that does not appear in the reference model image. Configured as follows.

  FIG. 2 shows an example of a setting screen presented to the user when registering the reference model image and the reference edge model. This screen has a configuration in which a plurality of setting buttons 22 to 27 are arranged around the image display window 20, and the upper screen 1 is an initial screen. The lower screen 2 is used for confirming a registered model or correcting the model. Of the setting buttons 22 to 27 displayed on the screen 1, only operable ones are displayed. .

  In the window 20 of the screen 1, a grayscale image of the model of the recognition object (in this example, the printed circuit board 40) is displayed. The user sets an area 21 to be registered as a reference model image on the image, and adjusts the position and size of the area 21 with a mouse or the like. The “OK” button 22 in the figure is for confirming the setting of the area 21, and the “Cancel” button 23 is for canceling the setting of the area 21.

  When the designation of the area 21 is confirmed and the “model registration” button 24 at the upper right is operated, the image in the area 21 is cut out and registered as a reference model image. Also, an edge code and edge strength calculation process is performed, and a reference edge model is created and registered based on the calculation result. As described above, the user can complete registration of the reference model image and the reference edge model only by performing an operation of designating the registration target region.

  The screen 2 is called by operating the “model display” button 27 after the above registration. In the window 20 in the screen 2, the edge 30 included in the region 21 specified by the user is displayed in green (represented by a thick solid line in the drawing) as a reference edge. Although the edge outside the area 21 is not displayed, the edge image is displayed at the same position as the corresponding portion of the original image, so that the user can easily collate with the original image. In addition, when there is an incompleteness such as an edge not intended by the user included in the edge displayed as the reference edge or a part of the pattern to be recognized is missing, the “cancel” button 23 The registration can be deleted by the operation, or the registration of the irrelevant edge can be invalidated by the operation of the “mask registration” button 25 (the details of this process will be described later with reference to FIG. 6).

  Further, although not shown here, when the “edge extraction” button 26 on the screen 1 is operated, the edge extraction processing is performed on the entire image, and the display in the window 20 is also displayed on the screen representing the edge extraction result. Can be switched.

  FIG. 3 shows an example of a setting screen for registering an error model image and an error edge model. The basic configuration of this setting screen is the same as that in the example of FIG. 2, and the operation method for registration is also the same. However, in the edge image displayed when the screen is switched to the screen 2 by the operation of the “model display” button 27, the edge 31 having the same shape as the reference edge 30 is displayed in green, whereas it appears in the reference model image. The non-existing edge 32 is displayed in red as an error edge (expressed by a very thick dashed line in the figure). Therefore, the user can easily confirm whether or not an appropriate error edge model has been registered by confirming whether or not the red display reflects a contour pattern that should not be recognized.

The printed circuit board 40 to be recognized shown in FIGS. 2 and 3 has a frame portion 41 formed along the edge, and the color of the frame portion 41 is darker than the inside 42. A rectangular mark 43 having the same color as that of the frame portion 41 is formed in the vicinity of the corner portion of the inside 42.
In this embodiment, when the reference model image is registered, the region 21 is set so as to include the corners of the edge of the substrate, and as a result, the inverted L-shaped contour pattern 30 is extracted as the reference edge. On the other hand, at the time of registration of the error model image, the area 21 (in this example, the same size as the area 21 on the reference model image side) includes the corners of the boundary portion between the frame 41 and the interior 42 and the rectangular mark 43. As a result, the edge 32 representing the contour pattern of the rectangular mark 43 is extracted as an error edge.

  4 and 5 show examples of model registration in the case where characters printed on the package 44 are to be recognized. The setting screen shown in each figure is the same as the example shown in FIGS. 2 and 3, but an image including a character pattern to be registered is displayed in the window 20. This image includes part of the background pattern 47 in addition to the character patterns 45 and 46 of “P” and “R”.

  In this embodiment, for the purpose of recognizing the “P” pattern 45, an image including the pattern 45 is registered as a reference model image, and an image including the “R” pattern 46 that is easily misidentified as “P”. Are registered as error model images.

  At the time of registration of the reference model image, as shown in FIG. 4A, the region to be registered is designated by setting the region 21 so that the entire “P” pattern 45 is included. By this area designation, the image in the area 21 is registered as a reference model image, as in the example of FIG. Further, a reference edge model is created and registered using the edge 33 included in the reference model image as a reference edge.

  At the time of registration of the error model image, as shown in FIG. 5A, the area 21 is set so that the entire pattern 46 is included. However, since the pattern 46 in this embodiment is slightly larger than the pattern 45, the area 21 is set. Is larger than that at the time of registration of the reference model image. In addition to the “R” pattern 46, the region 21 includes a part of a background pattern 47 that is not related to characters.

  As described above, in the model display screen in the case where an area having a size larger than the reference model image is specified in the registration of the error model image, the area 21 is most similar to the reference edge as shown in FIG. A frame indicating an area (hereinafter referred to as “corresponding area”) 29 is displayed. Further, the color-coded display of the edge 34 corresponding to the reference edge and the edge not corresponding to the reference edge is performed only in the corresponding area 29, and the edge 37 outside the corresponding area 29 is white (represented by a very thick dotted line in the figure). Is displayed.

  In the above example, of the edges 35 and 36 displayed in red as error edges in the corresponding area 29, 36 is an edge of the background pattern 37 and is not of an nature that should be an error edge. In this way, when an edge irrelevant to the misidentification candidate pattern is displayed in red, the user can invalidate the information related to the irrelevant edge by using the “mask registration” button 25.

  FIG. 6 is an enlarged view of the image in the area 21 of the second screen in FIG. 5 in order to clarify the processing contents by the operation of the “mask registration” button 25. In this process, as shown in FIG. 6A, a mask region 50 that includes an edge 36 that is irrelevant to the misidentification candidate pattern among the edges 35 and 36 displayed in red is set, and “mask registration” is performed. The button 25 is operated. When this operation is performed, as shown in FIG. 6B, the color of the edge 36 commonly included in the corresponding region 29 and the mask region 50 changes from red to white. This change in display color is linked to the change in the data structure of the error edge model so that the edge pixels in the mask area 50 are not recognized as error edges. By such processing, only an edge representing a misidentification candidate pattern can be set as an error edge.

  The edge model data changing process by operating the “mask registration” button 25 can be performed not only on the error edge model but also on the reference edge model.

  In this embodiment, with respect to the processing target image, the degree of inconsistency with respect to each edge model registered by the above setting is obtained, and the degree of similarity of the processing target image with respect to the recognition target pattern is obtained based on the degree of inconsistency of both. . Hereinafter, the data structure of the edge model and the method of calculating the degree of inconsistency will be described in order.

  First, FIG. 7 shows the concept of the edge code obtained in this embodiment. In the figure, S is an enlarged view of an edge in the image, a point E is one edge pixel constituting the edge S, and F is a vector indicating a density gradient direction in the edge pixel E.

The vector F is obtained by synthesizing a vector representing the magnitude of the density gradient for each of the x and y axis directions.
In this embodiment, a vector B directed from the pixel E toward the positive direction of the x-axis is set as a reference direction, and a vector C orthogonal to the vector F is obtained (the vector C is obtained by rotating the vector F by 90 degrees in the clockwise direction). ), An angle Ec (x, y) when the vector C is viewed from the vector B in the counterclockwise direction is defined as an edge code. However, the edge code is not limited to the above, and for example, an angle indicating the direction of the vector F with reference to the vector B may be used as the edge code.

  In this embodiment, the edge code is obtained for each constituent pixel of the reference model image and the error model image, and the density gradient magnitude (edge strength) at each pixel is obtained. The edge strength corresponds to the length of the vector F and can be obtained using density gradients in the x and y directions.

  Each edge model is obtained by associating the coordinates of the constituent pixels of the corresponding model image with the edge code and the edge strength of the corresponding pixel. The coordinates of a pixel whose edge strength is equal to or greater than a predetermined threshold value represent the position of the edge pixel, and the edge gradient associated with the coordinates of the edge pixel represents the density gradient direction of the edge pixel.

  Further, each edge model includes a flag v set for each pixel in order to determine the display color of the edge on the screen 2. Since this flag v takes any value of 0, 1, and 2, v = 0 for a pixel whose display color is green, v = 1 for a pixel whose display color is red, and the display color is white V = 2 for the pixel to be processed. However, only pixels whose edge intensity exceeds a predetermined threshold (hereinafter referred to as “u”) are displayed based on the value of v.

In this embodiment, for each set of corresponding pixels between the edge code of the reference edge model and the image to be collated, the degree of mismatch of the edge code is obtained by the following equation (a), and the degree of mismatch of each set is accumulated. This is used as the degree of inconsistency with respect to the reference edge model. The mismatch degree indicates that the smaller the value is, the higher the degree of similarity is, and corresponds to one aspect of the similarity degree.
h (x, y) = | sin {Ic (i + x, j + y) −Mc (x, y)} |
... (a)

  In the above formula (a), (x, y) is the coordinates of an arbitrary pixel in the reference edge model, and Mc (x, y) is the edge code on the reference edge model side at this coordinate, h (x, y) y) indicates the degree of inconsistency with respect to this edge code. (I, j) is the coordinates of a point associated with the origin (upper left vertex) of the reference edge model in the image to be collated, and Ic (i + x, j + y) is a pixel corresponding to the coordinate (x, y). Is an edge code.

  According to the equation (a), h (x, y) has a maximum value of 1 when the difference between the edge code IC (i + x, j + y) and Mc (x, y) is 90 degrees or 270 degrees, The minimum value is 0 when the edge code difference is 0 degree or 180 degrees. As the edge code difference approaches 0 degree or 180 degrees, the value of h (x, y) also approaches 0.

  In this embodiment, in the region associated with the reference edge model (hereinafter referred to as “collation region”), the edge strength of the corresponding pixel on the reference edge model side exceeds the threshold value u, and the flag v is set to 0. The above equation (a) is executed for the pixels that have been processed, and the sum ur (i, j) of each calculated value is obtained. Therefore, the total sum ur (i, j) of the mismatch degrees represents the mismatch degree of the edge code distribution between the reference edge and the corresponding portion.

  Further, according to the equation (a), in addition to the case where the light / dark relationship in the image to be collated matches the reference model image, even when the light / dark relationship is reversed from the reference model image, the mismatch degree h (x , Y) becomes the minimum value of 0. Therefore, if the image has an outline pattern having the same shape as that indicated by the reference edge, even if the light / dark relationship with the reference model image is reversed, the value of the mismatch degree ur (i, j) is obtained. The edge corresponding to the reference edge can be detected.

For the error edge model, similarly to the above, the degree of inconsistency in units of pixels is obtained by the equation (a), and the degree of inconsistency ur E (i, j) is obtained by accumulating each degree of inconsistency. In this case, the expression (a) is executed for a pixel in which the edge strength exceeds the threshold u and the flag v is set to 1 in the error edge model, so ur E (i, j) Indicates the degree of inconsistency of the edge code distribution between the error edge and the corresponding portion.

  As described in the example of FIG. 5, the error edge model is created using an image of an area most similar to the corresponding area 29 corresponding to the reference edge model among the error model images. The region to be processed is also specified by the process of calculating the degree of coincidence ur (i, j). Since the error edge model created based on this specification has the same size as the reference edge model, the same region can be collated by each edge model.

Therefore, in this embodiment, the degree of inconsistency ur (with respect to the reference edge model of the image in the collation area is scanned at the hourly scanning position (i, j) while scanning the collation area corresponding to the size of each edge model on the processing target image. i, j) and the degree of inconsistency ur E (i, j) for the error edge model are calculated. Further, the mismatch degree ur (i, j) with respect to the reference edge model is adjusted by the mismatch degree ur E (i, j) with respect to the error edge model, and the recognition target is determined using the adjusted mismatch degree ur * (i, j). The presence / absence and position of the pattern is determined.

The mismatch degree ur (i, j) is adjusted by the following equation (b).
ur * (i, j) = ur (i, j) + (VL−ur E (i, j)) (b)

In the equation (b), (VL-ur E (i, j)) is an adjustment value for the mismatch degree ur (i, j). Of these, VL is a fixed value. For example, the mismatch degree ur E (i, j) when the mismatch degree h (x, y) for 50% of the pixels in the error edge model has a maximum value of 1, respectively. It is set based on. As the similarity to the error edge model of the image in the collation area increases, the value of ur E (i, j) decreases, but the value of the above (VL-ur E (i, j)) increases. Change.

In particular, when the false candidate pattern becomes the comparison target is the similarity ur (i, j), ur E (i, j) both become the minimum value. At this time, since (VL-ur E (i, j)) becomes the maximum value, a large value is set as the mismatch degree ur * (i. J) after adjustment. Therefore, it is possible to prevent the misidentification candidate pattern from being determined as a recognition target pattern.

On the other hand, when the pattern to be recognized is a collation target, the disagreement ur (i, j) with respect to the reference edge model becomes the minimum value, while the similarity ur E (i, j) with respect to the error edge model is Great value. Therefore, the value added to ur (i, j) can be reduced. In addition, when the pattern to be recognized is a collation target, the degree of mismatch ur (i, j) before adjustment is a value that approximates 0, and therefore a certain value as (VL-ur E (i, j)). Even if is added, the value of the mismatch degree ur * (i, j) can be made smaller than in the case of collating images that do not include patterns that are not recognition targets. Therefore, the degree of mismatch ur * (i, j) when the pattern to be recognized becomes the collation target can be minimized, and highly accurate pattern recognition processing can be performed.

FIG. 8 shows a flow of processing for registering a reference model image and a reference edge model, and FIG. 9 shows a flow of processing for registering an error model image and an error edge model.
In each figure and the following description, ST is an abbreviation for “step”.

  First, in the processing of FIG. 8, in ST11 and ST12, an area designating operation for the image displayed in the window 20 of the above setting screen is accepted, the image in the designated area 21 is cut out, and the reference model image is obtained. Register as Next, in ST13, an edge code and an edge strength are calculated for each constituent pixel of the reference model image. Further, in ST14, “0” is set as the initial value of the flag v in each constituent pixel.

  In ST15, the edge code, edge strength, and flag v of each pixel in the region 21 are registered in association with the coordinates of the pixel. A collection of these three types of data functions as a reference edge model.

Further, when the “mask registration” button 25 is operated (when ST16 is “YES”), the set mask area is set on the condition that the mask area is set in the designated area 21 in ST17. A process of changing the flag of the pixels included in the pixel 50 to “2” is executed.
Although not shown in FIG. 8, when the “model display” button 27 is operated, the screen 1 is switched to the screen 2 and the edge strength is set to a threshold value based on the registered reference edge model. Pixels exceeding u are displayed in a color corresponding to the value of the flag v. If the “mask registration” button 25 is operated after this display, processing for switching the color of the edge pixel whose flag v has been changed from green to white is executed after the processing of ST16 and ST17. .

  Next, in the process of FIG. 9, after receiving an area specifying operation in ST21, an image in the specified area 21 is registered as an error model image in ST22. Further, in ST23, an edge code and an edge strength are calculated for each pixel of the error model image.

  Next, in ST24, the error model image is scanned with the matching region corresponding to the reference edge model, and the inconsistency ur (i, j with respect to the reference edge model is calculated for each scanning position based on the above-described equations (a) and (b). ) Is calculated. Then, based on the calculation result at each scanning position, a region where the mismatch degree ur (i, j) is minimized, in other words, a region most similar to the reference edge model is extracted, and this is set as the corresponding region 29. In ST25, “0” is set as the initial value of the flag v for each pixel in the corresponding area 29.

  In ST26, among the pixels in which the edge strength is greater than or equal to the threshold value u in the corresponding region 29, the pixels whose edge strength of the corresponding pixel on the reference edge model side is less than or equal to the threshold value u are specified, Change to “1”. This process corresponds to a process of setting an edge that does not correspond to the reference edge in the corresponding area 29 as an error edge.

  In the next ST27, the edge code, edge strength, and flag v of each pixel in the corresponding area 29 are registered in association with the coordinates of the pixel. With this group of data, an error edge model representing the position and density gradient direction of the edge pixel not corresponding to the reference model image is registered.

  Further, in this process, if the “mask registration” button 25 is operated, the flag v of the pixel included in the mask area 50 in the corresponding area 29 is changed to “2” (ST28, 29). Although not shown, if there is a “model display” operation, the screen 2 is started up, and pixels having an edge intensity exceeding the threshold u are displayed in the window 20 in a color corresponding to the value of the flag v. Execute the process to be displayed.

FIG. 10 shows a flow of pattern recognition processing executed after each model registration processing is completed. In ST101, which is the first step of this process, a predetermined initial value (for example, 50%) greater than 0 is set as the minimum mismatch degree ur0. In ST102, an image to be processed is input, and in ST103, an edge code is calculated for each pixel in the image.

After this, the collation area is scanned for a preset search range of the processing target image. Specifically, in ST104, 105, after the set position (i, j) of the collation area is matched with the initial position (x1, y1) of the search range, this (i, j) becomes the end point (x2, x2) of the search range. The degree of inconsistency is calculated while updating one by one until y2). Here, after calculating the inconsistency ur (i, j) with respect to the reference edge model in ST106 and the inconsistency ur E (i, j) with respect to the error edge model in ST107, respectively, Based on the above, the adjusted inconsistency ur * (i, j) is calculated.

When the inconsistency ur * (i, j) is smaller than the minimum value ur 0 (when ST109 is “YES”), the process proceeds to ST110, and the minimum value ur 0 is determined by the value of ur * (i, j). Update. Also, i and j when ur * (i, j) is obtained are set to sx and sy, respectively.

By repeating the above process, finally, the ur 0, the smallest value of the adjusted mismatch degree ur * (i, j) is stored. Further, sx and sy represent positions when the minimum value of ur * (i, j) is obtained.

In STs 106 and 107, the value of ur (i, j) or ur E (i, j) is updated by accumulating each calculated value while calculating the degree of inconsistency in pixel units according to equation (a). . However, in ST106, when the cumulative total value of the inconsistency ur (i, j) with respect to the reference edge model exceeds a predetermined threshold value, the calculation including the following ST107 and 108 is terminated, and the collation area is set to the next. Move to the operating position. By such processing, it is possible to shorten the calculation time when a region that does not correspond to the reference edge at all is to be collated, and to speed up the processing.

In ST115, the value of the minimum value ur 0, is converted into similarity R to the reference model image. Thereafter, in ST116, the similarity R is output together with the final values of sx and sy, and then the process is terminated. Note that sx and sy are output as matching positions, that is, positions of patterns to be recognized.

  According to the above pattern recognition processing, even if the pattern includes almost the same contour pattern as the recognition target pattern, a pattern different from the recognition target is not erroneously recognized, and the recognition accuracy is greatly improved. it can.

  Furthermore, the number of registered error edge models is not limited to one, and a plurality of models may be set and the mismatch degree ur (i, j) with respect to the reference edge model may be adjusted based on the mismatch degree calculated for each error edge model. Good. The adjustment process in this case can also be performed by the same calculation as the equation (b).

For example, when two error edge models are registered, if the inconsistencies for these models are ur E1 (i, j) and ur E2 (i, j), respectively, ur (i, j ) Can be adjusted.
ur * (i, j)
= Ur (i, j) + {VL- (ur E1 (i, j) + ur E1 (i, j))}
... (c)

By the way, in the above formulas (b) and (c), an adjustment value that increases as the degree of similarity with the error edge model increases, and this adjustment value is added to the degree of inconsistency with respect to the reference edge model. Although the degree of inconsistency ur * (i, j) has been obtained, the method for determining the pattern to be recognized is not limited to such calculation.

For example, each time the collation region is scanned, the degree of inconsistency ur (i, j) with respect to the reference edge model is calculated, and only when this ur (i, j) becomes smaller than a predetermined threshold T, an error edge is calculated. The inconsistency ur E (i, j) for the model is calculated. Here, when the mismatch degree ur E (i, j) is also lower than the threshold value T, the value of the mismatch degree ur (i, j) is changed to a high value (for example, 90%). Then, the similarity to the pattern to be recognized is calculated with the minimum value of ur (i, j) at the time when scanning of the search range is completed.
According to the above processing, the value of ur (i, j) in a region having a high degree of similarity to the error edge model is not minimized, so that a misidentification candidate pattern is prevented from being misidentified as a recognition target pattern. can do.

It is a block diagram which shows the structural example of an image processing apparatus. It is explanatory drawing which shows the screen display at the time of registration of a reference | standard model image and a reference | standard edge model. It is explanatory drawing which shows the screen display at the time of registration of an error model image and an error edge model. It is explanatory drawing which shows the screen display at the time of registration of a reference | standard model image and a reference | standard edge model. It is explanatory drawing which shows the screen display at the time of registration of an error model image and an error edge model. FIG. 6 is an explanatory diagram illustrating an example of display change processing for a “mask registration” operation by enlarging the image display in the second screen of FIG. 5. It is explanatory drawing which shows the concept of an edge code. It is a flowchart which shows the flow of a registration process of a reference | standard model image and a reference | standard edge model. It is a flowchart which shows the flow of a registration process of an error model image and an error edge model. It is a flowchart which shows the flow of a pattern recognition process. It is explanatory drawing which shows the example which a pattern misidentification produces.

Explanation of symbols

DESCRIPTION OF SYMBOLS 1 Image processing apparatus 10 Control part 12 Image memory 13 Operation part 14 Display part 101 CPU
104 Flash disk 20 (for image display) Window 21 Specified area 30, 33 Reference edge 32, 36 Error edge

Claims (8)

  1. For a reference model image generated by imaging a model of the recognition target pattern with a specific contour pattern as a recognition target, a reference edge model representing the position of the edge pixel and the density gradient direction is registered, In the image processing method for determining whether or not the recognition target pattern is included in the grayscale image to be collated based on the similarity of the grayscale image to the reference edge model,
    At least one grayscale image including an edge not included in the reference image is prepared, and for each prepared image, the position and density gradient direction of edge pixels included in the image but not included in the reference model image are determined. Register the data to represent as an error edge model,
    For the grayscale image to be collated, the presence or absence of the recognition target pattern is determined based on both the similarity to the reference edge model and the similarity to the error edge model.
    An image processing method.
  2. The image processing method according to claim 1,
    In the discrimination process, the similarity with respect to the reference edge model is adjusted so that the similarity with the error edge model becomes higher and lower than before the change, and the image to be collated is used by using the adjusted similarity. An image processing method for determining whether or not a recognition target pattern is included.
  3. The image processing method according to claim 1,
    In the process of registering the error edge model, an area having the highest similarity to the reference edge model is extracted from the prepared grayscale image, and an edge pixel that does not correspond to the reference edge model is specified in the extracted area. An image processing method for registering data representing the position and density gradient direction as the error edge model.
  4. A first model creating means for creating a reference edge model indicating a position of an edge pixel and a density gradient direction with respect to a reference model image generated using a model of a pattern to be recognized;
    At least one grayscale image including an edge not included in the reference model image is received, and for each received image, the position and density gradient direction of edge pixels included in the image but not included in the reference model image are represented. A second model creation means for creating an error edge model;
    Model storage means for storing the reference edge model and the error edge model;
    A similarity calculation unit that receives input of a grayscale image to be collated and individually calculates the similarity to the reference edge model and the error edge model for the grayscale image;
    A discriminating unit that discriminates whether or not the recognition target pattern is included in the grayscale image to be collated based on each similarity calculated by the similarity calculating unit;
    An image processing apparatus comprising the means described above.
  5.   The discrimination means scans a matching area having a size corresponding to the reference edge model on a grayscale image having a size larger than each edge model, and changes the setting position of the matching area each time the matching area is changed. The degree calculation means calculates the two kinds of similarities, and the degree of similarity with respect to the reference edge model is changed so that the degree of similarity with respect to the error edge model increases and becomes lower than before the change. The image processing apparatus according to claim 4, wherein the image processing apparatus determines whether or not a recognition target pattern is included in an image in the collation area using a degree.
  6. The image processing apparatus according to claim 4,
    A display unit for image display and an operation unit for setting operation;
    The second model creating means displays a predetermined grayscale image on the display unit, and when the operation unit performs a region designation operation on the display image, the image in the designated region is error-corrected. Accept as an image for creating an edge model, identify the region with the highest similarity to the reference edge model from the received image, and determine the position and density gradient direction of edge pixels that do not correspond to the reference edge model in the specified region An image processing apparatus that creates data to be expressed as the error edge model.
  7. The image processing apparatus according to claim 6, wherein
    In the second model creation means, for the region having the highest degree of similarity to the reference edge model, the edge pixels corresponding to the reference edge model and the edge pixels not corresponding to the reference edge model are displayed in different display modes. An image processing apparatus including means for displaying.
  8. The image processing device according to claim 7,
    The second model creation means receives an operation of designating a part of the edge pixel displayed on the display unit as an edge pixel that does not correspond to the reference edge model, and information on the designated edge pixel is deleted or An image processing apparatus that creates an invalid error edge model.
JP2007210237A 2007-08-10 2007-08-10 Image processing method and image processor Pending JP2009043184A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007210237A JP2009043184A (en) 2007-08-10 2007-08-10 Image processing method and image processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007210237A JP2009043184A (en) 2007-08-10 2007-08-10 Image processing method and image processor

Publications (1)

Publication Number Publication Date
JP2009043184A true JP2009043184A (en) 2009-02-26

Family

ID=40443839

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007210237A Pending JP2009043184A (en) 2007-08-10 2007-08-10 Image processing method and image processor

Country Status (1)

Country Link
JP (1) JP2009043184A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011096011A (en) * 2009-10-29 2011-05-12 Toshiba Corp Conveyance monitoring device and conveyance monitoring method
US9245198B2 (en) 2010-09-03 2016-01-26 Canon Kabushiki Kaisha Object recognition by comparison of patterns against map of image

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6175978A (en) * 1984-09-21 1986-04-18 Fujitsu Ltd Recognizer
JPH0620032A (en) * 1992-07-03 1994-01-28 Fujitsu Ltd Method and device for pattern check
JPH09147056A (en) * 1995-11-22 1997-06-06 Hitachi Ltd Method and device for checking appearance of mark
JP2682382B2 (en) * 1992-08-03 1997-11-26 ヤマハ株式会社 Music recognition device
JP2802183B2 (en) * 1991-05-30 1998-09-24 日立エンジニアリング株式会社 Inspection apparatus and a pattern matching method using pattern matching
JP2002044489A (en) * 2000-07-19 2002-02-08 Konica Corp System and method for photographing facial picture information and automatic photography device
JP2002230549A (en) * 2001-02-05 2002-08-16 Omron Corp Image processing method and device
JP2005196678A (en) * 2004-01-09 2005-07-21 Neucore Technol Inc Template matching method, and objective image area extracting device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6175978A (en) * 1984-09-21 1986-04-18 Fujitsu Ltd Recognizer
JP2802183B2 (en) * 1991-05-30 1998-09-24 日立エンジニアリング株式会社 Inspection apparatus and a pattern matching method using pattern matching
JPH0620032A (en) * 1992-07-03 1994-01-28 Fujitsu Ltd Method and device for pattern check
JP2682382B2 (en) * 1992-08-03 1997-11-26 ヤマハ株式会社 Music recognition device
JPH09147056A (en) * 1995-11-22 1997-06-06 Hitachi Ltd Method and device for checking appearance of mark
JP2002044489A (en) * 2000-07-19 2002-02-08 Konica Corp System and method for photographing facial picture information and automatic photography device
JP2002230549A (en) * 2001-02-05 2002-08-16 Omron Corp Image processing method and device
JP2005196678A (en) * 2004-01-09 2005-07-21 Neucore Technol Inc Template matching method, and objective image area extracting device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011096011A (en) * 2009-10-29 2011-05-12 Toshiba Corp Conveyance monitoring device and conveyance monitoring method
US9245198B2 (en) 2010-09-03 2016-01-26 Canon Kabushiki Kaisha Object recognition by comparison of patterns against map of image
US9740965B2 (en) 2010-09-03 2017-08-22 Canon Kabushiki Kaisha Information processing apparatus and control method thereof

Similar Documents

Publication Publication Date Title
CN101681432B (en) Photo-document segmentation method and system
JP4806230B2 (en) Deterioration dictionary generation program, method and apparatus
US5265173A (en) Rectilinear object image matcher
EP1497787B1 (en) System and method for identifying and extracting character strings from captured image data
EP2278553A1 (en) Building roof outline recognizing device, building roof outline recognizing method, and building roof outline recognizing program
US20040207600A1 (en) System and method for transforming an ordinary computer monitor into a touch screen
US4408342A (en) Method for recognizing a machine encoded character
US5764799A (en) OCR method and apparatus using image equivalents
US5410611A (en) Method for identifying word bounding boxes in text
EP0738987A2 (en) Processing machine readable forms
JP5787642B2 (en) Object holding device, method for controlling object holding device, and program
JP2004340840A (en) Distance measuring device, distance measuring method and distance measuring program
US5799115A (en) Image filing apparatus and method
US8406470B2 (en) Object detection in depth images
US6385338B1 (en) Image processing method and apparatus
US7133572B2 (en) Fast two dimensional object localization based on oriented edges
US20070253040A1 (en) Color scanning to enhance bitonal image
JPH11502348A (en) Position and direction of the detection method of the reference mark
JP2007508633A (en) Method and image processing device for analyzing object contour image, method and image processing device for detecting object, industrial visual device, smart camera, image display, security system, and computer program product
JP2745764B2 (en) Position recognition device
JP2007524950A (en) Object detection method, object detection apparatus, and object detection program
WO2010113821A1 (en) Face feature point detection device and program
JP4380838B2 (en) Video image automatic road sign recognition method, road sign automatic recognition device, and road sign automatic recognition program
US20040131256A1 (en) Image processing apparatus and image processing method
US20050123199A1 (en) Method for optical recognition of a multi-language set of letters with diacritics

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20090220

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20110104

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110111

A521 Written amendment

Effective date: 20110311

Free format text: JAPANESE INTERMEDIATE CODE: A523

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110405

A521 Written amendment

Effective date: 20110413

Free format text: JAPANESE INTERMEDIATE CODE: A523

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20110628