CN118134907A - Control method and device for drill point type and electronic equipment - Google Patents

Control method and device for drill point type and electronic equipment Download PDF

Info

Publication number
CN118134907A
CN118134907A CN202410525520.8A CN202410525520A CN118134907A CN 118134907 A CN118134907 A CN 118134907A CN 202410525520 A CN202410525520 A CN 202410525520A CN 118134907 A CN118134907 A CN 118134907A
Authority
CN
China
Prior art keywords
image
drill point
variance
convolution
drill
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.)
Granted
Application number
CN202410525520.8A
Other languages
Chinese (zh)
Other versions
CN118134907B (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.)
Jinzhou Jinggong Technology Kunshan Co ltd
Original Assignee
Jinzhou Jinggong Technology Kunshan 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 Jinzhou Jinggong Technology Kunshan Co ltd filed Critical Jinzhou Jinggong Technology Kunshan Co ltd
Priority to CN202410525520.8A priority Critical patent/CN118134907B/en
Priority claimed from CN202410525520.8A external-priority patent/CN118134907B/en
Publication of CN118134907A publication Critical patent/CN118134907A/en
Application granted granted Critical
Publication of CN118134907B publication Critical patent/CN118134907B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Analysis (AREA)

Abstract

The embodiment of the application provides a control method and device for a drill point type and electronic equipment. Acquiring a first image of the drill point; the first image is subjected to convolution according to the Laplace convolution check to determine the variance of the convolution sequence, and if the variance of the convolution sequence is larger than the preset variance, the position of the drill needle is calibrated and the contour moment of the head-shaped outer contour of the drill needle is obtained; the method for analyzing the drill point type defect is determined based on the contour moment of the head type outer contour of the drill point and the corresponding ROI region extraction template, at the moment, convolution processing is carried out on the first image of the drill point, position calibration and contour moment calculation of the drill point type outer contour are triggered by utilizing comparison of variance of a convolution sequence and preset variance, further, the method for analyzing the drill point type defect is determined based on the contour moment of the head type outer contour of the drill point and the corresponding ROI region extraction template, use accuracy of the drill point type defect analysis method is guaranteed, and further identification of the drill point type defect is guaranteed.

Description

Control method and device for drill point type and electronic equipment
Technical Field
The application relates to the technical field of control of drill point type, in particular to a control method and device of drill point type and electronic equipment.
Background
In the intelligent driving field, the drill point is applied to the industrial field and is a part of the industrial field, at this time, the drill point is used as one of equipment, the appearance of the drill point is slender and is not easy to observe by naked eyes, therefore, graphic analysis is performed on the drill point, and region division is performed on an image of the drill point, so that further analysis is performed, but the existing analysis of the drill point has great difficulty in identifying defects.
Disclosure of Invention
The embodiment of the application provides a control method, a control device and electronic equipment for a drill bit type, which are used for carrying out convolution processing on a first image of a drill bit, triggering position calibration and contour moment calculation of an outer contour of the drill bit type by utilizing comparison of variance of a convolution sequence and preset variance, further determining a defect analysis method for the drill bit type based on the contour moment of the outer contour of the drill bit type and a corresponding ROI (region of interest) extraction template, and ensuring the use accuracy of the defect analysis method for the drill bit type, thereby ensuring the defect identification of the drill bit type.
Other features and advantages of the application will be apparent from the following detailed description, or may be learned by the practice of the application.
According to an aspect of the embodiment of the present application, there is provided a control method of a drill bit type, including:
Acquiring a first image of the drill point;
Convolving the first image according to the Laplace convolution kernel to determine a variance of the convolved sequence;
If the variance of the convolution sequence is larger than the preset variance, calibrating the position of the drill point and acquiring the contour moment of the head-shaped outer contour of the drill point;
And determining a defect analysis method of the drill point type based on the contour moment of the head type outer contour of the drill point and the corresponding ROI region extraction template.
Optionally, the acquiring a first image of the drill point includes;
Obtaining the model of the drill point;
Triggering corresponding detection logic based on the model of the drill point;
In corresponding detection logic, capturing a first image of the drill point based on the camera;
Marking each pixel point of the first image of the drill point;
removing the pixel points with the brightness less than 50, and calculating the brightness standard deviation and the brightness mean value of the rest pixel points;
The light source position is adjusted based on the standard deviation of the brightness, and the light source brightness is adjusted based on the mean value.
Optionally, the removing the pixel with brightness <50, calculating the standard deviation and the average brightness of the rest pixel, includes:
calculation formula of brightness standard deviation:
Where Width refers to the image Width, height refers to the image Height, Referring to the calculated pixel mean value, img ij refers to the gray value at row i and column j in the image matrix;
The calculation formula of the brightness average value:
where Img refers to the image gray matrix, width refers to the image Width, and Height refers to the image Height.
Optionally, the convolving the first image according to the laplace convolution kernel to determine a variance of the convolved sequence includes:
convolving the first image according to the Laplace convolution kernel;
calculating a second derivative of the gray value of the image, calculating the variance of the convolution sequence, and taking the variance of the convolution sequence as a measure of definition;
And selecting different stepping gear moving camera positions according to the comparison of the variance of the convolution sequence and the set difference value until the variance of the convolution sequence meets the set difference value.
Optionally, the convolving the first image according to the laplace convolution kernel to determine a variance of the convolved sequence further includes:
Laplace convolution kernel:
convolution formula:
wherein ImgG (x, y) refers to the gray value of the image matrix after the convolution of the pixel points in x rows and y columns; img (x+i, y+j) refers to the gray value of the original pixel point of the image matrix in x+i rows and y+j columns; kel (i, j) refers to the value of the convolution kernel in x rows and y columns.
Optionally, the convolving the first image according to the laplace convolution kernel to determine a variance of the convolved sequence further includes:
The sharpness calculation formula of the first image:
Wherein Width refers to the image Width and Height refers to the image Height; imgG (i, j) refers to the gray value of the image matrix after convolution of the pixel points in the i rows and j columns; refers to the gray average of the convolved image matrix.
Optionally, if the variance of the convolution sequence is greater than the preset variance, calibrating the drill point position and obtaining the contour moment of the head-type outer contour of the drill point includes:
If the variance of the convolution sequence is larger than the preset variance, triggering the placement of the drill point;
Positioning a rough position based on the placement position of the drill point, and adjusting the circumscribed rectangle of the outer contour by multiple rotations of a designated corner in the placement position to ensure that the aspect ratio of the circumscribed rectangle meets the requirement to obtain the rough position;
In the rough position, intercepting an upper left area, calculating average brightness, and if the average brightness is larger than preset brightness, turning left and right of the first image to obtain a rough position image with a final rotation angle of 0-45 degrees;
Capturing straight lines on the right half side image by using a Hofsta tool, deleting the overlapped straight lines, and then taking the straight lines with the first five intensities for screening, wherein at the moment, the center line of the drill point is the center line of the drill point meeting the constraint condition in the set: the distance between the origin of the circumscribed circle and the straight line is smaller than a threshold value, and the maximum value of the distance between the intersection of the circumscribed circle and the top of the image, the position of the drill point is calibrated according to the central line, so that the central line is horizontal; and after the drill point is in place, extracting an image to obtain the contour moment of the head-shaped outer contour of the drill point.
Optionally, the method for determining the defect analysis of the drill point type based on the contour moment of the outer contour of the drill point type and the corresponding ROI region extraction template comprises the following steps of;
Calculating a contour moment based on the head-shaped outer contour of the drill point;
Matching the outline moment with the inner template of the outline moment of the drill point, taking a template with a first difference value smaller than a preset value as a matching result, and extracting a corresponding ROI template according to the index of the template;
extracting a corresponding region from the original image by using the ROI template, carrying out Hough transformation to extract a straight line, and taking the strongest straight line as a return value;
Calculating a back bright surface characteristic point according to the extracted straight line, and constructing a real ROI region extraction template again by utilizing the characteristic point;
interpolation is carried out on the ROI image to obtain a sub-pixel image, edge points are obtained after the edge of the sub-pixel image is captured, and a target straight line can be obtained after straight line fitting;
Based on the intersection point between the straight lines after fitting, each defect value can be obtained by the intersection point between the straight lines and the circumscribed circle, so as to determine the defect analysis method of the drill point type.
According to an aspect of an embodiment of the present application, there is provided a control device of a drill bit type, including:
The acquisition module is used for acquiring a first image of the drill point;
the screening module is used for carrying out convolution on the first image according to the Laplace convolution check so as to determine the variance of the convolution sequence;
The outer contour module is used for calibrating the position of the drill point and acquiring the contour moment of the head-type outer contour of the drill point if the variance of the convolution sequence is larger than the preset variance;
And the defect module is used for determining a drill point type defect analysis method based on the contour moment of the head type outer contour of the drill point and the corresponding ROI region extraction template.
According to an aspect of an embodiment of the present application, there is provided an electronic apparatus including: one or more processors; and the storage device is used for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors are enabled to realize the drill point type control method.
In some embodiments of the present application, a first image of a drill point is acquired; convolving the first image according to the Laplace convolution kernel to determine a variance of the convolved sequence; if the variance of the convolution sequence is larger than the preset variance, calibrating the position of the drill point and acquiring the contour moment of the head-shaped outer contour of the drill point; the method for analyzing the drill point type defect is determined based on the contour moment of the head type outer contour of the drill point and the corresponding ROI region extraction template, at the moment, convolution processing is carried out on the first image of the drill point, position calibration and contour moment calculation of the drill point type outer contour are triggered by utilizing comparison of variance of a convolution sequence and preset variance, further, the method for analyzing the drill point type defect is determined based on the contour moment of the head type outer contour of the drill point and the corresponding ROI region extraction template, use accuracy of the drill point type defect analysis method is guaranteed, and further identification of the drill point type defect is guaranteed.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application as claimed.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application. It is evident that the drawings in the following description are only some embodiments of the present application and that other drawings may be obtained from these drawings without inventive effort for a person of ordinary skill in the art. In the drawings:
FIG. 1 shows a flow chart of a control method of the drill tip type according to one embodiment of the application;
FIG. 2 shows a flow chart of S110 in FIG. 1;
FIG. 3 shows a flow chart of S130 in FIG. 1;
fig. 4 shows a flowchart of S140 in fig. 1;
FIGS. 5-9 illustrate drill point morphology diagrams of a drill point type control method according to one embodiment of the present application;
FIG. 10 shows a block diagram of a control device of the drill tip type according to one embodiment of the application;
Fig. 11 shows a schematic diagram of a computer system suitable for use in implementing an embodiment of the application.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. However, the exemplary embodiments may be embodied in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the application. One skilled in the relevant art will recognize, however, that the application may be practiced without one or more of the specific details, or with other methods, components, devices, steps, etc. In other instances, well-known methods, devices, implementations, or operations are not shown or described in detail to avoid obscuring aspects of the application.
The block diagrams depicted in the figures are merely functional entities and do not necessarily correspond to physically separate entities. That is, the functional entities may be implemented in software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
The flow diagrams depicted in the figures are exemplary only, and do not necessarily include all of the elements and operations/steps, nor must they be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the order of actual execution may be changed according to actual situations.
Fig. 1 shows a flowchart of a control method of a drill bit type according to an embodiment of the present application, and referring to fig. 1 to 11, the control method of a drill bit type at least includes steps S110 to S140, which will be described in detail as follows:
Step S110: acquiring a first image of the drill point;
Step S120: convolving the first image according to the Laplace convolution kernel to determine a variance of the convolved sequence;
Step S130: if the variance of the convolution sequence is larger than the preset variance, calibrating the position of the drill point and acquiring the contour moment of the head-shaped outer contour of the drill point;
Step S140: and determining a defect analysis method of the drill point type based on the contour moment of the head type outer contour of the drill point and the corresponding ROI region extraction template.
In some embodiments of the present application, a first image of a drill point is acquired; convolving the first image according to the Laplace convolution kernel to determine a variance of the convolved sequence; if the variance of the convolution sequence is larger than the preset variance, calibrating the position of the drill point and acquiring the contour moment of the head-shaped outer contour of the drill point; the method for analyzing the drill point type defect is determined based on the contour moment of the head type outer contour of the drill point and the corresponding ROI region extraction template, at the moment, convolution processing is carried out on the first image of the drill point, position calibration and contour moment calculation of the drill point type outer contour are triggered by utilizing comparison of variance of a convolution sequence and preset variance, further, the method for analyzing the drill point type defect is determined based on the contour moment of the head type outer contour of the drill point and the corresponding ROI region extraction template, use accuracy of the drill point type defect analysis method is guaranteed, and further identification of the drill point type defect is guaranteed.
In step S110, a first image of the drill point is acquired.
In one implementation of this embodiment, the method includes the steps of:
Step S111: obtaining the model of the drill point;
step S112: triggering corresponding detection logic based on the model of the drill point;
step S113: in corresponding detection logic, capturing a first image of the drill point based on the camera;
Step S114: marking each pixel point of the first image of the drill point;
Step S115: removing the pixel points with the brightness less than 50, and calculating the brightness standard deviation and the brightness mean value of the rest pixel points;
Step S116: the light source position is adjusted based on the standard deviation of the brightness, and the light source brightness is adjusted based on the mean value.
In one implementation of this embodiment, the corresponding detection logic is triggered based on the model of the drill point so as to adapt to detection of the model of different drill points, and meanwhile, in the corresponding detection logic, the first image of the drill point is shot based on the camera so as to facilitate further processing of the first image of the drill point.
At this time, each pixel point is marked for the first image so as to be convenient for screening for each pixel point, therefore, the pixel point with the brightness less than 50 is removed, and the brightness standard deviation and the brightness average value of the rest pixel points are calculated; further, the light source position is adjusted based on the standard deviation of the brightness, and the light source brightness is adjusted based on the mean value, so that the corresponding control of the standard deviation of the brightness and the mean value is realized, the adjustment of the light source position and the light source brightness is further realized, and the corresponding treatment under different environments is ensured.
Calculation formula of brightness standard deviation:
Where Width refers to the image Width, height refers to the image Height, Referring to the calculated pixel mean value, img ij refers to the gray value at row i, column j in the image matrix.
The calculation formula of the brightness average value:
wherein Img refers to an image gray matrix, width refers to an image Width, height refers to an image Height, and matrix element accumulation and summation operation is realized through matrix multiplication.
In step S120, the first image is convolved according to the laplace convolution kernel to determine the variance of the convolution sequence.
In one implementation of the present embodiment, the first image is convolved according to a Laplace convolution kernel; calculating a second derivative of the gray value of the image, calculating the variance of the convolution sequence, and taking the variance of the convolution sequence as a measure of definition; and selecting different stepping gear moving camera positions according to the comparison of the variance of the convolution sequence and the set difference value until the variance of the convolution sequence meets the set difference value.
At this time, the first image is further processed, and convolution is performed on the first image according to the Laplace convolution check; calculating a second derivative of the gray value of the image, and calculating the variance of the convolution sequence so as to be convenient for taking the variance of the convolution sequence as a measure of definition, so that according to the comparison of the variance of the convolution sequence and a set difference value, different stepping shift moving camera positions are selected according to the result until the variance of the convolution sequence meets the set difference value, and therefore, the different stepping shift moving camera positions are adjusted gradually, and the first image is perfected gradually.
The convolving the first image according to the Laplace convolution kernel to determine a variance of the convolved sequence, further comprising:
Laplace convolution kernel:
convolution formula:
Wherein ImgG (x, y) refers to the gray value of the image matrix after the convolution of the pixel points in x rows and y columns; img (x+i, y+j) refers to the gray value of the original pixel point of the image matrix in x+i rows and y+j columns; kel (i, j) refers to the value of the convolution kernel in row i, column j.
The sharpness calculation formula of the first image:
Wherein Width refers to the image Width and Height refers to the image Height; imgG (i, j) refers to the gray value of the image matrix after convolution of the pixel points in the i rows and j columns; refers to the gray average of the convolved image matrix.
In step S130, if the variance of the convolution sequence is greater than the preset variance, the drill point position is calibrated and the contour moment of the head-shaped outer contour of the drill point is obtained.
In one implementation of this embodiment, the method includes the steps of:
step S131: if the variance of the convolution sequence is larger than the preset variance, triggering the placement of the drill point;
Step S132: positioning a rough position based on the placement position of the drill point, and adjusting the circumscribed rectangle of the outer contour by multiple rotations of a designated corner in the placement position to ensure that the aspect ratio of the circumscribed rectangle meets the requirement to obtain the rough position;
In the embodiment of the application, the variance of the convolution sequence is compared with the preset variance, so that the placement of the drill point is triggered when the variance of the convolution sequence is larger than the preset variance, and the placement position of the drill point is regulated and controlled, so that the rough position is positioned based on the placement position of the drill point.
Step S133: in the rough position, intercepting the left upper area, calculating average brightness, if the average brightness is larger than preset brightness, turning the first image left and right to obtain a rough position image with a final rotation angle of 0-45 degrees,
Step S134: capturing straight lines on the right half side image by using a Hofsta tool, deleting the overlapped straight lines, and then taking the straight lines with the first five intensities for screening, wherein at the moment, the center line of the drill point is the center line of the drill point meeting the constraint condition in the set: the distance between the origin of the circumscribed circle and the straight line is smaller than a threshold value, and the maximum value of the distance between the intersection point of the circumscribed circle and the top of the image is used for calibrating the position of the drill point according to the central line, so that the central line is horizontal. And after the drill needle is in place, extracting an image to obtain the contour moment of the outer contour of the drill needle.
At the moment, further processing is carried out on the rough position, an upper left area is intercepted in the rough position, average brightness is calculated, and if the average brightness is larger than preset brightness, the first image is turned left and right, so that a rough position image with a final rotation angle of 0-45 degrees is obtained; capturing straight lines on the right half side image by using a Hofsta tool, deleting the overlapped straight lines, and then taking the straight lines with the first five intensities for screening, wherein at the moment, the center line of the drill point is the center line of the drill point meeting the constraint condition in the set: the distance between the origin of the circumscribed circle and the straight line is smaller than a threshold value, and the maximum value of the distance between the intersection point of the circumscribed circle and the top of the image is used for calibrating the position of the drill point according to the central line, so that the central line is horizontal. And after the drill needle is in place, extracting an image to obtain the contour moment of the outer contour of the drill needle. Optionally, the external rectangle of the outer contour is adjusted by multiple rotations of the designated corner, so that the aspect ratio of the external rectangle meets the requirement.
In step S140, a drill tip type defect analysis method is determined based on the contour moment of the drill tip type outer contour and the corresponding ROI area extraction template.
The first image of the drill needle is subjected to convolution processing, and the outline moment of the head-shaped outer outline of the drill needle is triggered by utilizing the comparison of the variance of the convolution sequence and the preset variance, further, the drill needle head-shaped defect analysis method is determined based on the outline moment of the head-shaped outer outline of the drill needle and the corresponding ROI region extraction template, the use accuracy of the drill needle head-shaped defect analysis method is ensured, and further, the drill needle head-shaped defect identification is ensured.
In one implementation of this embodiment, the method includes the steps of:
step S141: calculating a contour moment based on the head-shaped outer contour of the drill point;
step S142: matching the outline moment with the inner template of the outline moment of the drill point, taking a template with a first difference value smaller than a preset value as a matching result, and extracting a corresponding ROI template according to the index of the template;
Step S143: extracting a corresponding region from the original image by using the ROI template, carrying out Hough transformation to extract a straight line, and taking the strongest straight line as a return value;
step S144: calculating a back bright surface characteristic point according to the extracted straight line, and constructing a real ROI region extraction template again by utilizing the characteristic point;
Step S145: interpolation is carried out on the ROI image to obtain a sub-pixel image, edge points are obtained after the edge of the sub-pixel image is captured, and a target straight line can be obtained after straight line fitting;
Step S146: based on the intersection point between the straight lines after fitting, each defect value can be obtained by the intersection point between the straight lines and the circumscribed circle, so as to determine the defect analysis method of the drill point type.
In the application, an image boundary is extracted, a contour moment is calculated, the contour moment is matched with a template in the contour moment of a drill bit, a first template with a difference smaller than a preset value is taken as a matching result, and a corresponding ROI template is extracted according to an index of the template.
Two profile moment difference value calculation formulas:
wherein H 1 refers to the Hu moment of the current image contour, which characterizes the image contour, consisting of seven elements;
H 2 denotes the Hu moment of the compared contour in the contour library, which characterizes the compared contour, consisting of seven elements;
D (H 1,H2) refers to the distance between Hu moments H 1 and H 2 to measure contour similarity;
h 1i denotes the i-th element in H 1;
h 2i denotes the ith element in H 2.
And extracting a corresponding region from the original image by using the ROI template, carrying out Hough transformation to extract a straight line, and taking the strongest straight line as a return value.
The re-determination of the ROI region extraction template and the sub-pixel image acquisition may not fully utilize the image information because the template setting ROI region extraction template area is relatively conservative. And calculating a back bright surface characteristic point according to the extracted straight line, and constructing a real ROI region extraction template again by utilizing the characteristic point.
Interpolation is carried out on the ROI image to obtain a sub-pixel image, edge points are obtained after the edge of the sub-pixel image is captured, and a target straight line can be obtained after straight line fitting.
Bilinear interpolation interpolates in two directions, an interpolation method for estimating a value of a certain position in a two-dimensional grid.
Assume that the value of a certain position (x, y) needs to be estimated, and the gray values of four adjacent points (x 1,y1),(x2,y1),(x1,y2),(x2,y2) are respectively Q11, Q21, Q12 and Q22.
Firstly, performing linear interpolation in the horizontal direction to obtain a result R 1,R2; and then linearly interpolating the obtained R 1 and R 2 in the vertical direction to obtain the gray value P of the target position.
The difference formula:
Wherein R 1 is the horizontal interpolation result of the pointing (x 1,y1) and point (x 2,y1);
R 2 points (x 1,y2) and points (x 2,y2) horizontal interpolation results;
P refers to the result of the secondary interpolation;
the point (x, y) refers to a pixel point in the image that is at a distance y from the top and x from the left.
The coordinates of adjacent points take integer boundaries of coordinates of target points, for example: the four neighbors of the target point (1.5 ) are (1, 1), (1, 2), (2, 1), (2, 2).
Q11 refers to the gray value of the image at point (x 1,y1).
Q12 refers to the gray value of the image at point (x 1,y2).
Q21 refers to the gray value of the image at point (x 2,y1).
Q22 refers to the gray value of the image at point (x 2,y2).
The rotation angle of the drill point is adjusted when the first back bright surface is calibrated, and the second back bright surface is in a horizontal state; 1. the measuring position of the two rear bright faces only has the difference of the front position and the rear position, so that the ROI area extraction template used for extracting the characteristic straight line of the one rear bright face can be directly used.
In addition, a method for capturing the feature points of the bright face behind the double-edged drill point II will be described below. Firstly, binarizing the whole image, cutting out the image of the finished drill point by 1.25 times of the minimum circumscribed rectangle, and obtaining an upper image and a lower image by taking the central line as a segmentation. Taking a certain position column vector out for example, calculating an inner product with a row vector of all 1, obtaining the brightness pixel width of the column by the inner product value/255, sampling with a set step length, and calculating the brightness width of each pixel column. The column with the maximum width is the approximate column of the feature points; the minimum value of the Y coordinate in the column is the approximate row. And taking the approximate point as the center, taking the step length twice as the side length, and extracting the local area. And obtaining sub-pixel information by using a quadratic linear difference value for the local area. And obtaining final characteristic points by using a sampling method with the step length of 1. The lower image concept is similar. The included angle between the straight line segment formed by the upper and lower characteristic points and the central line is the back angle of the ditch.
The method for capturing the characteristic points of the bright surface behind the single-edge drilling needle II is introduced, the lower image is processed similarly to the image, the upper image is divided by taking the cutting edge as a reference, the rest parts are similar, and after the upper characteristic point and the lower characteristic point are found, the included angle between the connecting line and the central line is the facing angle.
Bilinear interpolation is a method of interpolation on a rectangular grid, commonly used for image processing. Firstly, linear interpolation is used in the x direction to obtain two intermediate values, then linear interpolation is used again in the y direction, and finally interpolation of a target point is obtained.
Assuming that four neighboring points (x 1,y1),(x2,y2),(x3,y3),(x4,y4) are targeted (x, y), the difference result can be obtained by the following formula.
Where u, v refers to the coefficient of the difference of the two levels.
IMGTARGET (x, y) refers to the result of quadratic interpolation at the target point (x, y), which is the gray value at the target image point (x, y), and the gray value at the coordinate point corresponding to the difference image can be obtained by scaling up the coordinates.
Examples: IMGTARGET (1.5 ) refers to the result of quadratic interpolation at the target point (1.5 ), which is the gray value at the target image point (1.5 ), and by multiplying the coordinates by one, this coordinate value corresponds to the difference image coordinate value (3, 3), the gray value of the difference image at the coordinate point (3, 3) is IMGTARGET (1.5 ).
The point (x, y) refers to a pixel point in the image that is at a distance y from the top and x from the left.
The coordinates of adjacent points take integer boundaries of coordinates of target points, for example: the four neighbors of the target point (1.5 ) are (1, 1), (1, 2), (2, 1), (2, 2).
Img (x 1,y1) refers to the gray value of the image at point (x 1,y1).
Img (x 1,y2) refers to the gray value of the image at point (x 1,y2).
Img (x 2,y1) refers to the gray value of the image at point (x 2,y1).
Img (x 2,y2) refers to the gray value of the image at point (x 2,y2).
The two back bright face images and the one back bright face image are shot successively, wherein detail difference is unavoidable, but the original image of the one back bright face is analyzed to have redundant parts on the partial image, so that the partial region for extracting the one back bright face can be directly used for the two back bright faces.
And (3) marking a rear bright face coordinate system as a chord 1, performing secondary straight line fitting on the two rear bright face images by referring to an analysis mode of the rear bright face, and marking the image coordinate system as a chord 2. And obtaining a final straight line by taking the average value through fitting differences of the same straight line on different images, wherein the coordinate system is named as chord 3. After the characteristic straight lines are calculated, the complete description of the image can be completed, the intersection points between the straight lines are calculated, and the intersection points between the straight lines and the circumscribed circles can obtain the defect values.
Calculating specific values of each target defect according to the characteristic lines and the characteristic points, for example, the following steps:
The defect of the first relief surface specifically refers to:
① Size head: included angles between the cutting edges on the same side and the central line are formed;
② Separation: the feature point distance at two opposite angles;
③ Long and short sides: the cutting edge length difference of the double-edge drill point;
④ Size facets: the first relief surface of the double-edged drill bit has a difference in width;
⑤ Rounded corners: the distance between the first rear bright surface edge characteristic point and the intersection point of the cutting edge and the circumscribing circle;
And extracting the residual part characteristic points based on the second rear face image to determine the defect about the second rear face in the drill bit type.
Optionally, the defect of the second relief surface specifically refers to:
① Groove back angle: and an included angle between the connecting line of the characteristic points of the bright surface behind the double-edge drill point II and the central line.
② Angle of orientation: and an included angle between the connecting line of the characteristic points of the bright surface of the second single-edge drill point and the central line.
Assume that the straight line 1 expression is:
Assume that the straight line 2 expression is:
The included angle of the two straight lines is as follows:
the coordinates of the assumed points are respectively (x 1,y1),(x2,y2)
Distance between two points
In some embodiments of the present application, a first image of a drill point is acquired; convolving the first image according to the Laplace convolution kernel to determine a variance of the convolved sequence; if the variance of the convolution sequence is larger than the preset variance, calibrating the position of the drill point and acquiring the contour moment of the head-shaped outer contour of the drill point; the method comprises the steps of determining a drill point type defect analysis method based on the contour moment of the head type outer contour of the drill point and the corresponding ROI region extraction template, performing convolution processing on a first image of the drill point, triggering position calibration and calculation of the contour moment of the head type outer contour of the drill point by utilizing comparison of the variance of a convolution sequence and a preset variance, further determining the drill point type defect analysis method based on the contour moment of the head type outer contour of the drill point and the corresponding ROI region extraction template, and guaranteeing use accuracy of the drill point type defect analysis method, so that drill point type defect identification is guaranteed.
The following describes an embodiment of the device according to the application, which can be used to carry out the control method of the drill head type according to the above-described embodiment of the application. For details not disclosed in the embodiments of the apparatus of the present application, please refer to the embodiments of the control method of the drill head type of the present application.
Referring to fig. 10, a control device 200 of a drill bit type according to an embodiment of the present application includes:
An acquisition module 210, configured to acquire a first image of the drill point;
A screening module 220, configured to convolve the first image according to the laplace convolution kernel to determine a variance of the convolution sequence;
The outer contour module 230 is configured to calibrate the drill point position and obtain a contour moment of a head-type outer contour of the drill point if the variance of the convolution sequence is greater than a preset variance;
a defect module 240 for determining a defect analysis method of the drill point type based on the contour moment of the head type outer contour of the drill point and the corresponding ROI area extraction template.
Fig. 11 shows a schematic diagram of a computer system suitable for use in implementing an embodiment of the application.
It should be noted that, the computer system 300 of the electronic device shown in fig. 11 is only an example, and should not impose any limitation on the functions and the application scope of the embodiments of the present application.
As shown in fig. 11, the computer system 300 includes a central processing unit (Central Processing Unit, CPU) 301 that can perform various appropriate actions and processes, such as performing the methods described in the above embodiments, according to a program stored in a Read-Only Memory (ROM) 302 or a program loaded from a storage section 308 into a random access Memory (Random Access Memory, RAM) 303. In the RAM 303, various programs and data required for the system operation are also stored. The CPU 301, ROM 302, and RAM 303 are connected to each other through a bus 304. An Input/Output (I/O) interface 305 is also connected to bus 304.
The following components are connected to the I/O interface 305: an input section 306 including a keyboard, a mouse, and the like; an output portion 307 including a Cathode Ray Tube (CRT), a Liquid crystal display (Liquid CRYSTAL DISPLAY, LCD), and a speaker, etc.; a storage section 308 including a hard disk or the like; and a communication section 309 including a network interface card such as a LAN (Local Area Network ) card, a modem, or the like. The communication section 309 performs communication processing via a network such as the internet. The drive 310 is also connected to the I/O interface 305 as needed. A removable medium 311 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is installed on the drive 310 as needed, so that a computer program read therefrom is installed into the storage section 308 as needed.
In particular, according to embodiments of the present application, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising a computer program for performing the method shown in the flowchart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 309, and/or installed from the removable medium 311. When executed by a Central Processing Unit (CPU) 301, performs the various functions defined in the system of the present application.
It should be noted that, the computer readable medium shown in the embodiments of the present application may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-Only Memory (ROM), an erasable programmable read-Only Memory (Erasable Programmable Read Only Memory, EPROM), a flash Memory, an optical fiber, a portable compact disc read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present application, however, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with a computer-readable computer program embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. A computer program embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. Where each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present application may be implemented by software, or may be implemented by hardware, and the described units may also be provided in a processor. Wherein the names of the units do not constitute a limitation of the units themselves in some cases.
As another aspect, the present application also provides a computer-readable medium that may be contained in the electronic device described in the above embodiment; or may exist alone without being incorporated into the electronic device. The computer-readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to implement the methods described in the above embodiments.
It should be noted that although in the above detailed description several modules or units of a device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functions of two or more modules or units described above may be embodied in one module or unit in accordance with embodiments of the application. Conversely, the features and functions of one module or unit described above may be further divided into a plurality of modules or units to be embodied.
From the above description of embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or may be implemented in software in combination with the necessary hardware. Thus, the technical solution according to the embodiments of the present application may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.) or on a network, and includes several instructions to cause a computing device (may be a personal computer, a server, a touch terminal, or a network device, etc.) to perform the method according to the embodiments of the present application.
Other embodiments of the application will be apparent to those skilled in the art from consideration of the specification and practice of the embodiments disclosed herein. This application is intended to cover any variations, uses, or adaptations of the application following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the application pertains.
It is to be understood that the application is not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (10)

1. A method of controlling a drill tip, comprising:
Acquiring a first image of the drill point;
Convolving the first image according to the Laplace convolution kernel to determine a variance of the convolved sequence;
If the variance of the convolution sequence is larger than the preset variance, calibrating the position of the drill point and acquiring the contour moment of the head-shaped outer contour of the drill point;
And determining a defect analysis method of the drill point type based on the contour moment of the head type outer contour of the drill point and the corresponding ROI region extraction template.
2. The method of claim 1, wherein the acquiring the first image of the drill point comprises;
Obtaining the model of the drill point;
Triggering corresponding detection logic based on the model of the drill point;
In corresponding detection logic, capturing a first image of the drill point based on the camera;
Marking each pixel point of the first image of the drill point;
removing the pixel points with the brightness less than 50, and calculating the brightness standard deviation and the brightness mean value of the rest pixel points;
The light source position is adjusted based on the standard deviation of the brightness, and the light source brightness is adjusted based on the mean value.
3. The method according to claim 2, wherein the removing the pixel with brightness <50 and calculating the standard deviation and the average brightness of the rest of the pixels comprises:
calculation formula of brightness standard deviation:
Where Width refers to the image Width, height refers to the image Height, Referring to the calculated pixel mean value, img ij refers to the gray value at row i and column j in the image matrix;
The calculation formula of the brightness average value:
where Img refers to the image gray matrix, width refers to the image Width, and Height refers to the image Height.
4. The method of claim 1, wherein convolving the first image according to a laplace convolution kernel to determine a variance of the convolved sequence comprises:
convolving the first image according to the Laplace convolution kernel;
calculating a second derivative of the gray value of the image, calculating the variance of the convolution sequence, and taking the variance of the convolution sequence as a measure of definition;
And selecting different stepping gear moving camera positions according to the comparison of the variance of the convolution sequence and the set difference value until the variance of the convolution sequence meets the set difference value.
5. The method of claim 4, wherein the convolving the first image according to a laplace convolution kernel to determine a variance of the convolved sequence, further comprising:
Laplace convolution kernel:
convolution formula:
wherein ImgG (x, y) refers to the gray value of the image matrix after the convolution of the pixel points in x rows and y columns; img (x+i, y+j) refers to the gray value of the original pixel point of the image matrix in x+i rows and y+j columns; kel (i, j) refers to the value of the convolution kernel in x rows and y columns.
6. The method of claim 5, wherein the convolving the first image according to a laplace convolution kernel to determine a variance of the convolved sequence, further comprising:
The sharpness calculation formula of the first image:
Wherein Width refers to the image Width and Height refers to the image Height; imgG (i, j) refers to the gray value of the image matrix after convolution of the pixel points in the i rows and j columns; refers to the gray average of the convolved image matrix.
7. The method according to claim 6, wherein calibrating the drill point position and obtaining the contour moment of the drill point head type outer contour if the variance of the convolution sequence is greater than a preset variance comprises:
If the variance of the convolution sequence is larger than the preset variance, triggering the placement of the drill point;
Positioning a rough position based on the placement position of the drill point, and adjusting the circumscribed rectangle of the outer contour by multiple rotations of a designated corner in the placement position to ensure that the aspect ratio of the circumscribed rectangle meets the requirement to obtain the rough position;
In the rough position, intercepting an upper left area, calculating average brightness, and if the average brightness is larger than preset brightness, turning left and right of the first image to obtain a rough position image with a final rotation angle of 0-45 degrees;
Capturing straight lines on the right half side image by using a Hofsta tool, deleting the overlapped straight lines, and then taking the straight lines with the first five intensities for screening, wherein at the moment, the center line of the drill point is the center line of the drill point meeting the constraint condition in the set: the distance between the origin of the circumscribed circle and the straight line is smaller than a threshold value, and the maximum value of the distance between the intersection of the circumscribed circle and the top of the image, the position of the drill point is calibrated according to the central line, so that the central line is horizontal; and after the drill point is in place, extracting an image to obtain the contour moment of the head-shaped outer contour of the drill point.
8. The method according to claim 1, wherein the method for determining a defect analysis of a drill tip type based on a contour moment of a drill tip type outer contour and a corresponding ROI area extraction template comprises;
Calculating a contour moment based on the head-shaped outer contour of the drill point;
Matching the outline moment with the inner template of the outline moment of the drill point, taking a template with a first difference value smaller than a preset value as a matching result, and extracting a corresponding ROI template according to the index of the template;
extracting a corresponding region from the original image by using the ROI template, carrying out Hough transformation to extract a straight line, and taking the strongest straight line as a return value;
Calculating a back bright surface characteristic point according to the extracted straight line, and constructing a real ROI region extraction template again by utilizing the characteristic point;
interpolation is carried out on the ROI image to obtain a sub-pixel image, edge points are obtained after the edge of the sub-pixel image is captured, and a target straight line can be obtained after straight line fitting;
Based on the intersection point between the straight lines after fitting, each defect value can be obtained by the intersection point between the straight lines and the circumscribed circle, so as to determine the defect analysis method of the drill point type.
9. A drill point type control device, comprising:
The acquisition module is used for acquiring a first image of the drill point;
the screening module is used for carrying out convolution on the first image according to the Laplace convolution check so as to determine the variance of the convolution sequence;
The outer contour module is used for calibrating the position of the drill point and acquiring the contour moment of the head-type outer contour of the drill point if the variance of the convolution sequence is larger than the preset variance;
And the defect module is used for determining a drill point type defect analysis method based on the contour moment of the head type outer contour of the drill point and the corresponding ROI region extraction template.
10. An electronic device, comprising:
One or more processors;
Storage means for storing one or more programs which when executed by the one or more processors cause the one or more processors to implement the drill tip type control method as claimed in any one of claims 1 to 8.
CN202410525520.8A 2024-04-29 Control method and device for drill point type and electronic equipment Active CN118134907B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410525520.8A CN118134907B (en) 2024-04-29 Control method and device for drill point type and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410525520.8A CN118134907B (en) 2024-04-29 Control method and device for drill point type and electronic equipment

Publications (2)

Publication Number Publication Date
CN118134907A true CN118134907A (en) 2024-06-04
CN118134907B CN118134907B (en) 2024-07-02

Family

ID=

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1486918A2 (en) * 2003-06-10 2004-12-15 hema electronic GmbH Method for adaptive flawdetection on an inhomogeneous surface
CN112630222A (en) * 2020-11-24 2021-04-09 河海大学常州校区 Mobile phone cover plate glass defect detection method based on machine vision
CN112837294A (en) * 2021-02-07 2021-05-25 浙江工业大学 Thermal imaging defect detection method based on convolution self-encoder image amplification
CN112862770A (en) * 2021-01-29 2021-05-28 珠海迪沃航空工程有限公司 Defect analysis and diagnosis system, method and device based on artificial intelligence
US20210174486A1 (en) * 2017-11-06 2021-06-10 Tushar CHOWHAN A machine vision and machine intelligence aided electronic and computer system for assisting on formation drilling, boring, tunneling on-line guidance, assisted decision and dull grading system for drilling tool and associated drill string components
CN113240579A (en) * 2021-04-02 2021-08-10 维库(厦门)信息技术有限公司 Intelligent industrial product defect detection method and device and computer storage medium thereof

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1486918A2 (en) * 2003-06-10 2004-12-15 hema electronic GmbH Method for adaptive flawdetection on an inhomogeneous surface
US20210174486A1 (en) * 2017-11-06 2021-06-10 Tushar CHOWHAN A machine vision and machine intelligence aided electronic and computer system for assisting on formation drilling, boring, tunneling on-line guidance, assisted decision and dull grading system for drilling tool and associated drill string components
CN112630222A (en) * 2020-11-24 2021-04-09 河海大学常州校区 Mobile phone cover plate glass defect detection method based on machine vision
CN112862770A (en) * 2021-01-29 2021-05-28 珠海迪沃航空工程有限公司 Defect analysis and diagnosis system, method and device based on artificial intelligence
CN112837294A (en) * 2021-02-07 2021-05-25 浙江工业大学 Thermal imaging defect detection method based on convolution self-encoder image amplification
CN113240579A (en) * 2021-04-02 2021-08-10 维库(厦门)信息技术有限公司 Intelligent industrial product defect detection method and device and computer storage medium thereof

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
尚姝钰;王键;: "微型钻针芯厚快速光学自动化测量系统开发", 制造技术与机床, no. 11, 2 November 2016 (2016-11-02) *

Similar Documents

Publication Publication Date Title
US7526140B2 (en) Model-based localization and measurement of miniature surface mount components
CN103632129A (en) Facial feature point positioning method and device
JPH05101183A (en) Method and apparatus for matching image of body comprising straight line
CN108428248B (en) Vehicle window positioning method, system, equipment and storage medium
CN113592886B (en) Drawing examining method and device for building drawing, electronic equipment and medium
CN112184888A (en) Three-dimensional blood vessel modeling method and device
CN110807459B (en) License plate correction method and device and readable storage medium
CN107545223B (en) Image recognition method and electronic equipment
CN114240845B (en) Light cutting method surface roughness measurement method applied to cutting workpiece
CN116205978A (en) Method, device, equipment and storage medium for determining mapping image of three-dimensional target object
CN115641415B (en) Method, device, equipment and medium for generating three-dimensional scene based on satellite image
CN111368573A (en) Positioning method based on geometric feature constraint
CN112651953A (en) Image similarity calculation method and device, computer equipment and storage medium
CN114119695A (en) Image annotation method and device and electronic equipment
CN118134907B (en) Control method and device for drill point type and electronic equipment
Somasundaram et al. Straightening of highly curved human chromosome for cytogenetic analysis
CN111898408B (en) Quick face recognition method and device
CN111754467A (en) Hough transform-based parking space detection method and device, computer equipment and storage medium
CN118134907A (en) Control method and device for drill point type and electronic equipment
CN113658195B (en) Image segmentation method and device and electronic equipment
CN113902927B (en) Comprehensive information processing method fusing image and point cloud information
CN115797533A (en) Model edge tracing method, device, equipment and storage medium
CN113920068B (en) Body part detection method and device based on artificial intelligence and electronic equipment
Ye et al. Active contour image segmentation method for training talents of computer graphics and image processing technology
CN112101139B (en) Human shape detection method, device, equipment and storage medium

Legal Events

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