A feature detection method and device
Through the two -dimensional camera and light source device to form a shadow, and use the shadow classifier to detect images, the problem of high detection costs of the high phenomenon of the surface parts of the equipment, and realized the low -cost three -dimensional special test test.
Patent Information
- Application Number
- CN202011238328.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-09
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2040-11-09
AI Technical Summary
In the prior art, the detection of floating high phenomenon of equipment surface parts requires the use of a high-cost 3D camera.
By using a two-dimensional camera and a light source device, the product is illuminated at a specified angle to form a shadow, and then the shadow classifier is used to classify the detected image to determine whether there is a floating phenomenon.
It is possible to use a low-cost two-dimensional camera to detect the three-dimensional characteristics of the surface of the equipment, accurately determine whether the parts are floating, and reduce the inspection cost.
Smart Images

Figure CN112560891B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent manufacturing technology, and in particular to a feature detection method and device. Background Art
[0002] When assembling equipment, various parts need to be used to fix the equipment surface. After being fixed, these parts are usually flush with the equipment surface. When the parts are not assembled on the equipment surface in accordance with regulations, these parts will float relative to the equipment surface. At present, the floating phenomenon of parts on the equipment surface usually needs to be detected by 3D cameras to determine the height of the parts relative to the equipment surface. However, the cost of 3D cameras is too high. Summary of the invention
[0003] The embodiments of the present invention provide a feature detection method and device, which have the effect of detecting three-dimensional features through a two-dimensional camera.
[0004] On the one hand, an embodiment of the present invention provides a feature detection method, which includes: when a designated product is located at a designated position, irradiating the designated product along a first designated angle through a light source device; wherein the first designated angle is an angle that is not perpendicular to the designated product; capturing an image of the designated product through an image capture device to obtain a detection image; and classifying the shadows of the detection image through a shadow classifier, and when it is classified that the detection image has a shadow feature, determining that the designated product has a floating phenomenon.
[0005] In one possible implementation manner, the image acquisition device is used to acquire the detection image by acquiring the image of the designated product, comprising: acquiring the designated product by the image acquisition device to acquire a first acquired image; wherein the designated product and the light source device are relatively rotated along a first designated angle; and the first detection image is screenshotted according to a preset frequency to acquire a detection image.
[0006] In one possible implementation, the image acquisition device is used to acquire a detection image for the designated product, and the method includes: controlling the image acquisition device to move along a preset path relative to the designated product, and acquiring a plurality of second acquired images during the movement of the image acquisition device; and screening the plurality of second acquired images according to preset shadow indicators, and determining a second acquired image that meets the preset shadow indicators as the detection image.
[0007] In one possible implementation, the designated product includes a target feature; accordingly, the shadow classification of the detection image is performed by a shadow classifier, and when it is classified that the detection image has a shadow feature, it is determined that the product to be designated has a floating phenomenon, including: determining a detection area on the detection image according to the target feature; shadow classification of the detection area is performed by the shadow classifier, and when it is classified that the detection area has a shadow feature, determining that the target feature has a floating phenomenon according to the shadow feature.
[0008] In one possible implementation, the method further includes: when the detection image is classified as having a shadow feature, determining a height feature of the target feature according to the shadow feature.
[0009] In one possible implementation, the detection image includes multiple detection images in different directions; accordingly, the method also includes: obtaining height features of target features in each detection image; integrating all height features to determine height information and offset information corresponding to the target features.
[0010] In one possible implementation, the method further includes: acquiring images of the detection samples through an image acquisition device to obtain a plurality of detection image samples; the detection image samples include image samples with shadows and image samples without shadows; training a neural network through the image samples to obtain a shadow classifier, and the shadow classifier is used to classify shadows of the detection images.
[0011] In one possible implementation manner, the training of a neural network through image samples to obtain a shadow classifier includes: annotating features of the image samples to obtain annotated feature samples; training a neural network through the annotated feature samples to obtain a shadow classifier; wherein the annotated features include at least one of the following features: shadow information, detection area, shadow length, and target features.
[0012] On the other hand, an embodiment of the present invention provides a feature detection device, which includes: an illumination module, which is used to illuminate the designated product along a first designated angle through a light source device when the designated product is located at a designated position; wherein the first designated angle is an angle that is not perpendicular to the designated product; an acquisition module, which is used to acquire an image of the designated product through an image acquisition device to obtain a detection image; and a classification module, which is used to classify the shadows of the detection image through a shadow classifier, and when it is classified that the detection image has a shadow feature, it is determined that the designated product has a floating phenomenon.
[0013] In one possible implementation, the acquisition module includes: an acquisition submodule, used to acquire the designated product through the image acquisition device to obtain a first acquired image; wherein the designated product and the light source device rotate relative to each other along a first designated angle; and a screenshot submodule, used to perform screenshot processing on the first detection image according to a preset frequency to obtain a detection image.
[0014] In one possible implementation, the acquisition module includes: a moving submodule, used to control the image acquisition device to move along a preset path relative to the designated product, and during the movement of the image acquisition device, to acquire images of the designated product to obtain multiple second acquired images; a screening submodule, used to screen the multiple second acquired images according to preset shadow indicators, and determine the second acquired images that meet the preset shadow indicators as the detection images.
[0015] In one possible implementation, the designated product includes a target feature; accordingly, the classification module includes: a determination submodule, used to determine the detection area on the detection image according to the target feature; a classification submodule, used to perform shadow classification on the detection area through the shadow classifier, and when it is classified that the detection area has a shadow feature, determining that the target feature has a floating phenomenon according to the shadow feature.
[0016] In one possible implementation manner, the device further includes: a determination module, configured to determine a height feature of the target feature according to the shadow feature when the detection image is classified as having a shadow feature.
[0017] In one possible implementation, the detection image includes multiple detection images in different directions; accordingly, the device also includes: an acquisition module for obtaining height features of target features in each detection image; an integration module for integrating all height features to determine height information and offset information corresponding to the target features.
[0018] In one possible implementation manner, the acquisition module is further used to acquire images of the detection samples through an image acquisition device to obtain multiple detection image samples; the detection image samples include image samples with shadows and image samples without shadows; the device also includes: a training module, used to train a neural network through image samples to obtain a shadow classifier, and the shadow classifier is used to classify shadows in the detection images.
[0019] In one possible implementation, the training module includes: a labeling submodule, used to perform feature labeling on the image samples to obtain labeled feature samples; a training submodule, used to train a neural network through the labeled feature samples to obtain a shadow classifier; wherein the labeled features include at least one of the following features: shadow information, detection area, shadow length and target features.
[0020] The feature detection method provided by the embodiment of the present method illuminates the designated product through a light source device so that a portion protruding relative to the surface of the designated product forms a shadow on the surface of the designated product, and an image acquisition device acquires an image of the surface of the designated product. Then, a shadow classifier is used to classify the detection image obtained by the image acquisition to determine whether there is a shadow feature on the detection image. When the classification result is that the detection image has a shadow feature, it can be considered that there is a portion protruding relative to the surface of the designated product on the designated product, that is, it can be determined that the designated product has a floating phenomenon. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood by reading the detailed description below with reference to the accompanying drawings. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, in which:
[0022] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts.
[0023] Figure 1 A schematic diagram of an implementation flow of a feature detection method according to an embodiment of the present invention;
[0024] Figure 2 A schematic diagram of a specific scenario of a feature detection method according to an embodiment of the present invention;
[0025] Figure 3 A schematic diagram of an implementation flow of image acquisition of a feature detection method according to an embodiment of the present invention;
[0026] Figure 4 A schematic diagram of an implementation flow of image acquisition of a feature detection method according to another embodiment of the present invention;
[0027] Figure 5 A schematic diagram of the implementation process of shadow classification of a feature detection method according to an embodiment of the present invention;
[0028] Figure 6 A schematic diagram of the implementation process of a feature detection method classifier training in an embodiment of the present invention;
[0029] Figure 7 The present invention is a schematic diagram of an implementation process of a feature detection device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0030] In order to make the purpose, features and advantages of the present invention more obvious and easy to understand, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0031] Figure 1 The present invention is a flowchart of a feature detection method according to an embodiment of the present invention.
[0032] See also Figure 1 On one hand, an embodiment of the present invention provides a feature detection method, the method comprising: operation 101, when a designated product is located at a designated position, irradiating the designated product along a first designated angle through a light source device; wherein the first designated angle is an angle that is not perpendicular to the designated product; operation 102, capturing an image of the designated product through an image capture device to obtain a detection image; operation 103, performing shadow classification on the detection image through a shadow classifier, and when the classification shows that the detection image has a shadow feature, determining that the designated product has a floating phenomenon.
[0033] The feature detection method provided by the embodiment of the present method is applied to the field of intelligent manufacturing technology. The present method can use simple low-cost equipment, such as a two-dimensional camera, to detect the three-dimensional features of a specified manufactured product. Specifically, it can be used to detect whether a specified manufactured product has a floating phenomenon. The present method irradiates the specified product through a light source device so that the part protruding relative to the surface of the specified product forms a shadow on the surface of the specified product, and the image acquisition device is used to acquire an image of the surface of the specified product. Then, a shadow classifier is used to classify the detection image obtained by the image acquisition to determine whether there is a shadow feature on the detection image. When the classification result is that the detection image has a shadow feature, it can be considered that there is a part protruding relative to the surface of the specified product on the specified product, that is, it can be determined that the specified product has a floating phenomenon.
[0034] Among them, the designated product can be any product that needs to be tested for floating on the surface, such as laptops, display screens, mobile phones, keyboards, speakers, computer hosts, household products and other products. The parts that form protrusions relative to the surface of the designated product can be bolts, screws, hooks, buckles, welds, surface defects of injection molded parts, etc., which may be formed during the assembly or production process of the designated product. According to the actual production situation of the designated product, the protrusion can be integrally formed with the designated product, or it can be a spare part or assembly fixed to the designated product. Furthermore, the cause of the protrusion can be due to process or assembly defects, or it can be that the designated product needs to form the protrusion in the design, that is, the protrusion can be a defect or a structure corresponding to the design.
[0035] In operation 101 of the method, the designated product can be placed at the designated position by means of assembly line transportation, manual handling or other methods, and the designated position can be a stage. When the method is applied to one link of the assembly line, the detection device can be used to detect whether the designated product is located at the designated position. The designated product can also be transferred to the designated position manually or by a mechanical arm. According to actual needs, the designated product can be precisely placed at the designated position, such as setting a fixture at the designated position, and clamping the designated product by the fixture to achieve precise positioning of the designated product; the designated product can also be non-precisely placed at the designated position, such as the designated position is an area larger than the area occupied by the designated product, and any position of the designated product in the area can be determined as belonging to the situation where the designated product is located at the designated position. When the designated product is located at the designated position, the designated product is illuminated at a first designated angle by a light source device. Wherein, the light source device can be one or more as needed. When there are multiple light source devices, the first designated angle corresponding to each light source device can be different. The first designated angle is used to refer to the angle formed between the light source device and the line connecting the feature to be detected on the designated product and the light source device and the surface of the designated product. Wherein, in order to form a shadow on the surface of the designated product by the light source device, the first designated angle is an angle that is not perpendicular to the designated product. It is further preferred to be a small angle, such as less than 60°, less than 45°, less than 30°, less than 15°, etc. It will not be described in detail below, and it is understandable that the first specified angle may also be greater than or equal to 60°. Further, the light source device may be fixed or movable.
[0036] In operation 102 of the method, when the designated product is illuminated by the light source device along the first designated angle, the designated product is imaged by the image acquisition device to acquire a detection image under the illumination state. The image acquisition device may be a camera, and further, may be a 2D camera. It is understandable that when the surface of the designated product has a protrusion, a shadow corresponding to the protrusion may be formed on the surface of the designated product in the detection image. The image acquisition device may be fixed or mobile. The detection image may be a captured picture or a captured video, and the image acquisition device may capture only one picture or a video, or may capture multiple pictures or multiple videos.
[0037] In operation 103 of the method, the shadow classification is performed on the detection image by a shadow classifier, and the shadow classifier is obtained by training the corresponding training samples, and is used to classify the detection image to determine whether there is a shadow on the detection image. When it is classified as the detection image having a shadow feature, it is determined that the specified product has a floating phenomenon. That is, the surface of the specified product corresponding to the detection image has a feature that is protruding relative to the surface.
[0038] Figure 2 The figure is a schematic diagram of a specific scenario of a feature detection method according to an embodiment of the present invention.
[0039] like Figure 2 As shown, a specific implementation scenario is provided below for illustration. In this implementation scenario, in this scenario, the designated product is a mobile phone 203, and the method is applied to detect whether the screws 204 on the surface of the mobile phone have a floating phenomenon. The method includes a stage, a camera 201 is installed above the stage, and a light source device 202 is installed on the side of the stage. The surface of the mobile phone 203 that needs to be checked for floating phenomenon is placed upward on the stage, and the mobile phone 203 is located directly below the camera 201. When the light source device 202 illuminates the mobile phone 203, the mobile phone 203 is photographed by the camera 201 to obtain a detection image. Then, the detection image is classified by a shadow classifier to determine whether there is a shadow on the detection image. When it is classified as having a shadow on the detection image, it is determined that the screws 204 on the mobile phone 203 have a floating phenomenon.
[0040] Figure 3 The present invention is a schematic diagram of an implementation process of a feature detection method for image acquisition according to an embodiment of the present invention.
[0041] See also Figure 3In an embodiment of the present invention, operation 102, capturing an image of a designated product through an image capture device to obtain a detection image, includes: operation 1021, capturing the designated product through an image capture device to obtain a first captured image; wherein the designated product and the light source device rotate relative to each other along a first designated angle; operation 1022, screenshotting the first detection image according to a preset frequency to obtain a detection image.
[0042] This method can collect multiple detection images under different lighting conditions to further identify the protruding features on the specified product.
[0043] Specifically, the method causes the designated product and the light source device to rotate relative to each other along the first designated angle, which can be to fix the designated product and rotate the light source device relative to the designated product, or to fix the light source device and rotate the designated product relative to the light source device. When the first designated angle is an unchangeable angle, the light source device can rotate around the center of the designated product as the axis, or rotate through the stage so that the designated product rotates around the center of the designated product as the axis. When the first designated angle is a changeable angle, the light source device can be moved along a specific trajectory, such as spirally circling. When the designated product and the light source device rotate relative to each other along the first designated angle, the designated product is captured by the image acquisition device to obtain a first captured image. The first captured image can be a video recording, so as to understand the continuous change of the shadow when there is a floating phenomenon on the surface of the designated product. The first captured image can be directly used as a detection image for classification by a shadow classifier. In this case, the shadow classifier can be trained by using the video sample corresponding to the first captured image as training data. In another case, the first detection image can be screenshotted according to a preset frequency to obtain multiple detection images at multiple angles and positions, that is, multiple detection images. In this case, the shadow classifier can be trained using image samples as training data. The preset frequency can be the frequency of other variables such as preset angle frequency, preset position frequency, preset time frequency, etc. If the preset frequency is the preset time frequency, when the first captured image is 10 seconds, the time frequency can be preset to 1 second, with the 0th second as the first screenshot time, and screenshots are taken again every 1 second thereafter, corresponding to a total of 11 screenshot images obtained for the first captured image.
[0044] Figure 4 The present invention is another embodiment of the method for detecting features of the present invention.
[0045] See also Figure 4In the embodiment of the present invention, operation 102, capturing an image of a designated product through an image capture device to obtain a detection image, includes: operation 1023, controlling the image capture device to move along a preset path relative to the designated product, and capturing an image of the designated product during the movement of the image capture device to obtain a plurality of second captured images; operation 1024, screening the plurality of second captured images according to a preset shadow index, and determining the second captured image that meets the preset shadow index as the detection image.
[0046] It should be noted that each operation of the method is only used to distinguish the steps, and there is no substantial order relationship. For example, operation 1021-operation 1022 and operation 1023-operation 1024 belong to two different implementation scenarios. In operation 102, only operation 1021-operation 1022 can be executed, or only operation 1023-operation 1024 can be executed, or operation 1021-operation 1022 and operation 1023-operation 1024 can be combined and executed. However, it can be understood that when operation 1021-operation 1022 and operation 1023-operation 1024 are combined and executed, the execution order of operation 1023 does not necessarily follow operation 1022, and can be executed before or synchronously.
[0047] Specifically, the image acquisition device may also be fixedly installed or movably installed. In one implementation scenario, when the image acquisition device is movably installed, the method may control the image acquisition device to move along a preset path relative to the designated product. The preset path may be a path that changes the angle between the image acquisition device and the designated product, or may be other paths, and the specific moving path may be adjusted and preset according to the target requirements. During the movement of the image acquisition device, the designated product is imaged by the image acquisition device, and the image acquisition may be image acquisition or picture acquisition to obtain a plurality of second acquired images. When it is picture acquisition, the angle between the image acquisition device and the designated product in each picture may be different to acquire the second acquired images with different shadow postures and feature postures. Then, the plurality of second acquired images are screened according to the preset shadow index, wherein the preset shadow index may be an index that the shadow posture in the picture is not interfered by other features or shadows, the feature posture in the picture is not interfered by other features or shadows, or other preset indexes according to actual requirements. The preset shadow index may also be matched by a shadow matching model to determine whether the second acquired image meets the index. The shadow matching model may be a neural network model, which is obtained by training samples corresponding to the preset shadow index. The second collected image that meets the preset shadow index is determined as the detection image. Here, the detection image can also be multiple.
[0048] Figure 5The present invention is a schematic diagram of the implementation process of a feature detection method for shadow classification according to an embodiment of the present invention.
[0049] See also Figure 5 In an embodiment of the present invention, the designated product includes a target feature; accordingly, operation 103, shadow classification is performed on the detection image through a shadow classifier, and when it is classified as the detection image having a shadow feature, it is determined that the product to be designated has a floating phenomenon, including: operation 1031, determining a detection area on the detection image according to the target feature; operation 1032, shadow classification is performed on the detection area through a shadow classifier, and when it is classified as the detection area having a shadow feature, it is determined that the target feature has a floating phenomenon according to the shadow feature.
[0050] The target feature contained in the designated product is the feature to be detected for whether there is a floating phenomenon, and the target feature can be one or more. Since the target feature position information and other relevant information on the designated product are the same during the production process, in order to determine the actual position to be detected in the detection image, the method can determine the detection area on the detection image according to the target feature. Specifically, a preset template corresponding to the target feature can be preset, and the detection image can be template mapped by the preset template to determine the detection area on the detection image, or the detection image can be segmented by a model corresponding to the detection area to determine the detection area on the detection image. Among them, the model corresponding to the detection area can be a neural network model, which is obtained by training the training data corresponding to the detection area. The method can also determine the detection area in the detection image according to the position annotation information by marking the position of the target feature. The method can also determine the detection method on the detection image in other ways, which will not be repeated below. Since the target feature can be one or more, the determined detection area can also be one or more. Each detection area can have a preset size, and the size of the detection area is preferably such that all patterns corresponding to the target feature and patterns corresponding to the shadow feature can be included within the size. After determining the detection area, each detection area is shadow-classified by a shadow classifier to determine whether there is a shadow feature in each detection area. When the detection area is determined to have a shadow feature, it can be determined that the target feature corresponding to the detection area has a floating phenomenon. In this way, when it is possible to determine that a specified product has a floating phenomenon, it is also possible to determine the position information of the target feature with a floating phenomenon on the specified object, and locate and further process the floating information. For example, when performing a floating detection on the screws of a mobile phone, the detection area corresponding to each screw in the detection image is shadow-classified. When a detection area is determined to have a shadow feature, the screw corresponding to the detection area can be judged to have a floating phenomenon.
[0051] In the embodiment of the present invention, in operation 103 of the method, the method further includes: when the detection image is classified as having a shadow feature, determining a height feature of the target feature according to the shadow feature.
[0052] Furthermore, when it is determined that there are shadow features in the detected image, the height feature of the target feature can also be determined based on other available parameters such as the illumination angle of the light source device and the length of the shadow. For example, in the process of detecting the floating height of the screws of a mobile phone, when the preset illumination angle of the light source device and the preset angle of the image acquisition device are known, the height feature of the target feature corresponding to the shadow feature can be determined by measuring the length of the shadow feature. If it is known that the angle between the light source device and the target feature is 45, and the image acquisition device is located directly above the target feature, the shadow length is consistent with the floating height of the target feature, that is, when the shadow is 1 unit, the height feature of the target feature is also 1 unit. Specifically, the method can determine the height feature of the target feature by a shadow classifier, which is a neural network model, which can be obtained by training with training samples having image acquisition device angle annotations, light source device angle annotations, shadow feature length annotations, and target feature height feature annotations.
[0053] In an embodiment of the present invention, the detection image includes multiple detection images in different directions; accordingly, in operation 103 of the present method, the method also includes: first, obtaining the height features of the target features in each detection image; then, integrating all the height features to determine the height information and offset information corresponding to the target features.
[0054] In this method, multiple detection images with different directions refer to different directions relative to the target feature. For example, when the target feature is a cuboid, the detection image can be a detection image that collects its four faces and four edges respectively. It can be understood that the angles between the multiple detection images with different directions and the target feature can be the same or different. In this embodiment, the angles between the multiple detection images with different directions and the target feature are the same. This method first obtains the height feature of the target feature in each detection image. The height feature can be obtained by determining the height feature of the target feature according to the shadow feature in the above embodiment of the present invention. Then, the height feature in each detection image is integrated. The integration of the height feature includes but is not limited to obtaining the average, obtaining the difference between the maximum height and the minimum height, obtaining the angle between the target feature and the specified product according to the maximum height and the minimum height, and other integration operations. The specific integration operation can be set according to actual needs. In the case where the integration operation is to obtain the angle between the target feature and the specified product according to the maximum height and the minimum height, the height information and the offset information corresponding to the target feature can be determined. Among them, the height information can be other height information such as average height information, maximum height information, minimum height information, etc. The offset information can be represented by the offset between the target feature and the specified center line corresponding to the product design, or it can be represented by the angle between the target feature and the specified product.
[0055] Figure 6 The present invention is a schematic diagram of the implementation process of a feature detection method classifier training according to an embodiment of the present invention.
[0056] See also Figure 6 In an embodiment of the present invention, the method further includes: operation 601, performing image acquisition on the detection sample through an image acquisition device to obtain multiple detection image samples; the detection image samples include image samples with shadows and image samples without shadows; operation 602, training a neural network through the image samples to obtain a shadow classifier, and the shadow classifier is used to classify the shadows of the detection image.
[0057] Before performing shadow classification, the method needs to first train the neural network to obtain a shadow classifier. The neural network of the method can select a variety of known neural networks used for image recognition and feature classification.
[0058] In operation 601 of the present method, an image acquisition device is used to acquire images of the test sample. The test sample may be a product sample that is the same as the specified product, and there may be multiple product samples, including product samples with different floating height phenomena and / or different offset phenomena and product samples without floating height phenomena and offset phenomena. The image acquisition device and the light source device are used to acquire images of the product sample. During the acquisition process, videos and / or pictures of multiple product samples may be acquired as needed, videos and / or pictures under different lighting angles and lighting positions of the light source device may be acquired, and videos and / or pictures under different positions and angles of the image acquisition device may be acquired. The above images and / or pictures may all be used as image samples. It is understood that when the product sample has a floating height phenomenon and / or a different offset phenomenon, the corresponding image sample has a shadow. When the product sample has no floating height phenomenon and no offset phenomenon, the corresponding image sample does not have a shadow.
[0059] In operation 602 of the method, a neural network is trained using the labeled and / or unlabeled image samples obtained in operation 601 to obtain a shadow classifier, which is used to classify shadows in the detection image.
[0060] In an embodiment of the present invention, operation 602, training a neural network through image samples to obtain a shadow classifier, includes: first, feature labeling of the image samples to obtain labeled feature samples; then, training the neural network through the labeled feature samples to obtain a shadow classifier; wherein the labeled features include at least one of the following features: shadow information, detection area, shadow length, and target feature.
[0061] Furthermore, the method can train the neural network as a marked feature sample after marking on the image sample, and the marked feature includes but is not limited to at least one of the following features: shadow information, detection area, shadow length and target feature. Specifically, the marked feature may include but is not limited to one or more of the following: light source device angle marking, light source position marking, image acquisition device angle marking, image acquisition device position marking, shadow feature angle marking, shadow feature position marking, shadow feature length marking, target feature shape marking, target feature position marking, target feature offset marking, etc. Then, the neural network is trained by the marked feature sample to obtain a shadow classifier. It can be understood that when the neural network is trained by the marked feature sample with annotations, the shadow classifier is used to classify the detected image, and other required information such as the height feature and offset information of the target feature corresponding to the shadow feature can also be determined.
[0062] Figure 7 The present invention is a schematic diagram of an implementation process of a feature detection device according to an embodiment of the present invention.
[0063] See also Figure 7 On the other hand, an embodiment of the present invention provides a feature detection device, which includes: an irradiation module 701, which is used to illuminate the specified product along a first specified angle through a light source device when the specified product is located at a specified position; wherein the first specified angle is an angle that is not perpendicular to the specified product; an acquisition module 702, which is used to acquire an image of the specified product through an image acquisition device to obtain a detection image; and a classification module 703, which is used to classify the shadows of the detection image through a shadow classifier, and when the detection image is classified as having a shadow feature, it is determined that the specified product has a floating phenomenon.
[0064] In an embodiment of the present invention, the acquisition module 702 includes: an acquisition submodule 7021, which is used to acquire a designated product through an image acquisition device to obtain a first acquired image; wherein the designated product and the light source device rotate relative to each other along a first designated angle; and a screenshot submodule 7022, which is used to perform screenshot processing on the first detection image according to a preset frequency to obtain a detection image.
[0065] In the embodiment of the present invention, the acquisition module 702 includes: a moving submodule 7023, which is used to control the image acquisition device to move along a preset path relative to the designated product, and during the movement of the image acquisition device, the designated product is imaged to obtain multiple second acquired images; a screening submodule 7024, which is used to screen the multiple second acquired images according to preset shadow indicators, and determine the second acquired images that meet the preset shadow indicators as the detection image.
[0066] In an embodiment of the present invention, the designated product includes a target feature; accordingly, the classification module 703 includes: a determination submodule 7031, for determining a detection area on a detection image according to the target feature; a classification submodule 7032, for performing shadow classification on the detection area through a shadow classifier, and when it is classified as a detection area having a shadow feature, determining that a floating phenomenon exists in the target feature according to the shadow feature.
[0067] In the embodiment of the present invention, the device further includes: a determination module 704, which is used to determine the height feature of the target feature according to the shadow feature when the detection image is classified as having a shadow feature.
[0068] In an embodiment of the present invention, the detection image includes multiple detection images in different directions; accordingly, the device also includes: an acquisition module 705, which is used to obtain the height features of the target features in each detection image; an integration module 706, which is used to integrate all the height features and determine the height information and offset information corresponding to the target features.
[0069] In an embodiment of the present invention, the acquisition module 702 is also used to acquire images of the detection samples through an image acquisition device to obtain multiple detection image samples; the detection image samples include image samples with shadows and image samples without shadows; the device also includes: a training module 707, which is used to train the neural network through image samples to obtain a shadow classifier, and the shadow classifier is used to classify shadows in the detection images.
[0070] In an embodiment of the present invention, the training module 707 includes: a labeling submodule 7071, which is used to perform feature labeling on image samples to obtain labeled feature samples; a training submodule 7072, which is used to train a neural network through the labeled feature samples to obtain a shadow classifier; wherein the labeled features include at least one of the following features: shadow information, detection area, shadow length and target feature.
[0071] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments or examples described in this specification and the features of different embodiments or examples, unless they are contradictory.
[0072] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0073] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A feature detection method, characterized in that: The method comprises: When the designated product is located at the designated position, the designated product is illuminated by a light source device along a first designated angle; wherein the first designated angle is an angle that is not perpendicular to the designated product, and the designated product includes a target feature; Capturing the image of the designated product through an image acquisition device to obtain a detection image; Classifying the shadows of the inspection image by a shadow classifier, and determining that the designated product has a floating phenomenon when it is classified as having shadow features in the inspection image; The method further comprises: When the detection image is classified as having a shadow feature, determining the height feature of the target feature according to the shadow feature; The detection image includes a plurality of detection images in different directions; Accordingly, the method further includes: Obtaining the height features of the target features in each detection image; All height features are integrated to determine the height information and offset information corresponding to the target feature.
2. The method according to claim 1, characterized in that The step of acquiring an image of the designated product by an image acquisition device to obtain a detection image includes: The designated product is captured by the image capture device to obtain a first captured image; wherein the designated product and the light source device are relatively rotated along a first designated angle; The first detection image is processed by screenshot according to a preset frequency to obtain a detection image.
3. The method according to claim 1 or 2, characterized in that: The step of acquiring an image of the designated product by an image acquisition device to obtain a detection image includes: Controlling the image acquisition device to move along a preset path relative to the designated product, and during the movement of the image acquisition device, acquiring images of the designated product to obtain a plurality of second acquired images; The plurality of second collected images are screened according to a preset shadow index, and a second collected image that meets the preset shadow index is determined as a detection image.
4. The method according to claim 1, characterized in that: The shadow classification of the detection image by a shadow classifier, and when the detection image is classified as having shadow features, determining that the designated product has a floating phenomenon, includes: Determine a detection area on the detection image according to the target feature; The shadow classifier is used to classify the shadows of the detection area. When it is classified that the detection area has shadow features, it is determined that the target feature has a floating phenomenon according to the shadow features.
5. The method according to claim 1, characterized in that: The method further comprises: The image acquisition device acquires images of the detection sample to obtain a plurality of detection image samples; the detection image samples include image samples with shadows and image samples without shadows; The neural network is trained through image samples to obtain a shadow classifier, which is used to classify shadows in the detection image.
6. The method according to claim 5, characterized in that The method of training a neural network through image samples to obtain a shadow classifier includes: Performing feature annotation on the image sample to obtain an annotated feature sample; The neural network is trained by using the labeled feature samples to obtain a shadow classifier; The annotation feature includes at least one of the following features: shadow information, detection area, shadow length and target feature.
7. A feature detection device, characterized in that: The device comprises: An irradiation module, used for irradiating the designated product along a first designated angle through a light source device when the designated product is located at a designated position; wherein the first designated angle is an angle that is not perpendicular to the designated product, and the designated product includes a target feature; An acquisition module is used to acquire an image of the designated product through an image acquisition device to obtain a detection image; A classification module, used for performing shadow classification on the detection image through a shadow classifier, and determining that the designated product has a floating phenomenon when it is classified as having shadow features in the detection image; The device also includes: A determination module, configured to determine a height feature of the target feature according to the shadow feature when the detection image is classified as having a shadow feature; The detection image includes a plurality of detection images in different directions; Accordingly, the device also includes: An acquisition module, used for acquiring a height feature of the target feature in each detection image; The integration module is used to integrate all height features and determine the height information and offset information corresponding to the target feature.
8. The device according to claim 7, characterized in that The acquisition module comprises: A collection submodule, used for collecting the designated product through the image collection device to obtain a first collected image; wherein the designated product and the light source device rotate relative to each other along a first designated angle; The screenshot submodule is used to perform screenshot processing on the first detection image according to a preset frequency to obtain a detection image.
Citation Information
Patent Citations
Fuzzy self-optimization debugging method of automation equipment based on cloud platform
CN106681143A