CN109101982B - Target object identification method and device - Google Patents

Target object identification method and device Download PDF

Info

Publication number
CN109101982B
CN109101982B CN201810835895.9A CN201810835895A CN109101982B CN 109101982 B CN109101982 B CN 109101982B CN 201810835895 A CN201810835895 A CN 201810835895A CN 109101982 B CN109101982 B CN 109101982B
Authority
CN
China
Prior art keywords
edge point
image
identification
target object
similarity
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810835895.9A
Other languages
Chinese (zh)
Other versions
CN109101982A (en
Inventor
杨智慧
覃道赞
宋明岑
张天翼
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Gree Electric Appliances Inc of Zhuhai
Zhuhai Gree Intelligent Equipment Co Ltd
Original Assignee
Gree Electric Appliances Inc of Zhuhai
Zhuhai Gree Intelligent Equipment Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Gree Electric Appliances Inc of Zhuhai, Zhuhai Gree Intelligent Equipment Co Ltd filed Critical Gree Electric Appliances Inc of Zhuhai
Priority to CN201810835895.9A priority Critical patent/CN109101982B/en
Publication of CN109101982A publication Critical patent/CN109101982A/en
Application granted granted Critical
Publication of CN109101982B publication Critical patent/CN109101982B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Artificial Intelligence (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses a target object identification method and a target object identification device. Wherein, the method comprises the following steps: acquiring a direction vector of each first edge point in a first identification area in a sample image, wherein the first identification area comprises a target object; acquiring a direction vector of each second edge point in a second identification area in the image to be identified; obtaining the similarity measurement of each second edge point according to the direction vector of each second edge point and the direction vectors of all the first edge points in the first identification area; and obtaining an identification result of the image to be identified based on the similarity measurement of each second edge point, wherein the identification result is used for representing whether the image to be identified contains the target object. The invention solves the technical problems of low identification accuracy and low efficiency caused by the influence of ambient illumination on the identification method of the target object in the prior art.

Description

Target object identification method and device
Technical Field
The invention relates to the field of image recognition, in particular to a target object recognition method and device.
Background
The introduction of machine vision enables some works to be stable, reliable and efficient and more intelligent at the same time, overcomes the defects of manual operation and enables workers to break away from boring and single work. In practice, however, machine vision tends to produce erratic results for a variety of reasons. For example, in actual production, the environment is difficult to reach an ideal state, and a large amount of illumination changes have a large influence on image processing. In addition, due to the fact that the standard of the recognized object is not high, the recognized object is uneven, various interferences are generated, and the recognition rate is influenced. Under the condition, a more complex image processing method is often adopted, the processing speed is greatly reduced, and certain stations with high requirements on efficiency are difficult to meet. In the assembly process of the four-way valve, the front surface and the back surface of the reinforcing plate need to be distinguished, and the front surface of the reinforcing plate is provided with a stamped L-shaped mark. However, the surface of the reinforcing plate can be scratched due to the manufacturing process of the reinforcing plate, so that the identification of the mark is interfered, and in addition, due to the limitation of the station space, the environmental light cannot be shielded, and the change of the environmental illumination greatly reduces the identification rate.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides a target object identification method and a target object identification device, which are used for at least solving the technical problems of low identification accuracy and low efficiency caused by the influence of ambient illumination on a target object identification method in the prior art.
According to an aspect of the embodiments of the present invention, there is provided a target object identification method, including: acquiring a direction vector of each first edge point in a first identification area in a sample image, wherein the first identification area comprises a target object; acquiring a direction vector of each second edge point in a second identification area in the image to be identified; obtaining the similarity measurement of each second edge point according to the direction vector of each second edge point and the direction vectors of all the first edge points in the first identification area; and obtaining an identification result of the image to be identified based on the similarity measurement of each second edge point, wherein the identification result is used for representing whether the image to be identified contains the target object.
According to another aspect of the embodiments of the present invention, there is also provided an apparatus for identifying a target object, including: the first acquisition module is used for acquiring a direction vector of each first edge point in a first identification area in a sample image, wherein the first identification area comprises a target object; the second acquisition module is used for acquiring the direction vector of each second edge point in a second identification area in the image to be identified; the first processing module is used for obtaining the similarity measurement of each second edge point according to the direction vector of each second edge point and the direction vectors of all the first edge points in the first identification area; and the second processing module is used for obtaining the recognition result of the image to be recognized based on the similarity measurement of each second edge point, wherein the recognition result is used for representing whether the image to be recognized contains the target object or not.
According to another aspect of the embodiments of the present invention, there is also provided a storage medium including a stored program, wherein when the program runs, a device on which the storage medium is located is controlled to execute the above-mentioned target object identification method.
According to another aspect of the embodiments of the present invention, there is also provided a processor, configured to execute a program, where the program executes the method for identifying a target object.
In the embodiment of the invention, the direction vector of each first edge point in the first identification area in the sample image is obtained, the direction vector of each second edge point in the second identification area in the image to be identified is obtained at the same time, and the similarity measurement of each second edge point is further obtained according to the direction vector of each second edge point and the direction vectors of all the first edge points in the first identification area, so that the identification result of the image to be identified can be obtained according to the similarity measurement. Compared with the prior art, the method has the advantages that the direction vector of the first edge point is obtained from the first identification area, the direction vector of the second edge point is obtained from the second identification area, the similarity measurement of each second edge point is obtained according to the direction vector of each second edge point and the direction vectors of all the first edge points in the first identification area, the influences of shielding, chaos and nonlinear illumination change are avoided, the technical effects of improving the identification rate and the identification speed and enabling the visual system to have robustness are achieved, and the technical problems that the identification accuracy is low and the efficiency is low due to the influences of environmental illumination on the identification method of the target object in the prior art are solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
fig. 1 is a flowchart of a target object identification method according to an embodiment of the present invention; and
fig. 2 is a schematic diagram of a target object recognition apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
In accordance with an embodiment of the present invention, there is provided an embodiment of a method for identifying a target object, it should be noted that the steps illustrated in the flowchart of the drawings may be performed in a computer system such as a set of computer executable instructions, and that while a logical order is illustrated in the flowchart, in some cases the steps illustrated or described may be performed in an order different than here.
Fig. 1 is a flowchart of a target object identification method according to an embodiment of the present invention, as shown in fig. 1, the method includes the following steps:
step S102, obtaining a direction vector of each first edge point in a first identification area in a sample image, wherein the first identification area comprises a target object.
Specifically, the sample image may be a reinforcing plate image, and the target object may be an "L" mark on the front surface of the reinforcing plate. For the sample image, the target object can be marked in the sample image in a manual labeling mode. The discrimination of the front and back sides of the reinforcement is achieved by identifying whether the image contains an "L" mark, and therefore, only the front side image of the reinforcement may be taken as a sample image.
In order to avoid performing subsequent processing on the whole sample image and improve the recognition efficiency, the first recognition area can be determined in advance according to the position of the L mark in the front face of the reinforcement, the sample image is cut, and the area where the L mark is located can be obtained. For the image to be recognized, if the 'L' mark can be recognized in the corresponding area, the image can be determined as the front image of the reinforcing part, and further the front of the reinforcing part can be determined; if the "L" mark is not recognized in the corresponding region, the image can be determined as a stiffener reverse image, and further, the stiffener reverse can be determined.
In an alternative scheme, for the sample image, a region of interest containing the "L" identifier may be extracted from the sample image, and then a direction vector of each first edge point is obtained through an edge filter. At the moment of acquisitionAfter the direction vector of each first edge point, the template can be represented as a set of points pi=(ri+ci)TAnd each point direction vector di=(ti+ui)T,i=1,...,n。
And step S104, acquiring the direction vector of each second edge point in the second identification area in the image to be identified.
Specifically, the image to be recognized may be an image of the reinforcement member captured by the capturing device, and may be a front side or a back side. In order to improve the recognition efficiency, the second recognition area may be determined according to the first recognition area, and the second recognition area may be the same as the first recognition area or may be adjusted according to the recognition result.
In an alternative scheme, for the image to be identified, in order to ensure that the similarity measure is not affected by occlusion and confusion in the subsequent processing process, the image may be filtered by using an edge filter that is the same as the template, so as to obtain a direction vector e of the second edge pointr,c=(vr,c,wr,c)T
And step S106, obtaining the similarity measurement of each second edge point according to the direction vector of each second edge point and the direction vectors of all the first edge points in the first identification area.
Specifically, the similarity measure is used to characterize the percentage of coincidence between the image to be recognized and the sample image, e.g., if "L" in the image to be recognized indicates 50% occlusion, the similarity measure will not exceed 0.5. The larger the similarity measure is, the higher the goodness of fit is indicated, so that it can be determined that the more likely the "L" mark is included in the image to be recognized.
It should be noted that, the existing similarity measure method is to calculate the Sum of Absolute Differences (SAD) or the sum of squares of all differences (SSD) between the sample image and the image to be recognized, and another NCC. The former two schemes can be used only under the condition that the illumination condition is not changed, and the last scheme can only be suitable for linear illumination change and cannot be shielded, disordered and nonlinear illumination change.
To solve the above problemsIn the present invention, a method is used in which an arbitrary point q in an image to be recognized is (r, c)TAnd calculating the dot product of the direction vectors of all the first edge points in the template and the direction vectors of the corresponding points, and obtaining the similarity measure s of the points after calculating the average value. Because the direction vector is influenced by the image brightness, the similarity measure s' can be obtained by calculation according to the normalized direction vector. Further, in order to adapt to the non-linear illumination variation, the similarity measure s' may be taken as an absolute value, resulting in the similarity measure s ″ that is finally used to determine the recognition result.
And S108, obtaining an identification result of the image to be identified based on the similarity measurement of each second edge point, wherein the identification result is used for representing whether the image to be identified contains the target object.
Specifically, in order to obtain a final recognition result, the similarity measure of all the second edge points in the image to be recognized may be compared with a threshold, and when the similarity measure exceeds the threshold, it may be determined that the image to be recognized is consistent with the sample image, and the image to be recognized includes an "L" identifier, that is, the image to be recognized is a front image of the reinforcement. If all the similarity measures do not exceed the threshold value, the image to be recognized is determined to be inconsistent with the sample image, and the image to be recognized does not contain the L mark, namely, the image to be recognized is the reverse image of the reinforcing piece.
By adopting the embodiment of the invention, the direction vector of each first edge point in the first identification area in the sample image is obtained, the direction vector of each second edge point in the second identification area in the image to be identified is simultaneously obtained, and the similarity measurement of each second edge point is further obtained according to the direction vector of each second edge point and the direction vectors of all the first edge points in the first identification area, so that the identification result of the image to be identified can be obtained according to the similarity measurement. Compared with the prior art, the method has the advantages that the direction vector of the first edge point is obtained from the first identification area, the direction vector of the second edge point is obtained from the second identification area, the similarity measurement of each second edge point is obtained according to the direction vector of each second edge point and the direction vectors of all the first edge points in the first identification area, the influences of shielding, chaos and nonlinear illumination change are avoided, the technical effects of improving the identification rate and the identification speed and enabling the visual system to have robustness are achieved, and the technical problems that the identification accuracy is low and the efficiency is low due to the influences of environmental illumination on the identification method of the target object in the prior art are solved.
Optionally, in the foregoing embodiment of the present invention, before obtaining the similarity measure of each second edge point according to the direction vector of each second edge point and the direction vectors of all the first edge points in the first identification area in step S106, the method further includes: carrying out translation transformation on the direction vector of each first edge point to obtain a transformed vector of each first edge point; and obtaining the similarity measurement of each second edge point according to the direction vector of each second edge point and the transformed vector of each first edge point.
Specifically, the template may be affine transformed, and the transformation is moved along all points in the image to be recognized, that is, the direction vector of the first edge point is subjected to translation transformation, and then the transformed template is compared with the image to be recognized, and the similarity measure is calculated at the position of each edge point. The translation transformation described above may be implemented by multiplication of a translation matrix with a direction vector.
Optionally, in the foregoing embodiment of the present invention, obtaining the similarity measure of each second edge point according to the direction vector of each second edge point and the transformed vector of each first edge point includes: acquiring a dot product of the direction vector of each second edge point and the transformed vector of each first edge point; and obtaining the average value of the dot product of the direction vector of each second edge point and the transformed vectors of all the first edge points in the first identification area to obtain the similarity measurement of each second edge point.
Specifically, for any point in the image to be recognized, q ═ r (r, c)TThe dot product of the direction vectors of all the first edge points in the transformed template and the direction vectors of the corresponding points in the image to be recognized can be calculated, and then the average value is calculated to be used as the similarity measure s of the transformed template at the point. PublicThe formula is as follows:
Figure BDA0001744544610000051
wherein n is the number of first edge points, d'iTransformed vector for the ith first edge point, eq+p′Is the direction vector of the point.
Optionally, in the foregoing embodiment of the present invention, before obtaining a dot product of the direction vector of each second edge point and the transformed vector of each first edge point, the method further includes: normalizing the direction vector of each second edge point and the transformed vector of each first edge point to obtain a normalized vector of each second edge point and a normalized vector of each first edge point; and acquiring the dot product of the normalized vector of each second edge point and the normalized vector of each first edge point.
Specifically, since the acquired direction vector is affected by the image brightness, the similarity measure s cannot be completely unaffected by the illumination change, and to improve this, the direction vector may be normalized, and a new similarity measure s' may be calculated as follows:
Figure BDA0001744544610000061
where | represents the modulus of the vector.
Optionally, in the foregoing embodiment of the present invention, obtaining an average value of dot products of the direction vector of each second edge point and the transformed vectors of all the first edge points in the first identification area to obtain the similarity metric of each second edge point includes: acquiring an average value of dot products of the normalized vector of each second edge point and the normalized vector of each first edge point to obtain an initial similarity measure of each second edge point; and obtaining the absolute value of the initial similarity measurement of each second edge point to obtain the similarity measurement of each second edge point.
Specifically, in order to adapt to the nonlinear illumination change, the final similarity measure s ″ is obtained by taking the absolute value of the previously calculated similarity measure s', and meanwhile, the influence of occlusion and confusion is avoided. The formula is as follows:
Figure BDA0001744544610000062
where, | represents an absolute value.
It should be noted that the similarity measure s "is a value smaller than 1, and is used to indicate the percentage of coincidence between the sample image and the image to be recognized, and s" ═ 1 indicates that the template and the image are completely coincident, and conversely, the closer to 0 indicates that the two are inconsistent.
Optionally, in the foregoing embodiment of the present invention, in step S108, obtaining a recognition result of the image to be recognized based on the similarity measure of each second edge point, where the step includes: judging whether a second edge point with the similarity measurement larger than or equal to a preset threshold value exists in the second identification area; if a second edge point with the similarity measurement larger than or equal to a preset threshold exists in the second identification area, judging whether the similarity measurement of the second edge point is a local maximum value in the preset area or not, wherein the second edge point is a central point of the preset area, and the local maximum value is used for representing that the similarity measurement of the second edge point is larger than the similarity measurement of other second edge points in the preset area; if the similarity measure of the second edge point is a local maximum value in the preset area, determining that the recognition result is that the image to be recognized contains the target object; and if the second edge point with the similarity metric larger than or equal to the preset threshold value does not exist in the second identification area, or the similarity metric of the second edge point is not the local maximum value in the preset area, determining that the identification result is that the target object is not contained in the image to be identified.
Specifically, the preset threshold may be a threshold s ″' preset according to experiments to determine whether the image to be recognized and the sample image are consistent with each othermin
In an alternative arrangement, the similarity measure s "for each second edge point in the second identified region may be calculated sequentially, and then each similarity measure s" may be compared to a threshold s ″minComparing, and obtaining s 'is greater than s' when a certain second marginal point position in the image to be identifiedminMeanwhile, if the similarity measure s ' is also a local maximum value, the identification of the ' L ' can be determined, namely the image to be identified contains the ' L ' identification, and the identification is the front image of the reinforcement; if the positions of all the second edge points in the image to be recognized are not obtained, s '> s'minOr not, determining that the "L" mark is not recognized, that is, determining that the image to be recognized does not contain the "L" mark, and is a reverse image of the stiffener.
Optionally, in the foregoing embodiment of the present invention, after acquiring, in step S104, a direction vector of each second edge point in the second identification area in the image to be identified, the method further includes: obtaining the similarity measurement of any one second edge point according to the direction vector of any one second edge point in the second identification area and the direction vectors of all the first edge points in the first identification area; judging whether the similarity measurement of any one second edge point is greater than or equal to a preset threshold value; if the similarity of any one second edge point is greater than or equal to a preset threshold value, judging whether the similarity of any one second edge point is a local maximum value in a preset area; if the similarity measure of any one second edge point is smaller than the preset threshold value or the similarity measure of any one second edge point is not the local maximum value in the preset area, taking the next second edge point as any one second edge point, and returning to execute the step of obtaining the similarity measure of any one second edge point according to the direction vector of any one second edge point and the direction vectors of all the first edge points in the first identification area until the next second edge point is the last second edge point in the second identification area; if the similarity measure of any one second edge point is a local maximum value in a preset area, determining that the recognition result is that the image to be recognized contains the target object; and if the similarity measure of the last second edge point is smaller than the preset threshold value or the similarity measure of the last second edge point is not the local maximum value in the preset area, determining that the recognition result is that the target object is not contained in the image to be recognized.
Specifically, since the calculation amount of the similarity measure is huge, in order to increase the recognition speed, the similarity measures from the first second edge point to the jth second edge point may be calculated in sequence
Figure BDA0001744544610000071
If so, s is calculatedj>s″minWhile the similarity measure sjIf the local maximum value is also the local maximum value, the similarity measurement of all the second edge points after calculation can be stopped, and the L mark is determined to be recognized, namely the L mark is determined to be contained in the image to be recognized and is the front image of the reinforcement; if the similarity measure does not satisfy sj>s″minOr not the local maximum, the similarity measure of the next second edge point may be calculated, and if the calculated similarity measure of the last second edge point does not satisfy sj>s″minOr not, determining that the "L" mark is not recognized, that is, determining that the image to be recognized does not contain the "L" mark, and is a reverse image of the stiffener.
Optionally, in the embodiment of the present invention, the image to be recognized is any layer of image in an image pyramid constructed based on the original image, where resolution of each layer of image in the image pyramid is different, a second recognition area corresponding to each layer of image is different, and a preset threshold corresponding to each layer of image is different.
Specifically, the original image may be an image obtained by photographing the reinforcement, and in order to efficiently search for the target object, an image pyramid may be created for the original image. And acquiring the direction vector of the second edge pixel point in each layer of image of the image pyramid. The above-mentioned identification process can be performed on each layer of image of the image pyramid, and therefore, each layer of image of the image pyramid can be processed as an image to be identified. Due to the fact that the resolution ratios of the images in different layers are different, in order to ensure the recognition rate, the second recognition area extracted from each layer of image is different, and the preset threshold values of the obtained recognition results are also different.
Optionally, in the foregoing embodiment of the present invention, in step S108, after obtaining the recognition result of the image to be recognized based on the similarity measure of each second edge point, the method further includes: when the recognition result of any layer of image is that the image to be recognized contains the target object, taking the next layer of image as the image to be recognized, obtaining a second processed area corresponding to the next layer of image according to the position of the target object, returning to execute the acquisition of the direction vector of each second edge point in the second recognition area in the image to be recognized, and obtaining the recognition result of the next layer of image until the image to be recognized is the last layer of image in the image pyramid; determining that the original image contains the target object under the condition that the identification result of the last layer of image is that any layer of image contains the target object; and determining that the original image does not contain the target object under the condition that the identification result of the image of any layer is that the image of any layer does not contain the target object.
In an alternative, the threshold s "may be in a higher level, since the higher the level in the image pyramid, the lower the resolution, and thus the threshold s ″, may be in a higher levelminSet lower, a second identified region for the next layer may be determined based on the location of the "L" representation searched in the higher level image, and then a similarity measure may be calculated in that region. Looping on in turn until the "L" representation is not searched, or the lowest level of the image pyramid is reached. So that the accurate 'L' identification can be searched efficiently.
Optionally, in the foregoing embodiment of the present invention, in step S102, acquiring a direction vector of each first edge point in the first identification area in the sample image, where the acquiring includes: filtering the first identification area by using an edge filter to obtain a direction vector of each first edge point, wherein the threshold segmentation processing is not performed in the process of filtering the first identification area; step S104, obtaining a direction vector of each second edge point in a second identification area in the image to be identified, including: and filtering the second identification area by using an edge filter to obtain the direction vector of each second edge point.
Specifically, since the threshold value division is greatly affected by the illumination, when the edge filtering process is performed on the first recognition area extracted from the sample image, only the direction vector of each first edge point is acquired without performing the threshold value division. Similarly, when the edge filtering processing is performed on the second recognition area extracted from the image to be recognized, only the direction vector of each second edge point is acquired without performing threshold segmentation.
Through the scheme, the quick and stable image processing method is provided, and under the conditions that scratches (chaos) exist on the surface of the reinforcing plate, the identification is not clear, and the environmental illumination change is large, the L-shaped identification on the reinforcing plate is quickly and stably searched, so that the front side and the back side of the reinforcing plate are identified, the identification rate is improved, the identification speed is accelerated, and the visual system has robustness.
Example 2
According to an embodiment of the present invention, an embodiment of an apparatus for identifying a target object is provided.
Fig. 2 is a schematic diagram of an apparatus for identifying a target object according to an embodiment of the present invention, as shown in fig. 2, the apparatus including:
the first obtaining module 22 is configured to obtain a direction vector of each first edge point in a first recognition area in the sample image, where the first recognition area includes the target object.
Specifically, the sample image may be a reinforcing plate image, and the target object may be an "L" mark on the front surface of the reinforcing plate. For the sample image, the target object can be marked in the sample image in a manual labeling mode. The discrimination of the front and back sides of the reinforcement is achieved by identifying whether the image contains an "L" mark, and therefore, only the front side image of the reinforcement may be taken as a sample image.
In order to avoid performing subsequent processing on the whole sample image and improve the recognition efficiency, the first recognition area can be determined in advance according to the position of the L mark in the front face of the reinforcement, the sample image is cut, and the area where the L mark is located can be obtained. For the image to be recognized, if the 'L' mark can be recognized in the corresponding area, the image can be determined as the front image of the reinforcing part, and further the front of the reinforcing part can be determined; if the "L" mark is not recognized in the corresponding region, the image can be determined as a stiffener reverse image, and further, the stiffener reverse can be determined.
In an alternative scheme, for the sample image, a region of interest containing the "L" identifier may be extracted from the sample image, and then a direction vector of each first edge point is obtained through an edge filter. After obtaining the direction vector for each first edge point, the template may be represented as a set of points pi=(ri+ci)TAnd each point direction vector di=(ti+ui)T,i=1,...,n。
And the second obtaining module 24 is configured to obtain a direction vector of each second edge point in the second identification area in the image to be identified.
Specifically, the image to be recognized may be an image of the reinforcement member captured by the capturing device, and may be a front side or a back side. In order to improve the recognition efficiency, the second recognition area may be determined according to the first recognition area, and the second recognition area may be the same as the first recognition area or may be adjusted according to the recognition result.
In an alternative scheme, for the image to be identified, in order to ensure that the similarity measure is not affected by occlusion and confusion in the subsequent processing process, the image may be filtered by using an edge filter that is the same as the template, so as to obtain a direction vector e of the second edge pointr,c=(vr,c,wr,c)T
The first processing module 26 is configured to obtain a similarity measure of each second edge point according to the direction vector of each second edge point and the direction vectors of all the first edge points in the first identification area.
Specifically, the similarity measure is used to characterize the percentage of coincidence between the image to be recognized and the sample image, e.g., if "L" in the image to be recognized indicates 50% occlusion, the similarity measure will not exceed 0.5. The larger the similarity measure is, the higher the goodness of fit is indicated, so that it can be determined that the more likely the "L" mark is included in the image to be recognized.
It should be noted that, the existing similarity measure method is to calculate the Sum of Absolute Differences (SAD) or the sum of squares of all differences (SSD) between the sample image and the image to be recognized, and another NCC. The former two schemes can be used only under the condition that the illumination condition is not changed, and the last scheme can only be suitable for linear illumination change and cannot be shielded, disordered and nonlinear illumination change.
In order to solve the above problem, the present invention adopts a method in which an arbitrary point q in an image to be recognized is (r, c)TAnd calculating the dot product of the direction vectors of all the first edge points in the template and the direction vectors of the corresponding points, and obtaining the similarity measure s of the points after calculating the average value. Because the direction vector is influenced by the image brightness, the similarity measure s' can be obtained by calculation according to the normalized direction vector. Further, in order to accommodate non-linear illumination variations, the similarity measure s' may be taken in absolute terms, resulting in the similarity measure s ″ that is ultimately used to determine the recognition result.
And a second processing module 28, configured to obtain a recognition result of the image to be recognized based on the similarity metric of each second edge point, where the recognition result is used to characterize whether the image to be recognized includes the target object.
Specifically, in order to obtain a final recognition result, the similarity measure of all the second edge points in the image to be recognized may be compared with a threshold, and when the similarity measure exceeds the threshold, it may be determined that the image to be recognized is consistent with the sample image, and the image to be recognized includes an "L" identifier, that is, the image to be recognized is a front image of the reinforcement. If all the similarity measures do not exceed the threshold value, the image to be recognized is determined to be inconsistent with the sample image, and the image to be recognized does not contain the L mark, namely, the image to be recognized is the reverse image of the reinforcing piece.
By adopting the embodiment of the invention, the direction vector of each first edge point in the first identification area in the sample image is obtained, the direction vector of each second edge point in the second identification area in the image to be identified is simultaneously obtained, and the similarity measurement of each second edge point is further obtained according to the direction vector of each second edge point and the direction vectors of all the first edge points in the first identification area, so that the identification result of the image to be identified can be obtained according to the similarity measurement. Compared with the prior art, the method has the advantages that the direction vector of the first edge point is obtained from the first identification area, the direction vector of the second edge point is obtained from the second identification area, the similarity measurement of each second edge point is obtained according to the direction vector of each second edge point and the direction vectors of all the first edge points in the first identification area, the influences of shielding, chaos and nonlinear illumination change are avoided, the technical effects of improving the identification rate and the identification speed and enabling the visual system to have robustness are achieved, and the technical problems that the identification accuracy is low and the efficiency is low due to the influences of environmental illumination on the identification method of the target object in the prior art are solved.
Example 3
According to an embodiment of the present invention, an embodiment of a storage medium is provided, the storage medium including a stored program, wherein when the program runs, a device on which the storage medium is located is controlled to execute the method for identifying a target object in the above-described embodiment 1.
Example 4
According to an embodiment of the present invention, an embodiment of a processor for running a program is provided, where the program executes the method for identifying a target object in embodiment 1.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units may be a logical division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (12)

1. A method for identifying a target object, comprising:
acquiring a direction vector of each first edge point in a template, wherein the template is a first identification area extracted from a sample image, and the template comprises a target object;
acquiring a direction vector of each second edge point in a second identification area in the image to be identified;
obtaining a similarity measure of the image to be recognized according to the direction vector of each first edge point and the direction vector of the corresponding second edge point, wherein the similarity measure is used for representing the similarity between the image to be recognized and the template;
obtaining an identification result of the image to be identified based on the similarity measurement of the image to be identified, wherein the identification result is used for representing whether the image to be identified contains the target object or not,
obtaining the recognition result of the image to be recognized based on the similarity measurement of the image to be recognized, wherein the obtaining of the recognition result of the image to be recognized comprises the following steps:
judging whether a second edge point with the similarity measurement larger than or equal to a preset threshold value exists in the second identification area;
if a second edge point with the similarity metric larger than or equal to the preset threshold exists in the second identification area, judging whether the similarity metric of the second edge point is a local maximum value in a preset area, wherein the second edge point is a central point of the preset area, and the local maximum value is used for representing that the similarity metric of the second edge point is larger than the similarity metrics of other second edge points in the preset area;
if the similarity measure of the second edge point is a local maximum value in the preset area, determining that the identification result is that the target object is included in the image to be identified;
if a second edge point with the similarity metric larger than or equal to the preset threshold value does not exist in the second identification area, or the similarity metric of the second edge point is not a local maximum value in the preset area, determining that the identification result is that the target object is not contained in the image to be identified.
2. The method according to claim 1, wherein before deriving the similarity measure of the image to be recognized according to the direction vector of each first edge point and the direction vector of the corresponding second edge point, the method further comprises:
performing translation transformation on the direction vector of each first edge point to obtain a transformed vector of each first edge point;
and obtaining the similarity measurement according to the transformed vector of each first edge point and the direction vector of the corresponding second edge point.
3. The method of claim 2, wherein deriving the similarity measure according to the transformed vector of each first edge point and the direction vector of the corresponding second edge point comprises:
acquiring a dot product of the transformed vector of each first edge point and a direction vector of a corresponding second edge point to obtain a dot product corresponding to each first edge point;
and obtaining the average value of the dot products corresponding to all the first edge points in the template to obtain the similarity measurement.
4. The method according to claim 3, wherein before obtaining the dot product of the normalized vectors of the corresponding second edge points to obtain the dot product corresponding to each first edge point, the method further comprises:
normalizing the transformed vector of each first edge point, and normalizing the direction vector of the corresponding second edge point to obtain a normalized vector of each first edge point and a normalized vector of the corresponding second edge point;
and acquiring the dot product of the normalized vector of each first edge point and the normalized vector of the corresponding second edge point to obtain the dot product corresponding to each first edge point.
5. The method of claim 4, wherein obtaining an average of dot products corresponding to all first edge points in the template to obtain the similarity measure comprises:
acquiring an absolute value of a dot product corresponding to each first edge point to obtain an absolute value corresponding to each first edge point;
and obtaining an average value of the absolute values corresponding to each first edge point to obtain the similarity measure.
6. The method according to claim 1, wherein after obtaining the direction vector of each second edge point in the second recognition area in the image to be recognized, the method further comprises:
obtaining the similarity measurement of any one second edge point according to the direction vector of any one second edge point in the second identification area and the direction vectors of all first edge points in the first identification area;
judging whether the similarity measurement of any one second edge point is greater than or equal to a preset threshold value or not;
if the similarity of any one second edge point is greater than or equal to the preset threshold, judging whether the similarity of any one second edge point is a local maximum value in a preset area;
if the similarity measure of any one second edge point is smaller than the preset threshold value or the similarity measure of any one second edge point is not the local maximum value in the preset area, taking the next second edge point as the any one second edge point, and returning to the step of obtaining the similarity measure of any one second edge point according to the direction vector of any one second edge point and the direction vectors of all first edge points in the first identification area until the next second edge point is the last second edge point in the second identification area;
if the similarity measure of any one second edge point is a local maximum value in the preset area, determining that the identification result is that the image to be identified comprises the target object;
and if the similarity measure of the last second edge point is smaller than the preset threshold value or the similarity measure of the last second edge point is not the local maximum value in the preset area, determining that the target object is not contained in the image to be recognized as the recognition result.
7. The method according to claim 1, wherein the image to be identified is any layer of image in an image pyramid constructed based on an original image, wherein the resolution of each layer of image in the image pyramid is different, the second identification area corresponding to each layer of image is different, and the preset threshold value corresponding to each layer of image is different.
8. The method according to claim 7, wherein after obtaining the recognition result of the image to be recognized based on the similarity measure of each second edge point, the method further comprises:
when the recognition result of any layer of image is that the image to be recognized contains the target object, taking the next layer of image as the image to be recognized, obtaining a second processed area corresponding to the next layer of image according to the position of the target object, and returning to execute the acquisition of the direction vector of each second edge point in the second recognition area in the image to be recognized to obtain the recognition result of the next layer of image until the image to be recognized is the last layer of image in the image pyramid;
determining that the original image contains the target object under the condition that the identification result of the last layer of image is that the target object is contained in the image of any layer;
and determining that the original image does not contain the target object under the condition that the identification result of the image of any layer is that the image of any layer does not contain the target object.
9. The method of claim 1,
acquiring a direction vector of each first edge point in a first identification area in a sample image, wherein the direction vector comprises the following steps: filtering the first identification area by using an edge filter to obtain a direction vector of each first edge point, wherein in the process of filtering the first identification area, threshold segmentation processing is not performed;
acquiring a direction vector of each second edge point in a second identification area in the image to be identified, wherein the method comprises the following steps: and filtering the second identification area by using the edge filter to obtain the direction vector of each second edge point.
10. An apparatus for identifying a target object, comprising:
the device comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a direction vector of each first edge point in a first identification area in a sample image, and the first identification area contains a target object;
the second acquisition module is used for acquiring the direction vector of each second edge point in a second identification area in the image to be identified;
a first processing module, configured to obtain a similarity measure of each second edge point according to the direction vector of each second edge point and the direction vectors of all first edge points in the first identification area;
a second processing module, configured to obtain an identification result of the image to be identified based on the similarity metric of each second edge point, where the identification result is used to characterize whether the image to be identified includes the target object,
the second processing module is further configured to determine whether a second edge point with a similarity metric greater than or equal to a preset threshold is located in the second identification area; the second processing module is further configured to, if a second edge point with a similarity metric greater than or equal to the preset threshold exists in the second identification region, determine whether the similarity metric of the second edge point is a local maximum value in a preset region, where the second edge point is a central point of the preset region, and the local maximum value is used for representing that the similarity metric of the second edge point is greater than the similarity metrics of other second edge points in the preset region; the second processing module is further configured to determine that the identification result is that the target object is included in the image to be identified if the similarity measure of the second edge point is a local maximum value in the preset region; the second processing module is further configured to determine that the identification result is that the target object is not included in the image to be identified if a second edge point with a similarity metric greater than or equal to the preset threshold does not exist in the second identification region, or the similarity metric of the second edge point is not a local maximum value in the preset region.
11. A storage medium, characterized in that the storage medium comprises a stored program, wherein when the program runs, a device in which the storage medium is located is controlled to execute the identification method of the target object according to any one of claims 1 to 9.
12. A processor, configured to execute a program, wherein the program executes the method for identifying a target object according to any one of claims 1 to 9.
CN201810835895.9A 2018-07-26 2018-07-26 Target object identification method and device Active CN109101982B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810835895.9A CN109101982B (en) 2018-07-26 2018-07-26 Target object identification method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810835895.9A CN109101982B (en) 2018-07-26 2018-07-26 Target object identification method and device

Publications (2)

Publication Number Publication Date
CN109101982A CN109101982A (en) 2018-12-28
CN109101982B true CN109101982B (en) 2022-02-25

Family

ID=64847715

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810835895.9A Active CN109101982B (en) 2018-07-26 2018-07-26 Target object identification method and device

Country Status (1)

Country Link
CN (1) CN109101982B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105261012A (en) * 2015-09-25 2016-01-20 上海瑞伯德智能系统科技有限公司 Template matching method based on Sobel vectors
CN105760842A (en) * 2016-02-26 2016-07-13 北京大学 Station caption identification method based on combination of edge and texture features
CN105930858A (en) * 2016-04-06 2016-09-07 吴晓军 Fast high-precision geometric template matching method enabling rotation and scaling functions
CN106485701A (en) * 2016-09-26 2017-03-08 成都交大光芒科技股份有限公司 Based on the whether anti-loaded detection method of the railway overhead contact system catenary seat of image
CN107671896A (en) * 2017-05-19 2018-02-09 重庆誉鸣科技有限公司 Fast vision localization method and system based on SCARA robots

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101110100B (en) * 2006-07-17 2012-05-02 松下电器产业株式会社 Method and device for detecting geometric figure of any lines combination

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105261012A (en) * 2015-09-25 2016-01-20 上海瑞伯德智能系统科技有限公司 Template matching method based on Sobel vectors
CN105760842A (en) * 2016-02-26 2016-07-13 北京大学 Station caption identification method based on combination of edge and texture features
CN105930858A (en) * 2016-04-06 2016-09-07 吴晓军 Fast high-precision geometric template matching method enabling rotation and scaling functions
CN106485701A (en) * 2016-09-26 2017-03-08 成都交大光芒科技股份有限公司 Based on the whether anti-loaded detection method of the railway overhead contact system catenary seat of image
CN107671896A (en) * 2017-05-19 2018-02-09 重庆誉鸣科技有限公司 Fast vision localization method and system based on SCARA robots

Also Published As

Publication number Publication date
CN109101982A (en) 2018-12-28

Similar Documents

Publication Publication Date Title
CN107292248B (en) Commodity management method and system based on image recognition technology
CN108960211B (en) Multi-target human body posture detection method and system
CN110363047B (en) Face recognition method and device, electronic equipment and storage medium
CN108229475B (en) Vehicle tracking method, system, computer device and readable storage medium
CN108335331B (en) Binocular vision positioning method and equipment for steel coil
US20140092244A1 (en) Object search method, search verification method and apparatuses thereof
CN108846401A (en) Commodity detect terminal, method, system and computer equipment, readable medium
CN111898486B (en) Monitoring picture abnormality detection method, device and storage medium
US10445868B2 (en) Method for detecting a defect on a surface of a tire
GB2430735A (en) Object detection
CN110047063B (en) Material drop detection method, device, equipment and storage medium
CN109190617B (en) Image rectangle detection method and device and storage medium
CN111784675A (en) Method and device for processing article texture information, storage medium and electronic equipment
CN110533654A (en) The method for detecting abnormality and device of components
CN111553302B (en) Key frame selection method, device, equipment and computer readable storage medium
CN111126393A (en) Vehicle appearance refitting judgment method and device, computer equipment and storage medium
CN110766711A (en) Video shot segmentation method, system, device and storage medium
CN111881867A (en) Video analysis method and device and electronic equipment
CN108764343B (en) Method for positioning tracking target frame in tracking algorithm
CN114119695A (en) Image annotation method and device and electronic equipment
CN109101982B (en) Target object identification method and device
CN112966687A (en) Image segmentation model training method and device and communication equipment
CN109146834A (en) Car damage identification method and device, computer readable storage medium, terminal
CN111126436A (en) Visual matching method and device
CN107729839B (en) Method and device for identifying on-off state of pull-plug switch of protection pressing plate

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant