PPMA abnormal screening method and system based on image recognition
By calculating the grayscale variation coefficient and highlight selection factor in the grayscale image of PPMA sample, we can filter out the wear pixel points and evaluate the surface roughness and wear level of PPMA samples, solving the problem of interference detection results in the highlight area and improving PPMA Accuracy of sample abnormality detection.
Patent Information
- Application Number
- CN202411463914.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-21
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2044-10-21
AI Technical Summary
Due to the brightness slip and transparency of PPMA materials, local brightness areas will interfere with the visual characteristics of the wear area, resulting in errors in the wear resistance detection results of PPMA samples based on image recognition, reducing the accuracy of abnormal detection results.
By obtaining the grayscale image of the PPMA sample before and after grinding, the grayscale variation coefficient of each pixel point is calculated, and the suspected wear pixel points are screened based on this coefficient. Then, these pixel points are further screened according to the highlight selection factor to obtain wear pixel points, and then the surface roughness and wear level of the PPMA sample are evaluated.
The problem of interference detection results in the highlight area is effectively solved, the accuracy of abnormal detection results of PPMA samples is improved, and the PPMA samples are quantitatively evaluated through wear degree, which improves the detection accuracy of wear resistance.
Smart Images

Figure CN118982540B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a PPMA abnormality screening method and system based on image recognition. Background Art
[0002] Polymethyl methacrylate (PMMA) is one of the most commonly used materials for decorative parts in the fields of automobiles, industrial electronics and household appliances. PPMA has extremely high smoothness and surface hardness, and has good resistance to most inorganic acids, alkalis and salts. Due to its excellent mechanical properties, extremely excellent chemical resistance, and obvious surface wear resistance and self-lubricating properties; therefore, the wear resistance of PPMA material is an important indicator for its quality abnormality detection.
[0003] Due to the high glossiness, smoothness and transparency of the PPMA material, local highlights will be generated during the camera sampling process. The local highlight areas will interfere with the visual characteristics of the worn areas, causing the highlight areas to be misjudged as worn areas when detecting their wear resistance based on image recognition, thereby causing errors, thereby reducing the accuracy of the abnormal detection results of the PPMA samples. Summary of the invention
[0004] In order to solve the above problems, the present invention provides a PPMA abnormality screening method and system based on image recognition.
[0005] An embodiment of the present invention provides a PPMA abnormality screening method based on image recognition, the method comprising the following steps:
[0006] Get the grayscale images of the PPMA samples before and after polishing;
[0007] According to the grayscale difference between the grayscale images of the PPMA samples before and after polishing, and the grayscale difference between the pixel point and the surrounding pixels in the grayscale image of the PPMA sample after polishing, the grayscale variation coefficient of each pixel point is obtained; based on the grayscale variation coefficient, all the pixels in the grayscale image of the polished PPMA sample are screened to obtain all the suspected worn pixels;
[0008] According to the grayscale variation coefficient of the suspected worn pixel and the similarity of the gradient direction between the suspected worn pixel and the surrounding pixels, the highlight selection factor of the suspected worn pixel is obtained; based on the highlight selection factor, all suspected worn pixels are screened to obtain all worn pixels; according to the highlight selection factor and grayscale value of the worn pixel, the surface roughness of the PPMA sample is obtained; according to the surface roughness, the wear degree of the PPMA sample is obtained;
[0009] Anomaly screening of PPMA samples by degree of wear.
[0010] Preferably, the grayscale variation coefficient of each pixel is obtained according to the grayscale difference between the grayscale images of the PPMA sample before and after polishing, and the grayscale difference between the pixel in the grayscale image of the PPMA sample after polishing and the surrounding pixels, including the specific method of:
[0011] For any pixel in the grayscale image of the polished PPMA sample, the absolute value of the difference between the grayscale values of the pixel before and after polishing is recorded as the grayscale change value of the pixel;
[0012] The difference between 255 and the grayscale value of the pixel is recorded as the grayscale level value of the pixel;
[0013] According to the grayscale difference between the pixel point and the surrounding pixel points in the grayscale image of the polished PPMA sample, the neighborhood grayscale difference of the pixel point is obtained;
[0014] The ratio of the grayscale change value of the pixel point to the grayscale level value of the pixel point is recorded as the first ratio; the normalized value of the product of the first ratio and the neighborhood grayscale similarity of the pixel point is taken as the grayscale variation coefficient of the pixel point.
[0015] Preferably, the specific method of obtaining the neighborhood grayscale difference of the pixel point includes:
[0016] All pixels within the 8-neighborhood range of the pixel are recorded as comparison pixels of the pixel; for any comparison pixel of the pixel; the absolute value of the difference between the grayscale value of the pixel and the comparison pixel is recorded as the grayscale difference value of the comparison pixel; the average of the grayscale difference values of all comparison pixels of the pixel is taken as the neighborhood grayscale difference of the pixel.
[0017] Preferably, the method of screening all pixels in the grayscale image of the polished PPMA sample based on the grayscale variation coefficient to obtain all suspected worn pixels includes the following specific methods:
[0018] Preset a suspected parameter For any pixel in the grayscale image of the polished PPMA sample, if the grayscale variation coefficient of the pixel is greater than or equal to the suspected parameter , and record the pixel as a suspected worn pixel.
[0019] Preferably, the highlight selection factor of the suspected worn pixel is obtained according to the grayscale variation coefficient of the suspected worn pixel and the similarity of the gradient direction between the suspected worn pixel and the surrounding pixels, including the specific method of:
[0020] For any suspected worn pixel in the grayscale image of the polished PPMA sample, the neighborhood gradient similarity of the suspected worn pixel is obtained based on the similarity of the gradient direction between the suspected worn pixel and the surrounding pixels;
[0021] The ratio of the grayscale variation coefficient of the suspected wear pixel to the minimum value of the grayscale variation coefficient of all the suspected wear pixels in the grayscale image of the polished PPMA sample is used as the grayscale highlight feature value of the suspected wear pixel;
[0022] The normalized value of the product of the neighborhood gradient similarity of the suspected wear pixel and the grayscale highlight feature value is used as the highlight selection factor of the suspected wear pixel.
[0023] Preferably, the specific method of obtaining the neighborhood gradient similarity of the suspected wear pixel point includes:
[0024] All pixels within the 8-neighborhood range of the suspected wear pixel are recorded as reference pixels of the suspected wear pixel; for any reference pixel of the suspected wear pixel; the cosine value of the angle formed by the maximum gradient direction of the suspected wear pixel and the maximum gradient direction of the reference pixel is recorded as the gradient similarity value of the reference pixel; the average of the gradient similarity values of all reference pixels of the suspected wear pixel is taken as the neighborhood gradient similarity of the suspected wear pixel.
[0025] Preferably, the method of screening all suspected worn pixels based on the highlight selection factor to obtain all worn pixels includes:
[0026] Preset a selection parameter For any suspected worn pixel in the grayscale image of the polished PPMA sample, if the highlight selection factor of the suspected worn pixel is greater than or equal to the selection parameter , and record the suspected worn pixels as worn pixels.
[0027] Preferably, the surface roughness of the PPMA sample is obtained according to the highlight selection factor and grayscale value of the worn pixel point, and the specific method includes:
[0028] For any worn pixel in the grayscale image of the polished PPMA sample, the absolute value of the difference between the grayscale value of the worn pixel and the average grayscale value of all pixels in the grayscale image of the PPMA sample is recorded as the first difference of the worn pixel; the ratio of the first difference of the worn pixel to the highlight selection factor is recorded as the roughness factor of the worn pixel; the average of the roughness factors of all worn pixels in the grayscale image of the polished PPMA sample is taken as the surface roughness of the PPMA sample.
[0029] Preferably, the method of obtaining the wear degree of the PPMA sample according to the surface roughness includes:
[0030] The ratio between the number of all worn pixels in the grayscale image of the polished PPMA sample and the number of all pixels in the grayscale image of the polished PPMA sample is recorded as the wear ratio of the PPMA sample;
[0031] The normalized value of the product of the surface roughness of the PPMA sample and the wear ratio of the PPMA sample is taken as the wear degree of the PPMA sample.
[0032] The present invention also proposes a PPMA anomaly screening system based on image recognition, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the system implements any one of the steps of the PPMA anomaly screening method based on image recognition.
[0033] The beneficial effects of the technical solution of the present invention are as follows: the present invention screens all pixel points in the grayscale image of the polished PPMA sample based on the grayscale variation coefficient to obtain all suspected wear pixel points; screens all suspected wear pixel points based on the highlight selection factor to obtain all wear pixel points; obtains the surface roughness of the PPMA sample according to the highlight selection factor and the grayscale value of the wear pixel point; obtains the wear degree of the PPMA sample according to the surface roughness; screens the PPMA sample for abnormalities according to the wear degree; thereby solving the problem of the interference of the local highlight area generated by the PPMA material on the visual characteristics of the wear area, making the result of the wear resistance detection based on image recognition more accurate, and evaluating the wear degree of the material according to the roughness and wear area of the PPMA sample; quantifies the wear resistance of the PPMA sample according to the wear degree, thereby improving the accuracy of the abnormal detection result of the PPMA sample. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0035] Figure 1 The figure is a flowchart of the steps of the PPMA abnormality screening method based on image recognition of the present invention. DETAILED DESCRIPTION
[0036] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the PPMA abnormal screening method and system based on image recognition proposed by the present invention, its specific implementation, structure, features and effects, in conjunction with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0037] 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.
[0038] The specific scheme of the PPMA abnormal screening method and system based on image recognition provided by the present invention is described in detail below with reference to the accompanying drawings.
[0039] See also Figure 1 , which shows a flowchart of a PPMA abnormality screening method based on image recognition provided by an embodiment of the present invention, the method comprising the following steps:
[0040] Step S001: obtaining grayscale images of the PPMA sample before and after polishing.
[0041] It should be noted that in this embodiment, samples of standard size are cut from the PPMA material to ensure that the surface of the sample is flat and clean; due to the high transparency of the material, the sample is placed on a pure black background for shooting when collecting images in this embodiment; if the wear resistance of the PPMA sample does not meet the standard, more serious wear marks will be left on the surface of the PPMA sample, so it is necessary to use a high-resolution camera for sampling of the sample after the polishing experiment to ensure the consistency of the corresponding pixels in the PPMA sample image before and after polishing, so as to more conveniently compare the images before and after polishing to screen out abnormal PPMA samples.
[0042] Specifically, we first need to collect grayscale images of the PPMA samples before and after polishing. The specific process is as follows:
[0043] A PPMA sample of standard size is cut from the PPMA material, and the PPMA sample is photographed with a high-resolution camera to obtain an image of the PPMA sample before polishing; a certain pressure is applied to the surface of the PPMA sample by a rotating grinding head for polishing, and after polishing, the PPMA sample is photographed with a high-resolution camera to obtain an image of the PPMA sample after polishing; the PPMA sample image before and after polishing is subjected to median filtering, denoising and grayscale operations to obtain grayscale images of the PPMA sample before and after polishing. Among them, the median filtering and grayscale operations are prior arts, and are not described in detail in this embodiment.
[0044] At this point, the grayscale images of the PPMA samples before and after polishing were obtained by the above method.
[0045] Step S002: Obtain the grayscale variation coefficient of each pixel point based on the grayscale difference between the grayscale images of the PPMA samples before and after polishing, and the grayscale difference between the pixel point in the grayscale image of the PPMA sample after polishing and the surrounding pixels; screen all pixels in the grayscale image of the polished PPMA sample based on the grayscale variation coefficient to obtain all suspected worn pixels.
[0046] It should be noted that since some areas of the surface of the PPMA sample will have scratches and dents due to polishing before and after the polishing experiment, there will inevitably be visual grayscale differences between these marks and the original sample surface. Therefore, by comparing the grayscale change characteristics of the corresponding pixels between the grayscale images of the PPMA sample before and after polishing, that is, the grayscale change coefficient, the pixels with large change differences are screened out as suspected wear pixels.
[0047] Preferably, in some implementations of the embodiments of the present invention, according to the grayscale difference between the grayscale images of the PPMA samples before and after polishing, and the grayscale difference between the pixel point and the surrounding pixels in the grayscale image of the PPMA sample after polishing, the specific method for obtaining the grayscale variation coefficient of each pixel point is:
[0048] For any pixel in the grayscale image of the polished PPMA sample, the absolute value of the difference between the grayscale values of the pixel before and after polishing is recorded as the grayscale change value of the pixel;
[0049] The difference between 255 and the grayscale value of the pixel is recorded as the grayscale level value of the pixel;
[0050] According to the grayscale difference between the pixel point and the surrounding pixel points in the grayscale image of the polished PPMA sample, the neighborhood grayscale difference of the pixel point is obtained;
[0051] The ratio of the grayscale change value of the pixel point to the grayscale level value of the pixel point is recorded as the first ratio; the normalized value of the product of the first ratio and the neighborhood grayscale similarity of the pixel point is taken as the grayscale variation coefficient of the pixel point.
[0052] The specific formula is:
[0053] ;
[0054] In the formula, Represents the grayscale variation coefficient of the pixel; Represents the gray value of the pixel in the gray image of the PPMA sample before polishing; Represents the grayscale value of the pixel in the grayscale image of the polished PPMA sample; Indicates the grayscale difference of the pixel neighborhood; Indicates taking the absolute value; represents the linear normalization function.
[0055] It should be noted that, since there is a difference in grayscale between the polishing marks and the original sample surface, the greater the grayscale change value of the pixel, the greater the change in the grayscale of the pixel before and after polishing, and the more likely it is that it represents a pixel in the worn area; since the worn position of the PPMA material presents a white feature, the smaller the grayscale level value of the pixel, the more likely it is that the pixel is a pixel in the worn area; since the polishing area covers the entire PPMA sample surface, if the pixel is worn, then its neighboring pixels cannot avoid wear, so there is similarity between its grayscale and that of the neighboring pixels, that is, the smaller the difference in the neighboring grayscale, the more similar its grayscale is to that of the neighboring pixels, and the more likely it is that it represents a pixel in the worn area.
[0056] Preferably, in some implementations of the embodiments of the present invention, the specific method for obtaining the neighborhood grayscale difference of a pixel point is:
[0057] All pixels within the 8-neighborhood range of the pixel are recorded as comparison pixels of the pixel; for any comparison pixel of the pixel; the absolute value of the difference between the grayscale value of the pixel and the comparison pixel is recorded as the grayscale difference value of the comparison pixel; the average of the grayscale difference values of all comparison pixels of the pixel is taken as the neighborhood grayscale difference of the pixel.
[0058] The specific formula is:
[0059] ;
[0060] In the formula, Indicates the grayscale difference of the pixel neighborhood; Indicates the number of contrast pixels of a pixel; Represents the grayscale value of the pixel in the grayscale image of the polished PPMA sample; Indicates the pixel The gray value of the contrasting pixel in the gray image of the polished PPMA sample; Indicates taking the absolute value.
[0061] Preferably, in some implementations of the embodiments of the present invention, all pixels in the grayscale image of the polished PPMA sample are screened based on the grayscale variation coefficient to obtain a specific method of all suspected worn pixels:
[0062] Preset a suspected parameter , wherein this embodiment is based on This example is described as an example, and this embodiment is not specifically limited. Depends on the specific implementation situation;
[0063] For any pixel in the grayscale image of the polished PPMA sample, if the grayscale variation coefficient of the pixel is greater than or equal to the suspected parameter , and record the pixel as a suspected worn pixel.
[0064] At this point, all suspected worn pixels in the grayscale image of the polished PPMA sample are obtained through the above method.
[0065] Step S003: According to the grayscale variation coefficient of the suspected worn pixel point and the similarity of the gradient direction between the suspected worn pixel point and the surrounding pixels, the highlight selection factor of the suspected worn pixel point is obtained; based on the highlight selection factor, all suspected worn pixels are screened to obtain all worn pixels; according to the highlight selection factor and grayscale value of the worn pixel point, the surface roughness of the PPMA sample is obtained; according to the surface roughness, the wear degree of the PPMA sample is obtained.
[0066] It should be noted that since the suspected wear pixels not only include wear pixels, but also the refraction of the light source by the PPMA sample surface will produce highlight pixels that also meet the characteristic screening conditions of the suspected wear pixels, then if the wear resistance of the corresponding PPMA sample is evaluated based on all the suspected wear pixels, errors will occur, resulting in inaccurate evaluation results. Therefore, it is necessary to screen out the wear pixels from the suspected wear pixels based on the grayscale difference between the wear pixels and the highlight pixels, and then determine the surface roughness of all the wear pixels of the PPMA sample using the grayscale characteristics; finally, the wear degree of the PPMA sample is obtained based on the surface roughness.
[0067] 1. Obtain all the worn pixels in the grayscale image of the polished PPMA sample.
[0068] It should be noted that if the suspected worn pixel does not produce highlight features in the grayscale image of the PPMA sample before polishing, and appears as the grayscale of the black background, then the suspected worn pixel may show the following characteristics in the grayscale image of the PPMA sample after polishing: no wear and no highlight, it still presents the grayscale corresponding to the black background; if highlight features are produced, then the pixels in its local range will also show highlight features; wear has occurred, and milky white scratches will be produced at the worn position of the PPMA sample; since the grayscale variation coefficient of the pixel includes the grayscale characteristics of the pixel, the larger the grayscale variation coefficient of the suspected worn pixel, the greater the grayscale change of the suspected worn pixel, the larger the grayscale value, the whiter it appears, and the more likely it is to produce highlight features. At the same time, since the grayscale of the highlight area presents the same white characteristics, and the grayscale of the surrounding pixels is relatively uniform, then the maximum gradient direction corresponding to the surrounding pixels is also similar; then, based on this feature, the highlight selection factor of the suspected worn pixel is obtained, and all suspected worn pixels are screened to obtain the worn pixels.
[0069] Preferably, in some practical implementations of the present invention, the specific method for obtaining the highlight selection factor of the suspected worn pixel point according to the grayscale variation coefficient of the suspected worn pixel point and the similarity of the gradient direction between the suspected worn pixel point and the surrounding pixels is:
[0070] For any suspected worn pixel in the grayscale image of the polished PPMA sample, the neighborhood gradient similarity of the suspected worn pixel is obtained based on the similarity of the gradient direction between the suspected worn pixel and the surrounding pixels;
[0071] The ratio of the grayscale variation coefficient of the suspected wear pixel to the minimum value of the grayscale variation coefficient of all the suspected wear pixels in the grayscale image of the polished PPMA sample is used as the grayscale highlight feature value of the suspected wear pixel;
[0072] The normalized value of the product of the neighborhood gradient similarity of the suspected wear pixel and the grayscale highlight feature value is used as the highlight selection factor of the suspected wear pixel.
[0073] The specific formula is:
[0074] ;
[0075] In the formula, The highlight selection factor representing the suspected worn pixels; Represents the neighborhood gradient similarity of suspected wear pixels; Indicates the grayscale variation coefficient of suspected wear pixels; It represents the minimum value of the grayscale variation coefficient of all suspected worn pixels in the grayscale image of the polished PPMA sample; represents the linear normalization function.
[0076] It should be noted that the greater the neighborhood gradient similarity, the more similar the maximum gradient direction between the suspected wear pixel and the neighborhood pixel is, and the greater the possibility that the suspected wear pixel is a highlighted pixel, and the greater the possibility that the suspected wear pixel is a worn pixel; since the overall grayscale value of the pixels in the highlighted area is relatively large, the larger the grayscale highlight feature value of the suspected wear pixel, the greater the possibility that the suspected wear pixel is a highlighted pixel, and the greater the possibility that the suspected wear pixel is a worn pixel.
[0077] Preferably, in some practical aspects of the embodiments of the present invention, the specific method for obtaining the neighborhood gradient similarity of the suspected wear pixel point is:
[0078] All pixels within the 8-neighborhood range of the suspected wear pixel are recorded as reference pixels of the suspected wear pixel; for any reference pixel of the suspected wear pixel; the cosine value of the angle formed by the maximum gradient direction of the suspected wear pixel and the maximum gradient direction of the reference pixel is recorded as the gradient similarity value of the reference pixel; the average of the gradient similarity values of all reference pixels of the suspected wear pixel is taken as the neighborhood gradient similarity of the suspected wear pixel.
[0079] The specific formula is:
[0080] ;
[0081] In the formula, Represents the neighborhood gradient similarity of suspected wear pixels; The number of all reference pixels representing suspected worn pixels; Indicates the number of pixels suspected of wear. The cosine value of the angle between the maximum gradient direction of the reference pixel and the maximum gradient direction of the suspected wear pixel.
[0082] It should be noted that the smaller the angle between the maximum gradient direction of the reference pixel and the maximum gradient direction of the suspected wear pixel, the larger the cosine value, indicating that the maximum gradient directions of the two pixels are more similar, and the greater the similarity of the neighborhood gradients of the suspected wear pixel, indicating that the possibility that the suspected wear pixel is a highlighted pixel is greater, and the possibility that the suspected wear pixel is a wear pixel is greater.
[0083] Preferably, in some practical implementations of the present invention, all suspected worn pixels are screened based on the highlight selection factor, and the specific method for obtaining all worn pixels is:
[0084] Preset a selection parameter , wherein this embodiment is based on This example is described as an example, and this embodiment is not specifically limited. Depends on the specific implementation situation;
[0085] For any suspected worn pixel in the grayscale image of the polished PPMA sample, if the highlight selection factor of the suspected worn pixel is greater than or equal to the selection parameter , and record the suspected worn pixels as worn pixels.
[0086] At this point, all the worn pixels in the grayscale image of the polished PPMA sample are obtained.
[0087] 2. Obtain the surface roughness of PPMA samples.
[0088] It should be noted that the greater the average difference between the grayscale value of the worn pixel and the average grayscale value of all pixels in the grayscale image of the PPMA sample, the greater the grayscale difference of the worn pixel of the PPMA sample, and the greater the corresponding roughness; since the grayscale of the highlight pixel of the PPMA sample is more uniform, the smaller the highlight selectivity factor of the worn pixel, the greater the roughness.
[0089] Preferably, in some practical embodiments of the present invention, the specific method for obtaining the surface roughness of the PPMA sample according to the highlight selection factor and grayscale value of the worn pixel point is:
[0090] For any worn pixel in the grayscale image of the polished PPMA sample, the absolute value of the difference between the grayscale value of the worn pixel and the average grayscale value of all pixels in the grayscale image of the PPMA sample is recorded as the first difference of the worn pixel; the ratio of the first difference of the worn pixel to the highlight selection factor is recorded as the roughness factor of the worn pixel; the average of the roughness factors of all worn pixels in the grayscale image of the polished PPMA sample is taken as the surface roughness of the PPMA sample.
[0091] The specific formula is:
[0092] ;
[0093] In the formula, Indicates the surface roughness of the PPMA sample; Represents the number of all worn pixels in the grayscale image of the polished PPMA sample; Indicates Gray value of each worn pixel; Represents the average gray value of all pixels in the gray image of the PPMA sample; Indicates The highlight selection factor of each worn pixel; Indicates taking the absolute value.
[0094] At this point, the surface roughness of the PPMA sample was obtained.
[0095] 3. Obtain the wear extent of PPMA samples.
[0096] It should be noted that the surface roughness of the PPMA sample reflects the wear resistance of the PPMA sample. If the surface roughness is greater, it means that the grinding experiment has caused more serious wear on the PPMA sample, which means that the wear resistance of the PPMA sample is lower. At the same time, the wear area of the PPMA sample can also reflect the degree of wear. If the wear area is larger, it means that the wear resistance is lower.
[0097] Preferably, in some practical aspects of the embodiments of the present invention, the specific method for obtaining the wear degree of the PPMA sample according to the surface roughness is:
[0098] The ratio between the number of all worn pixels in the grayscale image of the polished PPMA sample and the number of all pixels in the grayscale image of the polished PPMA sample is recorded as the wear ratio of the PPMA sample;
[0099] The normalized value of the product of the surface roughness of the PPMA sample and the wear ratio of the PPMA sample is taken as the wear degree of the PPMA sample.
[0100] The specific formula is:
[0101] ;
[0102] In the formula, Indicates the degree of wear of the PPMA sample; Indicates the surface roughness of the PPMA sample; Represents the number of all worn pixels in the grayscale image of the polished PPMA sample; Represents the number of all pixels in the grayscale image of the polished PPMA sample; represents the linear normalization function.
[0103] So far, the wear degree of the PPMA sample is obtained by the above method.
[0104] Step S004: Screening the PPMA samples for abnormalities based on the degree of wear.
[0105] Preferably, in some practical aspects of the embodiments of the present invention, the specific method for screening PPMA samples for abnormalities by wear degree is:
[0106] Preset an exception parameter , wherein this embodiment is based on This example is described as an example, and this embodiment is not specifically limited. Depends on the specific implementation situation;
[0107] If the wear degree of the PPMA sample is greater than or equal to the abnormal parameter , the PPMA sample is recorded as an abnormal PPMA sample, and a hardening coating needs to be added to the surface of the PPMA sample to increase the hardness and wear resistance of the surface.
[0108] Through the above steps, the PPMA abnormality screening method based on image recognition is completed.
[0109] The present invention also proposes a PPMA anomaly screening system based on image recognition, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the PPMA anomaly screening method based on image recognition in steps S001 to S004 are implemented.
[0110] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present invention should be included in the protection scope of the present invention.
Claims
1. The PPMA abnormality screening method based on image recognition is characterized by: The method comprises the following steps: Get the grayscale images of the PPMA samples before and after polishing; According to the grayscale difference between the grayscale images of the PPMA samples before and after polishing, and the grayscale difference between the pixel point and the surrounding pixels in the grayscale image of the PPMA sample after polishing, the grayscale variation coefficient of each pixel point is obtained; based on the grayscale variation coefficient, all the pixels in the grayscale image of the polished PPMA sample are screened to obtain all the suspected worn pixels; According to the grayscale variation coefficient of the suspected worn pixel and the similarity of the gradient direction between the suspected worn pixel and the surrounding pixels, the highlight selection factor of the suspected worn pixel is obtained; based on the highlight selection factor, all suspected worn pixels are screened to obtain all worn pixels; according to the highlight selection factor and grayscale value of the worn pixel, the surface roughness of the PPMA sample is obtained; according to the surface roughness, the wear degree of the PPMA sample is obtained; The PPMA samples were screened for abnormalities by the degree of wear; Among them, the method for obtaining the highlight selection factor of the suspected wear pixel is as follows: for any suspected wear pixel in the grayscale image of the polished PPMA sample, the neighborhood gradient similarity of the suspected wear pixel is obtained according to the similarity of the gradient direction between the suspected wear pixel and the surrounding pixels; the ratio between the grayscale variation coefficient of the suspected wear pixel and the minimum value of the grayscale variation coefficient of all suspected wear pixels in the grayscale image of the polished PPMA sample is used as the grayscale highlight feature value of the suspected wear pixel; the normalized value of the product of the neighborhood gradient similarity of the suspected wear pixel and the grayscale highlight feature value is used as the highlight selection factor of the suspected wear pixel; Among them, the method for obtaining the neighborhood gradient similarity of suspected wear pixels is as follows: all pixels within the 8-neighborhood range of the suspected wear pixel are recorded as reference pixels of the suspected wear pixel; for any reference pixel of the suspected wear pixel; the cosine value of the angle formed by the maximum gradient direction of the suspected wear pixel and the maximum gradient direction of the reference pixel is recorded as the gradient similarity value of the reference pixel; the average of the gradient similarity values of all reference pixels of the suspected wear pixel is taken as the neighborhood gradient similarity of the suspected wear pixel.
2. The PPMA abnormality screening method based on image recognition according to claim 1, characterized in that: The grayscale variation coefficient of each pixel is obtained according to the grayscale difference between the grayscale images of the PPMA sample before and after polishing, and the grayscale difference between the pixel and the surrounding pixels in the grayscale image of the PPMA sample after polishing, including the specific method of: For any pixel in the grayscale image of the polished PPMA sample, the absolute value of the difference between the grayscale values of the pixel before and after polishing is recorded as the grayscale change value of the pixel; The difference between 255 and the grayscale value of the pixel is recorded as the grayscale level value of the pixel; According to the grayscale difference between the pixel point and the surrounding pixel points in the grayscale image of the polished PPMA sample, the neighborhood grayscale difference of the pixel point is obtained; The ratio of the grayscale change value of the pixel point to the grayscale level value of the pixel point is recorded as a first ratio; The normalized value of the product of the first ratio and the neighborhood grayscale similarity of the pixel point is used as the grayscale variation coefficient of the pixel point.
3. The PPMA abnormality screening method based on image recognition according to claim 2, characterized in that: The specific method of obtaining the neighborhood grayscale difference of the pixel point includes: All pixels within the 8-neighborhood range of the pixel are recorded as comparison pixels of the pixel; for any comparison pixel of the pixel; the absolute value of the difference between the grayscale value of the pixel and the comparison pixel is recorded as the grayscale difference value of the comparison pixel; the average of the grayscale difference values of all comparison pixels of the pixel is taken as the neighborhood grayscale difference of the pixel.
4. The PPMA abnormality screening method based on image recognition according to claim 1, characterized in that: The method of screening all pixel points in the grayscale image of the polished PPMA sample based on the grayscale variation coefficient to obtain all suspected wear pixel points includes: A suspected parameter T1 is preset. For any pixel in the grayscale image of the polished PPMA sample, if the grayscale variation coefficient of the pixel is greater than or equal to the suspected parameter T1, the pixel is recorded as a suspected wear pixel.
5. The PPMA abnormality screening method based on image recognition according to claim 1, characterized in that: The specific method of screening all suspected worn pixels based on the highlight selection factor to obtain all worn pixels is as follows: A selection parameter T2 is preset. For any suspected worn pixel in the grayscale image of the polished PPMA sample, if the highlight selection factor of the suspected worn pixel is greater than or equal to the selection parameter T2, the suspected worn pixel is recorded as a worn pixel.
6. The PPMA abnormality screening method based on image recognition according to claim 1, characterized in that: The specific method for obtaining the surface roughness of the PPMA sample according to the highlight selection factor and grayscale value of the worn pixel point is as follows: For any worn pixel in the grayscale image of the polished PPMA sample, the absolute value of the difference between the grayscale value of the worn pixel and the average grayscale value of all pixels in the grayscale image of the PPMA sample is recorded as the first difference of the worn pixel; the ratio of the first difference of the worn pixel to the highlight selection factor is recorded as the roughness factor of the worn pixel; the average of the roughness factors of all worn pixels in the grayscale image of the polished PPMA sample is taken as the surface roughness of the PPMA sample.
7. The PPMA abnormality screening method based on image recognition according to claim 1, characterized in that: The specific method for obtaining the wear degree of the PPMA sample according to the surface roughness is as follows: The ratio between the number of all worn pixels in the grayscale image of the polished PPMA sample and the number of all pixels in the grayscale image of the polished PPMA sample is recorded as the wear ratio of the PPMA sample; The normalized value of the product of the surface roughness of the PPMA sample and the wear ratio of the PPMA sample is taken as the wear degree of the PPMA sample.
8. A PPMA abnormality screening system based on image recognition, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the steps of the PPMA abnormality screening method based on image recognition as described in any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Textile bobbin yarn detection method based on computer vision
CN115063424A
Transformer welding seam quality detection method for image processing
CN116309579A
PS sheet wear resistance detection method based on image processing
CN116385450A