CN115063409A - Method and system for detecting surface material of mechanical cutter - Google Patents
Method and system for detecting surface material of mechanical cutter Download PDFInfo
- Publication number
- CN115063409A CN115063409A CN202210895287.3A CN202210895287A CN115063409A CN 115063409 A CN115063409 A CN 115063409A CN 202210895287 A CN202210895287 A CN 202210895287A CN 115063409 A CN115063409 A CN 115063409A
- Authority
- CN
- China
- Prior art keywords
- gray
- initial
- pixel
- category
- cutter
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 57
- 239000000463 material Substances 0.000 title claims abstract description 35
- 230000007547 defect Effects 0.000 claims abstract description 70
- 239000002245 particle Substances 0.000 claims abstract description 53
- 238000001514 detection method Methods 0.000 claims abstract description 17
- 230000002159 abnormal effect Effects 0.000 claims abstract description 10
- 230000011218 segmentation Effects 0.000 claims abstract description 10
- 230000006870 function Effects 0.000 claims description 10
- 238000003708 edge detection Methods 0.000 claims description 4
- 238000005457 optimization Methods 0.000 claims description 4
- 238000004590 computer program Methods 0.000 claims description 3
- 230000003287 optical effect Effects 0.000 abstract description 3
- 230000008569 process Effects 0.000 description 12
- 238000001914 filtration Methods 0.000 description 9
- 238000005520 cutting process Methods 0.000 description 5
- 238000004519 manufacturing process Methods 0.000 description 5
- 238000004458 analytical method Methods 0.000 description 3
- 238000003754 machining Methods 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 238000013473 artificial intelligence Methods 0.000 description 2
- 238000013145 classification model Methods 0.000 description 2
- 230000003247 decreasing effect Effects 0.000 description 2
- 230000002950 deficient Effects 0.000 description 2
- 238000005286 illumination Methods 0.000 description 2
- 230000000007 visual effect Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 239000011248 coating agent Substances 0.000 description 1
- 238000000576 coating method Methods 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000007796 conventional method Methods 0.000 description 1
- 239000000428 dust Substances 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
- 239000002184 metal Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
- G06T7/0004—Industrial image inspection
- G06T7/0008—Industrial image inspection checking presence/absence
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/40—Scaling of whole images or parts thereof, e.g. expanding or contracting
- G06T3/4053—Scaling of whole images or parts thereof, e.g. expanding or contracting based on super-resolution, i.e. the output image resolution being higher than the sensor resolution
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/11—Region-based segmentation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/13—Edge detection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20092—Interactive image processing based on input by user
- G06T2207/20104—Interactive definition of region of interest [ROI]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30108—Industrial image inspection
- G06T2207/30164—Workpiece; Machine component
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/30—Computing systems specially adapted for manufacturing
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Quality & Reliability (AREA)
- Image Analysis (AREA)
Abstract
The invention relates to the field of defect detection, in particular to a method and a system for detecting surface materials of a mechanical cutter. The method comprises the following steps: performing superpixel segmentation on the ROI area image to obtain an initial superpixel block; obtaining a Gaussian model of each initial pixel block according to the gray value of the pixel point; calculating the correlation of any two initial superpixel blocks according to a Gaussian model; iteratively merging the initial pixel blocks according to the correlation to obtain N target superpixel blocks; iteratively updating each particle according to the speed and position of each particle; constructing a fitness sequence according to the fitness of each particle updated at the last time, and taking the gray values corresponding to the first (N-1) fitness in the sequence as gray threshold values; dividing the ROI area image into N categories according to the gray threshold; calculating defect indexes according to gray values of pixel points in all categories; and judging whether the defect index is greater than a threshold value, and if so, judging that the surface of the cutter is abnormal. The method is a method for detecting the mechanical cutter by using an optical means, and improves the detection efficiency.
Description
Technical Field
The invention relates to the field of defect detection, in particular to a method and a system for detecting surface materials of a mechanical cutter.
Background
In the field of machine part production, metal cutting machine tools and various machine tools are basic process equipment in machining. In the production process of the cutter, due to the influence of various external factors such as operators, machine equipment, environment and the like and the influence of the factors of the cutter material, various conditions such as convex-concave, coating peeling, edge gaps, scratches and the like can appear on the surface of the cutter, and the abnormal defects not only can influence the appearance of the cutter, but also can influence the quality and the service life of the cutter in serious cases. The cutter surface detects at present and detects the manual work on placing the cutter on fixed workstation mostly, and the manual work detects and has increased the amount of labour, has reduced work efficiency, and detects the precision lower, and the false retrieval rate is higher.
Disclosure of Invention
In order to solve the problems of low detection efficiency and high false detection rate when the surface defects of the cutter are detected by the conventional method, the invention aims to provide a method and a system for detecting the surface material of the mechanical cutter, and the adopted technical scheme is as follows:
in a first aspect, the present invention provides a method for detecting a surface material of a mechanical tool, the method comprising the following steps:
acquiring a surface image of a cutter to be detected, carrying out edge detection on the surface image of the cutter to be detected, and taking an internal region image of the edge image of the cutter to be detected as an ROI region image;
performing superpixel segmentation on the ROI area image to obtain a corresponding initial superpixel block; obtaining a Gaussian model corresponding to each initial pixel block according to the gray value of the pixel point in each initial super pixel block; calculating the correlation of any two initial superpixel blocks according to the Gaussian models corresponding to the initial superpixel blocks; according to the correlation of any two initial superpixel blocks, carrying out iterative combination on the initial superpixel blocks to obtain N target superpixel blocks;
calculating the speed and the position corresponding to each particle updating according to the speed and position updating formula of the particles, wherein the particles are the gray values of the pixel points, and the number of the particles is more than (N-1); iteratively updating each particle according to the speed and position corresponding to each updating of each particle; calculating the fitness value corresponding to each particle updated at the last time according to the fitness function; sorting the fitness values from large to small to construct a sequence of the fitness values; acquiring gray values of particles corresponding to the first (N-1) fitness values in the fitness value sequence, and taking the gray values of the particles corresponding to the first (N-1) fitness values as gray threshold values; dividing the ROI area image into N categories according to the gray threshold;
calculating the defect index of the cutter to be detected according to the gray values of the pixel points in each category; and judging whether the defect index is larger than a threshold value, and if so, judging that the surface of the tool to be detected is abnormal.
In a second aspect, the present invention provides a system for detecting a surface material of a mechanical tool, including a memory and a processor, where the processor executes a computer program stored in the memory to implement the method for detecting a surface material of a mechanical tool.
Preferably, the correlation of any two initial superpixel blocks is calculated using the following formula:
wherein,is an initial super-pixel blockAnd an initial superpixel blockThe correlation of (a) with (b) is,for the correlation factor, c for the model bias,is an initial super-pixel blockGray scale of middle pixel pointThe mean value of the values is determined,as an initial superpixel blockThe mean value of the gray values of the middle pixels,initial superpixel blockThe standard deviation of the gray value of the middle pixel point,is an initial super-pixel blockAnd standard deviation of gray values of the middle pixel points.
Preferably, the inertia weight coefficient in the velocity and position updating formula is optimized, and the optimized inertia weight coefficient is as follows:
wherein,in order to optimize the inertial weight coefficient after optimization,is the maximum value of the weight coefficient,is the minimum value of the weight coefficient,is a first control factor to be used for controlling the motor,is a second control factor for the control of the motor,in order to be the maximum number of iterations,is the number of iterations.
Preferably, the fitness function is:
wherein,are particlesThe corresponding value of the degree of fitness is,is the ratio of the number of pixels in the 1 st category to the number of pixels in the ROI area image,is the ratio of the number of pixels in the 2 nd category to the number of pixels in the ROI area image,is the ratio of the number of pixels in the Nth category to the number of pixels in the ROI area image,is the average value of the gray levels of the pixels in the 1 st category,is the average value of the gray levels of the pixels in the 2 nd category,the gray level mean value of the pixel points in the ROI area image is obtained.
Preferably, the iteratively combining the initial pixel blocks according to the correlation between any two initial superpixel blocks to obtain N target superpixel blocks includes:
for any initial superpixel block: combining the initial superpixel block and the initial superpixel block with the maximum correlation to obtain a first superpixel block;
calculating the correlation of any two first superpixel blocks;
for any first superpixel block: combining the first super-pixel block and the first super-pixel block with the maximum correlation to obtain a second super-pixel block;
and when the correlations among the super pixel blocks are all smaller than a set threshold value, stopping merging the super pixel blocks, and marking the super pixel block obtained by the last merging as a target super pixel block.
Preferably, the calculating the defect index of the tool to be detected according to the gray values of the pixel points in each category includes:
counting the number of pixel points in each category, taking the category with the largest number of pixel points as a cutter surface normal category, and taking other categories as defect categories, wherein the other categories are the categories except the cutter surface normal category in the N categories;
calculating the gray average value of the pixel points in the normal category of the surface of the cutter according to the gray value of each pixel point in the normal category of the surface of the cutter;
for any defect class: calculating the gray average value of the pixel points in the category according to the gray value of each pixel point in the category;
and calculating the defect index of the cutter to be detected according to the gray average value of the pixel points in the normal category of the surface of the cutter and the gray average value of the pixel points in each defect category.
Preferably, the defect index of the tool to be detected is calculated by adopting the following formula:
wherein,is an index of the defects of the cutter to be detected,is the sum of the number of pixels in the defect category,is the total number of defect classes,is the gray average value of the pixel points in the normal category of the surface of the cutter to be detected,is as followsThe mean value of the gray levels of the pixels in each defect category,is the base of the natural logarithm.
The invention has the following beneficial effects: the invention provides a method for detecting a mechanical cutter by using a visible light image in order to judge whether the surface of the cutter to be detected has defects, and the method can be applied to new material related services and can realize new material detection, metering, related standardization, authentication and approval services and the like. Considering that the gray value of the pixel point in the defect area is different from the gray value of the pixel point in the normal area, the invention analyzes whether the surface of the mechanical cutter to be detected has defects or not by utilizing the visible light image. The specific process is as follows: firstly, obtaining an ROI (region of interest) area image in a surface image of a tool to be detected, performing superpixel segmentation on the ROI area image to obtain corresponding initial superpixel blocks, then calculating the correlation of any two initial superpixel blocks, and merging the initial superpixel blocks according to the correlation to obtain N target superpixel blocks; considering that the segmentation of the superpixel blocks is very inaccurate, the method adopts a particle iterative updating method to obtain (N-1) optimal gray threshold values for dividing the pixel point categories; dividing the ROI area image into N categories according to the optimal gray threshold, dividing the N categories into a normal category and a defect category according to the number of pixel points in each category, calculating a defect index of the tool to be detected according to the gray value of the pixel points in each category, and judging whether the surface of the tool to be detected is abnormal or not according to the defect index. The system provided by the embodiment is an artificial intelligence system in the production field, the method provided by the invention is a method for analyzing the mechanical cutter by using an optical means, and particularly, the existence of the surface flaws or defects of the mechanical cutter is tested.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions and advantages of the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a flowchart of a method for detecting a surface material of a mechanical tool according to the present invention.
Detailed Description
To further illustrate the technical means and effects of the present invention for achieving the predetermined objects, the following detailed description of a method for detecting surface material of a mechanical cutting tool according to the present invention is provided with the accompanying drawings and preferred embodiments.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
The following describes a specific scheme of the method for detecting the surface material of the mechanical cutter in detail with reference to the accompanying drawings.
Embodiment of method for detecting surface material of mechanical cutter
The existing method has the problems of low detection efficiency and high false detection rate when detecting the surface defects of the cutter. In order to solve the above problem, the present embodiment provides a method for detecting a surface material of a mechanical tool, as shown in fig. 1, the method for detecting a surface material of a mechanical tool of the present embodiment includes the following steps:
and step S1, acquiring a surface image of the tool to be detected, performing edge detection on the surface image of the tool to be detected, and taking an internal region image of the edge image of the tool to be detected as an ROI region image.
The embodiment is provided with image acquisition equipment for acquiring images of the surface of the tool to be detected, the embodiment arranges a camera above the tool to be detected, the tool to be detected is placed on a black background, a camera shooting range can cover the surface of the tool to be detected so as to comprehensively detect the surface of the tool, the camera acquires surface images of the tool to be detected at a overlooking visual angle, the influence of the camera visual angle on the acquisition of the surface images of the tool is prevented, the system precision is improved, so that the tool area is accurately extracted in the following process, and the front-view images of the surface of the tool to be detected are obtained.
In the embodiment, the defect detection is mainly performed on the tool surface based on the acquired front-view image of the tool surface to be detected, and considering that a large amount of noise exists in the environment and floating dust on the tool surface can affect the acquisition of the tool surface image in the image acquisition process, the embodiment performs filtering and denoising processing on the acquired front-view image of the tool surface to be detected, eliminates noise points of the tool surface image, achieves denoising processing on the tool surface image, obtains a denoised filtered image, and an implementer can select a denoising processing method of a mean filtering algorithm, a median filtering algorithm, a gaussian filtering algorithm or a bilinear filtering algorithm to perform denoising processing on the front-view image of the tool surface to be detected. And then, the illumination equalization is carried out on the filtered image through gamma conversion, so that the brightness in the image is more uniform, and the influence of uneven brightness and the like on the surface anomaly detection result caused by the illumination of the light source on the surface of the cutter is avoided. And taking the finally processed image as a surface image of the tool to be detected. The mean filtering algorithm, the median filtering algorithm, the gaussian filtering, the bilinear filtering and the gamma transformation are all the prior art, and are not described herein again.
In the embodiment, the region of interest of the surface image of the tool to be detected is extracted, so that the influence of irrelevant factors on the detection of the tool surface is avoided. The method for extracting the region of interest specifically comprises the following steps: firstly, extracting edge pixel points in a surface image of a tool to be detected by adopting an edge detection operator to obtain an edge image of the tool to be detected, and taking an image in a communication domain inside an edge as a surface area image of the tool to be detected, namely an interested area image. According to the characteristic that the position of a corresponding pixel point of an image is unchanged, the image is cut based on the edge pixel point so as to obtain image data only containing the surface of the tool, and the image data is used as an ROI (region for region analysis) for subsequent detection and analysis of the surface of the tool to be detected.
Step S2, performing superpixel segmentation on the ROI area image to obtain a corresponding initial superpixel block; obtaining a Gaussian model corresponding to each initial pixel block according to the gray value of the pixel point in each initial super pixel block; calculating the correlation of any two initial superpixel blocks according to the Gaussian models corresponding to the initial superpixel blocks; and according to the correlation of any two initial superpixel blocks, carrying out iterative combination on the initial superpixel blocks to obtain N target superpixel blocks.
In this embodiment, the pixel points on the surface of the tool are divided so as to identify the defective pixel points on the surface of the tool, thereby implementing the detection and analysis of the material of the surface of the tool. Considering that when different defect conditions occur on the surface of a tool, gray information corresponding to different defects may have certain difference, in order to primarily identify the surface condition of the tool, the embodiment firstly adopts a superpixel segmentation algorithm to divide an ROI area image into a plurality of initial superpixel blocks, and a Gaussian model is fitted based on the gray value of a pixel point in each superpixel blockAnd x is the gray value of the pixel point,a Gaussian model corresponding to the initial super-pixel block i, each Gaussian model having two characteristic parametersIn this embodiment, the correlation of the initial superpixel block is analyzed based on the characteristic parameters of the gaussian model, so as to further merge the initial superpixel blocks obtained by the preliminary division, and calculate the correlation of any two initial superpixel blocks, that is:
wherein,is an initial super-pixel blockAnd an initial superpixel blockIs related to (A) and,for the correlation factor, c is the model bias,is an initial super-pixel blockThe mean value of the gray values of the middle pixels,is an initial super-pixel blockThe mean value of the gray values of the middle pixel points,initial superpixel blockThe standard deviation of the gray values of the middle pixel points,is an initial super-pixel blockAnd standard deviation of gray values of the middle pixel points. This example arrangementIn a specific application, the setting can be carried out according to specific situations.
Normalizing the Gaussian model to ensure that the function value is in [0,1 ]]The larger the model function value is, the more similar the two corresponding superpixel blocks are, and this embodiment calculates the correlation between the initial superpixel blocks based on the gaussian model, and merges the initial superpixel blocks. Specifically, the initial superpixel blocks to be combined and each initial superpixel block corresponding to the maximum correlation are combined to obtain combined superpixel blocks, in order to realize the merging precision of the superpixel blocks, the correlation of the combined superpixel blocks is calculated based on a Gaussian model of the combined superpixel blocks, and the method is adopted for iterative combination according to the correlation of the combined superpixel blocks until the correlation between any two superpixel blocks is lower than a correlation threshold valueThe present embodiment sets the correlation threshold valueIn a specific application, the setting is carried out according to specific situations. And obtaining N target superpixel blocks after the superpixel blocks are combined in an iterative manner.
Step S3, calculating the speed and position corresponding to each particle update according to the speed and position update formula of the particles, wherein the particles are the gray values of pixel points, and the number of the particles is more than (N-1); iteratively updating each particle according to the speed and position corresponding to each updating of each particle; calculating the fitness value corresponding to each particle updated for the last time according to the fitness function; sorting the fitness values from large to small to construct a sequence of the fitness values; acquiring gray values of particles corresponding to the first (N-1) fitness values in the fitness value sequence, and taking the gray values of the particles corresponding to the first (N-1) fitness values as gray threshold values; and dividing the ROI area image into N categories according to the gray threshold.
In order to accurately identify and divide the pixels on the surface of the tool, the present embodiment sets a pixel classification model for accurately dividing the pixels in the ROI image. The pixel point classification model specifically comprises: firstly, based on the segmentation and merging process of the superpixel blocks in step S2, the types of the pixel points on the surface of the tool are obtained, and in this embodiment, the obtained target number N of the superpixel blocks is used as the number of the types of the tool pixel point division, so as to realize the tool pixel point division. Then, the embodiment extracts the optimal gray scale threshold value set for pixel point division to obtain (N-1) optimal pixel point division threshold values, and performs category division on the cutter pixel points again.
The method for obtaining the optimal division gray level threshold value comprises the following steps:
in this embodiment, the gray value of a pixel point is abstracted into particles, and the number m of the particles is set, that is, m gray threshold values are selected first, and the value range [0,255] is selected, where m is greater than N-1. Then, each particle is endowed with a random initial position and speed, the fitness of each particle is calculated according to a fitness function, then the corresponding speed and position of each particle in the next updating process are calculated by using an updating formula of the speed and the position, each particle is updated according to the corresponding speed and position of each particle in the next updating process, and the updating formula of the speed and the position is as follows:
wherein,for the kth iteration speed of particle i,for the (k-1) th iteration speed of particle i,the position of the target is the best position of the group,for the optimal position of the particle i, k is the number of iterations,for the (k-1) th iteration position of particle i,for the kth iteration position of particle i,is at [0,1 ]]The random number is randomly distributed on the random number,is at [0,1 ]]The random number is randomly distributed on the random number,is the coefficient of the inertial weight, and,is a first one of the learning factors, and,is the second learning factor, in this embodiment。
The conventional updating strategy adopting linear decreasing is that linear decreasing updating is adopted, and considering that the optimal value is easily not searched in the initial stage of iteration, subsequent iteration is possibly trapped in a local extreme value, therefore, the embodiment optimizes and corrects the inertia weight coefficient to ensure that an accurate pixel point division threshold is searched, and the optimization of the inertia weight coefficient specifically comprises the following steps:
wherein,in order to optimize the inertial weight coefficient after optimization,is the maximum value of the weight coefficients smaller than 1,is the minimum value of the weight coefficients smaller than 1,is a first control factor to be used for controlling the motor,is a second control factor for the control of the motor,in order to be the maximum number of iterations,is the number of iterations. This example arrangement,,In the case of a particular application,、、、andthe value of (a) is set according to specific conditions.
The present embodiment updates the position and velocity of each particle based on the optimized inertial weight coefficient. Calculating the fitness value of each particle according to the fitness function at each time of updating, namely:
wherein,are particlesThe value of the corresponding degree of fitness is,is the ratio of the number of pixels in the 1 st category to the number of pixels in the ROI area image,is the ratio of the number of pixels in the 2 nd category to the number of pixels in the ROI area image,is the ratio of the number of pixels in the Nth category to the number of pixels in the ROI area image,is the average value of the gray levels of the pixels in the 1 st category,is the average value of the gray levels of the pixels in the 2 nd category,the gray level mean value of the pixel points in the ROI area image is obtained.
In the embodiment, the fitness value of each particle is obtained through a fitness function and an iterative update process, and in order to prevent infinite iteration and a locally optimal loop, the maximum iteration number K =100 is set in the embodiment. In this embodiment, the tool surface pixel division threshold is selected according to the fitness value corresponding to each particle after final update, and the specific selection process is as follows: the fitness of each particle corresponding to the last update is sorted from large to small, and a fitness value sequence is constructedWherein, in the process,the embodiment will be arranged at the front of the sequence of fitness valuesUsing particles corresponding to each fitness value as tool surface pixel stippling linesRespective optimal gray threshold values, which constitute a setBased on thisThe pixel points in the ROI area image are divided into N categories by the gray threshold, then corresponding gray values are endowed to the pixel points in each category again, after assignment, the gray values of the pixel points in the same category are equal, and the method specifically comprises the following steps:
wherein,is a pixel pointThe gray value after assignment is in the gray value of the pixel point) In between, the gray value of the corresponding pixel point is set(ii) a When the gray value of the pixel point is in the value of [ 2 ]) In between, the gray value of the corresponding pixel point is set(ii) a And so on; when the gray value of the pixel point is at]And in the middle, the gray value of the corresponding pixel point is set to 1. Subsequent liftingThe gray values to the pixel points are the gray values after assignment.
Step S4, calculating defect indexes of the cutter to be detected according to the gray values of the pixel points in each category; and judging whether the defect index is larger than a threshold value, and if so, judging that the surface of the tool to be detected is abnormal.
The dividing of pixel points in the ROI area image is completed based on the method, and most of defect areas on the surface of the cutter are considered to be small target features, so after the classification of the pixel points in the cutter area is divided, the number of the pixel points in each classification is counted in the embodiment, the classification with the largest number of the pixel points is taken as a normal classification of the surface of the cutter, the rest classifications are taken as defect classifications, the area where each defect classification is located is the defect area, and the embodiment determines the sum of the number of the pixel points in each defect areaThe total number of the pixel points of the surface defects of the cutter to be detected is used as the total number; obtaining the gray value of each pixel point in the normal category of the surface of the cutter, and calculating the gray average value of the pixel points in the normal category of the surface of the cutter according to the gray value of each pixel point in the normal category of the surface of the cutterMeanwhile, for any defect category: acquiring the gray value of each pixel point in the category, and calculating the gray average value of the pixel points in the category according to the gray value of each pixel point in the category; calculating the surface defect index of the cutter to be detected according to the gray average value of the pixel points in the normal category of the surface of the cutter and the gray average value of each defect area, namely:
wherein,is an index of the surface defect of the cutter to be detected,is the sum of the number of pixels in the defect category,is the total number of defect classes,is the gray average value of the pixel points in the normal category of the surface of the cutter to be detected,is as followsThe mean value of the gray levels of the pixels in each defect class,is the base of the natural logarithm.
Defect index of tool to be detectedThe larger the surface, the more abnormal the surface of the tool to be detected is; index of surface defect of tool to be detectedThe smaller the tool, the better the surface condition of the tool to be detected. The embodiment sets a defect index thresholdJudging whether the surface defect index of the tool to be detected is greater thanIf the number of the machining defects is larger than the preset number, judging that the surface of the tool to be detected is abnormal, and the tool cannot be used in the machining process of mechanical manufacturing, and needs to be machined again, so that the defective rate is reduced, and accidents in the subsequent use process are prevented; if the surface defect index of the tool to be detected is less than or equal toAnd judging that the surface of the tool to be detected is not abnormal. Defect index thresholdThe value of (a) is set according to specific conditions.
In order to determine whether the surface of the tool to be detected has defects, the embodiment provides a method for detecting a mechanical tool by using a visible light image, and the method can be applied to new material related services, and can realize new material detection, metering, related standardization, authentication and approval services and the like. In consideration of a certain difference between the gray value of the pixel point in the defect area and the gray value of the pixel point in the normal area, the embodiment utilizes the visible light image to analyze whether the surface of the mechanical tool to be detected has a defect. The specific process is as follows: firstly, obtaining an ROI (region of interest) area image in a surface image of a tool to be detected, performing superpixel segmentation on the ROI area image to obtain corresponding initial superpixel blocks, then calculating the correlation of any two initial superpixel blocks, and merging the initial superpixel blocks according to the correlation to obtain N target superpixel blocks; considering that the segmentation of the superpixel blocks is very inaccurate, the embodiment then adopts a particle iterative update method to obtain (N-1) optimal gray level thresholds for dividing the pixel point categories; dividing the ROI area image into N categories according to the optimal gray threshold, dividing the N categories into a normal category and a defect category according to the number of pixel points in each category, calculating a defect index of the tool to be detected according to the gray value of the pixel points in each category, and judging whether the surface of the tool to be detected is abnormal or not according to the defect index. The system of the embodiment is an artificial intelligence system in the production field, the method provided by the embodiment is a method for analyzing the mechanical cutter by using an optical means, and particularly, the existence of surface flaws or defects of the mechanical cutter is tested.
Embodiment of mechanical cutter surface material detection system
The system for detecting the surface material of the mechanical tool in this embodiment includes a memory and a processor, and the processor executes a computer program stored in the memory to implement the method for detecting the surface material of the mechanical tool.
Since the method for detecting the surface material of the mechanical cutting tool has been described in the embodiment of the method for detecting the surface material of the mechanical cutting tool, the method for detecting the surface material of the mechanical cutting tool is not described in detail in this embodiment.
It should be noted that: the above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.
Claims (8)
1. A method for detecting the surface material of a mechanical cutter is characterized by comprising the following steps:
acquiring a surface image of a tool to be detected, carrying out edge detection on the surface image of the tool to be detected, and taking an internal region image of the edge image of the tool to be detected as an ROI region image;
performing superpixel segmentation on the ROI area image to obtain a corresponding initial superpixel block; obtaining a Gaussian model corresponding to each initial pixel block according to the gray value of the pixel point in each initial super pixel block; calculating the correlation of any two initial superpixel blocks according to the Gaussian models corresponding to the initial superpixel blocks; according to the correlation of any two initial superpixel blocks, carrying out iterative combination on the initial superpixel blocks to obtain N target superpixel blocks;
calculating the speed and the position corresponding to each particle updating according to the speed and position updating formula of the particles, wherein the particles are the gray values of the pixel points, and the number of the particles is more than (N-1); iteratively updating each particle according to the speed and position corresponding to each updating of each particle; calculating the fitness value corresponding to each particle updated for the last time according to the fitness function; sorting the fitness values from large to small to construct a fitness value sequence; acquiring gray values of particles corresponding to the first (N-1) fitness values in the fitness value sequence, and taking the gray values of the particles corresponding to the first (N-1) fitness values as gray threshold values; dividing the ROI area image into N categories according to the gray threshold;
calculating the defect index of the cutter to be detected according to the gray values of the pixel points in each category; and judging whether the defect index is larger than a threshold value, and if so, judging that the surface of the tool to be detected is abnormal.
2. The method for detecting the surface material quality of the mechanical cutter according to claim 1, characterized in that the correlation between any two initial superpixel blocks is calculated by the following formula:
wherein,is an initial super-pixel blockAnd an initial superpixel blockThe correlation of (a) with (b),for the correlation factor, c is the model bias,is an initial super-pixel blockThe mean value of the gray values of the middle pixels,is an initial super-pixel blockThe mean value of the gray values of the middle pixels,initial superpixel blockThe standard deviation of the gray value of the middle pixel point,is an initial super-pixel blockAnd standard deviation of gray values of the middle pixel points.
3. The method for detecting the surface material quality of the mechanical cutter according to claim 1, wherein the inertia weight coefficient in the speed and position updating formula is optimized, and the optimized inertia weight coefficient is as follows:
wherein,in order to optimize the inertial weight coefficient after optimization,the maximum value of the weight coefficient is the value,is the minimum value of the weight coefficient,is a first control factor for the first control factor,is a second control factor for the control of the motor,in order to be the maximum number of iterations,is the number of iterations.
4. The method for detecting the surface material quality of the mechanical cutter according to claim 1, wherein the fitness function is as follows:
wherein,are particlesThe corresponding value of the degree of fitness is,is the ratio of the number of pixels in the 1 st category to the number of pixels in the ROI area image,is the ratio of the number of pixels in the 2 nd category to the number of pixels in the ROI area image,the number of pixels in the Nth category and the pixels in the ROI area imageThe ratio of the number of the first and second groups,is the average value of the gray levels of the pixels in the 1 st category,is the average value of the gray levels of the pixels in the 2 nd category,the gray level mean value of the pixel points in the ROI area image is obtained.
5. The method for detecting the surface material of the mechanical tool according to claim 1, wherein the iteratively combining the initial pixel blocks according to the correlation between any two initial superpixel blocks to obtain N target superpixel blocks comprises:
for any initial superpixel block: combining the initial superpixel block and the initial superpixel block with the maximum correlation to obtain a first superpixel block;
calculating the correlation of any two first superpixel blocks;
for any first superpixel block: combining the first super-pixel block and the first super-pixel block with the maximum correlation to obtain a second super-pixel block;
and when the correlations among the super pixel blocks are all smaller than a set threshold value, stopping merging the super pixel blocks, and marking the super pixel block obtained by the last merging as a target super pixel block.
6. The method for detecting the surface material of the mechanical cutter according to claim 1, wherein the step of calculating the defect index of the cutter to be detected according to the gray values of the pixel points in each category comprises the following steps:
counting the number of pixel points in each category, taking the category with the largest number of pixel points as a normal category of the surface of the cutter, and taking other categories as defect categories, wherein the other categories are the categories except the normal category of the surface of the cutter in the N categories;
calculating the gray average value of the pixel points in the normal category of the surface of the cutter according to the gray value of each pixel point in the normal category of the surface of the cutter;
for any defect class: calculating the gray average value of the pixel points in the category according to the gray value of each pixel point in the category;
and calculating the defect index of the cutter to be detected according to the gray average value of the pixel points in the normal category of the surface of the cutter and the gray average value of the pixel points in each defect category.
7. The method for detecting the surface material of the mechanical cutter according to claim 6, wherein the defect index of the cutter to be detected is calculated by adopting the following formula:
wherein,is an index of the defects of the cutter to be detected,the sum of the number of pixels in the defect class,is the total number of defect classes,is the gray average value of the pixel points in the normal category of the surface of the cutter to be detected,is as followsPixel point in defect categoryThe average value of the gray levels of (a),is the base of the natural logarithm.
8. A machine tool surface material detection system comprising a memory and a processor, wherein the processor executes a computer program stored in the memory to implement a machine tool surface material detection method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210895287.3A CN115063409B (en) | 2022-07-28 | 2022-07-28 | Method and system for detecting surface material of mechanical cutter |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210895287.3A CN115063409B (en) | 2022-07-28 | 2022-07-28 | Method and system for detecting surface material of mechanical cutter |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115063409A true CN115063409A (en) | 2022-09-16 |
CN115063409B CN115063409B (en) | 2022-11-11 |
Family
ID=83206342
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210895287.3A Active CN115063409B (en) | 2022-07-28 | 2022-07-28 | Method and system for detecting surface material of mechanical cutter |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115063409B (en) |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115272353A (en) * | 2022-10-07 | 2022-11-01 | 山东盛世恒机械制造有限公司 | Image processing method suitable for crack detection |
CN115294113A (en) * | 2022-09-30 | 2022-11-04 | 南通佳木汇木制品有限公司 | Wood veneer quality detection method |
CN115393657A (en) * | 2022-10-26 | 2022-11-25 | 金成技术股份有限公司 | Metal pipe production abnormity identification method based on image processing |
CN115439474A (en) * | 2022-11-07 | 2022-12-06 | 山东天意机械股份有限公司 | A fast fault location method for power equipment |
CN115431101A (en) * | 2022-10-18 | 2022-12-06 | 南通钜德智能科技有限公司 | Method and system for detecting state of numerical control machine tool |
CN115965624A (en) * | 2023-03-16 | 2023-04-14 | 山东宇驰新材料科技有限公司 | Detection method for anti-wear hydraulic oil pollution particles |
CN117124139A (en) * | 2023-10-26 | 2023-11-28 | 合肥亚明汽车部件有限公司 | Visual detection method for intelligent machine tool cutter abrasion |
CN117274241A (en) * | 2023-11-17 | 2023-12-22 | 四川赢信汇通实业有限公司 | Brake drum surface damage detection method and device based on rapid image analysis |
CN118365633A (en) * | 2024-06-17 | 2024-07-19 | 陕西中盛天泽复合材料科技有限公司 | Industrial product defect detection method and system based on image processing |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108053413A (en) * | 2017-12-12 | 2018-05-18 | 上海斐讯数据通信技术有限公司 | A kind of method for detecting image edge and system based on particle cluster algorithm |
CN109120230A (en) * | 2018-07-19 | 2019-01-01 | 苏州热工研究院有限公司 | A kind of solar battery sheet EL image detection and defect identification method |
CN114549497A (en) * | 2022-02-28 | 2022-05-27 | 扬州市恒邦机械制造有限公司 | Method for detecting surface defects of walking board based on image recognition and artificial intelligence system |
-
2022
- 2022-07-28 CN CN202210895287.3A patent/CN115063409B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108053413A (en) * | 2017-12-12 | 2018-05-18 | 上海斐讯数据通信技术有限公司 | A kind of method for detecting image edge and system based on particle cluster algorithm |
CN109120230A (en) * | 2018-07-19 | 2019-01-01 | 苏州热工研究院有限公司 | A kind of solar battery sheet EL image detection and defect identification method |
CN114549497A (en) * | 2022-02-28 | 2022-05-27 | 扬州市恒邦机械制造有限公司 | Method for detecting surface defects of walking board based on image recognition and artificial intelligence system |
Cited By (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115294113A (en) * | 2022-09-30 | 2022-11-04 | 南通佳木汇木制品有限公司 | Wood veneer quality detection method |
CN115294113B (en) * | 2022-09-30 | 2023-10-27 | 南通佳木汇木制品有限公司 | Quality detection method for wood veneer |
CN115272353A (en) * | 2022-10-07 | 2022-11-01 | 山东盛世恒机械制造有限公司 | Image processing method suitable for crack detection |
CN115431101A (en) * | 2022-10-18 | 2022-12-06 | 南通钜德智能科技有限公司 | Method and system for detecting state of numerical control machine tool |
CN115393657A (en) * | 2022-10-26 | 2022-11-25 | 金成技术股份有限公司 | Metal pipe production abnormity identification method based on image processing |
CN115439474A (en) * | 2022-11-07 | 2022-12-06 | 山东天意机械股份有限公司 | A fast fault location method for power equipment |
CN115965624A (en) * | 2023-03-16 | 2023-04-14 | 山东宇驰新材料科技有限公司 | Detection method for anti-wear hydraulic oil pollution particles |
CN117124139A (en) * | 2023-10-26 | 2023-11-28 | 合肥亚明汽车部件有限公司 | Visual detection method for intelligent machine tool cutter abrasion |
CN117124139B (en) * | 2023-10-26 | 2024-01-09 | 合肥亚明汽车部件有限公司 | Visual detection method for intelligent machine tool cutter abrasion |
CN117274241A (en) * | 2023-11-17 | 2023-12-22 | 四川赢信汇通实业有限公司 | Brake drum surface damage detection method and device based on rapid image analysis |
CN117274241B (en) * | 2023-11-17 | 2024-02-09 | 四川赢信汇通实业有限公司 | Brake drum surface damage detection method and device based on rapid image analysis |
CN118365633A (en) * | 2024-06-17 | 2024-07-19 | 陕西中盛天泽复合材料科技有限公司 | Industrial product defect detection method and system based on image processing |
Also Published As
Publication number | Publication date |
---|---|
CN115063409B (en) | 2022-11-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN115063409B (en) | Method and system for detecting surface material of mechanical cutter | |
CN113435460B (en) | A recognition method for bright crystal granular limestone images | |
CN110148130B (en) | Method and device for detecting part defects | |
CN116777907A (en) | Sheet metal part quality detection method | |
CN115147409B (en) | Mobile phone shell production quality detection method based on machine vision | |
CN116152242B (en) | Visual detection system of natural leather defect for basketball | |
CN116664565A (en) | Hidden crack detection method and system for photovoltaic solar cell | |
CN116030060B (en) | Plastic particle quality detection method | |
CN113469951A (en) | Hub defect detection method based on cascade region convolutional neural network | |
CN118279304B (en) | Abnormal recognition method, device and medium for special-shaped metal piece based on image processing | |
CN109359604B (en) | Method for identifying instrument under shadow interference facing inspection robot | |
CN116703251A (en) | Rubber ring production quality detection method based on artificial intelligence | |
CN114495098B (en) | Diaxing algae cell statistical method and system based on microscope image | |
CN118071749B (en) | A training method and system for steel surface defect detection model | |
CN113673396B (en) | Spore germination rate calculation method, device and storage medium | |
CN119599994A (en) | An intelligent visual inspection system and method for non-standard automated production lines | |
CN119151938A (en) | Surface defect detection method and detection system based on vision | |
CN114548250A (en) | Mobile phone appearance detection method and device based on data analysis | |
CN118967644A (en) | A workpiece surface defect detection method based on multi-attention mechanism | |
CN116630814B (en) | Quick positioning and evaluating method for building disasters based on machine learning | |
CN118967474A (en) | A defect image enhancement method based on traditional data enhancement | |
CN118587496A (en) | Automatic identification system and method of parts processing accuracy based on computer vision | |
CN118429320A (en) | Method and system for detecting coating defects of photovoltaic glass | |
CN118333929B (en) | A method for handling uncertainty in multi-defect classification | |
CN119941725B (en) | Chip defect detection method, device, equipment and medium based on diffusion model |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |