CN112464779B - Flexible material based pattern recognition positioning method - Google Patents

Flexible material based pattern recognition positioning method Download PDF

Info

Publication number
CN112464779B
CN112464779B CN202011322190.0A CN202011322190A CN112464779B CN 112464779 B CN112464779 B CN 112464779B CN 202011322190 A CN202011322190 A CN 202011322190A CN 112464779 B CN112464779 B CN 112464779B
Authority
CN
China
Prior art keywords
positioning
graph
graphs
flexible material
edge line
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011322190.0A
Other languages
Chinese (zh)
Other versions
CN112464779A (en
Inventor
陈琮林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Shunchen Technology Co ltd
Original Assignee
Wuhan Shunchen Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Shunchen Technology Co ltd filed Critical Wuhan Shunchen Technology Co ltd
Priority to CN202011322190.0A priority Critical patent/CN112464779B/en
Publication of CN112464779A publication Critical patent/CN112464779A/en
Application granted granted Critical
Publication of CN112464779B publication Critical patent/CN112464779B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/10Terrestrial scenes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/25Determination of region of interest [ROI] or a volume of interest [VOI]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/75Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
    • G06V10/751Comparing pixel values or logical combinations thereof, or feature values having positional relevance, e.g. template matching

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Computing Systems (AREA)
  • Databases & Information Systems (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Image Analysis (AREA)

Abstract

The invention provides a graph recognition and positioning method based on a flexible material, which comprises the following steps of manufacturing a graph positioning template and calculating to obtain a graph positioning area, and setting the upper left corner of the graph positioning area as a coordinate origin; flatly paving the flexible material on a platform to take a picture; carrying out image processing and smoothing processing on the obtained image; sequencing the smooth curves; traversing all points on the edge line graph to find a first reference point; finding out second reference points on all points according to the distance Dis between the starting point and the end point of the positioning graph; calculating an included Angle1 between a connecting line from the first reference point to the second reference point; adding the included Angle1 and the included Angle tan of the positioning graph, and translating and rotating the positioning graph to the position where the included Angle1 and the included Angle tan of the positioning graph are added; calculating whether the positioning graph is intersected with other positioning graphs or not; and obtaining the graph of the graph positioning template positioning and identifying the flexible material until the first reference point cannot be found on the edge line graph or the second reference point cannot be found.

Description

Flexible material based pattern recognition positioning method
[ technical field ] A method for producing a semiconductor device
The invention relates to the technical field of pattern recognition and positioning, in particular to a pattern recognition and positioning method based on a flexible material.
[ background ] A method for producing a semiconductor device
The existing recognition and positioning technology is carried out by a template matching method in image processing, namely, a material is placed in a visual field of a camera, a frame of image is obtained, a position with the most characteristic mark is found in the image, the image at the position is made into a characteristic template, and simultaneously, a graph to be positioned is associated with the characteristic template. In the actual production process, a frame of image is obtained every time, then the degree of identity is calculated through the comparison of the features in the target image and the template image, the position can be located after the set degree of identity is reached, and meanwhile, the associated graph is located at the specific position of the image. Flexible materials are very prone to stretching and deformation, and when this method is used, the identified location is not accurate, and errors are also caused by stretching and deformation of the material, and the method has no way to calculate the errors, and the identification of the location of the pattern on the material without obvious features is not possible.
In view of the above, it is actually necessary to provide a novel pattern recognition and positioning method based on flexible material to overcome the above-mentioned drawbacks.
[ summary of the invention ]
The invention aims to provide a pattern recognition and positioning method based on a flexible material, which can be used for positioning the edge of the flexible material and the edge line pattern of a manufactured pattern positioning template and recognizing the problems of position deviation, deformation and wrinkling of the flexible material.
In order to achieve the above object, the present invention provides a pattern recognition and positioning method based on flexible material, comprising the following steps,
s1: manufacturing a graph positioning template by using a CAD drawing tool, and drawing a positioning graph and an edge line graph on the graph positioning template;
s2: calculating according to the graph positioning template manufactured in the S1 to obtain a graph positioning area, and setting the upper left corner of the graph positioning area as a coordinate origin;
s3: the flexible material is laid on the platform, then the camera is arranged on the platform, and the lens of the camera is aligned with the flexible material to take a picture;
s4: processing images obtained by photographing a camera by using an edge extraction method;
s5: smoothing the line subjected to the image processing in the step S4, and smoothing the line by using a B spline curve equation to obtain a smooth curve;
s6: judging the y values of the starting point and the end point of each fairing curve, and if the y1 value of the starting point is smaller than the y2 value of the end point, exchanging the sequence of all points of the fairing curves;
s7: sequencing the fairing curves, and sequencing the x values of the midpoints center of the rectangles Rect circumscribed to the fairing curves;
s8: traversing all points on the edge line graph of the graph positioning template to find a first reference point according to the graph positioning template obtained in the S1;
s9: finding out second reference points on all points according to the distance Dis between the starting point and the end point of the positioning graph;
s10: calculating an included Angle1 of a connecting line from the first reference point to the second reference point;
s11: adding the included Angle1 and the included Angle tan of the positioning graph, and then translating and rotating the positioning graph to the position where the included Angle1 and the included Angle tan of the positioning graph are added;
s12: calculating whether the positioning graph in the S11 is intersected with other already arranged positioning graphs or not;
s13: if the positioning graphs are judged to be intersected, after the first reference point of the starting point of the positioning graphs is moved, the steps from S9 to S12 are repeated until the positioning graphs are not intersected;
s14: and repeating the steps from S8 to S13 for each positioning graph until the first reference point cannot be found on the edge line graph or the second reference point cannot be found, and obtaining the positioning graph of the graph positioning template and the graph of the edge line graph positioning identification flexible material.
Preferably, the positioning graphics and the edge line graphics in the graphic positioning template are grouped; if the positioning pattern close to the first line exists, placing the positioning pattern close to the first line; if the positioning patterns close to the second line exist, the positioning patterns are placed close to the second line, and the positioning patterns are not overlapped.
Preferably, S21: starting the positioning graph and the starting point of the edge line graph in the graph positioning template from the lower part of the graph positioning template, enabling the y value of the starting point of the graph positioning template to be larger than the y value of the end point, and obtaining a starting point p0 and an end point p1 of the graph positioning template;
preferably, S22: sequencing the positioning graphs and the edge line graphs of the graph positioning template, calculating the circumscribed rectangle Rect of the positioning graphs and the edge line graphs, and obtaining a midpoint center of the outside rectangle Rect, wherein the midpoint center replaces the positioning graphs and the edge line graphs, and sequencing the x values in the midpoint center by using a bubble sequencing algorithm to obtain a graph list;
preferably, S23: and grouping the positioning graphs to obtain the center of the circumscribed rectangle of the positioning graphs, and calculating the distance from the center of each positioning graph to the edge line graph.
Preferably, S24: after grouping is completed, the position relation between each positioning graph and the corresponding edge line graph is calculated, the starting point of the edge line graph is p3 (x 3, y 3), the starting point of each positioning graph is p4 (x 4, y 4),
the length from the starting point p3 of the edge line pattern to the starting point p4 of the positioning pattern
Figure DEST_PATH_FDA0003818280050000031
(1)。
Preferably, S25: the positioning graphs obtained by calculation through the formula (1) are all semi-closed irregular polygons, and the distance between the starting point p0 (x 0, y 0) and the end point p1 (x 1, y 1) of the graph positioning template is obtained by calculation through the connection slope according to the following formula
Figure DEST_PATH_FDA0003818280050000032
The angle tan = | (k 2-k 1)/[ 1+ (k 2) (k 1) of the line from the starting point p0 to the end point p1]And l, wherein k1 is the slope of the connecting line, and k2 is the slope of the coordinate axis.
Preferably, S41: and manually setting a threshold value according to the background chromatic aberration of the flexible material and the platform, and binarizing the image.
Preferably, the line is smoothed by using a B-spline curve equation,
the general equation for the B-spline curve is:
Figure BDA0002793238100000041
wherein P is i Is a characteristic point of the control curve, fi j K (t) is a K-th order B-spline basis function, and the basis function in the B-spline curve equation is as follows:
Figure BDA0002793238100000042
wherein
Figure BDA0002793238100000043
Representing factorial, we get:
Figure BDA0002793238100000044
Figure BDA0002793238100000045
Figure BDA0002793238100000046
Figure BDA0002793238100000047
substituting the basis function into the general equation can calculate a B spline curve equation:
P(t)=P 0 *F 0,3 (t)+P 1 *F 1,3 (t)+P 2 *F 2,3 (t)+P 3 *F 3,3 (t)。
compared with the prior art, the pattern recognition and positioning method based on the flexible material has the beneficial effects that: by manufacturing the pattern positioning template in advance, the edge of the flexible material and the edge line pattern of the pattern positioning template can be positioned, and the problems of position deviation, deformation and wrinkles of the flexible material are identified, so that the error caused by deformation is reduced, and accurate positioning is realized.
[ description of the drawings ]
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
Fig. 1 (including fig. 1a and fig. 1 b) is a flowchart of a pattern recognition and positioning method based on flexible material according to the present invention.
Fig. 2 is a schematic view of a flexible material used in embodiment 1 of the present invention.
Fig. 3 is a schematic diagram of a graphic positioning template manufactured in embodiment 1 of the present invention.
Fig. 4 is a schematic diagram of positioning patterns and edge line pattern positioning identification flexible materials of the pattern positioning template in embodiment 1 of the present invention.
Fig. 5 is a schematic view of a flexible material used in embodiment 2 of the present invention.
Fig. 6 is a schematic diagram of a graphic positioning template manufactured in embodiment 2 of the present invention.
Fig. 7 is a schematic diagram of positioning patterns and edge line pattern positioning identification flexible materials of the pattern positioning template in embodiment 2 of the present invention.
[ detailed description ] embodiments
In order to make the objects, technical solutions and advantageous effects of the present invention more clearly apparent, the present invention is further described in detail below with reference to the accompanying drawings and the detailed description. It should be understood that the detailed description and specific examples, while indicating the preferred embodiment of the invention, are intended for purposes of illustration only and are not intended to limit the scope of the invention.
It should be noted that the flexible material adopted in the embodiment of the present invention has obvious features (for example, the edge of the flexible material is a straight line or a wavy line), and feature points need to be set for coarse positioning.
Referring to fig. 1, the present invention provides a pattern recognition and positioning method based on flexible material, comprising the following steps,
s1: manufacturing a graph positioning template by using a CAD drawing tool, and drawing a positioning graph and an edge line graph on the graph positioning template;
s2: calculating according to the graph positioning template manufactured in the S1 to obtain a graph positioning area, and setting the upper left corner of the graph positioning area as a coordinate origin;
s3: flatly laying the flexible material on a platform, then arranging a camera on the platform, and aligning a lens of the camera with the flexible material for taking a picture;
s4: processing images obtained by photographing a camera by using an edge extraction method;
s5: performing smoothing processing on the lines subjected to the image processing in the S4, and performing smoothing processing on the lines by using a B spline curve equation to obtain a smooth curve;
s6: judging the y values of the starting point and the end point of each fairing curve, and if the y1 value of the starting point is smaller than the y2 value of the end point, exchanging the sequence of all points of the fairing curves;
s7: sequencing the fairing curves, and sequencing the x values of the midpoints center of the rectangles Rect circumscribed to the fairing curves;
s8: traversing all points on the edge line graph of the graph positioning template to find a first reference point according to the graph positioning template obtained in the S1;
s9: finding out second reference points on all points according to the distance Dis between the starting point and the end point of the positioning graph;
s10: calculating an included Angle1 of a connecting line from the first reference point to the second reference point;
s11: adding the included Angle1 and the included Angle tan of the positioning graph, and then translating and rotating the positioning graph to the position where the included Angle1 and the included Angle tan of the positioning graph are added;
s12: calculating whether the positioning graph in the S11 is intersected with other already arranged positioning graphs or not;
s13: if the positioning graphs are judged to be intersected, after the first reference point of the starting point of the positioning graphs is moved, the steps from S9 to S12 are repeated until the positioning graphs are not intersected;
s14: and repeating the steps from S8 to S13 for each positioning graph until the first reference point cannot be found on the edge line graph or the second reference point cannot be found, and obtaining the positioning graph of the graph positioning template and the graph of the edge line graph positioning identification flexible material.
Example 1:
s1: a graphic positioning template (as shown in fig. 3) is made by using a CAD drawing tool, and a positioning graphic and an edge line graphic are drawn on the graphic positioning template.
Specifically, an irregular polygon (blue lines) is drawn to represent a positioning graph, which is a real object line; drawing two straight lines (adopting green lines) on the graph positioning template to represent as an edge line graph, wherein the two straight lines are simulated positioning lines and have coordinates of (x, y);
grouping positioning graphs and edge line graphs in the graph positioning template; if the positioning graph close to the first line (No. 1 straight line) exists, the positioning graph is placed close to the first line (No. 1 straight line); if the positioning pattern close to the second line (No. 2 straight line) exists, the positioning pattern is placed close to the second line (No. 2 straight line), and according to the placing rule, the positioning patterns are not overlapped and are placed close to the lower end of the edge line pattern.
S2: and calculating to obtain a graph positioning area according to the graph positioning template manufactured in the S1, and setting the upper left corner of the graph positioning area as a coordinate origin (0, 0).
Specifically, starting from the lower part of the graph positioning template, starting from 4 positioning graphs and 2 starting points of edge line graphs in the graph positioning template, and enabling the y value of the starting point of the graph positioning template to be larger than the y value of the end point, so as to obtain 4 positioning graphs and 2 starting points p0 (x 0, y 0) and end points p1 (x 1, y 1) of the edge line graphs of the graph positioning template; judging whether the y0 value is larger than the y1 value, if the y0 values of the 4 positioning patterns are smaller than the y1 values of the 4 positioning patterns and the y0 values of the 2 edge line patterns are smaller than the y1 values of the 2 edge line patterns, changing the positions of the original points of the 4 positioning patterns and the 2 edge line patterns of the pattern positioning template;
sequencing 4 positioning graphs and 2 edge line graphs from left to right, calculating circumscribed rectangles Rect of the 4 positioning graphs and the 2 edge line graphs, obtaining the midpoint center of the external rectangle Rect, replacing 6 graphs with 6 midpoint centers, sequencing the x values in the 6 midpoint centers (x, y) from small to large by using a bubble sequencing algorithm, and obtaining a well-arranged graph list;
grouping the 4 positioning graphs to obtain the center points center (x, y) of the circumscribed rectangles of the 4 positioning graphs, calculating the distance from the center point center (x, y) of each positioning graph to a straight line, and dividing the distance into a group when the distance is small; it should be noted that the edge line patterns (two straight lines) are simulated positioning lines, and 4 positioning patterns are positioned according to the edge line patterns;
after grouping is finished, each group has 1 edge line graph (namely a straight line) and 2 positioning graphs, then the position relation between each positioning graph and the corresponding edge line graph is calculated, the starting point of the edge line graph is p3 (x 3, y 3), the starting point of each positioning graph is p4 (x 4, y 4), and the length from the starting point p3 of the edge line graph to the starting point p4 of the positioning graph is obtained
Figure 520535DEST_PATH_FDA0003818280050000031
(1);
Calculating by formula (1) to obtain 4 positioning graphs which are all semi-closed irregular polygons, and calculating by a connection line slope according to the following formula to obtain the distance between a starting point p0 (x 0, y 0) and an end point p1 (x 1, y 1) of the graph positioning template
Figure 437675DEST_PATH_FDA0003818280050000032
The angle tan = | (k 2-k 1)/[ 1+ (k 2) (k 1) of the connection line from the starting point p0 to the end point p1]And l, wherein k1 is the slope of the connecting line, and k2 is the slope of the coordinate axis.
S3: the flexible material (as shown in fig. 2) is laid flat on the platform and the camera is mounted on the platform with the lens of the camera directed at the flexible material to take a picture. It should be noted that the flexible material does not have wrinkles or curls when being laid on the platform, and if the flexible material laid on the platform has wrinkles or curls, the calculation is not accurate.
S4: and processing the image obtained by photographing the camera by using an edge extraction method. Specifically, S41: artificially setting a threshold value (the range of gray value is 0-255) according to the background color difference of the flexible material and the platform, binarizing the image, so that the color of the flexible material is changed into white (the gray value is 255), the background color of the platform is changed into black (the gray value is 0), and then obtaining the edge line (straight line) of the flexible material according to the jump of the gray value.
S5: and (5) smoothing the lines (zigzag broken lines) after the image processing in the step (S4), and smoothing the lines by using a B-spline curve equation.
Specifically, the general equation of the B-spline curve is:
Figure BDA0002793238100000091
wherein P is i Is a characteristic point of the control curve, fi j K (t) is a K-order B-spline basis function;
the basis functions in the B-spline curve equation are:
Figure BDA0002793238100000092
wherein
Figure BDA0002793238100000093
Representing factorial, we get:
Figure BDA0002793238100000094
Figure BDA0002793238100000095
Figure BDA0002793238100000096
Figure BDA0002793238100000097
substituting the basis function into the general equation of the B spline curve to convert the B spline curve equation:
P(t)=P 0 *F 0,3 (t)+P 1 *F 1,3 (t)+P 2 *F 2,3 (t)+P 3 *F 3,3 (t), 2 smooth curves were obtained.
S6: judging the y values of a starting point p1 (x 1, y 1) and an end point p2 (x 2, y 2) of each fairing curve, and if the value of the starting point y1 is smaller than the value of the end point y2, exchanging the sequence of all points of the 2 fairing curves;
s7: sequencing the 2 fairing curves, and sequencing the x values of the midpoints center of Rect of rectangles circumscribed by the 2 fairing curves from small to large;
s8: finding a corresponding group according to the graph template obtained in the S1, taking out the positioning graph in the group, traversing all points on the edge line graph from the first edge line graph, and finding a first reference point with the length equal to Len at the starting point p0 of the edge line graph;
s9: traversing all the points of the edge line graph in the step S8 from the first reference point, and finding second reference points on all the points of the edge line graph according to the distance Dis between the starting point p0 and the end point p1 of the positioning graph;
s10: calculating an included Angle1 of a connecting line from the first reference point to the second reference point;
s11: adding the included Angle1 and the included Angle tan of the positioning graph, and finally, translating and rotating the positioning graph to the position where the included Angle1 and the included Angle tan of the positioning graph are added;
s12: calculating whether the positioning graph in the S11 is intersected with other already-arranged positioning graphs or not, discretizing the positioning graphs in the S11 into lines so as to judge whether the positioning graphs are intersected or not, if so, taking a line segment AB as a standard, and two end points of another line segment CD are arranged at two ends of the line segment AB, wherein the vector multiplication shows that: AB × CD = -CD × AB, if (CA × CD) · (CB × CD) < =0, CA is indicated, and if the directions of CB relative to CD are different, the line segment AB is shown on two sides of the line segment CD, and the intersection of the positioning patterns can be judged;
s13: if the positioning patterns are intersected, moving the starting point of the pattern positioning template, wherein 1mm is a step pitch, and repeating the steps from S8 to S11 after moving the starting point of the pattern positioning template until the positioning patterns of the pattern positioning template are not intersected;
s14: and repeating the steps from S8 to S12 for each positioning pattern until the first reference point cannot be found on the edge line pattern or the second reference point cannot be found, and obtaining the positioning pattern of the pattern positioning template and the pattern of the edge line pattern positioning identification flexible material (as shown in FIG. 4).
Example 2:
s101: a graphic positioning template (as shown in fig. 6) is made by using a CAD drawing tool, and a positioning graphic and an edge line graphic are drawn on the graphic positioning template.
Specifically, an irregular polygon (blue lines) is drawn to represent a positioning graph, which is a real object line; drawing two wavy lines and two straight lines (adopting green lines) on the graph positioning template to represent as an edge line graph which is a simulated positioning line, wherein the position is an (x, y) coordinate;
grouping positioning graphs and edge line graphs in the graph positioning template; if the positioning pattern close to the first line (No. 1 wavy line) exists, the positioning pattern is placed close to the first line (No. 1 wavy line); if the positioning patterns close to the second line (No. 2 wavy line) exist, the positioning patterns are placed close to the second line (No. 2 wavy line), according to the placing rule, the positioning patterns are not overlapped, and the positioning patterns are placed close to the lower end of the edge line pattern.
S102: and calculating to obtain a graph positioning area according to the graph positioning template manufactured in the S100, and setting the upper left corner of the graph positioning area as a coordinate origin (0, 0).
Specifically, starting from the lower part of the graph positioning template, starting from 4 positioning graphs and 2 starting points of edge line graphs in the graph positioning template, and enabling the y value of the starting point of the graph positioning template to be larger than the y value of the end point, so as to obtain 4 positioning graphs and 2 starting points p0 (x 0, y 0) and end points p1 (x 1, y 1) of the edge line graphs of the graph positioning template; judging whether the y0 value is larger than the y1 value, if the y0 values of the 4 positioning patterns are smaller than the y1 values of the 4 positioning patterns and the y0 values of the starting points of the 2 edge line patterns are smaller than the y1 values of the 2 edge line patterns, changing the positions of the original points of the 4 positioning patterns and the 2 edge line patterns of the pattern positioning template;
sequencing 4 positioning graphs and 2 edge line graphs from left to right, calculating circumscribed rectangles Rect of the 4 positioning graphs and the 2 edge line graphs, obtaining the center points center of the outside rectangles Rect, using 6 center points center to replace 6 graphs, using a bubble sequencing algorithm, sequencing the x values in the 6 center points center (x, y) from small to large, and obtaining a well-arranged graph list;
grouping the 4 positioning graphs to obtain the center points center (x, y) of the circumscribed rectangles of the 4 positioning graphs, calculating the distance from the center point center (x, y) of each positioning graph to a straight line, and dividing the distance into a group when the distance is small; it should be noted that each edge line pattern (i.e. 1 wavy line, 1 straight line) is a simulated positioning line, and 4 positioning patterns are positioned according to the edge line pattern;
after grouping is finished, each group has 1 edge line graph (namely 1 straight line and 1 wavy line) and 2 positioning graphs, then the position relation between each positioning graph and the corresponding edge line graph is calculated, the starting point of each edge line graph is p3 (x 3, y 3), the starting point of each positioning graph is p4 (x 4, y 4), and the length from the starting point p3 of each edge line graph to the starting point p4 of each positioning graph is obtained
Figure 217412DEST_PATH_FDA0003818280050000031
(1);
Calculating by the formula (1) to obtain 4 positioning graphs which are all semi-closed irregular polygons, and calculating the distance between a starting point p0 (x 0, y 0) and an end point p1 (x 1, y 1) of the graph positioning template by a connection line slope according to the following formula
Figure 894512DEST_PATH_FDA0003818280050000032
The angle tan = | (k 2-k 1)/[ 1+ (k 2) (k 1) of the line from the starting point p0 to the end point p1]And l, wherein k1 is the slope of the connecting line, and k2 is the slope of the coordinate axis.
S103: the flexible material (as shown in fig. 5) is laid flat on the platform and the camera is mounted on the platform with the lens of the camera directed at the flexible material to take a picture. It should be noted that the flexible material does not have wrinkles or curls when being laid on the platform, and if the flexible material laid on the platform has wrinkles or curls, the calculation is not accurate.
S104: and processing the image obtained by photographing the camera by using an edge extraction method.
Specifically, a threshold value (the gray value range is 0-255) is artificially set according to the color difference between the flexible material and the platform background, the image is binarized, so that the color of the flexible material is changed into white (the gray value 255), the color of the platform background is changed into black (the gray value 0), and then the edge Line1 (a wavy Line) is obtained according to the jump of the gray value.
S105: setting the image area surrounded by the edge lines obtained in the step S104 as an area Region, performing opening operation on the area Region to remove waves, contracting the straight Line of the area Region to the trough of the edge Line1, and then extracting Line2 (wave Line) of the edge Line graph of the area Region; smoothing the edge Line1 and the edge Line2, and smoothing the lines by using a B-spline curve equation.
Specifically, the general equation of the B-spline curve is:
Figure BDA0002793238100000131
wherein P is i Is a characteristic point of the control curve, fi j K (t) is a B-spline basis function of the K order;
the basis functions in the B-spline curve equation are:
Figure BDA0002793238100000132
wherein
Figure BDA0002793238100000133
Representing factorial, we get:
Figure BDA0002793238100000134
Figure BDA0002793238100000135
Figure BDA0002793238100000136
Figure BDA0002793238100000137
substituting the basis function into the general equation can calculate a B spline curve equation:
P(t)=P 0 *F 0,3 (t)+P 1 *F 1,3 (t)+P 2 *F 2,3 (t)+P 3 *F 3,3 (t), 4 smooth curves were obtained.
S106: judging the y values of a starting point p1 (x 1, y 1) and an end point p2 (x 2, y 2) of each fairing curve, and if the value of the starting point y1 is smaller than the value of the end point y2, exchanging the sequence of all the points of the 4 fairing curves;
s107: sequencing the 4 fairing curves, and sequencing the x values of the midpoints center of Rect of the circumscribed rectangles Rect of the 4 fairing curves from small to large;
s108: traversing all points on the lines of the edge line graph from the starting point of the first edge line graph (1 wave line and 1 straight line), finding out the point with the closest distance from the starting point p0 on the straight line of the edge line graph to the first reference point on the wave line of the edge line graph,
that is, the second reference point (the valley point wp 1) at which the distance from the starting point p0 to the first reference point is smallest; in the range from 1/2 wavelength behind the wave trough point wp1 to 3/2 wavelength of the wave trough point wp1, calculating a second reference (wave trough point wp 1) with the minimum distance from a starting point p0 on the straight line of the corresponding edge line graph of the small section to a point on the wave line; note that all the valley points wp1 are calculated in this manner;
s109: starting from a valley point wp1 of 1 group, setting a starting point p0 of a first edge Line graph of 1 group in the graph positioning template at the valley point wp1, and then searching a third reference point with the minimum distance from the starting point p0 to the valley point wp1 on an edge Line2 from the valley point wp1 according to the distance Dis of the edge Line graph;
s1010: calculating an included Angle1 of a connecting line from the first reference point to the second reference point (a valley point wp 1);
s1011: adding the included Angle1 and the included Angle tan of the positioning graph, and finally, translating and rotating the positioning graph to the position where the included Angle1 and the included Angle tan of the positioning graph are added;
s1012: calculating whether the positioning graph in the S1011 is intersected with other already-arranged positioning graphs or not, discretizing the positioning graph in the S1011 into lines so as to judge whether the positioning graphs are intersected or not, if so, taking a line segment AB as a standard, and two end points of another line segment CD are arranged at two ends of the line segment AB, wherein the vector multiplication shows that: AB × CD = -CD × AB, (CA × CD) · (CB × CD) < =0 indicates CA, and if the direction of CB relative to CD is different, AB is on two sides of the line segment CD, so that the intersection of the positioning patterns can be judged;
s1013: if the positioning graphs are intersected, moving a starting point p4 of the positioning graphs, and repeating the steps from S108 to S1011 after the starting point is moved until the positioning graphs are not intersected;
s1014: repeating the steps from S108 to S1012 for each positioning pattern until the valley point wp1 is not found on the edge line or the first reference point is not found, so as to obtain the positioning pattern of the pattern positioning template and the pattern of the edge line pattern positioning identification flexible material (as shown in FIG. 7).
The invention is not limited solely to that described in the specification and embodiments, and additional advantages and modifications will readily occur to those skilled in the art, so that the invention is not limited to the specific details, representative apparatus, and examples shown and described herein, without departing from the spirit and scope of the general concept as defined by the appended claims and their equivalents.

Claims (9)

1. A pattern recognition and positioning method based on flexible materials is characterized by comprising the following steps,
s1: manufacturing a graph positioning template by using a CAD drawing tool, and drawing a positioning graph and an edge line graph on the graph positioning template;
s2: calculating according to the graph positioning template manufactured in the S1 to obtain a graph positioning area, and setting the upper left corner of the graph positioning area as a coordinate origin;
s3: flatly laying the flexible material on a platform, then arranging a camera on the platform, and aligning a lens of the camera with the flexible material for taking a picture;
s4: processing images obtained by photographing the camera by using an edge extraction method;
s5: performing smoothing processing on the lines subjected to the image processing in the S4, and performing smoothing processing on the lines by using a B spline curve equation to obtain a smooth curve;
s6: judging the y values of the starting point and the end point of each fairing curve, and if the y1 value of the starting point is smaller than the y2 value of the end point, exchanging the sequence of all points of the fairing curves;
s7: sequencing the curves of the fairing, and sequencing the x values of the center of the circumscribed rectangle Rect of the curves of the fairing;
s8: traversing all points on the edge line graph of the graph positioning template to find a first reference point according to the graph positioning template obtained in the S1;
s9: finding out second reference points on all points according to the distance Dis between the starting point and the end point of the positioning graph;
s10: calculating an included Angle1 of a connecting line from the first reference point to the second reference point;
s11: adding the included Angle Angle1 and the included Angle tan of the positioning graph, and then translating and rotating the positioning graph to a position where the included Angle Angle1 and the included Angle tan of the positioning graph are added;
s12: calculating whether the positioning graph in the S11 is intersected with other already arranged positioning graphs or not;
s13: if the positioning graphs are judged to be intersected, after the first reference point of the starting point of the positioning graphs is moved, the steps from S9 to S12 are repeated until the positioning graphs are not intersected;
s14: and repeating the steps from S8 to S13 for each positioning graph until the first reference point cannot be found on the edge line graph or the second reference point cannot be found, and obtaining the positioning graph of the graph positioning template and the graph of the edge line graph positioning identification flexible material.
2. The pattern recognition and positioning method based on flexible material as claimed in claim 1, wherein the positioning patterns and the edge line patterns in the pattern positioning template are grouped; if the positioning pattern close to the first line exists, placing the positioning pattern close to the first line; if the positioning patterns close to the second line exist, the positioning patterns are placed close to the second line, and the positioning patterns are not overlapped.
3. The pattern recognition and positioning method based on flexible material according to claim 1, wherein the step S2 further comprises the step S21: starting the positioning graph and the starting point of the edge line graph in the graph positioning template from the lower part of the graph positioning template, enabling the y value of the starting point of the graph positioning template to be larger than the y value of the end point, and obtaining the starting point p0 and the end point p1 of the graph positioning template.
4. The pattern recognition positioning method based on flexible material according to claim 3, wherein the step S2 further comprises the step S22: and sequencing the positioning graphs and the edge line graphs of the graph positioning template, calculating the circumscribed rectangle Rect of the positioning graphs and the edge line graphs, and obtaining a center point of the external rectangle Rect, wherein the center point replaces the positioning graphs and the edge line graphs, and sequencing the x value in the center point by using a bubble sequencing algorithm to obtain a graph list.
5. The pattern recognition and localization method based on flexible material according to claim 4, wherein the step S2 further comprises the step S23: and grouping the positioning graphs to obtain the center of the circumscribed rectangle of the positioning graphs, and calculating the distance from the center of each positioning graph to the edge line graph.
6. The pattern recognition positioning method based on flexible material according to claim 5, wherein the step S2 further comprises the step S24: after grouping is completed, the position relation between each positioning graph and the corresponding edge line graph is calculated, the starting point of the edge line graph is p3 (x 3, y 3), the starting point of each positioning graph is p4 (x 4, y 4),
the length from the starting point p3 of the edge line pattern to the starting point p4 of the positioning pattern
Figure FDA0003818280050000031
(1)。
7. The pattern recognition localization method based on flexible material according to claim 6, wherein the step S2 further comprises the step S25: the positioning graphs obtained by calculation through the formula (1) are all semi-closed irregular polygons, and the distance between the starting point p0 (x 0, y 0) and the end point p1 (x 1, y 1) of the graph positioning template is obtained by calculation through the connection slope according to the following formula
Figure FDA0003818280050000032
The angle tan = | (k 2-k 1)/[ 1+ (k 2) (k 1) of the line from the starting point p0 to the end point p1]And l, wherein k1 is the slope of the connecting line, and k2 is the slope of the coordinate axis.
8. The pattern recognition and positioning method based on flexible material according to claim 1, wherein the step S4 further comprises the step S41: and manually setting a threshold value according to the background color difference of the flexible material and the platform, and binarizing the image.
9. The pattern recognition and positioning method based on flexible material as claimed in claim 1, wherein the line is smoothed by using B-spline curve equation,
the general equation for the B-spline curve is:
Figure FDA0003818280050000033
where Pi is a characteristic point of the control curve, fi j K (t) is a K-th order B-spline basis function, and the basis function in the B-spline curve equation is as follows:
Figure FDA0003818280050000034
wherein
Figure FDA0003818280050000035
Representing factorial, we get:
Figure FDA0003818280050000036
Figure FDA0003818280050000041
Figure FDA0003818280050000042
Figure FDA0003818280050000043
substituting the basis function into the general equation can calculate a B spline curve equation:
P(t)=P 0 *F 0,3 (t)+P 1 *F 1,3 (t)+P 2 *F 2,3 (t)+P 3 *F 3,3 (t)。
CN202011322190.0A 2020-11-23 2020-11-23 Flexible material based pattern recognition positioning method Active CN112464779B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011322190.0A CN112464779B (en) 2020-11-23 2020-11-23 Flexible material based pattern recognition positioning method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011322190.0A CN112464779B (en) 2020-11-23 2020-11-23 Flexible material based pattern recognition positioning method

Publications (2)

Publication Number Publication Date
CN112464779A CN112464779A (en) 2021-03-09
CN112464779B true CN112464779B (en) 2022-10-11

Family

ID=74798506

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011322190.0A Active CN112464779B (en) 2020-11-23 2020-11-23 Flexible material based pattern recognition positioning method

Country Status (1)

Country Link
CN (1) CN112464779B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104339946A (en) * 2014-07-28 2015-02-11 杨立群 Charting and drawing template
WO2016011433A2 (en) * 2014-07-17 2016-01-21 Origin Wireless, Inc. Wireless positioning systems
CN110268190A (en) * 2016-12-30 2019-09-20 同济大学 A kind of underground pipe gallery leakage detection method based on the processing of static Infrared Thermogram
CN112464950A (en) * 2020-11-23 2021-03-09 武汉舜陈技术有限公司 Flexible material based pattern recognition positioning method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003016463A (en) * 2001-07-05 2003-01-17 Toshiba Corp Extracting method for outline of figure, method and device for pattern inspection, program, and computer- readable recording medium with the same stored therein
AU2008202364B2 (en) * 2008-05-28 2011-04-21 Canon Kabushiki Kaisha Scan converting a set of vector edges to a set of pixel aligned edges

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016011433A2 (en) * 2014-07-17 2016-01-21 Origin Wireless, Inc. Wireless positioning systems
CN104339946A (en) * 2014-07-28 2015-02-11 杨立群 Charting and drawing template
CN110268190A (en) * 2016-12-30 2019-09-20 同济大学 A kind of underground pipe gallery leakage detection method based on the processing of static Infrared Thermogram
CN112464950A (en) * 2020-11-23 2021-03-09 武汉舜陈技术有限公司 Flexible material based pattern recognition positioning method

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
Learning Graph Matching: oriented to Category Modeling from Cluttered Scenes;Quanshi Zhang等;《2013 IEEE International Conference on Computer Vision》;20140303;1329-1336 *
基于形状与边缘特征的户型图识别研究;江州;《中国优秀硕士学位论文全文数据库_信息科技辑》;20180215;I138-1783 *
复杂图像中的QR码自动提取算法研究;屈德涛;《中国优秀硕士学位论文全文数据库_信息科技辑》;20180415;I138-2662 *

Also Published As

Publication number Publication date
CN112464779A (en) 2021-03-09

Similar Documents

Publication Publication Date Title
CN115033967A (en) Building template real-time modeling method based on point cloud data
CN109902585B (en) Finger three-mode fusion recognition method based on graph model
JPS63145577A (en) Pattern data generating method
CN112991176A (en) Panoramic image splicing method based on optimal suture line
CN115609591B (en) Visual positioning method and system based on 2D Marker and compound robot
CN114494045A (en) Large-scale straight gear geometric parameter measuring system and method based on machine vision
CN112464779B (en) Flexible material based pattern recognition positioning method
US6178392B1 (en) Method for combining the computer models of two surfaces in 3-D space
CN112488099A (en) Digital detection extraction element on electric power liquid crystal instrument based on video
CN115601769A (en) Method and device for adjusting hand-drawn graph, electronic equipment and medium
CN113592962B (en) Batch silicon wafer identification recognition method based on machine vision
CN112464950B (en) Pattern recognition positioning method based on flexible material
CN106934846B (en) Cloth image processing method and system
JP2003141567A (en) Three-dimensional city model generating device and method of generating three-dimensional city model
JPH0415884A (en) Picture processor
CN115112098B (en) Monocular vision one-dimensional two-dimensional measurement method
JPH04141783A (en) Device and method for preparing electron beam graphic data
CN114492681B (en) Method for identifying color printing packaging pattern by using electronic equipment and computer vision system thereof
CN115388785A (en) Flexible wire harness measuring method and system based on vision
CN114881900A (en) Pantograph image splicing method based on feature matching and gradual-in and gradual-out fusion
CN115625435A (en) Intelligent recognition cutting method, device and system
JP4639044B2 (en) Contour shape extraction device
WO2006053411A2 (en) Template based digital image correction system and magnetic pattern holder
CN111507287A (en) Method and system for extracting road zebra crossing corner points in aerial image
CN104143198A (en) Image description method and device

Legal Events

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