Disclosure of Invention
The invention aims to provide a flange size measuring method based on sub-pixel precision of machine vision, which is used for carrying out edge detection on a preprocessed flange image to obtain sub-pixel level coordinates of the flange edge to be measured, determining the size of the flange to be measured based on the sub-pixel level coordinates of the flange edge to be measured, improving the detection precision and the detection efficiency of flange size detection, reducing false detection rate and ensuring the product quality of the flange.
The flange plate size measuring method based on the sub-pixel precision of the machine vision provided by the embodiment of the invention comprises the following steps:
Calibrating the size of the CCD camera;
Acquiring a flange image of a flange to be measured by a CCD camera with calibrated size;
Preprocessing the flange plate image;
performing edge detection on the preprocessed flange image to obtain sub-pixel level coordinates of the flange edge to be measured;
and determining the size of the flange to be measured based on the sub-pixel level coordinates of the edge of the flange to be measured.
Preferably, preprocessing the flange plate image includes:
graying treatment is carried out on the flange plate image, wherein the graying treatment mode at least comprises a weighted average method;
filtering and denoising the flange plate image subjected to the graying treatment, wherein the filtering and denoising treatment at least comprises Gaussian filtering, median filtering and mean filtering;
And carrying out image segmentation processing on the flange plate image subjected to filtering denoising processing, wherein the image segmentation processing mode at least comprises segmentation based on a threshold value.
Preferably, edge detection is performed on the preprocessed flange image to obtain sub-pixel level coordinates of the flange edge to be measured, including:
And carrying out edge detection on the preprocessed flange image based on an improved Canny-Zernike moment sub-pixel edge detection algorithm to obtain sub-pixel level coordinates of the flange edge to be measured.
Preferably, determining the size of the flange to be measured based on the subpixel level coordinates of the edge of the flange to be measured includes:
fitting the size of the flange to be measured according to the sub-pixel level coordinates of the edge of the flange to be measured based on a least square method.
Preferably, the flange plate dimension measuring method based on sub-pixel precision of machine vision further comprises the following steps:
When the number of the dimension measurement abnormal events in the first time period is larger than or equal to a number threshold value, acquiring detection multi-mode data, wherein the dimension measurement abnormal events comprise that the deviation between the dimension of the flange to be measured and the preset dimension is larger than or equal to a deviation threshold value, and the detection multi-mode data comprise dimension detection tracing information of a CCD camera in the first time period and production tracing information of the flange to be measured in the production dimension measurement abnormal events;
performing feature processing on the detection multi-mode data based on a first feature processing template to obtain a first feature description vector;
determining an attribution policy based on the first feature description vector;
Determining a attribution result according to the detected multi-mode data based on the attribution strategy;
Stopping continuously measuring the size of the remaining flange plates to be detected in a second time period when the result of the angelica is size detection, wherein the second time period is after the first time period and is adjacent to the first time period;
And stopping continuously carrying out size measurement on the flange to be detected in the same production batch as the flange to be measured in the abnormal event of production size measurement within a second time period when the result of the angelica is that the product is produced, and carrying out recall early warning on the flange which is subjected to size measurement in the same production batch as the flange to be measured in the abnormal event of production size measurement.
Preferably, determining the attribution policy based on the first feature description vector includes:
Determining an analysis value corresponding to the first feature description vector from a situation analysis library;
when the analysis value is smaller than or equal to the analysis threshold value, determining an attribution strategy corresponding to the first feature description vector from an attribution strategy library;
when the analysis value is larger than the analysis threshold value, determining a crawling strategy corresponding to the first feature description vector from a crawling strategy library;
Based on the crawling strategy, crawling big data knowledge;
constructing a big data knowledge graph based on big data knowledge;
based on the big data knowledge graph, an attribution strategy is determined.
Preferably, the crawling strategy is based on crawling big data knowledge, including:
analyzing access scenes, content search rules and content extraction rules of the crawling strategy;
Generating a preparation factor according to the content searching rule and the content extracting rule based on the factor generating template;
pre-accessing the access scene, and acquiring preparation content from the access scene based on a preparation factor during pre-accessing;
performing feature processing on the prepared content based on a second feature processing template to obtain a second feature description vector;
determining a permission value corresponding to the second feature description vector and additional content from a permission analysis library;
when the permission value is greater than or equal to the permission threshold value, accessing the access scene, and searching first target content from the access scene based on the content searching rule during access;
when the additional content is empty, extracting big data knowledge from the first target content based on the content extraction rule;
When the additional content comprises at least one group of one-to-one association relation and content conditions, searching second target content with any association relation with the first target content from the access scene, and determining whether the second target content accords with the content conditions corresponding to any association relation;
When met, big data knowledge is extracted from the first target content based on the content extraction rules.
Preferably, constructing a big data knowledge graph based on big data knowledge includes:
Analyzing the knowledge type of the big data knowledge;
determining a mapping node corresponding to the knowledge type from a mapping node table;
the big data knowledge is set at the mapping node in the initial map;
and taking the initial map after all mapping nodes needing to set big data knowledge are provided with corresponding big data knowledge as a big data knowledge map.
Preferably, the determining the attribution strategy based on the big data knowledge graph includes:
The support degree is the ratio of the total number of big data knowledge matched and matched with the hypothesis attribution results in the big data knowledge graph to the total number of big data knowledge in the big data knowledge graph;
determining policy establishment basis search rules based on hypothesis attribution results corresponding to the maximum support;
Searching for strategy establishment basis in the big data knowledge graph based on strategy establishment basis searching rule;
and (5) formulating an attribution strategy based on the strategy formulation basis.
The flange plate size measurement system based on sub-pixel precision of machine vision provided by the embodiment of the invention comprises:
The camera calibration module is used for calibrating the size of the CCD camera;
The image acquisition module is used for acquiring a flange image of the flange to be measured through the CCD camera after the size calibration;
The preprocessing module is used for preprocessing the flange plate image;
The edge detection module is used for carrying out edge detection on the preprocessed flange image to obtain sub-pixel level coordinates of the flange edge to be measured;
the size determining module is used for determining the size of the flange to be measured according to the sub-pixel level coordinates of the edge of the flange to be measured.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims thereof as well as the appended drawings.
The technical scheme of the invention is further described in detail through the drawings and the embodiments.
Detailed Description
The preferred embodiments of the present invention will be described below with reference to the accompanying drawings, it being understood that the preferred embodiments described herein are for illustration and explanation of the present invention only, and are not intended to limit the present invention.
The embodiment of the invention provides a sub-pixel precision flange plate dimension measuring method based on machine vision, which is shown in fig. 1 and comprises the following steps:
s1, calibrating the size of a CCD camera;
S2, acquiring a flange image of a flange to be measured by a CCD camera with calibrated size;
s3, preprocessing the flange plate image;
s4, carrying out edge detection on the preprocessed flange image to obtain sub-pixel level coordinates of the flange edge to be measured;
S5, determining the size of the flange to be measured based on the sub-pixel level coordinates of the edge of the flange to be measured.
Preprocessing the flange plate image, including:
graying treatment is carried out on the flange plate image, wherein the graying treatment mode at least comprises a weighted average method;
filtering and denoising the flange plate image subjected to the graying treatment, wherein the filtering and denoising treatment at least comprises Gaussian filtering, median filtering and mean filtering;
And carrying out image segmentation processing on the flange plate image subjected to filtering denoising processing, wherein the image segmentation processing mode at least comprises segmentation based on a threshold value.
Edge detection is carried out on the preprocessed flange plate image to obtain sub-pixel level coordinates of the flange plate edge to be measured, and the method comprises the following steps:
And carrying out edge detection on the preprocessed flange image based on an improved Canny-Zernike moment sub-pixel edge detection algorithm to obtain sub-pixel level coordinates of the flange edge to be measured.
Fitting the size of the flange to be measured according to the sub-pixel level coordinates of the edge of the flange to be measured based on a least square method.
The working principle and the beneficial effects of the technical scheme are as follows:
Edge detection is carried out on the preprocessed flange plate image, sub-pixel level coordinates of the flange plate edge to be measured are obtained, the size of the flange plate to be measured is determined based on the sub-pixel level coordinates of the flange plate edge to be measured, the detection precision and the detection efficiency of the flange plate size detection are improved, the false detection rate is reduced, and the product quality of the flange plate is guaranteed.
The Zernike moment is an orthogonalization function based on a Zernike polynomial, the Zernike orthogonalization moment is widely applied, the moment has rotation invariance and low sensitivity to noise, and sub-pixel coordinates can be obtained by calculating parameter values such as a step gray value, a background gray value, a vertical distance from a circle center to an image edge, an included angle between an X axis and an image edge vertical line and the like of a Zernike moment edge model, and an accurate image edge is obtained.
The n-order m-th order Zernike moment Z nm of a continuous image f (x, y) is defined as shown in formula (1):
wherein x and y are x+y.ltoreq.l; Is the complex conjugate of an n-order m-th order Zernike moment polynomial V nm (ρ, θ), ρ is the vector length from the origin to the point (X, y), θ is the angle between the vector and the X-axis counterclockwise direction.
Under discrete conditions, the Zernike moment is as shown in formula (2):
The ideal edge step model is shown in fig. 2. In fig. 2, (X 0,y0) is the origin coordinate, L is the ideal edge of the image, k is the step amplitude of the background and the target area, h is the gray value of the background of the image, L is the vertical distance between the center of the circle and L, and α is the angle between the line L 1 and the X axis.
If the edge is rotated by alpha, the rotated Zernike momentThe relationship with the Zernike moment Z nm before rotation is shown in equation (3):
Z′nm=Znme-pmα (3)
Wherein p is an imaginary unit.
The rotation angle, namely the included angle alpha, can be obtained by utilizing the imaginary part Im [ Z 11 ] and the real part Re [ Z 11 ] of Z 11, and the result is shown as the formula (4):
Derived Z '00、Z′11 and Z' 20 are shown in formula (5):
the parameters h, k and l are obtainable from the formula as shown in formula (6):
finally, a subpixel edge detection formula is obtained, as shown in formula (7):
Where (x s,ys) is the sub-pixel edge coordinates.
The calculation formula of the Zernike moment sub-pixel coordinates when the unit circle is sampled by adopting an NxN template under the discrete condition is as shown in the formula (8):
The Canny algorithm is an edge detection algorithm widely used at present, and mainly comprises four steps of carrying out convolution smoothing on an image by using a two-dimensional Gaussian template, calculating gradient amplitude and direction of each pixel point, carrying out non-maximum suppression on the gradient amplitude, and detecting and connecting edges by using a double-threshold algorithm. The traditional Canny algorithm has many defects that edge protection is ignored when Gaussian filtering is used, the gradient is calculated by using a 2x2 neighborhood and is easy to be interfered by noise, the target edge is lost, and the adaptability of manually setting double thresholds is low.
The traditional Canny operator is improved in the pixel-level edge rough extraction process, an image input process is optimized by an improved algorithm, meanwhile, defects in the traditional algorithm image denoising process, gradient amplitude calculation and threshold selection modes are respectively improved, finally, the obtained pixel-level edge point is better in continuity, edge information is more accurate, a foundation is provided for fine positioning of the edge, and the workload of fine positioning of the sub-pixels is reduced.
In the process of image acquisition, noise is generated due to the influence of external environment and other factors, and the protection of edges is ignored due to Gaussian filtering, so that the system uses bilateral filtering to denoise the image in order to ensure the integrity of the edges. The bilateral filtering nonlinear filtering method is to add a pixel value weight item on the basis of Gaussian filtering, and meanwhile, spatial domain information and gray level similarity are considered, so that image target edge information is kept, and a noise reduction effect is achieved.
The bilateral filtering is shown as a formula (9), wherein i and j are coordinate points of a current convolved pixel, and k and l are coordinate points of a field pixel respectively.
In an algorithm of edge detection, the size of the gradient can well reflect the pixel change condition of a picture, 45-degree and 135-degree direction templates are added on the basis of a traditional Sobel operator, and the direction templates are converted into four directions of horizontal and vertical directions, 45-degree and 135-degree directions. First order partial derivatives of x, y, 45 deg. and 135 deg. directions are calculated in the neighborhood of pixel 8, so the improved template is more accurate and better noise suppressing in edge location than conventional templates. The concrete template is as follows:
In the formula (10), hx, hy, h45°, and H135 ° represent the horizontal direction, the vertical direction, the 45 ° direction, and the 135 ° direction of the gradient template, respectively. And (3) carrying out plane convolution on the filtered original image by utilizing a multi-directional Canny template to obtain gradient components in four directions. The gradient calculation process is as follows:
Equation (11) is the partial derivative of the gradient template in each direction, θ is the gradient direction in equation (12), and f x (i, j) and f y (i, j) represent the horizontal direction and the vertical direction, respectively. The gradient weighting coefficients are denoted by α and β, respectively, the gradients in each direction are Mx °, my °, m45°, and m135°, respectively, and finally, the final gradient M can be obtained.
The edges extracted by only the gradient values remain blurred and the purpose of non-maximal suppression is to refine the edges in that the basic method is to compare the current pixel gradient intensity with the gradient values on both sides in the gradient direction. If the pixel is the extreme point, the pixel is reserved as the edge point, and if the pixel is not the extreme point, the pixel is not the edge point.
The application adopts a more accurate method to judge whether the pixel can form an edge or not. The direction of the gradient is also considered on the basis of the gradient magnitude of the pixel. Specifically, if the magnitude of the gradient in the x direction of the current pixel is greater than the magnitude of the gradient in the y direction, the gradient in the x direction is determined, and conversely, the gradient in the y direction is determined. By considering the direction of the gradient, we can better capture the image edges, thereby improving the accuracy of edge detection.
After maximum suppression is completed, the image also contains some noise and false edges, a double-threshold method is applied to the Canny algorithm to reduce the false edges, and on the problem of difficulty in selecting double thresholds, the threshold selection mode of the traditional Canny algorithm is improved, and the defect that the self-adaptive double threshold is obtained by adopting an Otsu method to optimize the traditional manual experience selection threshold is overcome. The specific algorithm is as follows:
Let the threshold T h be present to divide all pixels of the image into two classes C 1、C2, the gray average values of C 1 and C 2 are m 1 and m 2, respectively, the global average gray value of the image is m, and the probabilities of the pixels being divided into C 1 and C 2 are p 1 and p 2, respectively, then there are:
σ2=p1(m1-m)2+p2(m2-m)2 (14)
When σ 2 is maximum, T h, which is the best threshold, is obtained as the high threshold of the double threshold, and 0.5xT h is selected as the low threshold of the double threshold.
Conventional algorithms, when calculating the Zernike moments, identify the centroid of the image as the origin of coordinates, projecting the entire image into a unit circle. The improved Canny-Zernike subpixel edge detection algorithm does not require traversing the entire image. Therefore, the detection speed can be increased by adopting the sub-pixel edge detection method.
The value of the Zernike moment obtained by using the Zernike templates of different orders directly influences the image edge detection precision in the sub-pixel detection process, and generally, the larger the size of the selected template is, the higher the detection precision is, but the longer the detection precision is relative to time, and the detection precision of an algorithm is further improved by adopting a 7x7 Zernike moment parameter template comprehensively considering the needs of papers.
The improved algorithm expands Z 00、Z11、Z20 to a Z 31、Z40 coefficient template on the basis of the Ghosal algorithm, and meanwhile, a new edge judgment condition k is more than or equal to k t∩∣l2-l1∣≦lt to replace the traditional edge judgment condition k is more than or equal to k t∩l2-l1≦lt. The specific algorithm is as follows:
Derived from formulas (12), (15), (16):
the specific implementation steps of the improved algorithm are as follows:
Step 1, adopting a traditional Zernike moment detection algorithm to obtain 5 Zernike moments Z 00、Z11、Z20、Z31、Z40 with different orders;
step 2, calculating to obtain Z' 00、Z′11、Z′20、Z′31、Z′40 according to the rotation invariant property of the Zernike orthogonal moment;
Step 3, deducing l 1、l2 and k according to Z' 00、Z′11、Z′20、Z′31、Z′40, and calculating l;
Step 4, substituting l into a formula of k and h to calculate k;
Step 5, judging whether the parameters of each edge pixel point meet the judging conditions, namely that k is more than or equal to k t and
And 6, judging the pixel level rough edge point by adopting a new sub-pixel edge judgment basis k not less than k t∩∣l2-l1∣≦lt and then judging the pixel level rough edge point by adopting an improved Canny operator. And if the pixel points are matched, the pixel points are edge pixels, otherwise, the pixel points are not edge pixels.
The dimension measurement needs to convert the measured pixel dimension into the actual dimension of the workpiece, so that the conversion relation between the pixel dimension and the actual dimension needs to be obtained. In order to ensure the accuracy of the measurement result, a 6mmx6mm black and white chess grid calibration plate is used for carrying out size calibration on a camera, 20 calibration plate pictures with different angles are acquired in a measurement area by the camera, two angular points are found in each picture, and an actual distance between the two angular points and a pixel distance calibration formula are respectively calculated, wherein the actual distance and the pixel distance calibration formula is as follows:
wherein L is the actual size between two points of the calibration plate, and L is the pixel size between two points of the calibration plate.
The average value of 20 groups of K values is obtained, namely the calibration coefficient K, and the practical meaning is that the physical size of one pixel is 0.08421mm/pixel.
The hardware part of the detection system mainly comprises a computer, an industrial camera, a lens, a backlight source, an annular light source and a test bench. The detection process includes capturing an image of the flange end face by using an industrial camera, transmitting the captured image to a computer through a camera device driver, wherein the camera device driver can be a USB interface or other communication interfaces, and is used for transmitting static image data and frame data of a video stream to the computer, processing the image by using pycharm software through various algorithms (such as graying, filtering and noise reduction, image segmentation, edge detection and the like) by using the computer, and then fitting according to the processed image to obtain a measurement result.
Because the color three-channel image is collected by the camera, the characteristic quantity and the calculated quantity contained in the color three-channel image are large, and the time consumption is long for direct analysis. The image after graying becomes a single-channel image, so that the operation speed can be improved. Here, graying is achieved by using a weighted average method, and original images and gray images of the outer circle and the inner hole of the blue disk are shown in fig. 3, wherein the left side is the original image and the right side is the gray image in fig. 3.
Because noise mixed in the original image generation process can reduce the image quality, so that image details are not clear enough, and the effects of image segmentation, edge detection and the like are directly affected, the noise needs to be eliminated as much as possible by adopting a proper method, and the image quality is improved to the greatest extent. In a common filtering method, the median filtering has the characteristic of removing useless image noise contained in an image while protecting the edge information of the image, and the flange image is respectively subjected to three different filtering treatments, and the effects are compared, as shown in fig. 4, the images after Gaussian filtering, median filtering and mean filtering are respectively carried out in sequence from left to right.
The use of image segmentation to acquire the region of interest can simplify subsequent image processing. The segmentation method based on the threshold value is used, so that the image processing effect on the image with stronger contrast between the foreground and the background is remarkable. The flange plate is obviously compared with the background, so that the image segmentation is realized by using a threshold-based segmentation method, wherein the threshold-based segmentation is a method for binarization segmentation, namely, the threshold is directly given to carry out binarization segmentation.
The image gradation distribution is displayed by using the histogram, and the time division effect is good when t=88 is selected according to the gradation histogram display shown in fig. 5. The binarized segmentation map is shown in fig. 6.
For visual qualitative analysis of the conventional algorithm and the improved algorithm, the conventional and improved Zernike algorithms are adopted to extract sub-pixel edge points of the inner and outer diameter profiles of the part of fig. 6, the left graph in fig. 7 is a graph of the conventional algorithm on the edge extraction of the flange, and the right graph is a graph of the improved algorithm on the edge extraction of the outer diameter of the flange. As can be seen from FIG. 7, the algorithm before improvement can be used for detecting the edge profile of the flange plate in a fuzzy manner, but compared with the algorithm after improvement, a part of key point information is lost, the edge noise is more, and the profile point fracture appears on a part of the edge, so that the algorithm after improvement can be used for better size measurement, and the extraction precision is higher.
In one embodiment, the method for measuring the flange size based on the sub-pixel precision of the machine vision further comprises the following steps:
When the number of the dimension measurement abnormal events in the first time period is larger than or equal to a number threshold value, acquiring detection multi-mode data, wherein the dimension measurement abnormal events comprise that the deviation between the dimension of the flange to be measured and the preset dimension is larger than or equal to a deviation threshold value, and the detection multi-mode data comprise dimension detection tracing information of a CCD camera in the first time period and production tracing information of the flange to be measured in the production dimension measurement abnormal events;
performing feature processing on the detection multi-mode data based on a first feature processing template to obtain a first feature description vector;
determining an attribution policy based on the first feature description vector;
Determining a attribution result according to the detected multi-mode data based on the attribution strategy;
Stopping continuously measuring the size of the remaining flange plates to be detected in a second time period when the result of the angelica is size detection, wherein the second time period is after the first time period and is adjacent to the first time period;
And stopping continuously carrying out size measurement on the flange to be detected in the same production batch as the flange to be measured in the abnormal event of production size measurement within a second time period when the result of the angelica is that the product is produced, and carrying out recall early warning on the flange which is subjected to size measurement in the same production batch as the flange to be measured in the abnormal event of production size measurement.
The first time period is a time period in which any time period for performing size measurement on a plurality of flanges to be measured waiting to be detected in a queue is, for example, 100 seconds; the duration of the second period of time may be, for example, 50 seconds; the number threshold value can be, for example, 5, the flanges to be measured are all of preset sizes and are determined by production standards of the flanges to be measured, the deviation between the sizes of the flanges to be measured and the preset sizes is the ratio of a size difference value to the preset sizes, the deviation threshold value can be, for example, 0.001%, when the number of abnormal events of size measurement occurs in a first time period and is larger than or equal to the number threshold value, batch abnormality detected by the flanges is described to occur, attribution is needed, size detection tracing information is working state information of a CCD camera in the first time period, such as working temperature, white balance parameters, gamma correction parameters and the like, product production tracing information is the service life of production equipment for producing the flanges to be measured in the abnormal events of size measurement, last maintenance time, historical abnormality records and the like, information characteristics of detected multi-mode data can be extracted by using a first characteristic processing template, an attribution-mode data detection multi-mode information describing vector is established, based on the first characteristic describing vector, attribution the multi-mode attribution strategy indicates how to cause abnormal batch detection of the flanges occurs according to the detected by the detected multi-mode data, based on the first characteristic describing strategy, if the flanges are detected by the fact that the flanges to be detected, if the flanges to be detected are required to be stopped, and if the production measurement of the flange to be detected is continued, the same as the flange measurement is required in the production measurement has been stopped, and the production measurement has been continued, if the size measurement has been required to be detected, and the size measurement has been continued, and the rest measurement result has been described above measurement result is determined based on the measurement result, and carrying out recall early warning on the flanges which are subjected to size measurement and are in the same production batch as the flanges to be measured in the abnormal event of production size measurement.
The application has realized that there is no need to measure the size of the flange manually, but in the course that the system measures the size of the flange automatically, it is possible to measure the abnormality, at this moment, need to be attributed immediately, adopt the corresponding processing means, but in the concrete implementation, if there is abnormality in measurement, the system needs to be suspended manually to continue to measure the size of the flange for whatever reason, seriously affects the detection progress of the flange, in addition, it also needs staff to check the reason, the labor cost is high. According to the embodiment of the application, the problems can be solved, when the number of the abnormal events of the dimension measurement in the first time period is larger than or equal to the number threshold value, the multi-mode data is acquired, the first characteristic description vector for detecting the multi-mode data is constructed, the attribution strategy is determined based on the first characteristic description vector, the attribution is rapidly carried out by utilizing the attribution strategy, corresponding measures are taken, the system is not required to be suspended for a long time to continue the dimension measurement of the flange, the influence on the detection progress of the flange is greatly reduced, in addition, the personnel is not required to check the reasons, the labor cost is reduced, and the applicability of the system is improved.
In one embodiment, determining an attribution policy based on the first feature description vector comprises:
Determining an analysis value corresponding to the first feature description vector from a situation analysis library;
when the analysis value is smaller than or equal to the analysis threshold value, determining an attribution strategy corresponding to the first feature description vector from an attribution strategy library;
when the analysis value is larger than the analysis threshold value, determining a crawling strategy corresponding to the first feature description vector from a crawling strategy library;
Based on the crawling strategy, crawling big data knowledge;
constructing a big data knowledge graph based on big data knowledge;
based on the big data knowledge graph, an attribution strategy is determined.
Based on the big data knowledge, constructing a big data knowledge graph, comprising:
Analyzing the knowledge type of the big data knowledge;
determining a mapping node corresponding to the knowledge type from a mapping node table;
the big data knowledge is set at the mapping node in the initial map;
and taking the initial map after all mapping nodes needing to set big data knowledge are provided with corresponding big data knowledge as a big data knowledge map.
The determining an attribution strategy based on the big data knowledge graph comprises the following steps:
The support degree is the ratio of the total number of big data knowledge matched and matched with the hypothesis attribution results in the big data knowledge graph to the total number of big data knowledge in the big data knowledge graph;
determining policy establishment basis search rules based on hypothesis attribution results corresponding to the maximum support;
Searching for strategy establishment basis in the big data knowledge graph based on strategy establishment basis searching rule;
and (5) formulating an attribution strategy based on the strategy formulation basis.
The analysis values corresponding to different first feature description vectors are arranged in the condition analysis library, the analysis values represent the complexity of attribution of detection of multi-mode data reaction, the greater the analysis value is, the greater the complexity of attribution is, and a technician can preset the analysis values corresponding to the different first feature description vectors to establish the condition analysis library, for example, the analysis values which are more in data types and more in data of the same type in the detection of multi-mode data and are constructed into the first feature description vectors are provided, the greater the complexity of attribution is represented, and the greater the analysis value is set for the corresponding first feature description vectors; the analysis threshold may be, for example, 8, when the analysis value is less than or equal to the analysis threshold, representing that the degree of complexity of attribution is small, determining attribution strategies corresponding to first feature description vectors directly based on attribution strategies corresponding to different first feature description vectors in an attribution strategy library, a technician may set in advance, the first feature description vectors reflecting the current situation of attribution need, attribution strategies indicating how attribution is performed for the situation, when the analysis value is greater than the analysis threshold, representing that the degree of complexity of attribution is large, determining crawling strategies corresponding to the first feature description vectors from a crawling strategy library, the crawling strategies being strategies for crawling big data knowledge available for determining attribution strategies, crawling strategies corresponding to different first feature description vectors in the crawling strategy library, the technician may set in advance, the first feature description vectors reflecting the current situation of attribution need, the crawling strategy knowledge needs to collect knowledge for the situation, constructing a big data map based on the big data knowledge, an attribution policy is determined.
The method comprises the steps of setting a plurality of attribution processes for obtaining attribution conclusions on a plurality of sub-nodes connected with the main node, dividing knowledge types into attribution conclusions and attribution processes, mapping the mapping nodes corresponding to different knowledge types in a node mapping table, wherein the mapping nodes are the main node and the sub-nodes, and taking the initial map with all the mapping nodes needing to be provided with big data knowledge set with corresponding big data knowledge as a big data knowledge map.
The attribution result is assumed to be divided into three types, namely 1, size detection; the method comprises the steps of 2, product production, 3, combining size detection and product production, determining the support degree corresponding to a plurality of hypothesis attribution results from a big data knowledge graph, wherein the support degree is the ratio of the total number of big data knowledge matched with the hypothesis attribution results in the big data knowledge graph to the total number of big data knowledge of the big data knowledge graph, the total number of big data knowledge of the big data knowledge graph only counts the number of main nodes set with attribution conclusions in the big data knowledge graph, the big data knowledge matched with the hypothesis attribution results is the attribution conclusions matched with the hypothesis attribution results, determining the strategy formulation according to search rules based on the hypothesis attribution results corresponding to the maximum support degree, searching the same attribution process on the sub-nodes connected with the main nodes matched with the hypothesis attribution results corresponding to the maximum support degree according to the search rules, and determining the attribution strategies based on the same attribution processes.
According to the embodiment of the invention, the situation analysis library is introduced, the analysis value is determined, the attribution complexity is rapidly determined, when the complexity is smaller, the attribution strategy is directly determined based on the local attribution strategy library, when the complexity is larger, the big data knowledge graph is constructed, and the attribution strategy is comprehensively, comprehensively and accurately determined, so that the applicability of the system is greatly improved. When the big data knowledge graph is constructed, an initial graph is introduced, mapping nodes are determined based on the knowledge type of the big data knowledge, and the big data knowledge is mapped in the initial graph, so that the construction efficiency of the big data knowledge graph is improved. When the attribution strategy is determined by using the big data knowledge graph, the support degree is introduced, the attribution strategy establishment basis is reversely searched based on the assumption attribution result corresponding to the maximum support degree, and the attribution strategy is determined based on the strategy establishment basis, so that the accuracy and the determination efficiency of attribution strategy determination are greatly improved.
In one embodiment, the crawling big data knowledge based on the crawling policy includes:
analyzing access scenes, content search rules and content extraction rules of the crawling strategy;
Generating a preparation factor according to the content searching rule and the content extracting rule based on the factor generating template;
pre-accessing the access scene, and acquiring preparation content from the access scene based on a preparation factor during pre-accessing;
performing feature processing on the prepared content based on a second feature processing template to obtain a second feature description vector;
determining a permission value corresponding to the second feature description vector and additional content from a permission analysis library;
when the permission value is greater than or equal to the permission threshold value, accessing the access scene, and searching first target content from the access scene based on the content searching rule during access;
when the additional content is empty, extracting big data knowledge from the first target content based on the content extraction rule;
When the additional content comprises at least one group of one-to-one association relation and content conditions, searching second target content with any association relation with the first target content from the access scene, and determining whether the second target content accords with the content conditions corresponding to any association relation;
When met, big data knowledge is extracted from the first target content based on the content extraction rules.
The access scene is a scene which needs to be accessed when executing a crawling strategy, for example, a CCD camera researches and shares a forum, a flange production technology communication group and the like, a content search rule is a rule for searching for content which is attributed to valuable large data knowledge to be extracted, a content extraction rule is a rule for extracting large data knowledge from searched content, before formally accessing the access scene, the access scene can be pre-accessed, the pre-access is based on the preparation of the access scene, the pre-access refers to the access scene which occupies fewer access resources, the preparation factor is formed by characteristic ordering of the content search rule and the content extraction rule, when acquiring the preparation content, the content which is related to the preparation factor in the access scene is taken as the preparation content, a second characteristic description vector which is constructed by utilizing a first characteristic processing template is identical to the condition that the access scene contains large data knowledge which is required to be crawled by the crawling strategy, the second characteristic description vector has different permission values and additional content which correspond to the large data which are required to be crawled by the crawling strategy, the second characteristic description vector corresponds to the large data which is required to be crawled in the access scene, the first characteristic description vector has a permission value which is corresponding to the large data which is required to be crawled by the crawling strategy, the first characteristic description vector has a first association relation which is at least one-to be associated with the large data which is required to be extracted by the target in a set of at least one-to be associated condition, for example, the first target content is the process of the flange production technology communication group in which the publisher A communicates the generation cause of the flange production abnormality, the second target content with the association relationship is the number of the historical published contents of the publisher A, the integrity of the personal authentication information and the like, and the content conditions to be met are that the number of the historical published contents of the publisher A is more than or equal to 20 and the integrity of the personal authentication information is more than or equal to 85%, so that the process of the flange production technology communication group in which the publisher A communicates the generation cause of the flange production abnormality can be illustrated to have higher credibility, and the large data knowledge can be extracted.
According to the embodiment of the invention, based on the crawling strategy, large data knowledge is crawled, firstly, the access scene is pre-accessed, the preparation factors are introduced to obtain the divided preparation content, the permission value and the additional content are determined based on the permission analysis library, the subsequent front view access and the large data knowledge extraction are performed based on the permission value and the additional content, the accuracy of crawling the large data knowledge is improved, the knowledge quality of the crawled large data knowledge is ensured, the accuracy of attributing strategy determination after the large data knowledge is used for constructing a large data knowledge map is indirectly improved, in addition, the unnecessary occupation of access resources of a system can be greatly reduced by the pre-access, and the applicability of the system is improved.
The embodiment of the invention provides a flange plate size measurement system based on sub-pixel precision of machine vision, as shown in fig. 8, comprising:
The camera calibration module 1 is used for calibrating the size of the CCD camera;
the image acquisition module 2 is used for acquiring a flange image of the flange to be measured through a CCD camera with calibrated size;
the preprocessing module 3 is used for preprocessing the flange plate image;
The edge detection module 4 is used for carrying out edge detection on the preprocessed flange image to obtain sub-pixel level coordinates of the flange edge to be measured;
And the size determining module 5 is used for determining the size of the flange to be measured according to the sub-pixel level coordinates of the edge of the flange to be measured.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present invention without departing from the spirit or scope of the invention. Thus, it is intended that the present invention also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.