WO2020125528A1 - Anchor object detection method and apparatus, electronic device, and storage medium - Google Patents

Anchor object detection method and apparatus, electronic device, and storage medium Download PDF

Info

Publication number
WO2020125528A1
WO2020125528A1 PCT/CN2019/124678 CN2019124678W WO2020125528A1 WO 2020125528 A1 WO2020125528 A1 WO 2020125528A1 CN 2019124678 W CN2019124678 W CN 2019124678W WO 2020125528 A1 WO2020125528 A1 WO 2020125528A1
Authority
WO
WIPO (PCT)
Prior art keywords
straight line
anchor
line
straight
similarity
Prior art date
Application number
PCT/CN2019/124678
Other languages
French (fr)
Chinese (zh)
Inventor
刁梁
梁伟彬
Original Assignee
广东美的白色家电技术创新中心有限公司
美的集团股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 广东美的白色家电技术创新中心有限公司, 美的集团股份有限公司 filed Critical 广东美的白色家电技术创新中心有限公司
Publication of WO2020125528A1 publication Critical patent/WO2020125528A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras

Definitions

  • the present application relates to the field of information technology, and in particular to an anchor detection method and device, electronic equipment, and storage medium.
  • a camera is used to collect an image containing an anchor, and then processed based on multiple images such as a deep learning model to track the position of the anchor in the image.
  • a deep learning model to track the position of the anchor in the image.
  • existing anchor tracking methods such as deep learning models, when the tracked object is blocked or the color of the surrounding environment is similar, the detection of the anchor is likely to fail.
  • the embodiments of the present application desire to provide an anchor detection method and device, an electronic device, and a storage medium.
  • An anchor detection method including:
  • the position of the anchor in the image is located.
  • the detection of the straight line in the image includes:
  • a second straight line is formed based on the first straight line belonging to the same class.
  • the determining the similarity between the detected object and the anchor based on the characteristics of the detected straight line includes:
  • the method further includes:
  • the distance is less than the first distance threshold, it is determined that the i-th second straight line and the j-th second straight line intersect;
  • the length of the ith second straight line is determined based on the coordinates of the intersection point, where the coordinates of the intersection point are the coordinates of the intersection point of the ith second straight line and at least two other second straight lines.
  • the method further includes that: the ith second straight line intersects with the jth second straight line, and then the angle between the ith straight line and the jth second straight line is determined.
  • the straight line classification according to the equation of the first straight line includes:
  • the two first straight lines whose distance of the normal form is smaller than the second distance threshold are classified into one category.
  • the determining the similarity between the detected object and the anchor based on the characteristics of the detected straight line includes:
  • the x-th second straight line and the y-th straight line simultaneously satisfy the included angle matching condition and the length matching condition, according to the coordinates of the head and tail points of the x-th second straight line and the y-th line
  • the coordinates of the first and last points of the line to determine the affine matrix that transforms the x-th second straight line affine to the y-th straight line;
  • the determining whether the x-th second straight line and the y-th straight line satisfy the length matching condition includes: determining whether the length difference between the x-th second straight line and the y-th straight line Less than the length threshold; the difference between the length of the x-th second straight line and the y-th straight line is less than the length threshold, it is determined that the x-th second straight line and the y-th straight line satisfy the length matching condition.
  • the method further includes:
  • the x-th second straight line of the test object and the plurality of straight lines in the template simultaneously satisfy the included angle matching condition and the length matching condition to generate a combination set, wherein the combination set includes the x-th Multiple combinations of two straight lines and at least two straight lines;
  • Each combination in the combination set is traversed, and the similarity between the test substance and the anchor is determined based on each combination.
  • the method further includes:
  • the angle between the second straight line and the other second straight line where the detection object exists is outside the angle range, the angle between the second straight line and the other second straight line in the detection object is located at the angle The second straight line outside the angular range is eliminated from the second straight line set.
  • the method further includes:
  • the detecting the straight line in the image includes:
  • a straight line located in the target contour area is detected.
  • An anchor detection device including:
  • An image module configured to obtain an image containing an anchor imaging
  • a straight line module configured to detect a straight line in the image
  • a similarity module configured to determine the similarity between the detected object and the anchor based on the characteristics of the detected straight line
  • the positioning module is configured to position the anchor in the image based on the similarity.
  • An electronic device includes:
  • a processor connected to the memory, is used to implement the anchor detection method provided by any of the foregoing technical solutions by executing computer-executable instructions located on the memory.
  • a computer storage medium that stores computer-executable instructions; after the computer-executable instructions are executed, implement the anchor detection method provided by any of the foregoing technical solutions.
  • the technical solution provided by the embodiment of the present application determines the similarity between the detected object and the anchor based on the characteristics of the detected straight line through the straight line detection in the image; based on the similarity, it is determined whether the currently detected detected object is the anchor If the detection object is very similar to the anchor, then the area where the current detection object is located is the area where the anchor is located, so that the anchor object in the image can be located; even if the detection object is partially blocked, However, as long as the similarity with the anchor is high enough, it will be deemed that the anchor needs to be detected, thereby achieving successful detection of the anchor, which has the characteristics of high detection efficiency and accurate detection.
  • FIG. 1 is a schematic flowchart of a first anchor detection method provided by an embodiment of the present application.
  • FIG. 2 is a schematic diagram of a system for acquiring images provided by an embodiment of the present application.
  • FIG. 3 is a schematic flowchart of a straight line detection provided by an embodiment of the present application.
  • FIG. 4 is a schematic flowchart of determining the similarity between a detection object and an anchor based on a straight line feature provided by an embodiment of the present application;
  • FIG. 5 is a schematic structural diagram of an anchor detection device according to an embodiment of the present application.
  • FIG. 6 is a schematic diagram of a process of creating a template provided by an embodiment of this application.
  • FIG. 7 is a schematic flowchart of an anchor detection method provided by an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
  • this embodiment provides an anchor detection method, including:
  • Step S110 Acquire an image including the anchor imaging
  • Step S120 Detect the straight line in the image
  • Step S130 Determine the similarity between the detected object and the anchor based on the characteristics of the detected straight line
  • Step S140 Based on the similarity, locate the position of the anchor in the image.
  • the image may be an image collected on the anchor.
  • the imaging of the anchor must be included in the image, but it may be necessary to locate the area where the anchor is located in the entire image.
  • the anchor may be an object with a known shape, and the characteristics of the straight line corresponding to the anchor are known. Therefore, in this embodiment, the straight line is directly detected from the image, and then the feature of the detected straight line is obtained. Based on the feature, the similarity between the detected test object and the anchor is determined. If the similarity is sufficiently high, for example, the similarity If it is greater than the similarity threshold, it is determined that the current detection object is the anchor, and the image area where the current detection object is located is the imaging area of the anchor.
  • step S110 it may include: receiving the image from the collection device, or collecting the image by itself.
  • FIG. 2 shows a schematic diagram of obtaining the image in industry.
  • Figure 2 shows the signal light, camera, and pulley production line; the accessory box can be one of the aforementioned anchors, and the accessory box moves with the operation of the pulley production line.
  • the camera collects the picture and sends it to the processing unit for recognition.
  • the output shows the recognition result.
  • the processing unit of the device obtains the image collected by the camera.
  • step S120 an image is directly detected from the image instead of generating an image based on the points in the image.
  • There are many ways to detect straight lines in the image and the following provides several optional ways:
  • Line segment detection Line Segment Detector, LSD
  • the realization of the Hough transform straight line detection can be as follows:
  • the line segment detection (Line Segment Detector, LSD) line detection can be as follows: first select the origin O of the polar coordinate system as the focus of the image (w/2, h/2). Establish the Cartesian coordinate system; among them is the image coordinate system. The conversion relationship between the polar coordinate system and the Cartesian coordinate system is. Therefore, when the first and last points of a line segment are known, the corresponding one can be solved. For the calculation of the specific angle, please refer to the polar coordinate representation of straight line detection.
  • the features of the straight line detected in step S130 include but are not limited to at least one of the following:
  • the relative position relationship between the straight lines for example, the relative position relationship includes: intersection and/or parallel.
  • step S130 the similarity between the detection object and the anchor can be determined based on the characteristics of the straight line, and then the current detection is determined based on the similarity Whether the object is an anchor.
  • straight line detection can be used to detect anchors whose straight line characteristics are known. Compared with the deep learning model, it has the characteristics of simpler and higher accuracy and less resource overhead. At the same time, when the contour to be detected is obscured by an unknown object, both the traditional algorithm and the deep learning algorithm will fail, and this method is still applicable.
  • the step S110 may include:
  • Step S111 Detect the straight line in the image and obtain at least one first straight line
  • Step S112 classify straight lines according to the equation of the first straight line
  • Step S113 According to the classification result of the first straight line, form a second straight line based on the first straight line belonging to the same class.
  • the straight line directly detected from the image is called the first straight line, here
  • the first straight line may be a straight line with a length instead of a straight line with a wireless length that is mathematically defined.
  • the first straight line has an end point, or such an end point is also called an end point.
  • the equation of the first straight line can be obtained. This equation can be called a straight line equation.
  • the straight line equation reflects the characteristics of the straight line, for example, the slope and intercept of the straight line.
  • straight line classification is performed based on the equation of the first straight line. For example, two straight lines that are sufficiently similar are considered to be classified into the same type, and then a second straight line is obtained based on the first straight line of the same type.
  • the step S112 may include at least one of the following:
  • the paradigm distance between any two first straight lines is calculated. If the paradigm distance is less than the second distance threshold, the two first straight lines can be classified into one category.
  • the step S112 may include: determining the rectangular coordinate equation of the first straight line according to the coordinates of the head and tail points of the first straight line; and determining the slope of the first straight line according to the rectangular coordinate equation And intercept; based on the slope and the intercept, determine the paradigm distance between the two first straight lines; the paradigm distance is less than the second distance threshold of the two first straight lines are classified as one type.
  • the first and last points may be two endpoints of a straight line.
  • the normal distance is called Manhattan distance, which can be determined by the following formula:
  • the sum of the first absolute value and the second absolute value is calculated to obtain the normal distance of the coordinates (X1, Y1) and the coordinates (X2, Y2).
  • step S113 a second straight line connecting the first straight lines of the same type is generated based on the first straight lines classified into the same type.
  • the head and tail points of all the first straight lines of the same type are located on the second straight line through soft fitting Up or around the second straight line.
  • the coordinates of the head and tail points of multiple first straight lines can be directly found, and then the first point and the second point can be obtained.
  • the predetermined coordinate axis may be an x axis or a y axis
  • the x axis is perpendicular to the y axis
  • the x axis and the y axis constitute a two-dimensional coordinate system.
  • the first point is the first and last points of the first straight line connected to the origin, and then looking at the angle between the line and the preset coordinate axis, where the first point is the point corresponding to the maximum included angle,
  • the second point is the point corresponding to the smallest included angle.
  • the first and last points can also be called end points, including: two end points at both ends of the first straight line.
  • the phenomenon of a large number of repeated straight lines caused by directly detecting the straight line from the image can be reduced, and it is convenient to accurately locate the position of the anchor in the image later.
  • the step S130 may include:
  • the similarity between the test object and the anchor is determined according to the intersection point, the included angle, and/or the length of the second straight line of at least two second straight lines of the test object.
  • a picture to be detected will detect multiple contours to be detected, and each contour to be detected may be fitted with multiple second straight lines.
  • the characteristics of the detected straight line may include: the length of the second straight line, the second Angles and intersections between straight lines.
  • one or more of the multiple features of the second straight line may be matched with the features of the known straight line of the anchor to determine the similarity between the test object and the test object.
  • the method further includes detecting features of the second straight line.
  • the feature of detecting the second straight line may include: included angle and length.
  • the method for obtaining the angle of the second straight line can be as follows:
  • the distance is less than the first distance threshold, it is determined that the i-th second straight line and the j-th second straight line intersect;
  • the length of the i-th straight line is determined based on the intersection point coordinates of the i-th second straight line and two other second straight lines that intersect the i-th second straight line.
  • the ith second straight line and the second straight line A and the second straight line B respectively intersect, and the intersection point of the ith second straight line and the second straight line A is close to the first projected coordinate, and the ith second straight line and the second straight line If the intersection point of the two straight lines B is close to the second projected coordinates, the length of the second straight line may be calculated based on the intersection points between the i-th second straight line and the second straight line A and the second straight line B, respectively.
  • the ith second straight line may intersect with more than two second straight lines, and the following method may be used when calculating the length of the ith second straight line:
  • the method includes: the ith second straight line intersects with the jth second straight line, and then determining the angle between the ith straight line and the jth second straight line.
  • the projection point Ptni on the line (xt ni , yt ni )
  • calculate the point Pfi (or Pni) j ⁇ i which is the closest distance between the Pfi on the straight line i and the start and end points of other straight lines, and find the intersection coordinate of the straight lines i and j PRfi (xr fi , Yr fi ), the angle between i and j is:
  • the preset coordinate axis may be an x axis or a y axis. If the coordinate distance between the end points of the two second straight lines in the anchor profile is less than the set threshold, the two second straight lines are considered to intersect, and the angle between the straight lines can be obtained by the straight line equation.
  • the angle between any two second straight lines of the outline and the length of the second straight line can be anchored.
  • a plurality of second straight lines can be detected in the anchoring profile, each second straight line has its own head and tail points, and then find other second straight lines that are closest to and farthest from the head and tail points of each second straight line. It is further determined whether two second straight lines intersect. In some embodiments, each second straight line will find two second intersecting straight lines, and the length of the second straight line can be confirmed by cutting the line.
  • the step S130 may include:
  • Step S131 the angle between the x-th second straight line and the other second straight lines in the second set of straight lines of the detection object and the y-th straight line and other straight lines in the template of the anchor Angle matching;
  • Step S132 Based on the matching result of the included angle, determine whether the x-th second straight line and the y-th straight line in the template satisfy the included angle matching condition;
  • Step S133 Determine whether the x-th second straight line and the y-th straight line satisfy the length matching condition
  • Step S134 the x-th second straight line and the y-th straight line satisfy the angle matching condition and the length matching condition at the same time, according to the coordinates of the head and tail points of the x-th second straight line and the The coordinates of the first and last points of the yth line determine the affine matrix that transforms the second affine line of the xth line to the yth line;
  • Step S135 Transform the second straight line other than the x-th second straight line according to the affine matrix to obtain a second set of straight lines after the affine transformation of the test object;
  • Step S136 Determine the similarity between the second set of straight lines and the straight lines in the template
  • Step S137 Determine whether the detection object is the anchor according to the similarity.
  • the imaging of the anchor in the image may change in translation and the like.
  • the angle and the length between the straight lines are matched to determine the similarity between the detected straight line and the straight line in the anchor template.
  • Both x and y are positive integers, where x is less than or equal to the total number of second straight lines, and y is less than or equal to the total number of straight lines in the template.
  • the template may be pre-generated by the electronic device and stored in the electronic device. In some embodiments, the template may also be pre-received by the electronic device from other devices.
  • the angle between a second straight line and any straight line in the template satisfies the angle similarity condition and the length similarity condition, which means that the detected second line is similar to the corresponding line in the template. Displacement or the like causes the coordinates of two similar or matching straight lines to be inconsistent.
  • the affine matrix can be solved. Using these affine matrices for the detected affine changes of other second straight lines, you can quickly get the affine changed second straight lines, and then match the straight lines in the template, you can get the detected straight lines and the template
  • the first ratio and/or the second ratio here can be directly used as a parameter for evaluating the degree of similarity between the test substance and the anchor substance. If the first ratio and/or the second ratio is greater than the ratio threshold, it may be considered that the detection object and the anchor are the same, and the detection object is the imaging region of the anchor in the image area.
  • the determining whether the x-th second straight line and the y-th straight line satisfy the length matching condition includes: determining whether a length difference between the x-th second straight line and the y-th straight line is less than a length threshold;
  • the length difference between the xth second straight line and the yth straight line is less than the length threshold, it is determined that the xth second straight line and the yth straight line satisfy the length matching condition.
  • the method further includes: the picture to be detected can detect multiple contours, and the contours need to be traversed; thereby, an image with an anchor imaging is found from the multiple images, and the imaging of the anchor is obtained The position in the image.
  • the method may further include: the x-th second straight line of the test object and the multiple straight lines in the template satisfy the angle matching condition and the length matching condition at the same time, generating a combination Set, wherein the combination set includes a plurality of combinations of the x-th second straight line and at least two straight lines; the step S130 may include: traversing each combination in the combination set and determining the based on each combination The similarity between the test object and the anchor.
  • step S130 it may include: traversing the combination set to determine the affine matrix corresponding to each combination; based on the second straight line detected by the transformation of each affine matrix solved, the transformed first The second straight line is matched with the straight line in the template, and according to the degree of similarity or matching degree between the transformed second straight line and the straight line, it is determined whether the currently detected test object is the anchor.
  • an x-th second straight line may be similar to or match with multiple straight lines in the template.
  • the method further includes:
  • the angle between the second straight line and the other second straight line where the detection object exists is outside the angle range, the angle between the second straight line and the other second straight line in the detection object is located at the angle The second straight line outside the angular range is eliminated from the second straight line set.
  • the angle range between multiple straight lines in the template is determined.
  • the angle range may be determined based on the angle between any two straight lines in the template in advance. Then, using the included angle range, an abnormal second straight line is proposed from the second straight line set.
  • the method further includes:
  • the obtained image contains candidate contour regions imaged by the anchor
  • the step S120 may include detecting a straight line located in the target contour area.
  • pixel-level segmentation can be used to segment the area where the object is imaged from the background area to obtain one or more candidate contour areas.
  • one or more target contour regions can be selected from the candidate contour regions. For example, a candidate contour region with the largest current area is selected as the target contour region, and straight line detection is performed in step S110.
  • the candidate contour area with the next largest area is used as the target contour area to continue the detection, so until the anchor is detected, or until all candidate contour areas are regarded as the target contour The area has been tested.
  • the imaging size of the anchor may also be determined directly according to the acquisition parameters of the camera and the size of the anchor, and one or more of the candidate contour regions may be selected as the target contour based on the imaging size Area, parallel detection of each target contour area to speed up the positioning rate of the anchor.
  • the acquisition parameters may include but are not limited to parameters related to image acquisition such as focal length and/or depth of field.
  • this embodiment also provides an anchor detection device, including:
  • the image module 110 is configured to obtain an image including the imaging of the anchor
  • the straight line module 120 is configured to detect straight lines in the image
  • the similarity module 130 is configured to determine the similarity between the detected object and the anchor based on the characteristics of the detected straight line;
  • the positioning module 140 is configured to position the anchor in the image based on the similarity.
  • the image module 110, the straight line module 120, the similarity module 130, and the positioning module 140 may all be program modules. After the program modules are executed by the processor, image acquisition, straight line detection, and similarity The determination of the degree and the positioning of the anchor in the image.
  • the straight line module 120 is configured to detect a straight line in the image and obtain at least one first straight line; classify straight lines according to the equation of the first straight line; according to the first straight line The classification result of the line forms a second straight line based on the first straight line belonging to the same class.
  • the similarity-based module 130 is configured to determine the detection based on the intersection point, the included angle, and/or the length of the second straight line of at least two second straight lines of the test object The similarity between the object and the anchor.
  • the device further includes:
  • a first projection module configured to vertically project the first point corresponding to the ith second straight line onto the ith second straight line to obtain a first projection coordinate, wherein the first point is the second straight line The line between the beginning and end points of the first straight line corresponding to the straight line and the origin and the point with the largest angle between the preset coordinate axes;
  • a second projection module configured to project a second point corresponding to the ith second straight line to the ith second straight line to obtain second projected coordinates, wherein the second point is the first The line between the beginning and end points of the first straight line corresponding to the two straight lines and the origin and the point with the smallest angle between the preset coordinate axes;
  • a length module configured to determine the distance between the intersection point between the ith second straight line and the jth second straight line and the first projected coordinate and the second projected coordinate; the distance is less than the first distance threshold , It is determined that the i-th second straight line intersects with the j-th second straight line; based on the coordinates of the intersection point, the length of the i-th second straight line is determined, wherein the coordinate of the intersection point is the i-th second straight line The coordinates of the intersection point of the second straight line and at least two other second straight lines.
  • the device further includes:
  • the first angle module is configured such that the i-th second straight line intersects with the j-th second straight line, and then determines the angle between the i-th straight line and the j-th second straight line.
  • the straight line module 120 is configured to determine the rectangular coordinate equation of the first straight line according to the coordinates of the first and last points of the first straight line; determine the first coordinate according to the rectangular coordinate equation The slope and the intercept of the straight line; based on the slope and the intercept, determine the paradigm distance between the two first straight lines; the two firsts whose distance of the paradigm is less than the second distance threshold Straight lines are grouped together.
  • the similarity module 130 is configured to determine the angle between the x-th second straight line in the second straight line set of the detected object and other second straight lines, and the template of the anchor The angle match between the y-th straight line and other straight lines in the inside; based on the matching result of the angle, determine whether the x-th second straight line and the y-th straight line in the template satisfy the angle matching Conditions; determine whether the x-th second straight line and the y-th straight line satisfy the length matching condition; if the x-th second straight line and the y-th straight line simultaneously satisfy the included angle matching condition and all The length matching condition, based on the coordinates of the head and tail points of the xth second line and the coordinates of the head and tail points of the yth line, determining the affine transformation of the xth second line to the y An affine matrix of straight lines; according to the affine matrix, transform the second straight line other than the x-th second straight line to obtain a set of second straight lines after
  • the device further includes:
  • a combination module configured such that the x-th second straight line of the detection object and the multiple straight lines in the template simultaneously satisfy the included angle matching condition and the length matching condition to generate a combined set, wherein the combined set Including multiple combinations of the xth second straight line and at least two straight lines;
  • the similarity module 130 is configured to traverse each combination in the combination set and determine the similarity between the detection object and the anchor based on each combination.
  • the device further includes:
  • the included angle range module is configured to determine the included angle range according to the included angle of all straight lines in the template
  • the rejection module is configured such that the angle between the second straight line and the other second straight line where the detected object exists is outside the included angle range, and then the angle between the detected object and the other second straight line is included The second straight line whose angle is outside the included angle range is removed from the second straight line set.
  • the device further includes:
  • a candidate contour region module configured to acquire the image and obtain a candidate contour region imaged by the anchor including the anchor;
  • a target contour area module configured to select a contour area with the largest area from the candidate contour area as the target contour area
  • the straight line module 120 is configured to detect a straight line located in the target contour area.
  • the hardware part includes: a belt production line, a photoelectric sensor, and a camera directly above the belt production line.
  • the accessory box moves below the camera and triggers the photoelectric switch, the camera collects the picture and sends it to the processing unit Recognize, the most output shows the recognition results.
  • the picture as a template needs to have the following standards: (1) the background of the picture is pure (2) the contour of the anchor to be detected is clear and unobstructed (2) the outer contour of the anchor to be detected is the largest and contains A template anchor.
  • the specific template creation method can refer to Figure 6, including the following steps:
  • Select the contour extraction template picture such as: pixel segmentation, set pixel threshold, extract candidate contour regions in the image by pixel segmentation; specifically, compare the area of each contour candidate region, and retain the largest area to filter out all others area;
  • the straight line detection algorithm is used for straight line detection, for example, the straight line detection algorithm is used to extract straight lines for the area contour.
  • the algorithm used in the specific embodiment is the Hough straight line detection or LSD straight line detection algorithm, which detects all straight lines in the contour;
  • the slope a i of the straight line i and the intercept b i are obtained. After all the slopes and intercepts are obtained, the slopes and intercepts are clustered, and the number of cluster centers is the number of straight lines of the anchor contour to be inspected .
  • the test can be carried out.
  • the inspection may include the following operations:
  • the formula is as follows:
  • the second distance threshold Td for clustering.
  • I is calculated straight line with all the other angle, to obtain an angle of N D, the angle of the primaries, retain all ⁇ min ⁇ d ⁇ max (d ⁇ [1, N D]), to give N ' D angles.
  • the distance between the point and a certain projection coordinate of the second straight line of the i-th line is the smallest; the coordinate of the third intersection point of the intersection point of the second straight line of the i-th line and the second straight line of the M2th line is determined, and the second Angle; determine the length of the ith second straight
  • the translation affine matrix can be:
  • the remaining N area -1 straight lines obtained in step (4) are affine transformed by the affine matrix. Affine transform the first and last coordinates of all straight lines to obtain
  • n ci n ci +1(n ci ⁇ [1,N ci ]) traverse the other combinations in n ci , and repeat steps (6) to (9).
  • the angle between the second straight line on the contour to be detected and all other straight lines and the length of the cut line and generating a list of angles and a list of the length of the cut line, and
  • the angle and length of the second straight line generated by the anchor contour are matched, and the matching situation of the i-th second straight line and the second line of the anchor contour is preliminarily predicted; it can quickly determine whether each current candidate contour area is an anchor Imaging area.
  • the candidate contours are sorted, and the contour with the largest area is selected first, thereby saving detection time.
  • the detection speed is fast, and the accuracy is much higher than the pure deep learning algorithm, which can achieve pixel-level point positioning.
  • this embodiment provides an electronic device, including:
  • a processor connected to the memory, is configured to implement a method for detecting a method anchor provided by any of the foregoing technical solutions by executing computer-executable instructions located on the memory, for example, FIG. 1, FIG. 3, and FIG. 4, One or more of the method anchor detection methods shown in FIGS. 6 and 7.
  • the memory may be various types of memory, such as random access memory, read-only memory, flash memory, etc.
  • the memory can be used for information storage, for example, storing computer-executable instructions.
  • the computer executable instructions may be various program instructions, for example, target program instructions and/or source program instructions.
  • the processor may be various types of processors, for example, a central processor, a microprocessor, a digital signal processor, a programmable array, a digital signal processor, an application specific integrated circuit, or an image processor.
  • the processor may be connected to the memory through a bus.
  • the bus may be an integrated circuit bus or the like.
  • the electronic device may further include: a communication interface, and the communication interface may include: a network interface, for example, a local area network interface, a transceiver antenna, and the like.
  • the communication interface is also connected to the processor and can be used for information transmission and reception.
  • the electronic device further includes a human-machine interaction interface.
  • the human-machine interaction interface may include various input and output devices, such as a keyboard, a touch screen, and the like.
  • This embodiment provides a computer storage medium that stores computer-executable instructions; after the computer-executable instructions are executed, the method for detecting a method anchor provided by any of the foregoing technical solutions is implemented, for example, FIG. 1.
  • FIG. 1 One or more of the method anchor detection methods shown in FIGS. 3 and 4, 6 and 7.
  • the computer storage medium may include various recording media having a recording function, for example, various storage media such as a CD, a floppy disk, a hard disk, a magnetic tape, an optical disk, a U disk, or a mobile hard disk.
  • the optional computer storage medium may be a non-transitory storage medium, and the computer storage medium may be read by a processor, so that computer-executable instructions stored on a computer storage mechanism are acquired and executed by the processor to implement any of the foregoing
  • An anchor detection method provided by a technical solution for example, executes an anchor detection method applied in a terminal device or an anchor detection method in an application server.
  • the disclosed device and method may be implemented in other ways.
  • the device embodiments described above are only schematic.
  • the division of the units is only a division of logical functions.
  • the displayed or discussed components are coupled to each other, or directly coupled, or the communication connection may be through some interfaces, and the indirect coupling or communication connection of the device or unit may be electrical, mechanical, or other forms of.
  • the above-mentioned units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units; Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • the functional units in the embodiments of the present application may all be integrated into one processing module, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above integration
  • the unit can be implemented in the form of hardware, or in the form of hardware plus software functional units.
  • the foregoing program may be stored in a computer-readable storage medium, and when the program is executed, Including the steps of the above method embodiments; and the foregoing storage media include: mobile storage devices, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disks or optical disks, etc.
  • ROM read-only memory
  • RAM random access memory
  • magnetic disks or optical disks etc.

Abstract

The embodiments of the present application disclose an anchor object detection method and apparatus, electronic device, and storage medium. The anchor object detection method comprises: obtaining an image containing anchor object imaging; detecting a straight line in said image; on the basis of the features of the detected straight line, determining the degree of similarity between a detected object and the anchor object; on the basis of the degree of similarity, positioning the anchor object in the image.

Description

锚定物检测方法及装置、电子设备及存储介质Anchor detection method and device, electronic equipment and storage medium
相关申请的交叉引用Cross-reference of related applications
本申请基于申请号为201811575222.0、申请日为2018年12月21日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。This application is based on a Chinese patent application with an application number of 201811575222.0 and an application date of December 21, 2018, and claims the priority of the Chinese patent application. The entire content of the Chinese patent application is hereby incorporated by reference.
技术领域Technical field
本申请涉及信息技术领域,尤其涉及一种锚定物检测方法及装置、电子设备及存储介质。The present application relates to the field of information technology, and in particular to an anchor detection method and device, electronic equipment, and storage medium.
背景技术Background technique
随着技术的发展,通常利用各种视觉技术检测锚定物。在相关技术中,利用摄像头采集包含有锚定物成像的图像,然后基于深度学习模型等多图像进行处理,追踪锚定物在图像中的位置。但是利用深度学习模型等现有的锚定物追踪方法,在被追踪的物体被遮挡或者与周边环境的颜色相似时,容易出现锚定物检测失败的现象。With the development of technology, various visual techniques are usually used to detect anchors. In the related art, a camera is used to collect an image containing an anchor, and then processed based on multiple images such as a deep learning model to track the position of the anchor in the image. However, when using existing anchor tracking methods such as deep learning models, when the tracked object is blocked or the color of the surrounding environment is similar, the detection of the anchor is likely to fail.
发明内容Summary of the invention
有鉴于此,本申请实施例期望提供一种锚定物检测方法及装置、电子设备及存储介质。In view of this, the embodiments of the present application desire to provide an anchor detection method and device, an electronic device, and a storage medium.
本申请的技术方案是这样实现的:The technical solution of this application is implemented as follows:
一种锚定物检测方法,包括:An anchor detection method, including:
获取包含有锚定物成像的图像;Acquire images that include imaging of anchors;
检测所述图像中的直线;Detect straight lines in the image;
基于所检测直线的特征,确定所述检测物与锚定物的相似度;Determine the similarity between the test object and the anchor based on the characteristics of the detected straight line;
基于所述相似度,定位所述锚定物在所述图像中的位置。Based on the similarity, the position of the anchor in the image is located.
基于上述方案,所述检测所述图像中的直线,包括:Based on the above solution, the detection of the straight line in the image includes:
检测所述图像中的直线并获得至少一条第一直线;Detect a straight line in the image and obtain at least one first straight line;
根据所述第一直线的方程式进行直线归类;Classify straight lines according to the equation of the first straight line;
根据所述第一直线的归类结果,基于属于同一类的所述第一直线形成第二直线。According to the classification result of the first straight line, a second straight line is formed based on the first straight line belonging to the same class.
基于上述方案,所述基于所检测直线的特征,确定所述检测物与锚定物的相似度,包括:Based on the above solution, the determining the similarity between the detected object and the anchor based on the characteristics of the detected straight line includes:
根据所述检测物至少两条所述第二直线的交点、夹角和/或所述第二直线的长度,确定所述检测物与锚定物的相似度根据所述检测物的至少两条所述第二直线的交点、夹角和/或所述第二直线的长度。Determine the similarity between the test object and the anchor according to the intersection point, angle and/or length of the second straight line of the at least two second straight lines of the test object The intersection point, the included angle of the second straight line and/or the length of the second straight line.
基于上述方案,所述方法还包括:Based on the above solution, the method further includes:
将第i条第二直线所对应第一点向第i条所述第二直线垂直投影以获得第一投影坐标,其中,所述第一点为所述第二条直线所对应第一直线的首尾点与原点之间的连线和预设坐标轴之间夹角最大的点;Perpendicularly projecting the first point corresponding to the ith second straight line to the ith second straight line to obtain the first projected coordinates, wherein the first point is the first straight line corresponding to the second straight line The line between the first and last points and the origin and the point with the largest angle between the preset coordinate axes;
将第i条所述第二直线所对应的第二点向第i条所述第二直线投影以获得第二投影坐标,其中,所述第二点为所述第二条直线所对应第一直线的首尾点与原点之间的连线和预设坐标轴之间夹角最小的点;Projecting a second point corresponding to the i-th second line onto the i-th second line to obtain second projected coordinates, wherein the second point is the first corresponding to the second line The line between the beginning and end points of the line and the origin and the point with the smallest angle between the preset coordinate axes;
确定第i条第二直线和第j条第二直线之间的交点与所述第一投影坐标和所述第二投影坐标之间的距离;Determining the distance between the intersection point between the ith second straight line and the jth second straight line and the first projected coordinate and the second projected coordinate;
所述距离小于第一距离阈值,则确定所述第i条第二直线和第j条第二直线相交;If the distance is less than the first distance threshold, it is determined that the i-th second straight line and the j-th second straight line intersect;
基于交点坐标,确定出所述第i条第二直线的长度,其中,所述交点坐标为所述第i条第二直线与至少两条其他所述第二直线的相交点的坐标。The length of the ith second straight line is determined based on the coordinates of the intersection point, where the coordinates of the intersection point are the coordinates of the intersection point of the ith second straight line and at least two other second straight lines.
基于上述方案,所述方法还包括:第i条第二直线与第j条第二直线相交,则确定所述第i条直线和所述第j条第二直线的夹角。Based on the above solution, the method further includes that: the ith second straight line intersects with the jth second straight line, and then the angle between the ith straight line and the jth second straight line is determined.
基于上述方案,所述根据所述第一直线的方程式进行直线归类,包括:Based on the above solution, the straight line classification according to the equation of the first straight line includes:
根据所述第一直线的首尾点的坐标,确定所述第一直线的直角坐标方程式;Determine the rectangular coordinate equation of the first straight line according to the coordinates of the first and last points of the first straight line;
根据所述直角坐标方程式确定所述第一直线的斜率和截距;Determine the slope and intercept of the first straight line according to the rectangular coordinate equation;
基于所述斜率和所述截距,确定两条所述第一直线之间的范式距离;Determine the paradigm distance between the two first straight lines based on the slope and the intercept;
将所述范式距离小于第二距离阈值的两条所述第一直线归为一类。The two first straight lines whose distance of the normal form is smaller than the second distance threshold are classified into one category.
基于上述方案,所述基于所检测直线的特征,确定所述检测物与锚定物的相似度,包括:Based on the above solution, the determining the similarity between the detected object and the anchor based on the characteristics of the detected straight line includes:
将检测物的第二直线集合中的第x条第二直线与其他第二直线之间的夹角,与所述锚定物的模板内的第y条直线与其他直线之间的夹角匹配;Match the angle between the x-th second line in the second line set of the test object and other second lines with the angle between the y-th line in the template of the anchor and the other line ;
基于所述夹角的匹配结果,确定所述第x条第二直线与所述第y条直线是否满足夹角匹配条件;Based on the matching result of the included angle, determining whether the x-th second straight line and the y-th straight line satisfy the included angle matching condition;
确定所述第x条第二直线与所述第y条直线是否满足长度匹配条件;Determining whether the x-th second straight line and the y-th straight line satisfy the length matching condition;
所述第x条第二直线与所述第y条直线同时满足所述夹角匹配条件及所述长度匹配条件,根据所述第x条第二直线的首尾点的坐标和所述第y条直线首尾点的坐标,确定出将所述第x条第二直线仿射变换到所述第y条直线的仿射矩阵;The x-th second straight line and the y-th straight line simultaneously satisfy the included angle matching condition and the length matching condition, according to the coordinates of the head and tail points of the x-th second straight line and the y-th line The coordinates of the first and last points of the line, to determine the affine matrix that transforms the x-th second straight line affine to the y-th straight line;
根据所述仿射矩阵,变换所述第x条第二直线以外的其他所述第二直线以获得所述检测物仿射变换后的第二直线集合;Transforming the second straight line other than the xth second straight line according to the affine matrix to obtain a second set of straight lines after the affine transformation of the detection object;
确定所述第二直线集合与所述模板中的直线相似度;Determining the similarity between the second set of straight lines and the straight lines in the template;
根据所述相似度,确定所述检测物是否为所述锚定物。According to the similarity, it is determined whether the detection object is the anchor.
基于上述方案,所述确定所述第x条第二直线与所述第y条直线是否满足长度匹配条件,包括:确定所述第x条第二直线与所述第y条直线的 长度差是否小于长度阈值;所述第x条第二直线与第y条直线的长度差小于所述长度阈值,则确定所述第x条第二直线与所述第y条直线满足所述长度匹配条件。基于上述方案,所述方法,还包括:Based on the above solution, the determining whether the x-th second straight line and the y-th straight line satisfy the length matching condition includes: determining whether the length difference between the x-th second straight line and the y-th straight line Less than the length threshold; the difference between the length of the x-th second straight line and the y-th straight line is less than the length threshold, it is determined that the x-th second straight line and the y-th straight line satisfy the length matching condition. Based on the above solution, the method further includes:
所述检测物的第x条第二直线与所述模板中的多条直线同时满足所述夹角匹配条件和所述长度匹配条件,生成组合集,其中,所述组合集中包括第x条第二直线与至少两条直线的多个组合;The x-th second straight line of the test object and the plurality of straight lines in the template simultaneously satisfy the included angle matching condition and the length matching condition to generate a combination set, wherein the combination set includes the x-th Multiple combinations of two straight lines and at least two straight lines;
所述基于所检测直线的特征,确定所述检测物与锚定物的相似度,包括:The determining the similarity between the test object and the anchor based on the characteristics of the detected straight line includes:
遍历所述组合集中每一个组合,基于每一个所述组合确定所述检测物与锚定物的相似度。Each combination in the combination set is traversed, and the similarity between the test substance and the anchor is determined based on each combination.
基于上述方案,所述方法还包括:Based on the above solution, the method further includes:
根据所述模板中所有直线的夹角,确定夹角范围;Determine the included angle range according to the included angle of all straight lines in the template;
存在所述检测物的所述第二直线与其他所述第二直线的夹角位于所述夹角范围外,则将所述检测物中与其他所述第二直线的夹角位于所述夹角范围外的所述第二直线从所述第二直线集合剔除。If the angle between the second straight line and the other second straight line where the detection object exists is outside the angle range, the angle between the second straight line and the other second straight line in the detection object is located at the angle The second straight line outside the angular range is eliminated from the second straight line set.
基于上述方案,所述方法还包括:Based on the above solution, the method further includes:
获取所述图像并获得图像包含所述锚定物成像的候选轮廓区域;Acquiring the image and obtaining an image containing candidate contour regions imaged by the anchor;
从所述候选轮廓区域选择面积最大的轮廓区域为目标轮廓区域;Selecting the contour area with the largest area from the candidate contour areas as the target contour area;
所述检测所述图像中的直线,包括:The detecting the straight line in the image includes:
检测位于所述目标轮廓区域的直线。A straight line located in the target contour area is detected.
一种锚定物检测装置,包括:An anchor detection device, including:
图像模块,配置为获取包含有锚定物成像的图像;An image module, configured to obtain an image containing an anchor imaging;
直线模块,配置为检测所述图像中的直线;A straight line module, configured to detect a straight line in the image;
相似度模块,配置为基于所检测直线的特征,确定所述检测物与锚定物的相似度;A similarity module configured to determine the similarity between the detected object and the anchor based on the characteristics of the detected straight line;
定位模块,配置为基于所述相似度,定位所述锚定物在所述图像中的位置。The positioning module is configured to position the anchor in the image based on the similarity.
一种电子设备包括:An electronic device includes:
存储器;Memory
处理器,与所述存储器连接,用于通过执行位于所述存储器上的计算机可执行指令,实现前述任意技术方案提供的锚定物检测方法。A processor, connected to the memory, is used to implement the anchor detection method provided by any of the foregoing technical solutions by executing computer-executable instructions located on the memory.
一种计算机存储介质,所述计算机存储介质存储有计算机可执行指令;所述计算机可执行指令被执行后,实现前述任意技术方案提供的锚定物检测方法。A computer storage medium that stores computer-executable instructions; after the computer-executable instructions are executed, implement the anchor detection method provided by any of the foregoing technical solutions.
本申请实施例提供的技术方案,通过图像中的直线检测,基于检测到直线的特征,确定检测物和锚定物的相似度;基于该相似度,确定出当前检测的检测物是否是锚定物,若检测物与锚定物相似度很高,则可认为当前检测物所在的区域即为锚定物所在的区域,从而实现定位出图像中的锚定物;即便检测物被部分遮挡,但是只要与锚定物的相似度足够高,就会本认定为是所需要检测锚定物,从而实现锚定物的成功检测,具有检测效率高及检测度精确的特点。The technical solution provided by the embodiment of the present application determines the similarity between the detected object and the anchor based on the characteristics of the detected straight line through the straight line detection in the image; based on the similarity, it is determined whether the currently detected detected object is the anchor If the detection object is very similar to the anchor, then the area where the current detection object is located is the area where the anchor is located, so that the anchor object in the image can be located; even if the detection object is partially blocked, However, as long as the similarity with the anchor is high enough, it will be deemed that the anchor needs to be detected, thereby achieving successful detection of the anchor, which has the characteristics of high detection efficiency and accurate detection.
附图说明BRIEF DESCRIPTION
图1为本申请实施例提供的第一种锚定物检测方法的流程示意图;1 is a schematic flowchart of a first anchor detection method provided by an embodiment of the present application;
图2为本申请实施例提供的一种获取图像的系统示意图;2 is a schematic diagram of a system for acquiring images provided by an embodiment of the present application;
图3为本申请实施例提供的一种直线检测的流程示意图;3 is a schematic flowchart of a straight line detection provided by an embodiment of the present application;
图4为本申请实施例提供的基于直线的特征确定检测物与锚定物之间相似度的流程示意图;4 is a schematic flowchart of determining the similarity between a detection object and an anchor based on a straight line feature provided by an embodiment of the present application;
图5为本申请实施例提供的一种锚定物检测装置的结构示意图;5 is a schematic structural diagram of an anchor detection device according to an embodiment of the present application;
图6为本申请实施例提供的模板建立的流程示意图;6 is a schematic diagram of a process of creating a template provided by an embodiment of this application;
图7为本申请实施例提供的一种锚定物检测方法的流程示意图;7 is a schematic flowchart of an anchor detection method provided by an embodiment of the present application;
图8为本申请实施例提供的一种电子设备的结构示意图。FIG. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
具体实施方式detailed description
以下结合说明书附图及具体实施例对本申请的技术方案做进一步的详细阐述。The technical solution of the present application will be further elaborated below in conjunction with the drawings and specific embodiments of the specification.
如图1所示,本实施例提供一种锚定物检测方法,包括:As shown in FIG. 1, this embodiment provides an anchor detection method, including:
步骤S110:获取包含有锚定物成像的图像;Step S110: Acquire an image including the anchor imaging;
步骤S120:检测所述图像中的直线;Step S120: Detect the straight line in the image;
步骤S130:基于所检测直线的特征,确定所述检测物与锚定物的相似度;Step S130: Determine the similarity between the detected object and the anchor based on the characteristics of the detected straight line;
步骤S140:基于所述相似度,定位所述锚定物在所述图像中的位置。Step S140: Based on the similarity, locate the position of the anchor in the image.
在本实施例中所述图像可为对锚定物采集的图像,如此,所述锚定物的成像必然包含在图像中,但是可能需要在整张图像中定位出锚定物所在的区域。In this embodiment, the image may be an image collected on the anchor. Thus, the imaging of the anchor must be included in the image, but it may be necessary to locate the area where the anchor is located in the entire image.
在本实施例中,所述锚定物可为已知形状的物体,该锚定物所对应直线的特征是已知的。故在本实施例中,通过直接从图像中检测直线,然后得到检测的直线的特征,基于该特征判断检出的检测物与锚定物的相似度,若相似度足够高,例如,相似度大于相似度阈值,则确定当前检测物即为锚定物,则当前检测物所在的图像区域,即为锚定物的成像区域。In this embodiment, the anchor may be an object with a known shape, and the characteristics of the straight line corresponding to the anchor are known. Therefore, in this embodiment, the straight line is directly detected from the image, and then the feature of the detected straight line is obtained. Based on the feature, the similarity between the detected test object and the anchor is determined. If the similarity is sufficiently high, for example, the similarity If it is greater than the similarity threshold, it is determined that the current detection object is the anchor, and the image area where the current detection object is located is the imaging area of the anchor.
在步骤S110可包括:从采集设备接收所述图像,或者,自行采集所述图像。In step S110, it may include: receiving the image from the collection device, or collecting the image by itself.
图2所示一种在工业上获取所述图像的示意图。在图2中显示有信号灯、摄像头、皮带轮产线;配件盒可为前述锚定物的一种,配件盒随着皮带轮产线的运行而移动。当配件盒移动至摄像头下方,并触发光电开关后,摄像头采集图片,并发送给处理单元进行识别,最输出显示识别结果。如此,设备的处理单元就获取到了摄像头采集的图像。如此获得图像中包括 所述配件盒的成像。FIG. 2 shows a schematic diagram of obtaining the image in industry. Figure 2 shows the signal light, camera, and pulley production line; the accessory box can be one of the aforementioned anchors, and the accessory box moves with the operation of the pulley production line. When the accessory box moves below the camera and triggers the photoelectric switch, the camera collects the picture and sends it to the processing unit for recognition. The output shows the recognition result. In this way, the processing unit of the device obtains the image collected by the camera. The image obtained by including the accessory box in the image thus obtained.
在步骤S120为直接从图像中检测图像,而非基于图像中的点生成图像。在所述图像中检测直线的方式有多种,以下提供几种可选方式:In step S120, an image is directly detected from the image instead of generating an image based on the points in the image. There are many ways to detect straight lines in the image, and the following provides several optional ways:
霍夫变换直线检测;Hough transform straight line detection;
直线分割检测(Line Segment Detector,LSD)直线检测。Line segment detection (Line Segment Detector, LSD) line detection.
所述霍夫变换直线检测的实现可如下:The realization of the Hough transform straight line detection can be as follows:
对于直角坐标系中的任意一点A(x0,y0),经过点A的直线满足Y0=k*X0+b(k是斜率,b是截距);那么在X-Y平面过点A(x0,y0)的直线簇可以用Y0=k*X0+b表示,但对于垂直于X轴的直线斜率是无穷大的则无法表示。因此将直角坐标系转换到极坐标系就能解决该特殊情况。For any point A(x0, y0) in a rectangular coordinate system, the straight line passing through point A satisfies Y0=k*X0+b (k is the slope and b is the intercept); then the point A(x0, y0) is crossed in the XY plane ) Can be represented by Y0=k*X0+b, but it cannot be represented if the slope of the straight line perpendicular to the X axis is infinite. Therefore, converting the rectangular coordinate system to the polar coordinate system can solve this special situation.
所述直线分割检测(Line Segment Detector,LSD)直线检测可如下:先选取极坐标系的原点O为图像的重点(w/2,h/2)。建立笛卡尔坐标系;其中是图像坐标系。极坐标系与笛卡尔坐标系的转换关系为。因此,当已知一线段的首尾点,即可求解出对应的。具体角度的计算请参考直线检测之极坐标表示。The line segment detection (Line Segment Detector, LSD) line detection can be as follows: first select the origin O of the polar coordinate system as the focus of the image (w/2, h/2). Establish the Cartesian coordinate system; among them is the image coordinate system. The conversion relationship between the polar coordinate system and the Cartesian coordinate system is. Therefore, when the first and last points of a line segment are known, the corresponding one can be solved. For the calculation of the specific angle, please refer to the polar coordinate representation of straight line detection.
具体的检测图像中直线的方式有多种,具体不限于上述任意一种。There are many specific ways to detect the straight line in the image, but it is not limited to any of the above.
在步骤S130中所检测直线的特征包括但不限于以下至少之一:The features of the straight line detected in step S130 include but are not limited to at least one of the following:
直线的长度;The length of a straight line;
直线的角度;Straight angle
直线之间的夹角;Angle between straight lines;
直线之间的相对位置关系,例如,该相对位置关系包括:相交和/或平行。The relative position relationship between the straight lines, for example, the relative position relationship includes: intersection and/or parallel.
这些直线的特征组合后直接反应了所述检测物的特点,故在步骤S130中可以基于直线的特点,确定出检测物与锚定物之间的相似度,再基于相似度确定出当前的检测物是否就是锚定物。The combination of the characteristics of these straight lines directly reflects the characteristics of the detection object, so in step S130, the similarity between the detection object and the anchor can be determined based on the characteristics of the straight line, and then the current detection is determined based on the similarity Whether the object is an anchor.
总之,在本实施例中,直接利用直线检测的方式能够检测出已知其直线特征的锚定物,相对于深度学习模型具有实现更加简单及精确度更高,且资源开销更小的特点,同时,当待检测轮廓被未知物体遮挡时,传统算法以及深度学习算法都将失效,而本方法依然适用。In short, in this embodiment, straight line detection can be used to detect anchors whose straight line characteristics are known. Compared with the deep learning model, it has the characteristics of simpler and higher accuracy and less resource overhead. At the same time, when the contour to be detected is obscured by an unknown object, both the traditional algorithm and the deep learning algorithm will fail, and this method is still applicable.
在一些实施例中,如图3所示,所述步骤S110可包括:In some embodiments, as shown in FIG. 3, the step S110 may include:
步骤S111:检测所述图像中的直线并获得至少一条第一直线;Step S111: Detect the straight line in the image and obtain at least one first straight line;
步骤S112:根据所述第一直线的方程式进行直线归类;Step S112: classify straight lines according to the equation of the first straight line;
步骤S113:根据所述第一直线的归类结果,基于属于同一类的所述第一直线形成第二直线。Step S113: According to the classification result of the first straight line, form a second straight line based on the first straight line belonging to the same class.
由于图像的光照等原因或者直线检测的自身的误差,有时候会将一个条直线被检测成多条直线,故在本实施例中直接从图像检测的直线称之为第一直线,此处的第一直线可为有长度的直线,而非数学定义上无线长度的直线。该第一直线具有端点,或者,这种端点又称之为端点。检测到这些第一直线之后,可以获得第一直线的方程式,这种方程式可以称之为直线方程式。直线方程式反应了直线的特点,例如,直线的斜率及截距等。Due to the illumination of the image or the error of the straight line detection, sometimes a straight line is detected as multiple straight lines, so in this embodiment, the straight line directly detected from the image is called the first straight line, here The first straight line may be a straight line with a length instead of a straight line with a wireless length that is mathematically defined. The first straight line has an end point, or such an end point is also called an end point. After detecting these first straight lines, the equation of the first straight line can be obtained. This equation can be called a straight line equation. The straight line equation reflects the characteristics of the straight line, for example, the slope and intercept of the straight line.
在本实施例中,基于第一直线的方程式进行直线归类,例如,将足够相似的两条直线视为归类为同一类,然后基于同一类的第一直线得到第二直线。In this embodiment, straight line classification is performed based on the equation of the first straight line. For example, two straight lines that are sufficiently similar are considered to be classified into the same type, and then a second straight line is obtained based on the first straight line of the same type.
在一些实施例中,所述步骤S112可包括以下至少之一:In some embodiments, the step S112 may include at least one of the following:
比对不同第一直线的斜率和截距,将斜率和截距相同的多条第一直线归为一类;Compare the slope and intercept of different first straight lines, and classify multiple first straight lines with the same slope and intercept as one category;
基于不同第一直线的斜率和截距,计算任意两条第一直线之间的范式距离,若范式距离小于第二距离阈值,可以将这两条第一直线归为一类。具体如,所述步骤S112可包括:根据所述第一直线的首尾点的坐标,确定所述第一直线的直角坐标方程式;根据所述直角坐标方程式确定所述第一 直线的斜率和截距;基于所述斜率和所述截距,确定两条所述第一直线之间的范式距离;将所述范式距离小于第二距离阈值的两条所述第一直线归为一类。在本实施例中,所述首尾点可为一条直线的两个端点。Based on the slopes and intercepts of different first straight lines, the paradigm distance between any two first straight lines is calculated. If the paradigm distance is less than the second distance threshold, the two first straight lines can be classified into one category. Specifically, the step S112 may include: determining the rectangular coordinate equation of the first straight line according to the coordinates of the head and tail points of the first straight line; and determining the slope of the first straight line according to the rectangular coordinate equation And intercept; based on the slope and the intercept, determine the paradigm distance between the two first straight lines; the paradigm distance is less than the second distance threshold of the two first straight lines are classified as one type. In this embodiment, the first and last points may be two endpoints of a straight line.
所述范式距离有称之为曼哈顿距离,是可以通过如下公式确定的:The normal distance is called Manhattan distance, which can be determined by the following formula:
以坐标(X1,Y1)和坐标(X2,Y2)为例:Take the coordinates (X1, Y1) and coordinates (X2, Y2) as an example:
求取X1和X2之间差的第一绝对值,Find the first absolute value of the difference between X1 and X2,
求取Y1和Y2之间差的第二绝对值,Find the second absolute value of the difference between Y1 and Y2,
计算所述第一绝对值和所述第二绝对值的和,得到所述坐标(X1,Y1)和坐标(X2,Y2)的范式距离。The sum of the first absolute value and the second absolute value is calculated to obtain the normal distance of the coordinates (X1, Y1) and the coordinates (X2, Y2).
总之,基于所述方程式进行直线归类的方式有多种,不局限于上述任意一种。In short, there are many ways to classify straight lines based on the equations, and are not limited to any of the above.
在步骤S113中会基于归为同一类的第一直线生成一条串联同一类第一直线的第二直线。所述步骤S113的实现方式有多种,在本实施例中提供两种可选方式:In step S113, a second straight line connecting the first straight lines of the same type is generated based on the first straight lines classified into the same type. There are various ways to implement step S113, and in this embodiment, two optional ways are provided:
基于同一类的各条第一直线的首尾点的坐标,进行第二直线的软拟合,如此,即便第一直线的存在一定偏差的情况下,也可以成功且精确的拟合出所述第二直线;Based on the coordinates of the head and tail points of each first straight line of the same type, soft fitting of the second straight line is performed. In this way, even if there is a certain deviation in the first straight line, the fitting can be successfully and accurately performed. State the second straight line;
基于同一类的各条第一直线的首尾点的坐标,进行第二直线的硬拟合。Based on the coordinates of the head and tail points of each first straight line of the same type, a hard fitting of the second straight line is performed.
在进行第二直线的软拟合时,将同一类的多条第二直线的首尾点的坐标得到之后,通过软拟合则同一类所有第一直线的首尾点均位于所述第二直线上或者围绕在所述第二直线周围。When the soft fitting of the second straight line is obtained, after the coordinates of the head and tail points of multiple second straight lines of the same type are obtained, the head and tail points of all the first straight lines of the same type are located on the second straight line through soft fitting Up or around the second straight line.
在进行第二直线的硬拟合是:可以直接找出多条第一直线的首尾点的坐标,然后第一点和第二点,就可以得到所述第二直线。例如,该预定坐标轴可为x轴或y轴,x轴垂直y轴,x轴和y轴构成了一个二维坐标系。此处,所述第一点为第一直线的首尾点分别与原点连线,然后看该连线与 预设坐标轴的夹角,其中,第一点为最大夹角所对应的点,所述第二点为最小夹角所对应的点。所述首尾点又可以称之为端点,包括:第一直线两端的两个端点。When performing the hard fitting of the second straight line, the coordinates of the head and tail points of multiple first straight lines can be directly found, and then the first point and the second point can be obtained. For example, the predetermined coordinate axis may be an x axis or a y axis, the x axis is perpendicular to the y axis, and the x axis and the y axis constitute a two-dimensional coordinate system. Here, the first point is the first and last points of the first straight line connected to the origin, and then looking at the angle between the line and the preset coordinate axis, where the first point is the point corresponding to the maximum included angle, The second point is the point corresponding to the smallest included angle. The first and last points can also be called end points, including: two end points at both ends of the first straight line.
通过第二直线的形成,可以减少因为直接从图像中检测直线,导致的大量重复的直线的现象,方便后续精确定位锚定物在图像中的位置。By forming the second straight line, the phenomenon of a large number of repeated straight lines caused by directly detecting the straight line from the image can be reduced, and it is convenient to accurately locate the position of the anchor in the image later.
在一些实施例中,所述步骤S130可包括:In some embodiments, the step S130 may include:
根据所述检测物的至少两条所述第二直线的交点、夹角和/或所述第二直线的长度,确定所述检测物与锚定物的相似度。The similarity between the test object and the anchor is determined according to the intersection point, the included angle, and/or the length of the second straight line of at least two second straight lines of the test object.
在本实施例中,一个待检测图片会检测出多个待检测轮廓,每个待检测轮廓可以拟合出多条第二直线,该检测直线的特征可包括:第二直线的长度、第二直线之间的夹角及交点等。In this embodiment, a picture to be detected will detect multiple contours to be detected, and each contour to be detected may be fitted with multiple second straight lines. The characteristics of the detected straight line may include: the length of the second straight line, the second Angles and intersections between straight lines.
在本实施例中,可以以上述第二直线的多个特征的一个或多个,与锚定物已知直线的特征进行匹配,来确定检测物和检测物之间的相似度。In this embodiment, one or more of the multiple features of the second straight line may be matched with the features of the known straight line of the anchor to determine the similarity between the test object and the test object.
在一些实施例中,所述方法还包括:检测第二直线的特征。In some embodiments, the method further includes detecting features of the second straight line.
所述检测所述第二直线的特征可包括:夹角以及长度。第二直线夹角的求取方式可如下:The feature of detecting the second straight line may include: included angle and length. The method for obtaining the angle of the second straight line can be as follows:
将第i条第二直线所对应第一点向第i条所述第二直线垂直投影以获得第一投影坐标,其中,所述第一点为所述第二条直线所对应第一直线的首尾点与原点之间的连线和预设坐标轴之间夹角最大的点Perpendicularly projecting the first point corresponding to the ith second straight line to the ith second straight line to obtain the first projected coordinates, wherein the first point is the first straight line corresponding to the second straight line The line between the first and last points and the origin and the point with the largest angle between the preset coordinate axes
将第i条所述第二直线所对应的第二点向第i条所述第二直线投影以获得第二投影坐标,其中,所述第二点为所述第二条直线所对应第一直线的首尾点与原点之间的连线和预设坐标轴之间夹角最小的点;Projecting a second point corresponding to the i-th second line onto the i-th second line to obtain second projected coordinates, wherein the second point is the first corresponding to the second line The line between the beginning and end points of the line and the origin and the point with the smallest angle between the preset coordinate axes;
确定第i条第二直线和第j条第二直线之间的交点与所述第一投影坐标和所述第二投影坐标之间的距离;Determining the distance between the intersection point between the ith second straight line and the jth second straight line and the first projected coordinate and the second projected coordinate;
所述距离小于第一距离阈值,则确定所述第i条第二直线和第j条第二 直线相交;If the distance is less than the first distance threshold, it is determined that the i-th second straight line and the j-th second straight line intersect;
基于所述第i条第二直线和与所述第i条第二直线相交的其他两条所述第二直线的交点坐标,确定出所述第i条直线的长度。The length of the i-th straight line is determined based on the intersection point coordinates of the i-th second straight line and two other second straight lines that intersect the i-th second straight line.
例如,第i第二直线和第二直线A和第二直线B分别相交,且第i第二直线与第二直线A的交点靠近所述第一投影坐标,所述第i第二直线与第二直线B的交点靠近第二投影坐标,则可以基于第i第二直线分别与第二直线A和第二直线B之间的交点,计算所述第二直线的长度。For example, the ith second straight line and the second straight line A and the second straight line B respectively intersect, and the intersection point of the ith second straight line and the second straight line A is close to the first projected coordinate, and the ith second straight line and the second straight line If the intersection point of the two straight lines B is close to the second projected coordinates, the length of the second straight line may be calculated based on the intersection points between the i-th second straight line and the second straight line A and the second straight line B, respectively.
在一些实施例中,所述第i条第二直线可能与超过两条第二直线相交,则在计算第i条第二直线的长度时可以采用以下方法:In some embodiments, the ith second straight line may intersect with more than two second straight lines, and the following method may be used when calculating the length of the ith second straight line:
选择出与第i条第二直线上第一投影坐标距离最小的第m1条第二直线;Select the m1 second straight line with the smallest distance from the first projected coordinate on the ith second straight line;
选择出与第i条第二直线上第一投影坐标距离最小的第m2条第二直线;Select the m2 second straight line with the smallest distance from the first projected coordinate on the ith second straight line;
基于第i条直线与第m1第二直线的第一交点,和第i条第二直线与第m2第二直线的第二交点,计算出第i条第二直线的长度;以提高长度的精度。Calculate the length of the ith second straight line based on the first intersection of the ith straight line and the m1 second straight line, and the second intersection of the ith second straight line and the m2 second straight line; to improve the accuracy of the length .
在一些实施例中,所述方法包括:第i条第二直线与第j条第二直线相交,则确定所述第i条直线和所述第j条第二直线的夹角。In some embodiments, the method includes: the ith second straight line intersects with the jth second straight line, and then determining the angle between the ith straight line and the jth second straight line.
此处的夹角,可以通过两条第二直线的直线方程直接求解,也可以通过其他方式进行求解。例如,并求出第一点Pfi=(x fi,y fi)在直线i上的投影点Ptfi=(xt fi,yt fi),以及第二点Pni=(x ni,y ni)在直线i上的投影点Ptni=(xt ni,yt ni),计算直线i上Pfi与其他直线首尾点距离最近的点Pfi(或者Pni)j≠i,求直线i与j的交点坐标PRfi=(xr fi,yr fi),此时有i与j的夹角为: The angle here can be directly solved by the straight line equation of the two second straight lines, or can be solved by other methods. For example, and find the projection point of the first point Pfi = (x fi , y fi ) on the line i Ptfi = (xt fi , yt fi ), and the second point Pni = (x ni , y ni ) on the line i The projection point Ptni on the line = (xt ni , yt ni ), calculate the point Pfi (or Pni) j≠i which is the closest distance between the Pfi on the straight line i and the start and end points of other straight lines, and find the intersection coordinate of the straight lines i and j PRfi = (xr fi , Yr fi ), the angle between i and j is:
Figure PCTCN2019124678-appb-000001
Figure PCTCN2019124678-appb-000001
所述预设坐标轴可为x轴或者y轴。若锚定轮廓中两条第二直线的端点坐标距离小于设定阈值,则认为该两条第二直线相交,通过直线方程式即可求出直线夹角。The preset coordinate axis may be an x axis or a y axis. If the coordinate distance between the end points of the two second straight lines in the anchor profile is less than the set threshold, the two second straight lines are considered to intersect, and the angle between the straight lines can be obtained by the straight line equation.
反复执行上述步骤,可以锚定轮廓任意两条第二直线的夹角以及第二直线的长度。By repeating the above steps, the angle between any two second straight lines of the outline and the length of the second straight line can be anchored.
锚定轮廓中可以检测出多条第二直线,每一条第二直线都有各自的首尾点,然后找到离各所述第二直线的首尾点最近和最远的其他第二直线,则根据并进一步判断两条第二直线是否相交。在一些实施例中,每条第二直线会找到两条第二相交直线,通过截线即可确认该第二直线的长度。A plurality of second straight lines can be detected in the anchoring profile, each second straight line has its own head and tail points, and then find other second straight lines that are closest to and farthest from the head and tail points of each second straight line. It is further determined whether two second straight lines intersect. In some embodiments, each second straight line will find two second intersecting straight lines, and the length of the second straight line can be confirmed by cutting the line.
在一些实施例中,如图4所示,所述步骤S130可包括:In some embodiments, as shown in FIG. 4, the step S130 may include:
步骤S131:将检测物的第二直线集合中的第x条第二直线与其他第二直线之间的夹角,与所述锚定物的模板内的第y条直线与其他直线之间的夹角匹配;Step S131: the angle between the x-th second straight line and the other second straight lines in the second set of straight lines of the detection object and the y-th straight line and other straight lines in the template of the anchor Angle matching;
步骤S132:基于所述夹角的匹配结果,确定所述模板中所述第x条第二直线与所述第y条直线是否满足夹角匹配条件;Step S132: Based on the matching result of the included angle, determine whether the x-th second straight line and the y-th straight line in the template satisfy the included angle matching condition;
步骤S133:确定所述第x条第二直线与所述第y条直线是否满足长度匹配条件;Step S133: Determine whether the x-th second straight line and the y-th straight line satisfy the length matching condition;
步骤S134:所述第x条第二直线与所述第y条直线同时满足所述夹角匹配条件及所述长度匹配条件,根据所述第x条第二直线的首尾点的坐标和所述第y条直线首尾点的坐标,确定出将所述第x条第二直线仿射变换到所述第y条直线的仿射矩阵;Step S134: the x-th second straight line and the y-th straight line satisfy the angle matching condition and the length matching condition at the same time, according to the coordinates of the head and tail points of the x-th second straight line and the The coordinates of the first and last points of the yth line determine the affine matrix that transforms the second affine line of the xth line to the yth line;
步骤S135:根据所述仿射矩阵,变换所述第x条第二直线以外的其他所述第二直线以获得所述检测物仿射变换后的第二直线集合;Step S135: Transform the second straight line other than the x-th second straight line according to the affine matrix to obtain a second set of straight lines after the affine transformation of the test object;
步骤S136:确定所述第二直线集合与所述模板中的直线相似度;Step S136: Determine the similarity between the second set of straight lines and the straight lines in the template;
步骤S137:根据所述相似度,确定所述检测物是否为所述锚定物。Step S137: Determine whether the detection object is the anchor according to the similarity.
由于锚定物相对于摄像头的角度会发生一定的变化,则锚定物在图像中的成像可能会发生平移等变化。在本实施例中为了精确匹配,会进行直线之间的夹角和长度的匹配,从而确定出所检测的直线与锚定物模板中的直线的相似度。Since the angle of the anchor relative to the camera will change to some extent, the imaging of the anchor in the image may change in translation and the like. In this embodiment, for accurate matching, the angle and the length between the straight lines are matched to determine the similarity between the detected straight line and the straight line in the anchor template.
所述x和y均为正整数,其中,x小于或等于所述第二直线的总条数,y小于或等于模板中直线的总条数。Both x and y are positive integers, where x is less than or equal to the total number of second straight lines, and y is less than or equal to the total number of straight lines in the template.
在一些实施例中,模板可为所述电子设备预先生成的并存储在电子设备中的。在一些实施例中,所述模板还可以是所述电子设备从其他设备预先接收的。In some embodiments, the template may be pre-generated by the electronic device and stored in the electronic device. In some embodiments, the template may also be pre-received by the electronic device from other devices.
一条第二直线和模板中任意一条直线,各自与其他直线之间的夹角满足夹角相似条件,同时满足长度相似条件,则说明所检测的第二直线与模板中对应的直线相似,然后由于位移等导致两条相似或相匹配的直线的坐标不一致,如此,通过相似或匹配的两条直线的首尾点的坐标的变化,可以求解出所述仿射矩阵。将这些仿射矩阵用于所检测的其他第二直线的仿射变化,就可以快速得到仿射变化后的第二直线,然后与模板中的直线进行匹配,就可以得到所检测直线与模板中直线的匹配条数与总条数之间的第一比值,或者,匹配条数与不匹配条数之间的第二比值。此处的第一比值和/或第二比值可以直接作为评价所述检测物与锚定物之间相似程度的参数。若所述第一比值和/或所述第二比值大于比值阈值,可认为检测物和锚定物相同,该检测物在图像区域即为锚定物的成像区域。The angle between a second straight line and any straight line in the template satisfies the angle similarity condition and the length similarity condition, which means that the detected second line is similar to the corresponding line in the template. Displacement or the like causes the coordinates of two similar or matching straight lines to be inconsistent. Thus, by changing the coordinates of the head and tail points of two similar or matching straight lines, the affine matrix can be solved. Using these affine matrices for the detected affine changes of other second straight lines, you can quickly get the affine changed second straight lines, and then match the straight lines in the template, you can get the detected straight lines and the template The first ratio between the number of matching lines and the total number of lines, or the second ratio between the number of matching lines and the number of unmatching lines. The first ratio and/or the second ratio here can be directly used as a parameter for evaluating the degree of similarity between the test substance and the anchor substance. If the first ratio and/or the second ratio is greater than the ratio threshold, it may be considered that the detection object and the anchor are the same, and the detection object is the imaging region of the anchor in the image area.
所述确定所述第x条第二直线与所述第y条直线是否满足长度匹配条件,包括:确定所述第x条第二直线与所述第y条直线的长度差是否小于长度阈值;The determining whether the x-th second straight line and the y-th straight line satisfy the length matching condition includes: determining whether a length difference between the x-th second straight line and the y-th straight line is less than a length threshold;
所述第x条第二直线与第y条直线的长度差小于所述长度阈值,则确 定所述第x条第二直线与所述第y条直线满足所述长度匹配条件。If the length difference between the xth second straight line and the yth straight line is less than the length threshold, it is determined that the xth second straight line and the yth straight line satisfy the length matching condition.
在一些实施例中,所述方法还包括:待检测图片可以检测出多个轮廓,需要对轮廓进行遍历;从而从多个图像中找到有锚定物成像的图像,并获得锚定物的成像在该图像中的位置。In some embodiments, the method further includes: the picture to be detected can detect multiple contours, and the contours need to be traversed; thereby, an image with an anchor imaging is found from the multiple images, and the imaging of the anchor is obtained The position in the image.
在一些实施例中,所述方法还可包括:所述检测物的第x条第二直线与所述模板中的多条直线同时满足所述夹角匹配条件和所述长度匹配条件,生成组合集,其中,所述组合集中包括第x条第二直线与至少两条直线的多个组合;所述步骤S130可包括:遍历所述组合集中每一个组合,基于每一个所述组合确定所述检测物与锚定物的相似度。In some embodiments, the method may further include: the x-th second straight line of the test object and the multiple straight lines in the template satisfy the angle matching condition and the length matching condition at the same time, generating a combination Set, wherein the combination set includes a plurality of combinations of the x-th second straight line and at least two straight lines; the step S130 may include: traversing each combination in the combination set and determining the based on each combination The similarity between the test object and the anchor.
例如,在所述步骤S130可包括:遍历所述组合集,确定出每一种组合对应的仿射矩阵;基于求解出的每一个仿射矩阵变换检测到的第二直线,将变换后的第二直线与模板中的直线进行匹配,根据变换后的第二直线与直线的相似程度或匹配程度,确定当前检测到的检测物是否为所述锚定物。For example, in the step S130, it may include: traversing the combination set to determine the affine matrix corresponding to each combination; based on the second straight line detected by the transformation of each affine matrix solved, the transformed first The second straight line is matched with the straight line in the template, and according to the degree of similarity or matching degree between the transformed second straight line and the straight line, it is determined whether the currently detected test object is the anchor.
若锚定物为矩形物、梯形物等,可能存在多条平行的边,则此时一条第x条第二直线可能会与模板中的多条直线相似或匹配,在本实施例中,会将一组匹配的两条直线视为一个组合,形成一个组合集。然后遍历组合集中每一个组合,求解出每一个组合的仿射矩阵,基于每一个组合确定检测物与锚定物之间的相似度,从而确定出检测物与锚定物是否相似。在一些实施例中,所述方法还包括:If the anchor is rectangular, trapezoid, etc., there may be multiple parallel sides, then at this time, an x-th second straight line may be similar to or match with multiple straight lines in the template. In this embodiment, Consider a set of matching two straight lines as a combination to form a combination set. Then traverse each combination in the combination set, solve the affine matrix of each combination, and determine the similarity between the test object and the anchor based on each combination, thereby determining whether the test object and the anchor are similar. In some embodiments, the method further includes:
根据所述模板中所有直线的夹角,确定夹角范围;Determine the included angle range according to the included angle of all straight lines in the template;
存在所述检测物的所述第二直线与其他所述第二直线的夹角位于所述夹角范围外,则将所述检测物中与其他所述第二直线的夹角位于所述夹角范围外的所述第二直线从所述第二直线集合剔除。If the angle between the second straight line and the other second straight line where the detection object exists is outside the angle range, the angle between the second straight line and the other second straight line in the detection object is located at the angle The second straight line outside the angular range is eliminated from the second straight line set.
模板中各个直线与其他直线之间的夹角一旦确定,则模板中多条直线之间的夹角范围就确定了。在本实施例中,为了减少后续计算量,可以预 先基于模板中任意两条直线之间的夹角,确定出所述夹角范围。然后利用该夹角范围从第二直线集合中提出异常的第二直线。Once the angle between each straight line in the template and other straight lines is determined, the angle range between multiple straight lines in the template is determined. In this embodiment, in order to reduce the amount of subsequent calculations, the angle range may be determined based on the angle between any two straight lines in the template in advance. Then, using the included angle range, an abnormal second straight line is proposed from the second straight line set.
在本实施例中,所述方法还包括:In this embodiment, the method further includes:
获取所述图像;Obtain the image;
获得图像包含所述锚定物成像的候选轮廓区域;The obtained image contains candidate contour regions imaged by the anchor;
从所述候选轮廓区域选择面积最大的轮廓区域为目标轮廓区域;Selecting the contour area with the largest area from the candidate contour areas as the target contour area;
所述步骤S120可包括:检测位于所述目标轮廓区域的直线。The step S120 may include detecting a straight line located in the target contour area.
在本实施例中,可以通过像素级别的分割,将有物品成像的区域与背景区域分割出来,得到一个或多个候选轮廓区域。In this embodiment, pixel-level segmentation can be used to segment the area where the object is imaged from the background area to obtain one or more candidate contour areas.
当前仅得到一个候选轮廓区域,则确定该候选轮廓区域即为所述目标轮廓区域。Currently, only one candidate contour area is obtained, and it is determined that the candidate contour area is the target contour area.
当前得到了多个候选轮廓区域,则可以从该候选轮廓区域中选出一个或多个目标轮廓区域。例如,选择当前面积最大的候选轮廓区域作为所述目标轮廓区域,在步骤S110中进行直线检测。Currently, if multiple candidate contour regions are obtained, one or more target contour regions can be selected from the candidate contour regions. For example, a candidate contour region with the largest current area is selected as the target contour region, and straight line detection is performed in step S110.
在该目标轮廓区域内检测到与锚定物相似或匹配的检测物,则可认为锚定物定位成功,则可以停止检测。If a detection object similar to or matching the anchor is detected in the target contour area, it can be considered that the anchor is successfully positioned, and the detection can be stopped.
当前目标轮廓区域中未检测到锚定物,则以面积次大的候选轮廓区域为目标轮廓区域继续检测,如此直到检测到锚定物,或者,直到所有的候选轮廓区域都被视为目标轮廓区域完成了检测。If no anchor is detected in the current target contour area, the candidate contour area with the next largest area is used as the target contour area to continue the detection, so until the anchor is detected, or until all candidate contour areas are regarded as the target contour The area has been tested.
在一些实施例中,还可以直接根据摄像头的采集参数及锚定物的尺寸,确定出锚定物的成像尺寸,基于该成像尺寸从所述候选轮廓区域选择一个或多个作为所述目标轮廓区域,并行对每一个目标轮廓区域进行直线检测,加速锚定物的定位速率。所述采集参数可包括但不限于焦距和/或景深等图像采集相关的参数。In some embodiments, the imaging size of the anchor may also be determined directly according to the acquisition parameters of the camera and the size of the anchor, and one or more of the candidate contour regions may be selected as the target contour based on the imaging size Area, parallel detection of each target contour area to speed up the positioning rate of the anchor. The acquisition parameters may include but are not limited to parameters related to image acquisition such as focal length and/or depth of field.
如图5所示,本实施例还提供一种锚定物检测装置,包括:As shown in FIG. 5, this embodiment also provides an anchor detection device, including:
图像模块110,配置为获取包含有锚定物成像的图像;The image module 110 is configured to obtain an image including the imaging of the anchor;
直线模块120,配置为检测所述图像中的直线;The straight line module 120 is configured to detect straight lines in the image;
相似度模块130,配置为基于所检测直线的特征,确定所述检测物与锚定物的相似度;The similarity module 130 is configured to determine the similarity between the detected object and the anchor based on the characteristics of the detected straight line;
定位模块140,配置为基于所述相似度,定位所述锚定物在所述图像中的位置。The positioning module 140 is configured to position the anchor in the image based on the similarity.
在一些实施例中,所述图像模块110、直线模块120、相似度模块130及定位模块140可均为程序模块,所述程序模块被处理器执行后,能够图像的获取、直线的检测、相似度的确定,及锚定物在图像中的定位。In some embodiments, the image module 110, the straight line module 120, the similarity module 130, and the positioning module 140 may all be program modules. After the program modules are executed by the processor, image acquisition, straight line detection, and similarity The determination of the degree and the positioning of the anchor in the image.
在一些实施例中,所述直线模块120,配置为检测所述图像中的直线并获得至少一条第一直线;根据所述第一直线的方程式进行直线归类;根据所述第一直线的归类结果,基于属于同一类的所述第一直线形成第二直线。In some embodiments, the straight line module 120 is configured to detect a straight line in the image and obtain at least one first straight line; classify straight lines according to the equation of the first straight line; according to the first straight line The classification result of the line forms a second straight line based on the first straight line belonging to the same class.
在一些实施例中,所述基于相似度模块130,配置为根据所述检测物的至少两条所述第二直线的交点、夹角和/或所述第二直线的长度,确定所述检测物与锚定物的相似度。In some embodiments, the similarity-based module 130 is configured to determine the detection based on the intersection point, the included angle, and/or the length of the second straight line of at least two second straight lines of the test object The similarity between the object and the anchor.
在一些实施例中,所述装置还包括:In some embodiments, the device further includes:
第一投影模块,配置为将第i条第二直线所对应第一点向第i条所述第二直线垂直投影以获得第一投影坐标,其中,所述第一点为所述第二条直线所对应第一直线的首尾点与原点之间的连线和预设坐标轴之间夹角最大的点;A first projection module configured to vertically project the first point corresponding to the ith second straight line onto the ith second straight line to obtain a first projection coordinate, wherein the first point is the second straight line The line between the beginning and end points of the first straight line corresponding to the straight line and the origin and the point with the largest angle between the preset coordinate axes;
第二投影模块,配置为将第i条所述第二直线所对应的第二点向第i条所述第二直线投影以获得第二投影坐标,其中,所述第二点为所述第二条直线所对应第一直线的首尾点与原点之间的连线和预设坐标轴之间夹角最小的点;A second projection module configured to project a second point corresponding to the ith second straight line to the ith second straight line to obtain second projected coordinates, wherein the second point is the first The line between the beginning and end points of the first straight line corresponding to the two straight lines and the origin and the point with the smallest angle between the preset coordinate axes;
长度模块,配置为确定第i条第二直线和第j条第二直线之间的交点与 所述第一投影坐标和所述第二投影坐标之间的距离;所述距离小于第一距离阈值,则确定所述第i条第二直线和第j条第二直线相交;基于交点坐标,确定出所述第i条第二直线的长度,其中,所述交点坐标为所述第i条第二直线与至少两条其他所述第二直线的相交点的坐标。A length module configured to determine the distance between the intersection point between the ith second straight line and the jth second straight line and the first projected coordinate and the second projected coordinate; the distance is less than the first distance threshold , It is determined that the i-th second straight line intersects with the j-th second straight line; based on the coordinates of the intersection point, the length of the i-th second straight line is determined, wherein the coordinate of the intersection point is the i-th second straight line The coordinates of the intersection point of the second straight line and at least two other second straight lines.
在一些实施例中,所述装置还包括:In some embodiments, the device further includes:
第一夹角模块,配置为第i条第二直线与第j条第二直线相交,则确定所述第i条直线和所述第j条第二直线的夹角。The first angle module is configured such that the i-th second straight line intersects with the j-th second straight line, and then determines the angle between the i-th straight line and the j-th second straight line.
在一些实施例中,所述直线模块120,配置为根据所述第一直线的首尾点的坐标,确定所述第一直线的直角坐标方程式;根据所述直角坐标方程式确定所述第一直线的斜率和截距;基于所述斜率和所述截距,确定两条所述第一直线之间的范式距离;将所述范式距离小于第二距离阈值的两条所述第一直线归为一类。In some embodiments, the straight line module 120 is configured to determine the rectangular coordinate equation of the first straight line according to the coordinates of the first and last points of the first straight line; determine the first coordinate according to the rectangular coordinate equation The slope and the intercept of the straight line; based on the slope and the intercept, determine the paradigm distance between the two first straight lines; the two firsts whose distance of the paradigm is less than the second distance threshold Straight lines are grouped together.
在一些实施例中,所述相似度模块130,配置为将检测物的第二直线集合中的第x条第二直线与其他第二直线之间的夹角,与所述锚定物的模板内的第y条直线与其他直线之间的夹角匹配;基于所述夹角的匹配结果,确定所述模板中所述第x条第二直线与所述第y条直线是否满足夹角匹配条件;确定所述第x条第二直线与所述第y条直线是否满足长度匹配条件;若所述第x条第二直线与所述第y条直线同时满足所述夹角匹配条件及所述长度匹配条件,根据所述第x条第二直线的首尾点的坐标和所述第y条直线首尾点的坐标,确定出将所述第x条第二直线仿射变换到所述第y条直线的仿射矩阵;根据所述仿射矩阵,变换所述第x条第二直线以外的其他所述第二直线以获得所述检测物仿射变换后的第二直线集合;确定所述第二直线集合与所述模板中的直线相似度;根据所述相似度,确定所述检测物是否为所述锚定物。In some embodiments, the similarity module 130 is configured to determine the angle between the x-th second straight line in the second straight line set of the detected object and other second straight lines, and the template of the anchor The angle match between the y-th straight line and other straight lines in the inside; based on the matching result of the angle, determine whether the x-th second straight line and the y-th straight line in the template satisfy the angle matching Conditions; determine whether the x-th second straight line and the y-th straight line satisfy the length matching condition; if the x-th second straight line and the y-th straight line simultaneously satisfy the included angle matching condition and all The length matching condition, based on the coordinates of the head and tail points of the xth second line and the coordinates of the head and tail points of the yth line, determining the affine transformation of the xth second line to the y An affine matrix of straight lines; according to the affine matrix, transform the second straight line other than the x-th second straight line to obtain a set of second straight lines after the affine transformation of the test object; determine the The similarity between the second set of straight lines and the straight lines in the template; according to the similarity, it is determined whether the detection object is the anchor.
在一些实施例中,所述装置,还包括:In some embodiments, the device further includes:
组合模块,配置为所述检测物的第x条第二直线与所述模板中的多条直线同时满足所述夹角匹配条件和所述长度匹配条件,生成组合集,其中,所述组合集中包括第x条第二直线与至少两条直线的多个组合;A combination module, configured such that the x-th second straight line of the detection object and the multiple straight lines in the template simultaneously satisfy the included angle matching condition and the length matching condition to generate a combined set, wherein the combined set Including multiple combinations of the xth second straight line and at least two straight lines;
所述相似度模块130,配置为遍历所述组合集中每一个组合,基于每一个所述组合确定所述检测物与锚定物的相似度。The similarity module 130 is configured to traverse each combination in the combination set and determine the similarity between the detection object and the anchor based on each combination.
在一些实施例中,所述装置还包括:In some embodiments, the device further includes:
夹角范围模块,配置为根据所述模板中所有直线的夹角,确定夹角范围;The included angle range module is configured to determine the included angle range according to the included angle of all straight lines in the template;
剔除模块,配置为存在所述检测物的所述第二直线与其他所述第二直线的夹角位于所述夹角范围外,则将所述检测物中与其他所述第二直线的夹角位于所述夹角范围外的所述第二直线从所述第二直线集合剔除。The rejection module is configured such that the angle between the second straight line and the other second straight line where the detected object exists is outside the included angle range, and then the angle between the detected object and the other second straight line is included The second straight line whose angle is outside the included angle range is removed from the second straight line set.
在一些实施例中,所述装置还包括:In some embodiments, the device further includes:
候选轮廓区域模块,配置为获取所述图像并获得图像包含所述锚定物成像的候选轮廓区域;A candidate contour region module configured to acquire the image and obtain a candidate contour region imaged by the anchor including the anchor;
目标轮廓区域模块,配置为从所述候选轮廓区域选择面积最大的轮廓区域为目标轮廓区域;A target contour area module configured to select a contour area with the largest area from the candidate contour area as the target contour area;
所述直线模块120,配置为检测位于所述目标轮廓区域的直线。The straight line module 120 is configured to detect a straight line located in the target contour area.
以下结合上述任意实施例提供一个具体示例:The following provides a specific example in combination with any of the above embodiments:
示例1:Example 1:
硬件部分以及系统算法部分。Hardware part and system algorithm part.
如图2所示,硬件部分包括:皮带产线,光电传感器,以及位于皮带产线正上方的摄像头,当配件盒移动至摄像头下方,并触发光电开关后,摄像头采集图片,并发送给处理单元进行识别,最输出显示识别结果。As shown in Figure 2, the hardware part includes: a belt production line, a photoelectric sensor, and a camera directly above the belt production line. When the accessory box moves below the camera and triggers the photoelectric switch, the camera collects the picture and sends it to the processing unit Recognize, the most output shows the recognition results.
第一部分,模板建立,作为模板的图片需要具备以下标准:(1)图 片背景纯净(2)待检测锚定物轮廓清晰且无遮挡(2)图片待检测锚定物的外轮廓最大且只包含一个模板锚定物。The first part, the template is established, the picture as a template needs to have the following standards: (1) the background of the picture is pure (2) the contour of the anchor to be detected is clear and unobstructed (2) the outer contour of the anchor to be detected is the largest and contains A template anchor.
具体的模板建立方法可参考图6,包括以下几步:The specific template creation method can refer to Figure 6, including the following steps:
选取轮廓提取模板图片,具体可如:像素分割,设置像素阈值,通过像素分割提取图像中的候选轮廓区域;具体如,;比较每个轮廓候选区域的面积,保留面积最大的区域筛除所有其他区域;Select the contour extraction template picture, such as: pixel segmentation, set pixel threshold, extract candidate contour regions in the image by pixel segmentation; specifically, compare the area of each contour candidate region, and retain the largest area to filter out all others area;
图像二值化;Binary image;
从二值化后的图片中提取轮廓;Extract the outline from the binarized picture;
进一步提取出面积最大的轮廓;Further extract the outline with the largest area;
使用直线检测算法进行直线检测,例如,对区域轮廓使用直线检测算法提取直线,具体实施例中使用的算法是霍夫直线检测或者LSD直线检测算法,检测出轮廓中所有的直线;The straight line detection algorithm is used for straight line detection, for example, the straight line detection algorithm is used to extract straight lines for the area contour. The algorithm used in the specific embodiment is the Hough straight line detection or LSD straight line detection algorithm, which detects all straight lines in the contour;
计算所有直线的直角坐标方程式,通过直线检测可以得到每条分线段的始末坐标,设第i条直线的首点的坐标为Psi=(x si,y si),尾点的坐标为Pei=(x ei,y ei),则有直线i方程式为: Calculate the rectangular coordinate equations of all straight lines. The straight line detection can get the starting and ending coordinates of each line segment. Let the coordinate of the first point of the i-th line be Psi=(x si , y si ) and the coordinate of the tail point Pei=( x ei , y ei ), then the equation of a straight line i is:
Figure PCTCN2019124678-appb-000002
Figure PCTCN2019124678-appb-000002
此时得到直线i的斜率a i,与截距为b i,得到所有的斜率和截距后,对斜率和截距进行聚类,聚类中心个数为待检锚定物轮廓直线个数。 At this time, the slope a i of the straight line i and the intercept b i are obtained. After all the slopes and intercepts are obtained, the slopes and intercepts are clustered, and the number of cluster centers is the number of straight lines of the anchor contour to be inspected .
聚类完毕后,对归属同一类的直线i的所有首尾点进行直线拟合,计算所有点到图像原点的原始检测直线与x轴之间的夹角,并求出最大夹角的第一点Pfi=(x fi,y fi)在直线i上的投影点Ptfi=(xt fi,yt fi),以及最小夹角所对应的第二点Pni=(x ni,y ni)在直线i上的投影点Ptni=(xt ni,yt ni),投影计算公式以最远为例,若直线i通过原点,则Pfi为距离原点最远的点,Pni 为距离原点最近的点: After the clustering is completed, straight line fitting is performed on all the head and tail points of the line i belonging to the same class, the angle between the original detection line from all points to the image origin and the x axis is calculated, and the first point of the maximum angle is obtained Pfi = (x fi , y fi ) projection point on line i Ptfi = (xt fi , yt fi ), and the second point corresponding to the smallest angle Pni = (x ni , y ni ) on line i Projection point Ptni = (xt ni , yt ni ), the projection calculation formula takes the farthest as an example, if the straight line i passes through the origin, then Pfi is the farthest point from the origin, and Pni is the closest point to the origin:
Figure PCTCN2019124678-appb-000003
Figure PCTCN2019124678-appb-000003
计算直线i上Pfi与其他直线首尾点距离最近的点Pfi(或者Pni)j≠i,求直线i与j的交点坐标PRfi=(xr fi,yr fi),此时有i与j的夹角为 Calculate the point Pfi (or Pni) j≠i which is the closest distance between the Pfi on the straight line i and the start and end points of other straight lines, and find the coordinate of the intersection point of the straight lines i and j PRfi=(xr fi , yr fi ). for
Figure PCTCN2019124678-appb-000004
Figure PCTCN2019124678-appb-000004
相同的方法求出Pni与其他直线距离最近的点Pni(或者Pfi)Pfi求出直线i与j的交点坐标PRni=(xr ni,yr ni),此时有i的长度计算公式为: The method of obtaining the same and other linear Pni nearest point Pni (or Pfi) Pfi straight line i and j is calculated intersection coordinates PRni = (xr ni, yr ni ), i having a length at this time is calculated as:
Figure PCTCN2019124678-appb-000005
Figure PCTCN2019124678-appb-000005
记录每条直线的长度L i,两个夹角θ fi以及θ ni,最终检测出模板中锚定物包含C line条直线。 Record the length L i of each line, the two included angles θ fi and θ ni , and finally detect that the anchor in the template contains C line lines.
记录所有夹角的最大值为θ min,最小值为θ maxRecord the maximum value of all included angles as θ min and the minimum value as θ max .
模板建立完毕后,即可进行测试,当配件盒挡住光电开关,摄像头采集待检图片后,参考图7所示,检测可包括如下操作:After the template is established, the test can be carried out. When the accessory box blocks the photoelectric switch and the camera collects the picture to be inspected, referring to FIG. 7, the inspection may include the following operations:
图像二值化,提取轮廓,并选取轮廓,具体可包括:像素分割,并通过像素阈值,提取候选轮廓;通过面积阈值对轮廓进行初步筛选,过滤掉面积小于锚定物锚定物轮廓,得到N area个候选轮廓;对第一个轮廓(N area=1)使用直线检测算法,检测出该轮廓中所有的直线。 Image binarization, extraction of contours, and selection of contours, which can include: pixel segmentation, and extraction of candidate contours through pixel thresholds; preliminary filtering of contours by area thresholds, filtering out areas smaller than anchors, and obtaining N area candidate contours; use the straight line detection algorithm for the first contour (N area =1) to detect all straight lines in the contour.
使用直线检测算法,例如,接下来计算所有直线的直角坐标方程式,通过直线检测可以得到每条分线段的始末坐标,设第i条直线的首坐标为Psi=(x si,y si),尾坐标为Pei=(x ei,y ei),利用公式(1)得到直线i的斜率a i,与截距为b i,得到所有的斜率和截距后,计算每两组直线的范式距离, 公式如下: Use straight line detection algorithm, for example, next calculate the rectangular coordinate equations of all straight lines, through straight line detection can get the starting and ending coordinates of each line segment, set the first coordinate of the i-th straight line as Psi = (x si , y si ), tail The coordinates are Pei = (x ei , y ei ), using formula (1) to obtain the slope a i of the straight line i , and the intercept is b i , after obtaining all the slopes and intercepts, calculate the paradigm distance of each two sets of straight lines, The formula is as follows:
L d=a i-a j+b i-b j(j≠i)    (5) L d = a i -a j +b i -b j (j≠i) (5)
此时需要设置聚类第二距离阈值Td,当L d≤Td时,将锚定物直线归为一类,并最终的到N line类直线,由于利用点斜方程式直线存在斜率趋于无穷的情况(即直线与x轴垂直时),此时设置斜率阈值T a,对于直线i,若a i≥T a或者直线与x轴垂直时则设a i=T aAt this time, it is necessary to set the second distance threshold Td for clustering. When L d ≤ Td, the anchor line is classified into one class, and finally to the N line class line. Due to the use of the point slope equation, the slope of the line tends to be infinite. (i.e. a straight line perpendicular to the x-axis), then set the slope threshold T a, the straight line i, or if a i ≥T a straight line perpendicular to the x-axis is set when a i = T a.
使用模板建立(5)中同样方法计算投影坐标Ptfi=(xt fi,yt fi),与Ptni=(xt ni,yt ni)。 The projection coordinates Ptfi = (xt fi , yt fi ) and Ptni = (xt ni , yt ni ) are calculated using the same method as in template creation (5).
计算直线i与其他所有直线的夹角,得到N D个夹角,对夹角进行初选,保留所有的θ min≤θ d≤θ max(d∈[1,N D]),得到N' D个夹角。确定第M1条所述第二直线,使得第M1条所述第二直线的某一投影点与第i条所述第二直线的某一投影坐标距离最小;确定所述第i条所述第二直线与所述第M1条所述第二直线交点的第二交点坐标,并确定二者夹角;确定第M2条所述第二直线,使得第M1条所述第二直线的某一投影点与第i条所述第二直线的某一投影坐标距离最小;确定所述第i条所述第二直线与所述第M2条所述第二直线交点的第三交点坐标,并确定二者夹角;基于所述第二交点坐标及所述第三交点坐标,确定锚定物上第i条所述第二直线的长度。 I is calculated straight line with all the other angle, to obtain an angle of N D, the angle of the primaries, retain all θ min ≤θ d ≤θ max (d∈ [1, N D]), to give N ' D angles. Determine the second straight line of the M1th line so that the distance between a certain projection point of the second straight line of the M1th line and a certain projection coordinate of the second straight line of the ith line is the smallest; The second intersection point coordinate of the intersection point of the second straight line and the second straight line of the M1th line, and determine the angle between the two; determine the second straight line of the M2th line, such that a certain projection of the second straight line of the M1th line The distance between the point and a certain projection coordinate of the second straight line of the i-th line is the smallest; the coordinate of the third intersection point of the intersection point of the second straight line of the i-th line and the second straight line of the M2th line is determined, and the second Angle; determine the length of the ith second straight line on the anchor based on the coordinates of the second intersection point and the coordinates of the third intersection point.
利用筛选后的夹角计算直线i与模板直线的相似度,其中,直线i与j的相似度计算公式如下:Calculate the similarity between the straight line i and the template straight line using the selected angle, and the formula for calculating the similarity between the straight line i and j is as follows:
Figure PCTCN2019124678-appb-000006
Figure PCTCN2019124678-appb-000006
此时求取:β i=min{β ij}(j∈[1,C line])  (7) Obtain at this time: β i =min{β ij }(j∈[1,C line ]) (7)
当j=v(v∈[1,C line]),有β i取最小值,则表示直线i与模板中的v匹配度 最高。 When j = v (v ∈ [1, C line ]), and β i takes the minimum value, it means that the straight line i matches v in the template the most.
设置相似度阈值T β,当β i≤T β时,则判断测试样本中的直线i可能与模板直线v相似,通过此方法即可对所有的直线进行初步筛选和分类,此时记与直线i的夹角符合上述模板匹配的两条直线为j n与j f,当选择平行线的阶梯多边形作为锚定物时,通过角度筛选会得到若干条符合匹配的直线,此时有v不唯一,设模板中有N linei'条直线与i直线匹配,此时同样有j n与j f不唯一,存在多组组合,设共有N ci种组合。 Set the similarity threshold T β , when β i ≤ T β , it is judged that the straight line i in the test sample may be similar to the template straight line v, and all straight lines can be preliminarily screened and classified by this method. The angle between i and the two straight lines matched by the above template is j n and j f . When the stepped polygon of parallel lines is selected as the anchor, several straight lines that match the matching will be obtained by angle filtering. At this time, v is not unique It is assumed that there are N linei 'straight lines matching the i straight line in the template. At this time, j n and j f are also not unique, there are multiple sets of combinations, and there are a total of N ci combinations.
选组合n ci=1(n ci∈[1,N ci]),此时有直线i与j n 1与j f 1相交,计算i与j n 1的交点为PTRni=(xtr ni,ytr ni),以及i与j f 1的交点为PTRfi=(xtr fi,ytr fi),计算长度LP t,设置阈值Tl,当|LP i-L v|≤Tl时,进行后续的匹配。 Composition is selected from n ci = 1 (n ci ∈ [1, N ci]), this time with a straight line intersecting i and j n 1 1 j f, i and j n is calculated as an intersection PTRni = (xtr ni, ytr ni ), and the intersection of i and j f 1 is PTRfi = (xtr fi , ytr fi ), calculate the length LP t , set the threshold Tl, and when |LP i -L v |≤Tl, perform subsequent matching.
假设n ci=1(n ci∈[1,N ci])符合长度筛选,并假设该直线对应模板中的直线v m(m∈[1,N linei']),设m=1,此时v m有PRfv=(xr fv,yr fv),PRnv=(xr nv,yr nv),此时假设,PRni与PRnv对应,而工业现场实际应用中,摄像头高度将被固定,故测试图片中锚定物与模板图片中锚定物只发生平移与旋转变换。 Assuming that n ci =1 (n ci ∈[1,N ci ]) meets the length screening, and assuming that the straight line corresponds to the straight line v m ( m∈ [1,N linei ']) in the template, let m=1, at this time v m has PRfv = (xr fv , yr fv ), PRnv = (xr nv , yr nv ), at this time, it is assumed that PRni corresponds to PRnv, and in actual industrial field applications, the camera height will be fixed, so the anchor in the test picture The anchor and anchor in the picture of the fixed object and the template only undergo translation and rotation transformation.
先将直线i平移,使得PRni与PRnv对重合,平移仿射矩阵可为:First translate the line i so that the PRni and PRnv pairs coincide, the translation affine matrix can be:
Figure PCTCN2019124678-appb-000007
Figure PCTCN2019124678-appb-000007
其中among them
Figure PCTCN2019124678-appb-000008
Figure PCTCN2019124678-appb-000008
设PTRni通过仿射变换后的PTRni'=PTRnv=(xtr ni',ytr ni'),PTRfi通过仿射变换后的PTRfi'=(xtr fi',ytr fi'),再围绕PTRni旋转θ,仿射矩阵为 Let PTRni' after affine transformation PTRni' = PTRnv = (xtr ni ', ytr ni '), PTRfi after affine transformation PTRfi' = (xtr fi ', ytr fi '), then rotate θ around PTRni The shooting matrix is
Figure PCTCN2019124678-appb-000009
Figure PCTCN2019124678-appb-000009
其中
Figure PCTCN2019124678-appb-000010
among them
Figure PCTCN2019124678-appb-000010
最终有全局仿射变换矩阵为
Figure PCTCN2019124678-appb-000011
Finally, the global affine transformation matrix is
Figure PCTCN2019124678-appb-000011
仿射矩阵计算完毕后,通过仿射矩阵对步骤(4)中得到的剩余的N area-1条直线进行仿射变换。将所有直线的首末坐标进行仿射变换,得到 After the affine matrix is calculated, the remaining N area -1 straight lines obtained in step (4) are affine transformed by the affine matrix. Affine transform the first and last coordinates of all straight lines to obtain
Figure PCTCN2019124678-appb-000012
Figure PCTCN2019124678-appb-000012
求取Ps”与Pf”的点斜式直线方程式,得到对应的直线斜率a′以及截距b′,此时通过步骤(5)得到剩余N area-1条直线的角度匹配结果,设有直线与模板中直线j匹配,则计算直线相似度 Find the point-slope straight line equations of Ps” and Pf” to obtain the corresponding straight line slope a′ and intercept b′. At this time, the angle matching result of the remaining N area -1 straight lines is obtained through step (5). Match the straight line j in the template, then calculate the straight line similarity
L d=a′-a j+b′-b j     (14) L d = a′-a j +b′-b j (14)
当L d≤Td时,判断该直线符合,相同的方法判断所有直线的相似情况,并最终得到C′ line条符合匹配的直线,此时有锚定物匹配相似度: When L d ≤ Td, it is judged that the straight line is consistent, the same method is used to judge the similarity of all straight lines, and finally the C′ line is matched with the matched straight line. At this time, there is an anchor matching similarity:
Figure PCTCN2019124678-appb-000013
Figure PCTCN2019124678-appb-000013
设置匹配度阈值Tnl,当
Figure PCTCN2019124678-appb-000014
时,则判定检测成功,将M p→r作为整张图片的仿射矩阵。此时测试图片上所有的点都可以通过仿射矩阵在模板图片上进行匹配。
Set the matching threshold Tnl, when
Figure PCTCN2019124678-appb-000014
, It is determined that the detection is successful, and M p→r is used as the affine matrix of the entire picture. At this time, all points on the test image can be matched on the template image through the affine matrix.
所有组合遍历完毕但依然无法匹配的,令m=m+1,有v m(m∈[1,N linei']),遍历所有的N linei',并重复(7)到(9)步。 If all combinations have been traversed but still cannot be matched, let m=m+1, with v m ( m∈ [1,N linei ']), traverse all N linei ', and repeat steps (7) to (9).
若匹配失败,则令n ci=n ci+1(n ci∈[1,N ci])遍历n ci里的其他组合,并重复(6)到(9)步。 If the match fails, let n ci =n ci +1(n ci ∈[1,N ci ]) traverse the other combinations in n ci , and repeat steps (6) to (9).
若直线i匹配失败,则遍历剩余的N line类直线,重复(4)至(10)步骤 If the matching of line i fails, traverse the remaining N line straight lines and repeat steps (4) to (10)
若轮廓N area=1匹配失败,则令N area=N area+1,重复(3)至(10)直到找到匹配轮廓为止。 If the contour N area = 1 matching fails, let N area = N area +1 and repeat (3) to (10) until a matching contour is found.
总之,通过求取待检测轮廓上所有的第二直线,求待检测轮廓上第i条第二直线与其他所有直线的夹角以及截线长度,并生成夹角列表以及截线长度列表,与锚定轮廓的生成的第二直线夹角以及长度进行匹配,并初步预测第i条第二直线与锚定轮廓第二线的匹配情况;可以快速确定出当前各个候选轮廓区域是否为锚定物的成像区域。一般会对候选轮廓进行排序,并首先对面积最大的轮廓进行筛选,籍此可以节约检测时间。In short, by finding all the second straight lines on the contour to be detected, the angle between the second straight line on the contour to be detected and all other straight lines and the length of the cut line, and generating a list of angles and a list of the length of the cut line, and The angle and length of the second straight line generated by the anchor contour are matched, and the matching situation of the i-th second straight line and the second line of the anchor contour is preliminarily predicted; it can quickly determine whether each current candidate contour area is an anchor Imaging area. Generally, the candidate contours are sorted, and the contour with the largest area is selected first, thereby saving detection time.
检测速度快,精度远高于纯粹的深度学习算法,可以实现像素级的点定位。The detection speed is fast, and the accuracy is much higher than the pure deep learning algorithm, which can achieve pixel-level point positioning.
抗遮挡,即便锚定物被颜色相近的物体遮挡,依然具有极强的鲁棒性。Anti-occlusion, even if the anchor is blocked by objects of similar colors, it is still extremely robust.
通用性强,适用于所有的多边形锚定物;且速度极快,针对非阶梯对称锚定物,可一次性高效定位仿射矩阵。Strong versatility, suitable for all polygonal anchors; and extremely fast, for non-stepped symmetric anchors, the affine matrix can be positioned efficiently at one time.
如图8所示,本实施例提供了一种电子设备,包括:As shown in FIG. 8, this embodiment provides an electronic device, including:
存储器;Memory
处理器,与所述存储器连接,用于通过执行位于所述存储器上的计算机可执行指令,实现前述任意一个技术方案提供的法锚定物检测方法,例如,图1、图3及图4、图6及图7所示法锚定物检测方法法中的一个或多个。A processor, connected to the memory, is configured to implement a method for detecting a method anchor provided by any of the foregoing technical solutions by executing computer-executable instructions located on the memory, for example, FIG. 1, FIG. 3, and FIG. 4, One or more of the method anchor detection methods shown in FIGS. 6 and 7.
该存储器可为各种类型的存储器,可为随机存储器、只读存储器、闪存等。所述存储器可用于信息存储,例如,存储计算机可执行指令等。所述计算机可执行指令可为各种程序指令,例如,目标程序指令和/或源程序指令等。The memory may be various types of memory, such as random access memory, read-only memory, flash memory, etc. The memory can be used for information storage, for example, storing computer-executable instructions. The computer executable instructions may be various program instructions, for example, target program instructions and/or source program instructions.
所述处理器可为各种类型的处理器,例如,中央处理器、微处理器、数字信号处理器、可编程阵列、数字信号处理器、专用集成电路或图像处理器等。The processor may be various types of processors, for example, a central processor, a microprocessor, a digital signal processor, a programmable array, a digital signal processor, an application specific integrated circuit, or an image processor.
所述处理器可以通过总线与所述存储器连接。所述总线可为集成电路总线等。The processor may be connected to the memory through a bus. The bus may be an integrated circuit bus or the like.
在一些实施例中,所述电子设备还可包括:通信接口,该通信接口可包括:网络接口、例如,局域网接口、收发天线等。所述通信接口同样与所述处理器连接,能够用于信息收发。In some embodiments, the electronic device may further include: a communication interface, and the communication interface may include: a network interface, for example, a local area network interface, a transceiver antenna, and the like. The communication interface is also connected to the processor and can be used for information transmission and reception.
在一些实施例中,所述电子设备还包括人机交互接口,例如,所述人机交互接口可包括各种输入输出设备,例如,键盘、触摸屏等。In some embodiments, the electronic device further includes a human-machine interaction interface. For example, the human-machine interaction interface may include various input and output devices, such as a keyboard, a touch screen, and the like.
本实施例提供一种计算机存储介质,所述计算机存储介质存储有计算机可执行指令;所述计算机可执行指令被执行后,实现前述任意一个技术方案提供的法锚定物检测方法,例如,图1、图3及图4、图6及图7所示法锚定物检测方法法中的一个或多个。This embodiment provides a computer storage medium that stores computer-executable instructions; after the computer-executable instructions are executed, the method for detecting a method anchor provided by any of the foregoing technical solutions is implemented, for example, FIG. 1. One or more of the method anchor detection methods shown in FIGS. 3 and 4, 6 and 7.
所述计算机存储介质可为包括具有记录功能的各种记录介质,例如,CD、软盘、硬盘、磁带、光盘、U盘或移动硬盘等各种存储介质。可选的所述计算机存储介质可为非瞬间存储介质,该计算机存储介质可被处理器读取,从而使得存储在计算机存储机制上的计算机可执行指令被处理器获取并执行后,实现前述任意一个技术方案提供的锚定物检测方法,例如,执行应用于终端设备中的锚定物检测方法或应用服务器中的锚定物检测方法。The computer storage medium may include various recording media having a recording function, for example, various storage media such as a CD, a floppy disk, a hard disk, a magnetic tape, an optical disk, a U disk, or a mobile hard disk. The optional computer storage medium may be a non-transitory storage medium, and the computer storage medium may be read by a processor, so that computer-executable instructions stored on a computer storage mechanism are acquired and executed by the processor to implement any of the foregoing An anchor detection method provided by a technical solution, for example, executes an anchor detection method applied in a terminal device or an anchor detection method in an application server.
在本申请所提供的几个实施例中,应该理解到,所揭露的设备和方法,可以通过其它的方式实现。以上所描述的设备实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,如:多个单元或组件可以结合,或可以集成到另一个系统,或一些特征可以忽略,或不执行。另外,所显示或讨论的各组成部分相互之间的耦合、或直接耦合、或通信连接可以是通过一些接口,设备或单元的间接耦合或通信连接,可以是电性的、机械的或其它形式的。In the several embodiments provided in this application, it should be understood that the disclosed device and method may be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a division of logical functions. In actual implementation, there may be other division methods, such as: multiple units or components may be combined, or Can be integrated into another system, or some features can be ignored, or not implemented. In addition, the displayed or discussed components are coupled to each other, or directly coupled, or the communication connection may be through some interfaces, and the indirect coupling or communication connection of the device or unit may be electrical, mechanical, or other forms of.
上述作为分离部件说明的单元可以是、或也可以不是物理上分开的,作为单元显示的部件可以是、或也可以不是物理单元,即可以位于一个地方,也可以分布到多个网络单元上;可以根据实际的需要选择其中的部分或全部单元来实现本实施例方案的目的。The above-mentioned units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units; Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本申请各实施例中的各功能单元可以全部集成在一个处理模块中,也可以是各单元分别单独作为一个单元,也可以两个或两个以上单元集成在一个单元中;上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现。In addition, the functional units in the embodiments of the present application may all be integrated into one processing module, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above integration The unit can be implemented in the form of hardware, or in the form of hardware plus software functional units.
本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于一计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:移动存储设备、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。Persons of ordinary skill in the art may understand that all or part of the steps to implement the above method embodiments may be completed by program instructions related hardware. The foregoing program may be stored in a computer-readable storage medium, and when the program is executed, Including the steps of the above method embodiments; and the foregoing storage media include: mobile storage devices, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disks or optical disks, etc. A medium that can store program codes.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本 申请的保护范围应以所述权利要求的保护范围为准。The above is only the specific implementation of this application, but the scope of protection of this application is not limited to this, any person skilled in the art can easily think of changes or replacements within the technical scope disclosed in this application. It should be covered by the scope of protection of this application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (14)

  1. 一种锚定物检测方法,包括:An anchor detection method, including:
    获取包含有锚定物成像的图像;Acquire images that include imaging of anchors;
    检测所述图像中的直线;Detect straight lines in the image;
    基于所检测直线的特征,确定检测物与所述锚定物的相似度;Determine the similarity between the detected object and the anchor based on the characteristics of the detected straight line;
    基于所述相似度,定位所述锚定物在所述图像中的位置。Based on the similarity, the position of the anchor in the image is located.
  2. 根据权利要求1所述的方法,其中,The method according to claim 1, wherein
    所述检测所述图像中的直线,包括:The detecting the straight line in the image includes:
    检测所述图像中的直线并获得至少一条第一直线;Detect a straight line in the image and obtain at least one first straight line;
    根据所述第一直线的方程式进行直线归类;Classify straight lines according to the equation of the first straight line;
    根据所述第一直线的归类结果,基于属于同一类的所述第一直线形成第二直线。According to the classification result of the first straight line, a second straight line is formed based on the first straight line belonging to the same class.
  3. 根据权利要求2所述的方法,其中,所述基于所检测直线的特征,确定检测物与所述锚定物的相似度,包括:The method according to claim 2, wherein the determining the similarity between the test object and the anchor object based on the characteristics of the detected straight line includes:
    根据所述检测物至少两条所述第二直线的交点、夹角和/或所述第二直线的长度,确定检测物与所述锚定物的相似度。The similarity between the test object and the anchor is determined according to the intersection point, the included angle, and/or the length of the second straight line of the at least two second straight lines of the test object.
  4. 根据权利要求3所述的方法,其中,所述方法还包括:The method of claim 3, wherein the method further comprises:
    将第i条第二直线所对应第一点向第i条所述第二直线垂直投影以获得第一投影坐标,其中,所述第一点为所述第二条直线所对应第一直线的首尾点与原点之间的连线和预设坐标轴之间夹角最大的点;Perpendicularly projecting the first point corresponding to the ith second straight line to the ith second straight line to obtain the first projected coordinates, wherein the first point is the first straight line corresponding to the second straight line The line between the first and last points and the origin and the point with the largest angle between the preset coordinate axes;
    将第i条所述第二直线所对应的第二点向第i条所述第二直线投影以获得第二投影坐标,其中,所述第二点为所述第二条直线所对应第一直线的首尾点与原点之间的连线和预设坐标轴之间夹角最小的点;Projecting a second point corresponding to the i-th second line onto the i-th second line to obtain second projected coordinates, wherein the second point is the first corresponding to the second line The line between the beginning and end points of the line and the origin and the point with the smallest angle between the preset coordinate axes;
    确定第i条第二直线和第j条第二直线之间的交点与所述第一投影坐标 和所述第二投影坐标之间的距离;Determining the distance between the intersection point between the ith second straight line and the jth second straight line and the first projected coordinate and the second projected coordinate;
    所述距离小于第一距离阈值,则确定所述第i条第二直线和第j条第二直线相交;If the distance is less than the first distance threshold, it is determined that the i-th second straight line and the j-th second straight line intersect;
    基于交点坐标,确定出所述第i条第二直线的长度,其中,所述交点坐标为所述第i条第二直线与至少两条其他所述第二直线的相交点的坐标。The length of the ith second straight line is determined based on the coordinates of the intersection point, where the coordinates of the intersection point are the coordinates of the intersection point of the ith second straight line and at least two other second straight lines.
  5. 根据权利要求3所述的方法,其中,所述方法还包括:The method of claim 3, wherein the method further comprises:
    第i条第二直线与第j条第二直线相交,则确定所述第i条第二直线和所述第j条第二直线的夹角。The intersection of the i-th second straight line and the j-th second straight line determines the angle between the i-th second straight line and the j-th second straight line.
  6. 根据权利要求2所述的方法,其中,The method according to claim 2, wherein
    所述根据所述第一直线的方程式进行直线归类,包括:The straight line classification according to the equation of the first straight line includes:
    根据所述第一直线的首尾点的坐标,确定所述第一直线的直角坐标方程式;Determine the rectangular coordinate equation of the first straight line according to the coordinates of the first and last points of the first straight line;
    根据所述直角坐标方程式确定所述第一直线的斜率和截距;Determine the slope and intercept of the first straight line according to the rectangular coordinate equation;
    基于所述斜率和所述截距,确定两条所述第一直线之间的范式距离;Determine the paradigm distance between the two first straight lines based on the slope and the intercept;
    将所述范式距离小于第二距离阈值的两条所述第一直线归为一类。The two first straight lines whose distance of the normal form is smaller than the second distance threshold are classified into one category.
  7. 根据权利要求2所述的方法,其中,所述基于所检测直线的特征,确定检测物与所述锚定物的相似度,包括:The method according to claim 2, wherein the determining the similarity between the test object and the anchor object based on the characteristics of the detected straight line includes:
    将检测物的第二直线集合中的第x条第二直线与其他第二直线之间的夹角,与所述锚定物的模板内的第y条直线与其他直线之间的夹角匹配;Match the angle between the x-th second line in the second line set of the test object and other second lines with the angle between the y-th line in the template of the anchor and the other line ;
    基于所述夹角的匹配结果,确定所述第x条第二直线与所述第y条直线是否满足夹角匹配条件;Based on the matching result of the included angle, determining whether the x-th second straight line and the y-th straight line satisfy the included angle matching condition;
    确定所述第x条第二直线与所述第y条直线是否满足长度匹配条件;Determining whether the x-th second straight line and the y-th straight line satisfy the length matching condition;
    所述第x条第二直线与所述第y条直线同时满足所述夹角匹配条件及所述长度匹配条件,根据所述第x条第二直线的首尾点的坐标和所述第y条直线首尾点的坐标,确定出将所述第x条第二直线仿射变换到所述第y 条直线的仿射矩阵;The x-th second straight line and the y-th straight line simultaneously satisfy the included angle matching condition and the length matching condition, according to the coordinates of the head and tail points of the x-th second straight line and the y-th line The coordinates of the first and last points of the line, determine the affine matrix that transforms the x-th second straight line affine to the y-th straight line;
    根据所述仿射矩阵,变换所述第x条第二直线以外的其他所述第二直线,获得所述检测物仿射变换后的第二直线集合;Transforming the second straight line other than the xth second straight line according to the affine matrix to obtain a second set of straight lines after the affine transformation of the detection object;
    确定所述第二直线集合与所述模板中的直线相似度;Determining the similarity between the second set of straight lines and the straight lines in the template;
    根据所述相似度,确定所述检测物是否为所述锚定物。According to the similarity, it is determined whether the detection object is the anchor.
  8. 根据权利要求7所述的方法,其中,所述方法,还包括:The method according to claim 7, wherein the method further comprises:
    所述检测物的第x条第二直线与所述模板中的多条直线同时满足所述夹角匹配条件和所述长度匹配条件,生成组合集,其中,所述组合集中包括第x条第二直线与至少两条直线的多个组合;The x-th second straight line of the test object and the plurality of straight lines in the template simultaneously satisfy the included angle matching condition and the length matching condition to generate a combination set, wherein the combination set includes the x-th Multiple combinations of two straight lines and at least two straight lines;
    所述基于所检测直线的特征,确定检测物与所述锚定物的相似度,包括:The determining the similarity between the test object and the anchor based on the characteristics of the detected straight line includes:
    遍历所述组合集中每一个组合,基于每一个所述组合确定检测物与所述锚定物的相似度。Each combination in the combination set is traversed, and the similarity between the test object and the anchor is determined based on each combination.
  9. 根据权利要求7所述的方法,其中,所述方法还包括:The method of claim 7, wherein the method further comprises:
    根据所述模板中所有直线的夹角,确定夹角范围;Determine the included angle range according to the included angle of all straight lines in the template;
    存在所述检测物的所述第二直线与其他所述第二直线的夹角位于所述夹角范围外,则将所述检测物中与其他所述第二直线的夹角位于所述夹角范围外的所述第二直线从所述第二直线集合剔除。If the angle between the second straight line and the other second straight line where the detection object exists is outside the angle range, the angle between the second straight line and the other second straight line in the detection object is located at the angle The second straight line outside the angular range is eliminated from the second straight line set.
  10. 根据权利要求7所述的方法,其中,The method according to claim 7, wherein
    所述确定所述第x条第二直线与所述第y条直线是否满足长度匹配条件,包括:The determining whether the x-th second straight line and the y-th straight line satisfy the length matching condition includes:
    确定所述第x条第二直线与所述第y条直线的长度差是否小于长度阈值;Determining whether the length difference between the x-th second straight line and the y-th straight line is less than a length threshold;
    所述第x条第二直线与第y条直线的长度差小于所述长度阈值,则确定所述第x条第二直线与所述第y条直线满足所述长度匹配条件。If the length difference between the xth second straight line and the yth straight line is less than the length threshold, it is determined that the xth second straight line and the yth straight line satisfy the length matching condition.
  11. 根据权利要求1至10任一项所述的方法,其中,所述方法还包括:The method according to any one of claims 1 to 10, wherein the method further comprises:
    获取所述图像并获得图像包含所述锚定物成像的候选轮廓区域;Acquiring the image and obtaining an image containing candidate contour regions imaged by the anchor;
    从所述候选轮廓区域选择面积最大的轮廓区域为目标轮廓区域;Selecting the contour area with the largest area from the candidate contour areas as the target contour area;
    所述检测所述图像中的直线,包括:The detecting the straight line in the image includes:
    检测位于所述目标轮廓区域的直线。A straight line located in the target contour area is detected.
  12. 一种锚定物检测装置,包括:An anchor detection device, including:
    图像模块,配置为获取包含有锚定物成像的图像;An image module, configured to obtain an image containing an anchor imaging;
    直线模块,配置为检测所述图像中的直线;A straight line module, configured to detect a straight line in the image;
    相似度模块,配置为基于所检测直线的特征,确定检测物与所述锚定物的相似度;A similarity module configured to determine the similarity between the detected object and the anchor based on the characteristics of the detected straight line;
    定位模块,配置为基于所述相似度,定位所述锚定物在所述图像中的位置。The positioning module is configured to position the anchor in the image based on the similarity.
  13. 一种电子设备,其中,包括:An electronic device, including:
    存储器;Memory
    处理器,与所述存储器连接,用于通过执行位于所述存储器上的计算机可执行指令,实现权利要求1至11任一项提供的方法。A processor, connected to the memory, is configured to implement the method provided in any one of claims 1 to 11 by executing computer-executable instructions located on the memory.
  14. 一种计算机存储介质,所述计算机存储介质存储有计算机可执行指令;所述计算机可执行指令被执行后,实现权利要求1至11任一项提供的方法。A computer storage medium that stores computer-executable instructions; after the computer-executable instructions are executed, the method provided in any one of claims 1 to 11 is implemented.
PCT/CN2019/124678 2018-12-21 2019-12-11 Anchor object detection method and apparatus, electronic device, and storage medium WO2020125528A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811575222.0A CN111354038B (en) 2018-12-21 2018-12-21 Anchor detection method and device, electronic equipment and storage medium
CN201811575222.0 2018-12-21

Publications (1)

Publication Number Publication Date
WO2020125528A1 true WO2020125528A1 (en) 2020-06-25

Family

ID=71102011

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/124678 WO2020125528A1 (en) 2018-12-21 2019-12-11 Anchor object detection method and apparatus, electronic device, and storage medium

Country Status (2)

Country Link
CN (1) CN111354038B (en)
WO (1) WO2020125528A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112859189A (en) * 2020-12-31 2021-05-28 广东美的白色家电技术创新中心有限公司 Workpiece detection device, detection method, and computer-readable storage medium
CN113362290B (en) * 2021-05-25 2023-02-10 同济大学 Method, storage device and device for quickly identifying collinear features of dot matrix planes

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103837135A (en) * 2012-11-27 2014-06-04 国际商业机器公司 Workpiece detecting method and system
CN104240227A (en) * 2013-06-24 2014-12-24 富泰华工业(深圳)有限公司 Image analysis system and method
US20160125252A1 (en) * 2013-05-31 2016-05-05 Nec Corporation Image recognition apparatus, processing method thereof, and program

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105069786B (en) * 2015-07-31 2018-05-08 小米科技有限责任公司 Line detection method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103837135A (en) * 2012-11-27 2014-06-04 国际商业机器公司 Workpiece detecting method and system
US20160125252A1 (en) * 2013-05-31 2016-05-05 Nec Corporation Image recognition apparatus, processing method thereof, and program
CN104240227A (en) * 2013-06-24 2014-12-24 富泰华工业(深圳)有限公司 Image analysis system and method

Also Published As

Publication number Publication date
CN111354038B (en) 2023-10-13
CN111354038A (en) 2020-06-30

Similar Documents

Publication Publication Date Title
WO2021017725A1 (en) Product defect detection method, device and system
US11774735B2 (en) System and method for performing automated analysis of air samples
Bansal et al. Ultrawide baseline facade matching for geo-localization
CN104616278B (en) Three-dimensional point cloud interest point detection method and system
CN109389105B (en) Multitask-based iris detection and visual angle classification method
CN107256410B (en) Fundus image classification method and device
US9836673B2 (en) System, method and computer program product for training a three dimensional object indentification system and identifying three dimensional objects using semantic segments
WO2020125528A1 (en) Anchor object detection method and apparatus, electronic device, and storage medium
Pintore et al. Recovering 3D existing-conditions of indoor structures from spherical images
US9189841B2 (en) Method of checking the appearance of the surface of a tyre
KR20210020065A (en) Systems and methods for finding and classifying patterns in images with vision systems
US20170125271A1 (en) Position detection apparatus, position detection method, information processing program, and storage medium
CN115375629A (en) Method for detecting line defect and extracting defect information in LCD screen
US7139421B1 (en) Methods and apparatuses for detecting similar features within an image
JP2003216931A (en) Specific pattern recognizing method, specific pattern recognizing program, specific pattern recognizing program storage medium and specific pattern recognizing device
US9830532B1 (en) Object detection in images using distance maps
CN111695373A (en) Zebra crossing positioning method, system, medium and device
US6614926B1 (en) Methods and apparatuses for generating from an image a model of an object
US7231086B2 (en) Knowledge-based hierarchical method for detecting regions of interest
JP2011107878A (en) Position detection apparatus and position detection method
JP5217917B2 (en) Object detection and tracking device, object detection and tracking method, and object detection and tracking program
US20030185432A1 (en) Method and system for image registration based on hierarchical object modeling
CN115546153A (en) Product surface defect detection method based on three-dimensional point cloud and two-dimensional image fusion perception
JP2008009745A (en) Face detector
JP6278757B2 (en) Feature value generation device, feature value generation method, and program

Legal Events

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

Ref document number: 19897866

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 09.11.2021)

122 Ep: pct application non-entry in european phase

Ref document number: 19897866

Country of ref document: EP

Kind code of ref document: A1