Object detection device and computer program product for object detection

By storing the model pattern and feature extraction part in the object detection device and calculating the overall and local matching degrees, the problem of low positioning accuracy of symmetrical objects is solved, and high-precision object detection and gesture recognition are achieved.

CN112419406BActive Publication Date: 2024-09-10FANUC LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010780126.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2019-08-22
Filing Date
2020-08-05
Publication Date
2024-09-10
Estimated Expiration
2040-08-05

AI Technical Summary

Technical Problem

When the existing technology detects symmetrical objects, it is difficult to locate their position and posture with high precision. Especially when the rotation search and linear search methods are improperly set, it is easy to cause positioning failure, and in the image matching of product groups, If the inspection window setting is inappropriate, accurate pass/fail determination cannot be obtained.

Method used

Using the stored model pattern and feature extraction unit, by extracting multiple predetermined features from the image, and when changing the relative position of the model pattern relative to the image, the overall matching degree and the local matching degree are calculated. When the matching degree reaches a predetermined threshold, , determine the existence and position of the target object, and use the combination of the feature extraction part and the comparison part to achieve high-precision detection of symmetrical objects.

Benefits of technology

It achieves high-precision detection of symmetrical objects in images, can accurately locate the position and posture of objects, reduces users' caution when setting search methods, and improves the accuracy and reliability of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112419406B_ABST
    Figure CN112419406B_ABST
Patent Text Reader

Abstract

Provided are an object detection device and a computer program for object detection, which can detect an object shown on an image with high accuracy. The object detection device comprises: a feature extraction unit, which extracts a plurality of predetermined features from an image showing the object, and a comparison unit, which changes the relative positional relationship of a model pattern with respect to the image when the object is observed from a predetermined direction, and simultaneously calculates the overall matching degree between a plurality of predetermined features set for the entire model pattern and a plurality of predetermined features extracted from a corresponding area on the image, and for each local area containing a portion of the model pattern, calculates the local matching degree between one or more predetermined features contained in the local area and one or more predetermined features extracted from an area on the image corresponding to the local area, and when the overall matching degree is greater than an overall matching degree threshold and the local matching degree calculated for each local area is greater than a local matching degree threshold, it is determined that the object is shown in the area on the image corresponding to the model pattern.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to an object detection device and a computer program product for object detection, for example, for detecting an object shown in an image. Background Art

[0002] In the past, a technology for detecting an area showing an object from an image showing the object has been proposed. Among such technologies, the following technology has been particularly proposed: for an object whose shape, such as a car wheel, is highly symmetrical and therefore the position and posture cannot be correctly determined without paying attention to a specific part, high-precision positioning is performed. For example, in the positioning method described in Japanese Patent Publication No. 2017-96749, in a product standard image that serves as a standard for an inspection object, a first area surrounding a standard pattern and a second area for characterizing the position and posture of the standard pattern are set. Moreover, in this positioning method, a feature extracted from the first area is searched from the inspection object image, and the position and posture of the standard pattern in the inspection object image are roughly calculated (the first search process), and at least one of the roughly calculated position and posture is finely calculated by searching the feature extracted from the second area from the inspection object image (the second search process).

[0003] In addition, in the product inspection method described in Japanese Patent Laid-Open No. 2004-318488, when mutual pattern matching is performed between products included in a collection of multiple products, an inspection window for each product shown from an image showing multiple products is set. In this product inspection method, the inspection window at the reference position is divided into a plurality of segmented images of patterns respectively representing features, and the whole image and the segmented images representing the whole inspection window at the reference position are used as templates, respectively, to perform pattern matching with other inspection windows. Moreover, in this product inspection method, the whole model correlation value obtained by pattern matching of the whole image and the segmented model correlation value obtained by pattern matching of the segmented images are compared with a threshold value, thereby determining whether the product is qualified or not. Summary of the invention

[0004] However, in the technology described in Japanese Patent Publication No. 2017-96749, in order to perform the second search process, the user must set the search method according to the shape of the inspection object. According to the setting of the search method, in the second search process, it is specified whether to perform a rotation search for the inspection object by rotating the inspection object image or to perform a linear search for the inspection object by moving the position and posture features in the inspection object image along the search direction, and in the case of the rotation search, the rotation center is set, and in the case of the linear search, the search direction is set. If the setting of the search method is not appropriate, in the second search process, the set second area does not match the inspection object image showing the inspection object, and a suitable positioning result cannot be obtained. In particular, with respect to the rotation center and the search direction, if the set rotation center or the search direction has a slight error, in the second search process, the angle and position at which the second area matches the inspection object image cannot be detected, so the operator must take extra care to set the search method. In addition, since the second search process is limited by the search results of the first search process, if the search results of the first search process itself are not appropriate, the correct position and posture of the inspection object cannot be obtained. In addition, in the technology described in Japanese Patent Publication No. 2004-318488, each inspection window is pre-set for an image showing a product group, and then matching between the inspection windows is performed. Therefore, at the time of setting the inspection window, if it is not properly set so that each inspection window shows a product, even if the pattern matching is performed on the entire window and each segmented image, it is impossible to obtain a suitable pass / fail judgment result.

[0005] One aspect of the present invention is to provide an object detection device capable of detecting a symmetrical object shown in an image with high accuracy.

[0006] One embodiment of the present invention provides an object detection device. The object detection device includes: a storage unit 33, which stores a model pattern and at least one local area including a part of the above-mentioned model pattern, wherein the model pattern represents a plurality of predetermined features of the object object 10 located at different positions when the object object 10 is observed from a predetermined direction; a feature extraction unit 41, which is used to extract a plurality of predetermined features from an image showing the object object 10; and a comparison unit 42, which calculates the overall matching degree while changing the relative positional relationship of the model pattern with respect to the image, and calculates the local matching degree for each local area in at least one local area, and when the above-mentioned overall matching degree is greater than a predetermined overall matching degree threshold and the local matching degree calculated for each local area in at least one local area is greater than a predetermined local matching degree threshold, it is determined that the object object 10 is shown in the area corresponding to the model pattern on the image, wherein the above-mentioned overall matching degree represents the matching degree between the plurality of predetermined features set for the model pattern as a whole and the plurality of predetermined features extracted from the area corresponding to the model pattern on the image, and the above-mentioned local matching degree represents the matching degree between one or more features included in the local area among the plurality of predetermined features and one or more predetermined features extracted from the area corresponding to the local area on the image.

[0007] Another embodiment of the present invention provides a computer program for object detection. The computer program for object detection includes a command for causing a computer to execute the following processing: extracting a plurality of predetermined features from an image showing an object 10; calculating an overall matching degree while changing the relative positional relationship of a model pattern with respect to the image, and calculating a local matching degree for each local area in at least one local area, and when the overall matching degree is greater than a predetermined overall matching degree threshold and the local matching degree calculated for each local area in at least one local area is greater than a predetermined local matching degree threshold, determining that the object 10 is shown in the area corresponding to the model pattern on the image, wherein the model pattern represents a plurality of predetermined features of the object that are located at different positions when the object 10 is observed from a predetermined direction, the overall matching degree represents the degree of matching between the plurality of predetermined features set for the model pattern as a whole and the plurality of predetermined features extracted from the area corresponding to the model pattern on the image, and the local matching degree represents the degree of matching between one or more features included in the local area among the plurality of features set for the model pattern and one or more predetermined features extracted from the area corresponding to the local area on the image.

[0008] According to one aspect, a symmetrical target object shown in an image can be detected with high accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] Figure 1 This is a schematic structural diagram of a robot system according to one embodiment.

[0010] Figure 2 This is a schematic diagram of the control device.

[0011] Figure 3A This is a diagram showing an example of the shape of a workpiece viewed from a predetermined direction.

[0012] Figure 3B This is a diagram showing an example of a model pattern of a workpiece.

[0013] Figure 4 This is a functional block diagram of a processor included in a control device related to movable part control processing including object detection processing.

[0014] Figure 5A to Figure 5E These are schematic diagrams for explaining the comparison between the model pattern and the image.

[0015] Figure 6 This is an operation flow chart of the movable part control process including the object detection process. DETAILED DESCRIPTION

[0016] Hereinafter, an object detection device according to an embodiment of the present invention will be described with reference to the accompanying drawings. The object detection device detects the object from an image showing the object (hereinafter simply referred to as the object) obtained by, for example, photographing the object to be searched by a photographing unit. At this time, the object detection device calculates the overall matching degree while changing the relative positional relationship between the image and the model pattern, the model pattern representing the appearance of the object when observed from a predetermined direction, and the overall matching degree represents the degree of matching between a plurality of features set for the entire model pattern and a plurality of features extracted from a comparison area corresponding to the model pattern on the image. Furthermore, the object detection device calculates a local matching degree representing the degree of matching between one or more features contained in the local area and one or more features extracted from a local comparison area corresponding to the local area on the image for each of at least one local area representing a part of the model pattern. Then, when the overall matching degree and the local matching degree calculated for each local area are above a threshold value, the object detection device determines that the object is shown in the comparison area corresponding to the model pattern on the image.

[0017] Next, an example in which the object detection device is incorporated into a robot system is described. In this example, a workpiece, which is a target object of the robot, is photographed by a photographing unit installed on a movable part of the robot to generate an image showing the target object. Then, a control device of the robot in which the object detection device is incorporated detects the target object from the image and controls the movable part based on the detection result.

[0018] Figure 1 The schematic diagram of a robot system 1 equipped with an object detection device according to one embodiment. The robot system 1 includes: a robot 2; a control device 3 for controlling the robot 2; and a camera 4 mounted on a movable part of the robot 2 for photographing a workpiece 10, which is an example of a target object. The robot system 1 is an example of an automatic machine.

[0019] The robot 2 includes a base 11, a rotating table 12, a first arm 13, a second arm 14, a wrist 15, and a tool 16. The rotating table 12, the first arm 13, the second arm 14, the wrist 15, and the tool 16 are each an example of a movable part. The rotating table 12, the first arm 13, the second arm 14, and the wrist 15 are each supported by a shaft provided on a joint to which they are mounted, and the shaft is driven by a servo motor to move. In addition, the workpiece 10 is conveyed by, for example, a conveyor belt, and the robot 2 performs a predetermined operation on the workpiece 10 while the workpiece 10 is within a predetermined range.

[0020] The base 11 is a member that serves as a platform when the robot 2 is placed on the floor. A rotating table 12 is mounted on the upper surface of the base 11 via a joint 21 and is rotatable about an axis (not shown) orthogonal to one surface of the base 11.

[0021] The first arm 13 is mounted on the rotating table 12 via a joint 22 provided on the rotating table 12 at one end thereof. Figure 1 As shown, the first arm 13 is rotatable via a joint 22 about an axis (not shown) provided parallel to the surface of the base 11 on which the rotating table 12 is mounted.

[0022] The second arm 14 is mounted on the first arm 13 at one end thereof via a joint 23 provided on the other end of the first arm 13 opposite to the joint 22. Figure 1 As shown, the second arm 14 is rotatable via a joint 23 around an axis (not shown) provided parallel to the surface of the base 11 on which the rotating table 12 is mounted.

[0023] The wrist 15 is attached to the front end of the second arm 14 on the opposite side of the joint 23 via the joint 24. The wrist 15 has the joint 25, and can be bent around an axis (not shown) provided parallel to the axis of the joint 22 and the axis of the joint 23 through the joint 25. Furthermore, the wrist 15 can also rotate in a plane orthogonal to the longitudinal direction of the second arm 14 around an axis (not shown) parallel to the longitudinal direction of the second arm 14 as a rotation center.

[0024] The tool 16 is mounted on the front end of the wrist 15 on the opposite side from the joint 24. The tool 16 has a mechanism or device for operating the workpiece 10. For example, the tool 16 may have a laser for processing the workpiece 10, or a servo welding gun for welding the workpiece 10. Alternatively, the tool 16 may also have a hand-held mechanism for holding the workpiece 10 or a component assembled on the workpiece 10.

[0025] The camera 4 is an example of an imaging unit, and is installed on the tool 16, for example. In addition, the camera 4 may be installed on other movable parts such as the wrist 15 or the second arm 14. The camera 4 is oriented so that the workpiece 10 is included in the imaging range of the camera 4 when the robot 2 performs an operation on the workpiece 10. In addition, the camera 4 captures the imaging range including the workpiece 10 at each predetermined imaging cycle to generate an image showing the workpiece 10. Whenever an image is generated, the camera 4 outputs the generated image to the control device 3 via the communication line 5.

[0026] The control device 3 is connected to the robot 2 via the communication line 5, and receives information indicating the operation of the servo motors driving the axes provided on the joints of the robot 2, images from the camera 4, etc. from the robot 2 via the communication line 5. Then, the control device 3 controls the servo motors based on the received information and images and the operation of the robot 2 received from the upper control device (not shown) or preset, thereby controlling the position and posture of each movable part of the robot 2.

[0027] Figure 2 3 is a schematic diagram of the control device 3. The control device 3 includes a communication interface 31, a drive circuit 32, a memory 33, and a processor 34. Furthermore, the control device 3 may include a user interface (not shown) such as a touch panel.

[0028] The communication interface 31 includes, for example, a communication interface for connecting the control device 3 to the communication line 5, and a circuit for executing processing related to the transmission and reception of signals via the communication line 5. Furthermore, the communication interface 31 receives information indicating the operation status of the servo motor 35, such as a measured value of the rotation amount from an encoder for detecting the rotation amount of the servo motor 35 as an example of a driving unit, from the robot 2 via the communication line 5, and transfers the information to the processor 34. Figure 2 In the figure, one servo motor 35 is representatively shown, but the robot 2 may have a servo motor for driving the axis of each joint. Furthermore, the communication interface 31 receives an image from the camera 4 and transfers it to the processor 34 .

[0029] The drive circuit 32 is connected to the servo motor 35 via a current supply cable, and supplies power corresponding to the torque, rotation direction, or rotation speed generated by the servo motor 35 to the servo motor 35 under the control of the processor 34 .

[0030] The memory 33 is an example of a storage unit, and includes, for example, a readable and writable semiconductor memory and a read-only semiconductor memory. Furthermore, the memory 33 may include a storage medium such as a semiconductor memory card, a hard disk, or an optical storage medium, and a device for accessing the storage medium.

[0031] The memory 33 stores various computer programs and the like for controlling the robot 2 executed by the processor 34 of the control device 3. In addition, the memory 33 stores information for controlling the movement of the robot 2 when the robot 2 is moved. Furthermore, the memory 33 stores information indicating the movement of the servo motor 35 obtained from the robot 2 during the movement of the robot 2. In addition, the memory 33 stores various data used in the object detection process. Such data includes, for example, a model pattern of the workpiece 10, camera parameters indicating information related to the camera 4 such as the focal length, installation position and orientation of the camera 4, and an image obtained from the camera 4.

[0032] In the present embodiment, a plurality of predetermined features of the workpiece 10 located at different positions when the workpiece 10 is observed from a predetermined direction (e.g., vertically upward) are shown in the model pattern. Furthermore, in the model pattern, at least one local area is set in a manner including a part of the workpiece 10. The local area is set in, for example, a local part representing the posture of the workpiece 10, for example, a part whose position and posture change according to the posture of the workpiece 10 relative to a reference point of the workpiece 10 (e.g., the center of gravity of the area showing the workpiece 10 when observed from a predetermined direction) when the workpiece 10 is observed from a predetermined direction. In addition, the local area is not limited to one, and may be set to multiple. In addition, the workpiece 10 may be, for example, a workpiece having a symmetrical shape when observed from a predetermined direction, for example, a workpiece having a line-symmetrical shape. Furthermore, the predetermined features shown in the model pattern may be set to feature points representing the outline of any part of the workpiece 10, such as points on the appearance contour of the workpiece 10 or points along the holes formed on the workpiece 10. Alternatively, the predetermined features may also be straight lines or curves located at specific parts of the workpiece 10, or figures (e.g., triangles or circles) representing the shapes of specific parts of the workpiece 10.

[0033] Figure 3A is a diagram showing an example of the shape of the workpiece 10 observed from a predetermined direction, Figure 3B 1 is a diagram showing an example of a model pattern of a workpiece 10. Figure 3A As shown, in this example, when viewed from a predetermined direction, the workpiece 10 has a line-symmetrical shape, wherein the contour is generally circular and a portion 10a of the contour is concave. Figure 3B As shown, in the model pattern 300, a plurality of points 301 on the contour of the workpiece 10 are respectively set as features. The plurality of features 301 are obtained, for example, by processing a reference image by a feature extraction unit 41 of a processor 34 described later, the reference image being an image obtained by photographing the workpiece 10 from a predetermined direction. In addition, in the model pattern 300, a concave portion 10a in the contour of the workpiece 10 is set as a local area 310. The local area 310 is set to include a portion whose relative position and posture relative to the center of gravity of the area showing the workpiece 10 change according to the posture of the workpiece 10. Therefore, not only the model pattern 300 as a whole but also the local area 310 is compared with the image showing the workpiece 10, thereby correctly detecting the position and posture of the workpiece 10 on the image. In addition, for example, the local area can be set while the operator visually confirms the reference image. In addition, the model pattern 300 can be represented, for example, by a binary image in which the pixels where each feature is located have different values ​​from other pixels.

[0034] The processor 34 is an example of a control unit, and includes, for example, a central processing unit (CPU) and its peripheral circuits. Furthermore, the processor 34 may also include a processor for numerical calculation. In addition, the processor 34 controls the robot system 1 as a whole. In addition, the processor 34 executes a movable part control process including an object detection process.

[0035] Figure 4 1 is a functional block diagram of the processor 34 related to the movable part control process including the object detection process. The processor 34 includes: a feature extraction unit 41, a comparison unit 42, and a movable part control unit 43. These parts of the processor 34 are, for example, functional modules implemented by a computer program executed on the processor 34. Alternatively, these parts may be implemented as a dedicated operation circuit installed on a part of the processor 34. In addition, the processing of the feature extraction unit 41 and the comparison unit 42 among these parts of the processor 34 is included in the object detection process.

[0036] The feature extraction unit 41 extracts a plurality of features of the same type as the features shown in the model pattern from each of a series of images in time series obtained by the camera 4. Since the feature extraction unit 41 only needs to perform the same processing on each image, the processing on one image will be described below.

[0037] When the feature is a feature point such as a point located on the contour of the workpiece 10, the feature extraction unit 41 applies an edge detection filter such as a Sobel filter to each pixel on the image, and extracts pixels whose edge strength is greater than a predetermined value as features. Alternatively, the feature extraction unit 41 may also extract pixels showing corners detected by applying a corner detection filter such as a Harris filter to the image as features. Alternatively, the feature extraction unit 41 may also extract pixels detected by applying a SIFT algorithm to the image as features.

[0038] In addition, when the feature is a straight line, the feature extraction unit 41 may also extract a plurality of feature points from the image as described above, and by performing Hough transform on the extracted plurality of feature points, extract the straight lines having a predetermined number of feature points or more as features. Similarly, when the feature is a predetermined curve (for example, a second-order curve such as an arc or a higher-order curve of the third order or more), the feature extraction unit 41 may extract a plurality of feature points from the image as described above, and perform generalized Hough transform on the extracted plurality of feature points. Thus, the feature extraction unit 41 may also extract predetermined curves having a predetermined number of feature points or more as features.

[0039] Alternatively, when the feature is a figure with a predetermined shape (such as a triangle or a circle), the feature extraction unit 41 may also extract the figure with the predetermined shape as a feature from the image by performing template matching between a template representing the figure and the image. Alternatively, the feature extraction unit 41 may also extract the figure by inputting the image into a recognizer such as a convolutional neural network that has been learned in advance to detect the figure with the predetermined shape.

[0040] The feature extraction unit 41 notifies the position of each feature extracted from the image to the comparison unit 42 for each image. For example, the feature extraction unit 41 generates a binary image as data representing the position of each feature, and transfers the binary image to the comparison unit 42. The binary image has pixels showing the extracted features and other pixels with different values.

[0041] The comparison unit 42 compares the plurality of features extracted from each image with the model pattern for each of a series of images in a time series obtained by the camera 4, thereby detecting the workpiece 10 from the image. In addition, since the comparison unit 42 only needs to perform the same processing on each image, the processing on one image will be described below.

[0042] For example, the comparison unit 42 reads the model pattern from the memory 33 and compares the model pattern with the image of interest, thereby detecting the area showing the workpiece 10 on the image. At this time, the comparison unit 42 sets a plurality of comparison areas on the image that need to be compared with the model pattern by changing the relative positional relationship of the model pattern with respect to the image. In addition, the change in the relative positional relationship is performed, for example, by changing at least one of the relative position, relative orientation, and ratio of the model pattern with respect to the image. Such a change is performed, for example, by applying an affine transformation to the model pattern. Moreover, the comparison unit 42 calculates the overall matching degree between the comparison area and the model pattern for each comparison area, and the overall matching degree indicates the matching degree between the plurality of features set for the entire model pattern and the plurality of features extracted from the comparison area. Furthermore, the comparison unit 42 calculates the local matching degree for each comparison area, and the local matching degree indicates the matching degree between one or more features contained in the local area set in the model pattern and one or more features extracted from the local comparison area corresponding to the local area on the image. Furthermore, when a plurality of local regions are set for the model pattern, the comparison unit 42 may calculate the local matching degree for each of the plurality of local regions.

[0043] The comparison unit 42 can calculate the overall matching degree and the local matching degree according to the following formula, for example.

[0044] Overall matching degree = the number of features set for the model pattern whose distance to any feature extracted from the comparison area of ​​the target image is less than a predetermined value / the total number of features set for the model pattern

[0045] Local matching degree = the number of features set for the local area of ​​the model pattern whose distance to any feature extracted from the local comparison area corresponding to the local area on the target image is less than a predetermined value / the total number of features included in the local area

[0046] In addition, when each feature is represented by a point such as a point on a contour (i.e., when each feature is a feature point), the distance between two features in the above-mentioned calculation formulas for the overall matching degree and the local matching degree can be set to the Euclidean distance between the feature points. In addition, when each feature is a straight line or a curve, the distance between two features can be set to the average value of the Euclidean distances between a plurality of predetermined positions (e.g., the two end points and the midpoint) of the two straight lines or two curves as features. Furthermore, when each feature is a figure with a predetermined shape such as a triangle or a circle, the distance between two features can be set to the average value of the Euclidean distances between a plurality of predetermined positions (e.g., the center of gravity of the figure, a certain corner point, etc.) of the two figures as features.

[0047] Alternatively, the comparison unit 42 may calculate the overall matching degree and the local matching degree according to the following equation for each feature of the model pattern, for example, so that the smaller the distance to the nearest feature of the comparison area, the greater the overall matching degree and the local matching degree.

[0048] Overall matching degree = Σ n=1 N (1 / (dn+1)) / N

[0049] Local matching degree = Σ m=1 M (1 / (dm+1)) / M

[0050] Wherein, dn is the minimum value of the distance between the nth feature set for the model pattern and any feature extracted from the comparison area of ​​the object image, and N represents the total number of features set for the model pattern. Similarly, dm is the minimum value of the distance between the mth feature set for the local area of ​​the model pattern and any feature extracted from the local comparison area corresponding to the local area on the object image, and M represents the total number of features contained in the local area of ​​the model pattern.

[0051] When the overall matching degree for the comparison region of interest is greater than or equal to a predetermined overall matching degree threshold and the local matching degree calculated for each local region is greater than or equal to a predetermined local matching degree threshold, the checking unit 42 determines that the workpiece 10 is shown in the comparison region of interest.

[0052] Figure 5A to Figure 5E is a diagram for explaining the overview of the comparison between the model pattern and the image. Figure 5A As shown in FIG. 5 , the workpiece 10 shown in the image 500 has a shape in which the outline is generally circular and a portion of the outline is concave. In addition, a plurality of features 501 are extracted along the outline of the workpiece 10. In contrast, Figure 5BAs shown, in the model pattern 510 , a plurality of features 511 are also set along the contour of the workpiece 10 , and a local area 520 is set in a portion where the contour is concave.

[0053] like Figure 5C As shown, in the image 500, the comparison area 530 is set so as to include the workpiece 10, and the orientation of the model pattern 510 is set to be consistent with the orientation of the workpiece 10 on the image 500. In this case, not only in the entire model pattern 510, but also in the local area 520, each feature 501 extracted from the image 500 is roughly matched with each feature 511 set for the model pattern. Therefore, both the overall matching degree and the local matching degree are high values, so it is determined that the workpiece 10 is shown in the comparison area 530, and it can be seen that the orientation of the workpiece 10 on the image 500 is the same as that of the model pattern 510.

[0054] On the other hand, Figure 5D As shown, if the comparison area 540 deviates from the area showing the workpiece 10, then with respect to the entire comparison area, each feature 501 extracted from the image 500 does not match each feature 511 set for the model pattern 510. Furthermore, even with respect to the local area 520, each feature 501 extracted from the image 500 does not match each feature 511 set for the model pattern 510. As a result, both the overall matching degree and the local matching degree are low values. Therefore, it is determined that the comparison area 540 is different from the area showing the workpiece 10.

[0055] Furthermore, if Figure 5E As shown, the comparison area 550 is set to include the workpiece 10, but the orientation of the workpiece 10 on the image 500 is different from the orientation of the model pattern 510 to be compared. In this case, since the model pattern 510 is aligned in a manner that roughly matches the contour of the workpiece 10, there are more features with a smaller distance from any feature 511 among the multiple features 501, so the overall matching degree is a high value. However, since the position of the concave portion of the workpiece 10 deviates from the position of the local area 520 of the model pattern 510, the local matching degree is a low value. As a result, the workpiece 10 cannot be detected from the comparison area 550.

[0056] In this way, the comparison unit 42 detects the area where the workpiece 10 is shown on the image based on both the overall matching degree calculated based on the entire model pattern and the local matching degree calculated for the local area, so that not only the position of the workpiece 10 shown on the image but also the posture of the workpiece 10 can be detected.

[0057] In addition, the overall matching degree threshold and the local matching degree threshold may be the same or different from each other.

[0058] For example, depending on the positional relationship between the camera 4 and the workpiece 10, some shadows may be cast on a part of the workpiece 10, and the feature extraction unit 41 cannot fully extract features from the place where the shadow is cast on the image. In such a case, the overall matching degree may become a low value. Therefore, it is preferred to set the overall matching degree threshold and the local matching degree threshold so that the local matching degree threshold is higher than the overall matching degree threshold. Thus, with respect to the overall matching degree, the workpiece 10 can be detected even if the matching degree is low, while with respect to the local matching degree, a higher matching degree is required in the detection of the workpiece 10. Therefore, it is possible to suppress the control unit 42 from misdetecting other objects as the workpiece 10, and it is possible to suppress the failure of the detection of the workpiece 10. Furthermore, in the case where a part of the workpiece 10 is a unique shape and the local area is set to include the unique shape, it is also preferred to set the overall matching degree threshold and the local matching degree threshold so that the local matching degree threshold is higher than the overall matching degree threshold. Thus, the control unit 42 can detect the workpiece 10 including the unique shape with higher accuracy.

[0059] In addition, there is a case where, when the workpiece 10 is pre-processed, such as when an irregular hole is formed on the workpiece 10, an irregular portion is included in a part of the workpiece 10, and the local area is set to include the irregular portion. In such a case, the position of the feature in the local area of ​​the model pattern may not match the position of the feature in the corresponding area of ​​the actual workpiece, and as a result, even if the workpiece 10 is shown in the comparison area of ​​interest, the local matching degree is lower than the overall matching degree. Therefore, in such a case, it is preferred to set the overall matching degree threshold and the local matching degree threshold so that the overall matching degree threshold is higher than the local matching degree threshold. Thus, even if an irregular portion is included in a part of the workpiece 10, the comparison unit 42 can detect the posture of the workpiece 10 shown in the image using the features of the irregular portion.

[0060] In addition, when a plurality of local regions are set in the model pattern, the value of the local matching degree threshold applied to each local region may be different, or the value of the local matching degree threshold applied to each local region may be the same.

[0061] In addition, a plurality of model patterns may be prepared in advance. In this case, the direction from which the workpiece 10 is observed may be different for each model pattern. In this case, the comparison unit 42 calculates the overall matching degree and the local matching degree for each comparison area in the same manner as described above for each of the plurality of model patterns. Then, the comparison unit 42 determines that: in the comparison area corresponding to the position of the model pattern where the sum of the overall matching degree and the local matching degree is the largest, the overall matching degree is above the overall matching degree threshold, and the local matching degree is above the local matching degree threshold, the workpiece 10 observed from the direction represented by the model pattern is shown.

[0062] When the position of the workpiece 10 on the image is obtained, the comparison unit 42 detects the position of the workpiece 10 in the actual space based on the position. Here, the position of each pixel on the image corresponds to the azimuth observed from the camera 4. Therefore, the comparison unit 42 can, for example, set the azimuth corresponding to the center of gravity of the area where the workpiece 10 is shown on the image as the azimuth from the camera 4 toward the workpiece 10. Furthermore, the comparison unit 42 can calculate the estimated distance from the camera 4 to the workpiece 10 by multiplying the ratio of the area of ​​the workpiece 10 on the image to the area of ​​the area where the workpiece 10 is shown on the image when the distance from the camera 4 to the workpiece 10 is a predetermined reference distance by the reference distance. Therefore, the comparison unit 42 can detect the position of the workpiece 10 in the camera coordinate system based on the position of the camera 4, based on the azimuth from the camera 4 to the workpiece 10 and the estimated distance.

[0063] Furthermore, the comparison unit 42 can obtain the actual rotation amount of the workpiece 10 relative to the orientation of the workpiece 10 shown in the model pattern when viewed from a predetermined direction, based on the orientation of the model pattern in the comparison area determined to show the workpiece 10. Therefore, the comparison unit 42 can obtain the posture of the workpiece 10 based on the rotation amount. Furthermore, the comparison unit 42 can obtain the posture of the workpiece 10 represented by the camera coordinate system by rotating the posture of the workpiece 10 on the image by the difference between the predetermined direction defined for the model pattern and the direction from the camera 4 corresponding to the center of gravity of the area showing the workpiece 10.

[0064] Every time the comparison unit 42 obtains the position of the workpiece 10 in the actual space, the comparison unit 42 outputs the position of the workpiece 10 to the movable unit control unit 43 .

[0065] The movable part control unit 43 controls the movable parts of the robot 2 based on the position and posture of the workpiece 10 detected by the control unit 42. For example, the movable parts of the robot 2 are controlled so that the tool 16 of the robot 2 moves to a position where the workpiece 10 can be operated. At this time, the movable part control unit 43 controls the movable parts of the robot 2 so that, for example, in the image generated by the camera 4, the workpiece 10 is represented at a predetermined position and a predetermined size corresponding to the position where the tool 16 operates on the workpiece 10. In this case, the movable part control unit 43 controls the movable parts of the robot 2 according to a method for controlling the robot based on an image of an object obtained by a camera, such as a position-based method or a feature-based method. For such a method, for example, reference can be made to: Hashimoto, "Vision and Control", Research Meeting of the Control Department of the Measurement and Automatic Control Society, Kyoto, pp. 37-68, 2001.

[0066] Figure 6This is an operation flowchart of the movable part control process including the object detection process. According to the operation flowchart below, the processor 34 executes the movable part control process every time an image is acquired from the camera 4. In addition, the processes of steps S101 to S107 in the following operation flowchart are included in the object detection process.

[0067] The feature extraction unit 41 extracts the features of the appearance of the plurality of workpieces 10 at different positions from the image (step S101). The comparison unit 42 sets a comparison area to be compared with the model pattern on the image (step S102). The comparison unit 42 calculates the overall matching degree Sa between the model pattern and the comparison area, and calculates the local matching degree Sp for each local area (step S103). Then, the comparison unit 42 determines whether the overall matching degree Sa is above the overall matching degree threshold Tha, and whether the local matching degree Sp for each local area is above the local matching degree threshold Thp (step S104).

[0068] When the overall matching degree is less than the overall matching degree threshold Tha, or the local matching degree for any local area is less than the local matching degree threshold Thp (step S104: No), the comparison unit 42 determines that there is no workpiece 10 in the comparison area that has the same orientation as the model pattern. Next, the comparison unit 42 changes the comparison area by changing at least one of the relative position, orientation, and ratio of the model pattern to the image (step S105). Then, the comparison unit 42 repeats the processing after step S103.

[0069] On the other hand, when the overall matching degree is greater than the overall matching degree threshold Tha, and the local matching degree for each local area is greater than the local matching degree threshold Thp (step S104: Yes), the comparison unit 42 determines that the workpiece 10 having the same orientation as the orientation of the compared model pattern is shown in the comparison area (step S106). Then, the comparison unit 42 detects the position and posture of the workpiece 10 in the actual space based on the position and orientation of the workpiece 10 on the image (step S107).

[0070] The movable part control unit 43 controls each movable part of the robot 2 based on the position and posture of the workpiece 10 in the real space so as to move the tool 16 to a position where the workpiece 10 can be operated (step S108 ).

[0071] After step S108, the processor 34 ends the movable part control process. In addition, if the workpiece 10 is still not detected on the image even if the comparison unit 42 repeats the process of steps S103 to S105 more than a predetermined number of times, the comparison unit 42 may determine that the workpiece 10 is not shown on the image. In this case, the movable part control unit 43 may stop the movable part.

[0072] As described above, the object detection device calculates the overall matching degree between the plurality of features set for the entire model pattern representing the target object and the plurality of features extracted from the comparison region in each of the plurality of comparison regions on the image. Furthermore, the object detection device calculates the local matching degree between one or more features contained in the local region and one or more features extracted from the local comparison region corresponding to the local region on the target image for each of at least one local region representing a part of the model pattern in each comparison region. Then, the object detection device determines that the target object is shown in the comparison region where the overall matching degree and the local matching degree for each local region are greater than the threshold value. Therefore, even when other objects whose overall shapes are similar to the target object as a whole are shown on the image, the object detection device can suppress the erroneous detection of other objects as the target object. Furthermore, since the object detection device also uses the local matching degree of one or more local regions set for the model pattern in the detection of the target object, it can accurately detect the orientation of the target object shown on the image based on the orientation of the model pattern compared with the image. Therefore, the object detection device can also detect the posture of the target object. In this way, the object detection device can detect the target object shown in the image with high accuracy. In particular, even if the target object has symmetry, the object detection device can detect the target object from the image with high accuracy by performing the above-mentioned processing.

[0073] According to a modified example, the type of feature used in the calculation of the local matching degree may be different from the type of feature used in the calculation of the overall matching degree. For example, the feature used in the calculation of the overall matching degree is a point (feature point) on the contour of the detection object, while the feature used in the calculation of the local matching degree may be a figure, a straight line or a curve representing a characteristic part of the detection object. Furthermore, when multiple local areas are set in the model pattern, the type of feature used in the calculation of the local matching degree may be different for each local area.

[0074] In this case, the feature extraction unit 41 extracts not only the features of the type (second type) used in the calculation of the overall matching degree, but also the features of the type (first type) used in the calculation of the local matching degree from the image. Then, the comparison unit 42 calculates the overall matching degree based on the matching degree between the features of the second type, and calculates the local matching degree based on the matching degree between the features of the first type. In addition, the calculation formula for the overall matching degree and the calculation formula for the local matching degree may be the same as the calculation formula used in the above-mentioned embodiment.

[0075] In this way, by using different types of features in the comparison of the entire model pattern and the comparison of a part of the model pattern, the comparison unit 42 can use features suitable for the comparison of the entire model pattern (e.g., feature points) and features suitable for the comparison of a part of the model pattern (e.g., graphics, straight lines, or curves). Therefore, the object detection device can further improve the detection accuracy of the target object.

[0076] In addition, the comparison unit 42 may also automatically set a search pattern for a local comparison area for calculating a local matching degree based on the calculation result of the overall matching degree. For example, the comparison unit 42 may set the local comparison area more densely as the overall matching degree decreases. Thus, the object detection device can detect the target object with high accuracy without the user having to set a search method.

[0077] In addition, the object detection device can also be used for purposes other than automatic machine control. For example, the object detection device can also be used to determine whether the workpiece 10 transported on the conveyor belt is qualified. In this case, the camera 4 can be fixedly installed in such a way that a part of the transport path of the workpiece 10 is included in the imaging range of the camera 4. In addition, the object detection device can be, for example, a device having a Figure 2 A device having the same structure as the control device 3 shown in the figure. However, the drive circuit 32 can be omitted. In this case, a model pattern representing a qualified product of the workpiece 10 is stored in a memory possessed by the object detection device. In this case, the processor of the object detection device can perform the processing of the feature extraction unit 41 and the processing of the comparison unit 42 on the image obtained by the camera 4. Then, if the comparison unit 42 detects the workpiece 10 from the image obtained by the camera 4 by comparing it with the model pattern, it is determined that the workpiece 10 is a qualified product. On the other hand, if the comparison unit 42 cannot detect the workpiece 10 from the image, it can be determined that the workpiece 10 located in the shooting range of the camera 4 when the image is generated is a defective product. In addition, the processor of the object detection device can display the pass / fail judgment result on the display device, or can also notify the pass / fail judgment result to other devices connected via the communication interface.

[0078] According to this modification, even when the position and posture of the inspection object are not determined, the object detection device can determine whether the inspection object is qualified.

[0079] In addition, the computer program for executing the processing of each part of the processor 34 of the control device 3 can be provided in the form of being recorded in a computer-readable portable recording medium such as a semiconductor memory, a magnetic recording medium, or an optical recording medium.

[0080] All examples and specific terms listed here should be interpreted as: they are for the purpose of helping readers understand the present invention and the concepts contributed by the inventors to promote the technology, and are not limited to the structure of any example in this specification related to the advantages and disadvantages of the present invention, those specific examples and conditions. The embodiments of the present invention are described in detail, but it is hoped that various changes, substitutions and modifications can be added without departing from the spirit and scope of the present invention.

Claims

1. An object detection device, It is characterized in that have: a storage unit storing a model pattern and at least one local area including a portion of the model pattern, the model pattern representing a plurality of predetermined features of the target object located at different positions when the target object is viewed from a predetermined direction; a feature extraction unit that extracts the plurality of predetermined features from the image showing the target object; and a comparison unit, which calculates an overall matching degree while changing a relative positional relationship of the model pattern with respect to the image, and further calculates a local matching degree for each of the at least one local area, and when the overall matching degree is above a predetermined overall matching degree threshold, and the local matching degree calculated for each of the at least one local area is above a predetermined local matching degree threshold, determines that the object is shown in the area corresponding to the model pattern on the image, the overall matching degree indicates a matching degree between a plurality of the predetermined features set for the model pattern as a whole and a plurality of the predetermined features extracted from the area corresponding to the model pattern on the image, and the local matching degree indicates a matching degree between one or more of the plurality of the predetermined features contained in the local area and one or more of the predetermined features extracted from the area corresponding to the local area on the image, Among the plurality of predetermined features, a type of feature used for the local matching degree calculation is different from a type of feature used for the overall matching degree calculation.

2. The object detection device according to claim 1, It is characterized in that Among the plurality of predetermined features, the feature included in the first local area is a first type of feature used for the local matching degree calculation, and the feature used for the overall matching degree calculation is a second type of feature. The feature extraction unit extracts the first type of feature and the second type of feature from the image, respectively. The above-mentioned comparison unit calculates the above-mentioned local matching degree for the above-mentioned first local area based on the degree of matching between the above-mentioned first type of features and the above-mentioned first type of features extracted from the area corresponding to the above-mentioned first local area on the above-mentioned image, and calculates the above-mentioned overall matching degree based on the degree of matching between the above-mentioned second type of features and the above-mentioned second type of features extracted from the area corresponding to the above-mentioned model pattern on the above-mentioned image.

3. The object detection device according to claim 2, It is characterized in that The first type of feature is a straight line, a predetermined curve, or a figure with a predetermined shape. The second type of features described above are feature points.

4. The object detection device according to any one of claims 1 to 3, It is characterized in that The above-mentioned overall matching degree threshold is higher than the above-mentioned local matching degree threshold.

5. The object detection device according to any one of claims 1 to 3, It is characterized in that The above-mentioned overall matching degree threshold is lower than the above-mentioned local matching degree threshold.

6. A computer program product for object detection, It is characterized in that Make the computer execute the following processing: extracting a plurality of predetermined features from an image showing a target object, The overall matching degree is calculated while changing the relative position relationship of the model pattern with respect to the above-mentioned image, and the local matching degree is calculated for each local area in the at least one local area, and when the above-mentioned overall matching degree is above a predetermined overall matching degree threshold, and the above-mentioned local matching degree calculated for each local area in the above-mentioned at least one local area is above a predetermined local matching degree threshold, it is determined that the above-mentioned object is shown in the area corresponding to the above-mentioned model pattern on the above-mentioned image, the above-mentioned model pattern represents a plurality of the above-mentioned predetermined features located at different positions of the above-mentioned object when the above-mentioned object is observed from a predetermined direction, the above-mentioned overall matching degree represents the degree of matching between the plurality of the above-mentioned predetermined features set for the above-mentioned model pattern as a whole and the plurality of the above-mentioned predetermined features extracted from the area corresponding to the above-mentioned model pattern on the above-mentioned image, and the above-mentioned local matching degree represents the degree of matching between one or more of the plurality of the above-mentioned predetermined features contained in the local area and one or more of the above-mentioned predetermined features extracted from the area corresponding to the local area on the above-mentioned image, Among the plurality of predetermined features, a type of feature used for the local matching degree calculation is different from a type of feature used for the overall matching degree calculation.