A surface image precision identification method, device and medium for medical instrument production

By adopting image acquisition at different angles and light intensities combined with grayscale value screening and grid division in medical film production, and dynamically adjusting the detection method, the problem of low detection efficiency is solved and efficient and accurate surface defect detection is achieved.

CN120219338BActive Publication Date: 2025-10-24ZHONGSHAN JINGYAN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510305495.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-14
Publication Date
2025-10-24
Estimated Expiration
2045-03-14

AI Technical Summary

Technical Problem

Existing medical device surface inspection technology also performs comprehensive image acquisition and analysis on films that are obviously defect-free during medical film production, resulting in low inspection efficiency, serious waste of resources, and a lack of dynamic adjustment capabilities.

Method used

By acquiring images at different angles and adjusting the light intensity for initial and secondary inspections, and utilizing image grayscale screening and grid division, the inspection method is dynamically adjusted to reduce the image acquisition and analysis of defect-free films.

Benefits of technology

It improves detection efficiency, reduces resource waste, increases the accuracy and speed of defect identification, and ensures comprehensive detection of surface defects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120219338B_ABST
    Figure CN120219338B_ABST
Patent Text Reader

Abstract

The application discloses a kind of medical instrument production with surface image precision identification method, equipment and medium, it is related to medical instrument surface detection technical field, including the following steps: based on different angles to medical film first image acquisition processing, obtain first surface image data;According to first surface image data, surface defect preliminary inspection processing is carried out, and the surface condition of medical film is obtained;According to the surface condition of medical film, second image acquisition processing is carried out, and second surface image data is obtained;According to second surface image data, surface defect re-inspection processing is carried out, and the defect condition of medical film is obtained;The present application is used to solve the problem that the existing medical instrument surface detection technology detects surface defect by image in medical film production, for the film without obvious defect, also will not adjust detection method, lack of dynamic adjustment ability according to actual situation, lead to the problem of low detection efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of medical device surface detection, in particular to a surface image precision identification method, device and medium for medical device production. BACKGROUND

[0002] Medical device surface detection technology is a technical system that uses various technical means and methods to identify, locate and evaluate various conditions that do not meet quality standards and design requirements on the surface of medical devices, aiming to ensure the safety, reliability and effectiveness of medical devices.

[0003] When the existing medical device surface detection technology detects surface defects through images in medical film production, in order to fully capture various defects that may exist on the medical film, multiple images need to be collected from different angles, which greatly increases the time required to collect image data for each film. The probability of defects in medical films is relatively low, and a large number of medical films are actually defect-free in the production process, but they still need to be subjected to the same multi-picture collection operation as films that may have defects, and processing and analyzing a large number of collected images requires a large amount of computing resources. Since most films are defect-free, the feature extraction, analysis and other operations performed on the images of these films are actually a waste of computing resources. For example, in the patent application with publication number CN114926441A, a defect detection method and system for injection molding are disclosed. This scheme is similar to the above situation, and a large number of defect-free images need to be carefully processed and analyzed, wasting a lot of time and resources. Therefore, when the existing medical device surface detection technology detects surface defects through images in medical film production, it does not adjust the detection method for films that are obviously defect-free, and lacks the ability to dynamically adjust according to actual conditions, resulting in low detection efficiency. SUMMARY

[0004] The present application aims to at least partially solve one of the technical problems in the prior art. By performing first image collection and processing of medical films based on different angles; and performing preliminary surface defect detection processing to obtain the surface condition of the medical film; performing second image collection and processing based on the surface condition of the medical film; and performing secondary surface defect detection processing to obtain the defect condition of the medical film; the problem of low detection efficiency caused by the lack of ability to dynamically adjust according to actual conditions when the existing medical device surface detection technology detects surface defects through images in medical film production is solved.

[0005] To achieve the above-mentioned purpose, in a first aspect, the present application provides a surface image precision identification method for medical device production, comprising the following steps:

[0006] First image acquisition processing is performed on the medical film based on different angles to obtain first surface image data;

[0007] Surface defect preliminary inspection processing is performed according to the first surface image data to obtain the surface condition of the medical film;

[0008] Second image acquisition processing is performed according to the surface condition of the medical film to obtain second surface image data;

[0009] Surface defect secondary inspection processing is performed according to the second surface image data to obtain the defect condition of the medical film.

[0010] Further, the first image acquisition processing based on different angles on the medical film to obtain the first surface image data includes the following sub-steps:

[0011] A medical film image acquisition device is set, including: setting an image acquisition device directly above the geometric center of the medical film, and uniformly setting four same light sources obliquely above the medical film, which are respectively recorded as a first light source, a second light source, a third light source and a fourth light source in clockwise order, and the four light sources have the same rotation angle in the clockwise direction.

[0012] Further, the first image acquisition processing based on different angles on the medical film to obtain the first surface image data includes the following sub-steps:

[0013] For any medical film to be identified, according to the medical film image acquisition device, only the first light source is turned on, and the light intensity of the first light source is set to A0; then an image of the medical film is acquired by using the image acquisition device, which is recorded as an initial debugging image;

[0014] The average gray value of all pixel points in the initial debugging image is calculated, which is recorded as H0; it is judged whether H0 satisfies H1

[0015] According to the medical film image acquisition device, only the first light source is turned on, and the light intensity of the first light source is set to the appropriate light intensity, and an image of the medical film is acquired by using the image acquisition device, which is recorded as a first preliminary inspection image 1; then only the second light source is turned on, and the light intensity of the second light source is set to the appropriate light intensity, and an image of the medical film is acquired by using the image acquisition device, which is recorded as a first preliminary inspection image 2; after completion, the first preliminary inspection image 1 and the first preliminary inspection image 2 are recorded as the first surface image data.

[0016] Further, the surface defect preliminary inspection processing according to the first surface image data to obtain the medical film surface condition includes the following sub-steps:

[0017] The size of the division grid is set as b1, and the first preliminary inspection image 1 and the first preliminary inspection image 2 are respectively subjected to grid division processing, and after the processing, the to-be-inspected grid image 1 and the to-be-inspected grid image 2 are obtained in sequence;

[0018] The grid division processing includes: for any one image of the medical film, denoted as the first division image, the image area corresponding to the medical film in the first division image is divided, denoted as the medical film area, and the image area of the non-medical film area is removed respectively, and after the processing, the second division image is obtained;

[0019] The second division image is subjected to grid division by using the division grid, and the divided grid areas are sequentially denoted as C1-Cn from left to right and from top to bottom.

[0020] Further, the surface defect preliminary inspection processing according to the first surface image data to obtain the medical film surface condition includes the following sub-steps:

[0021] The to-be-inspected grid image 1 and the to-be-inspected grid image 2 are respectively subjected to defect grid screening processing, and the preliminary inspection grid image 1 and the preliminary inspection grid image 2 are obtained;

[0022] The defect grid screening processing includes: for any one to-be-inspected grid image, denoted as the first grid image, for any one grid area in the first grid image, denoted as the grid Ci; the gray values corresponding to all pixels in the grid Ci are arranged in ascending order, denoted as the Ci gray sequence;

[0023] The threshold ratios k1% and k2% are set, and k2%>k1%; the smallest k2% gray value and the largest k2% gray value in the Ci gray sequence are removed, and the average value of the remaining gray values is calculated, denoted as the first reference value; the average value of the smallest k1% gray value in the Ci gray sequence is calculated, denoted as the first defect value; the average value of the largest k1% gray value in the Ci gray sequence is calculated, denoted as the second defect value; the absolute value of the difference between the first defect value and the first reference value is calculated, denoted as the first characteristic value; and the absolute value of the difference between the second defect value and the first reference value is calculated, denoted as the second characteristic value; the larger value between the first characteristic value and the second characteristic value is marked as the defect characteristic value of the grid Ci, denoted as the Ci defect characteristic value;

[0024] Obtaining the defect feature values of all grid regions in the first grid image, and sorting them in ascending order, denoted as the first feature value sequence; setting a threshold proportion k3%, removing the smallest k3% of the defect feature values and the largest k3% of the defect feature values in the first feature value sequence, and calculating the average value and the standard deviation of the remaining defect feature values, denoted as D0 and D1 in order; for any defect feature value in the first feature value sequence, denoted as TD, if TD satisfies TD<[D0-k4*D1] or satisfies TD>[D0+k4*D1], the grid region corresponding to TD is marked as a defective grid, otherwise the grid region corresponding to TD is marked as a normal grid; wherein k4 is a set threshold proportion; repeating the obtaining of all defective grids and normal grids in the first grid image;

[0025] If there is no defective grid in the preliminary inspection grid image 1 and the preliminary inspection grid image 2, the medical film to be identified is marked as having no defect, otherwise it is marked as having a defect.

[0026] Further, the second image acquisition processing is performed according to the surface condition of the medical film to obtain the second surface image data, including the following sub-steps:

[0027] For the medical film to be identified with defects, the medical film image acquisition device is used to acquire the second surface image data; including: setting the light intensities of the first light source, the second light source, the third light source and the fourth light source as E1, E2, E3 and E4 in order, wherein, Aw>E1>E2>E3>E4>Am; sequentially turning on only the first light source, the second light source, the third light source and the fourth light source, and acquiring the surface image of the medical film each time, obtaining the second inspection image 1, the second inspection image 2, the second inspection image 3 and the second inspection image 4 in order, denoted as the second surface image data.

[0028] Further, the surface defect second inspection processing is performed according to the second surface image data to obtain the defect condition of the medical film, including the following sub-steps:

[0029] Setting the size of the divided grid as b2, and performing grid division processing on the second inspection image 1, the second inspection image 2, the second inspection image 3 and the second inspection image 4 respectively, and obtaining the second inspection grid image 1, the second inspection grid image 2, the second inspection grid image 3 and the second inspection grid image 4 in order after completion, denoted as the second inspection grid image 1-4;

[0030] According to the position area of the defect grid in the first inspection grid image 1 and the first inspection grid image 2, the corresponding position area in the second inspection grid image 1-4 is recorded as a possible defect area; and the area outside the possible defect area in the second inspection grid image 1-4 is recorded as a normal area, and the first reference processing is performed on the normal area; including: for any one normal area, the gray values of all pixel points in the normal area are arranged in ascending order and recorded as a first normal sequence, the first normal sequence is divided into k5 subsequences, and the first subsequence and the last subsequence are removed, and after completion, a second normal sequence is obtained, the average value of the second normal sequence is calculated and recorded as a second inspection reference gray value corresponding to the second inspection grid image.

[0031] Further, the second surface image data is used to perform the second inspection processing of the surface defects, and the defect condition of the medical film obtained further includes the following sub-steps:

[0032] The grid areas in the possible defect areas of the second inspection grid images 1-4 are sorted according to the serial numbers of the corresponding images, and recorded as a grid area sequence; and the first defect processing is performed on any one grid area sequence;

[0033] The first defect processing includes: for any one grid area in the grid area sequence, recorded as a first grid area; the gray values corresponding to all pixel points in the first grid area are arranged in ascending order and recorded as a first gray sequence, the smallest k6 gray values and the largest k6 gray values in the first gray sequence are removed, and then the average values of the smallest k7 gray values and the largest k7 gray values in the remaining first gray sequence are obtained and recorded in order as the minimum average value and the maximum average value;

[0034] The difference between the minimum average value and the corresponding second inspection reference gray value is calculated and recorded as a first difference value, and the difference between the maximum average value and the corresponding second inspection reference gray value is calculated and recorded as a second difference value; the absolute value of the larger one of the first difference value and the second difference value is marked as the defect feature difference value of the corresponding grid area; the defect feature difference values of all grid areas in the grid area sequence are repeatedly obtained, and the grid area corresponding to the defect feature difference value with the largest absolute value is marked as a defect suspected area;

[0035] All the defect suspected areas in the second inspection grid images 1-4 are repeatedly obtained; and the second defect processing is performed on all the defect suspected areas;

[0036] The second defect processing includes: for any one defect suspected area recorded as a first suspected area, acquiring defect feature difference values of f1 grid areas closest to the defect suspected area in the two-inspection grid image where the first suspected area is located, recorded as a feature difference value sequence, calculating the average value and the standard deviation of k8 defect feature difference values closest to 0 in the feature difference value sequence, recorded as G1 and G2 in sequence respectively; acquiring the defect feature difference value of the first suspected area recorded as Q; if Q is not in [G1-p*G2, G1+p*G2], the corresponding defect suspected area is marked as a defective area, otherwise, it is marked as a non-defective area;

[0037] The defective areas in the two-inspection grid images 1-4 are repeatedly acquired, and the corresponding positions in the two-inspection image 1, the two-inspection image 2, the two-inspection image 3 and the two-inspection image 4 are marked, recorded as a medical film defect situation.

[0038] In a second aspect, the present application provides an electronic device, comprising a processor and a memory, wherein the memory stores computer readable instructions, and when the computer readable instructions are executed by the processor, the steps in the above method are executed.

[0039] In a third aspect, the present application provides a storage medium, which stores a computer program, and when the computer program is executed by a processor, the steps in the above method are executed.

[0040] The present application has the following advantages: the present application performs first image acquisition and processing on the medical film based on different angles to obtain first surface image data; performs surface defect preliminary inspection processing according to the first surface image data to obtain a medical film surface condition; performs second image acquisition and processing according to the medical film surface condition to obtain second surface image data; and performs surface defect secondary inspection processing according to the second surface image data to obtain a medical film defect situation; when detecting surface defects in the production of medical films, the detection method can be dynamically adjusted for films that obviously have no defects, the waste of detection resources is reduced, and the detection efficiency is improved;

[0041] The present application has the following advantages: the present application can reduce a large amount of image acquisition and image analysis of non-defective medical films, improve detection efficiency, and quickly detect whether the surface of the medical film has defects and the approximate position of the defects by performing defect grid screening processing on the image gray value of the initially acquired image and comprehensively judging; the present application can more comprehensively detect surface defects, avoid information loss or misjudgment under a single illumination angle and intensity, and improve defect recognition accuracy by acquiring images of defective medical films under different angles and different illumination intensities and then analyzing and processing according to the gray scale change and the gray scale characteristics. Brief Description of the Drawings

[0042] Figure 1 It is a flowchart of the steps of the method of the present invention;

[0043] Figure 2 It is a schematic structural diagram of the medical film image acquisition device of the present invention;

[0044] Figure 3 It is a flowchart of the initial inspection and treatment of surface defects of the present invention;

[0045] Figure 4 It is a schematic structural diagram of the electronic device of the present invention. Detailed Embodiments

[0046] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0047] Embodiment 1, please refer to Figure 1 As shown, the present application provides a method for precise recognition of surface images for medical device production, including the following steps: [[ID=2,8]] [0000108]]

[0048] Step S1, perform first image acquisition processing on the medical film from different angles to obtain first surface image data; Step S1 includes the following sub-steps:

[0049] Step S101, set up a medical film image acquisition device, including: please refer to Figure 2 As shown, set an image acquisition device directly above the geometric center of the medical film, and evenly set four identical light sources obliquely above the medical film. They are respectively denoted as the first light source, the second light source, the third light source, and the fourth light source in the clockwise order, and make the rotation angles of the four light sources the same in the clockwise direction, that is, each rotation angle is 90°;

[0050] Step S102, for any medical film to be recognized, according to the medical film image acquisition device, only turn on the first light source and set the illumination intensity of the first light source to A0; then use the image acquisition device to acquire an image of a medical film, denoted as the initial debugging image, and A0 can be set according to the actual application scenario;

[0051] Step S103, calculate the grayscale average value of all pixel points in the initial debugging image, denoted as H0; determine whether H0 satisfies H1 < H0 < H2. If it is satisfied, record the illumination intensity of A0 as the appropriate illumination intensity;

[0052] Step S104, if not satisfied, according to H0≤H1 or H0≥H2 corresponding to the increase or decrease in the size of A0, until the appropriate light intensity is obtained, wherein H1 is set to dark gray threshold, H2 is set to bright gray threshold; and H0=H1 and H0=H2 corresponding to the light intensity is obtained, respectively, Am and Aw; in this embodiment, H1 is 80, H2 is 170, the gray value range is 0-255;

[0053] Step S105, according to the medical film image acquisition device, only open the first light source, and set the light intensity of the first light source to the appropriate light intensity, and use the image acquisition device to collect a medical film image, denoted as the first initial inspection image 1;

[0054] Step S106, only open the second light source, and set the light intensity of the second light source to the appropriate light intensity, and use the image acquisition device to collect a medical film image, denoted as the first initial inspection image 2; after completion, the first initial inspection image 1 and the first initial inspection image 2 are recorded as the first surface image data;

[0055] In the specific implementation process, by collecting two images at different angles and rotating the included angle by 90°, the advantage is that because the light reflection and shadow effect at different angles are different, some defects that are not obvious at a certain angle may be more prominent at another angle due to the effect of light; for example, some small scratches or depressions may have a smaller gray difference with the surrounding area at a certain angle, but in images at other angles, due to the different incident angles of light, they may produce obvious shadows or highlights, so they are more easily identified; combining the information of the two images, the defect characteristics at different angles can be integrated to improve the accuracy of defect identification and reduce the situation of missed detection and false detection; if the rotation included angle of the two images is 180°, the two images collected have high repeatability, because the two perspectives are opposite, the content seen is basically symmetrical, only the left and right are reversed; while the two perspectives of the rotation included angle of 90° are different, the information of different sides can be obtained, the information redundancy is reduced, and more diverse image data is provided, which is helpful for more comprehensive analysis of the surface condition of the medical film.

[0056] Step S2, please refer to Figure 3 shown, according to the first surface image data, the surface defect initial inspection processing is carried out, and the surface condition of the medical film is obtained; step S2 includes the following substeps:

[0057] Step S201, setting the size of the division grid as b1, respectively performing grid division processing on the first preliminary inspection image 1 and the first preliminary inspection image 2, and obtaining the to-be-inspected grid image 1 and the to-be-inspected grid image 2 in sequence after completion; the size and shape of the division grid can be set according to the resolution of the collected image, and the image can be generally divided into 8 to 16 grids;

[0058] Step S202, grid division processing; step S202 includes the following sub-steps:

[0059] Step S2021, for any image of a medical film, denoted as a first division image, dividing the image area corresponding to the medical film in the first division image, denoted as a medical film area, and respectively removing the image area of the non-medical film area, obtaining a second division image after completion;

[0060] Step S2022, performing grid division on the second division image by using the division grid, and sequentially denoting the divided grid areas as C1-Cn from left to right and from top to bottom; when dividing, it is required to ensure that the grid areas of the same sequence number in the two to-be-inspected grid images correspond to the same area on the medical film, for example, the actual areas represented by C1 of the to-be-inspected grid image 1 and C1 of the to-be-inspected grid image 2 are consistent;

[0061] Step S203, performing defect grid screening processing on the to-be-inspected grid image 1 and the to-be-inspected grid image 2 respectively, and obtaining the preliminary inspection grid image 1 and the preliminary inspection grid image 2;

[0062] Step S204, defect grid screening processing; step S204 includes the following sub-steps:

[0063] Step S2041, for any to-be-inspected grid image, denoted as a first grid image, for any grid area in the first grid image, denoted as a grid Ci; arranging the gray values corresponding to all pixels in the grid Ci in ascending order, and denoted as a Ci gray sequence;

[0064] Step S2042, setting threshold ratios k1% and k2%, k2%>k1%; removing the gray values of k2% with the smallest and k2% with the largest in the Ci gray sequence, and calculating the average value of the remaining gray values, denoted as a first reference value; in this embodiment, k2%=20%, the purpose is to remove the gray values related to the defect area in the Ci gray sequence, and the extreme gray values affected by noise, reflection or other factors, so as to obtain the normal gray values of the normal surface;

[0065] Step S2043, the average value of the minimum k1% gray value in the Ci gray sequence is calculated as a first defect value, and the average value of the maximum k1% gray value in the Ci gray sequence is calculated as a second defect value; in this embodiment, k2%=8%,

[0066] Step S2044, the absolute value of the difference between the first defect value and the first reference value is calculated as a first characteristic value, and the absolute value of the difference between the second defect value and the first reference value is calculated as a second characteristic value; the larger value between the first characteristic value and the second characteristic value is marked as a defect characteristic value of the grid Ci, which is recorded as Ci defect characteristic value;

[0067] Step S2045, the defect characteristic values of all grid regions in the first grid image are obtained and sorted in ascending order, which is recorded as a first characteristic value sequence; a threshold proportion k3% is set, and the minimum k3% of the defect characteristic values in the first characteristic value sequence and the maximum k3% of the defect characteristic values are removed, in this embodiment, k3%=15%, the purpose is to obtain the defect characteristic values of normal grid regions; and the average value and the standard deviation of the remaining defect characteristic values are calculated in order, which are recorded as D0 and D1;

[0068] Step S2046, for any defect characteristic value in the first characteristic value sequence, recorded as TD, if TD satisfies TD<[D0-k4*D1] or satisfies TD>[D0+k4*D1], the grid region corresponding to TD is marked as a defect grid, otherwise the grid region corresponding to TD is marked as a normal grid; wherein k4 is a set threshold proportion; repeat to obtain all defect grids and normal grids in the first grid image;

[0069] Step S205, if there is no defect grid in the first inspection grid image 1 and the first inspection grid image 2, the medical film to be identified is marked as no defect, otherwise it is marked as defective;

[0070] In the specific implementation process, after the image is divided into grids, the gray value characteristics in each grid can be observed in more detail. Different grids may contain different image details, and by analyzing the gray value characteristics in each grid, more subtle changes in the image can be captured. Some features that are not easy to detect in the overall image may become more obvious at the grid scale. Taking whether there is a defect grid as the basis for judgment, without complex algorithms or a large amount of data analysis, the conclusion can be quickly drawn, improving the detection efficiency; and analyzing two images collected at different angles ensures the detection accuracy.

[0071] Step S3, according to the surface condition of the medical film, a second image acquisition and processing is performed to obtain second surface image data; step S3 includes the following sub-steps:

[0072] Step S301, collecting second surface image data of the defective medical film to be identified by using the medical film image acquisition device; including: setting the light intensity of the first light source, the second light source, the third light source and the fourth light source as E1, E2, E3 and E4 in order, wherein, Aw>E1>E2>E3>E4>Am; E1, E2, E3 and E4 can be set according to the light condition of the actual application scene;

[0073] Step S302, sequentially turning on the first light source, the second light source, the third light source and the fourth light source, and collecting the surface image of the medical film when each light source is turned on, and obtaining the second surface image data by sequentially obtaining the second image 1, the second image 2, the second image 3 and the second image 4; that is, when one light source is turned on, the other three light sources are kept off;

[0074] In the specific implementation process, the relative positions of the light source, the medical film and the image acquisition device are kept unchanged when collecting the first surface image data and the second surface image data; in this way, the grid areas corresponding to the same position on different images are consistent when the grid is divided; the types of defects on the surface of the medical film are various, different intensity light sources can highlight different types of defects, and different intensity light sources can illuminate the surface of the medical film from different angles, so that various defects can be highlighted under different lightings; 4 images under different light intensities, and observing the same defect from different angles can more comprehensively and accurately judge the nature, position and range of the defect, improve the defect identification accuracy, and reduce misjudgment and omission.

[0075] Step S4, performing surface defect double-checking processing according to the second surface image data to obtain the defect condition of the medical film; step S4 includes the following substeps:

[0076] Step S401, setting the size of the divided grid as b2, b2 is smaller than b1, and performing grid division processing on the second image 1, the second image 2, the second image 3 and the second image 4, respectively, and obtaining the second grid image 1, the second grid image 2, the second grid image 3 and the second grid image 4 in order after completion, and recording them as the second grid image 1-4;

[0077] Step S402, according to the position area of the defect grid in the first checking grid image 1 and the first checking grid image 2, recording the corresponding position area in the second grid image 1-4 as a possible defect area; and recording the area outside the possible defect area in the second grid image 1-4 as a normal area, and performing first reference processing on the normal area;

[0078] Step S403, the first reference processing includes: for any one normal region, arranging the gray values of all pixel points in the normal region in ascending order, denoted as a first normal sequence, dividing the first normal sequence into k5 sub-sequences, and removing the first sub-sequence and the last sub-sequence, obtaining a second normal sequence after completion, calculating the average value of the second normal sequence, denoted as a two-inspection reference gray value corresponding to the two-inspection grid image; in this embodiment, k5 is 5, that is, only 60% of the data in the middle of the first normal sequence is retained, mainly to remove extreme gray values affected by noise, reflection or other factors;

[0079] Step S404, arranging the grid regions in the same position in the possible defect area of the two-inspection grid image 1-4 according to the serial number of the corresponding image, denoted as a grid region sequence; performing first defect processing on any one grid region sequence;

[0080] Step S405, first defect processing; step S405 includes the following sub-steps:

[0081] Step S4051, for any one grid region in the grid region sequence, denoted as a first grid region; arranging the gray values corresponding to all pixel points in the first grid region in ascending order, denoted as a first gray sequence;

[0082] Step S4052, removing the smallest k6 gray values and the largest k6 gray values in the first gray sequence, and then obtaining the average value of the smallest k7 gray values and the average value of the largest k7 gray values in the remaining first gray sequence, denoted as the minimum average value and the maximum average value in order; in this embodiment, k6 is 2, mainly to remove extreme gray values affected by noise, reflection or other factors; k7 is 5, mainly to screen out the gray values of the defect area, the gray values of the defect area are often different from the gray values of the normal area, which may be larger or smaller;

[0083] Step S4053, calculating the difference between the minimum average value and the corresponding two-inspection reference gray value, denoted as a first difference value, and calculating the difference between the maximum average value and the corresponding two-inspection reference gray value, denoted as a second difference value;

[0084] Step S4054, mark the value with larger corresponding absolute value in the first difference value and the second difference value as the defect feature difference value of the corresponding grid area; that is, first calculate the absolute values of the first difference value and the second difference value, and then compare; repeat to obtain the defect feature difference values of all grid areas in the grid area sequence, and mark the grid area corresponding to the defect feature difference value with the largest corresponding absolute value as a defect suspected area; the obvious degree of the defect at the same position under different angles and different illumination intensities is different, that is, the obvious degree in the two-inspection grid images 1-4 is different; and the grid area corresponding to the defect feature difference value with the largest corresponding absolute value is the most obvious case of the defect in the grid area sequence;

[0085] Step S406, repeat to obtain all defect suspected areas in the two-inspection grid images 1-4; and perform a second defect processing on all defect suspected areas;

[0086] Step S407, the second defect processing includes the following sub-steps:

[0087] Step S4071, for any one defect suspected area, mark it as a first suspected area, obtain the defect feature difference values of f1 grid areas closest to the defect suspected area in the two-inspection grid image where the first suspected area is located, and mark them as a feature difference value sequence; in this embodiment, f1 is 8;

[0088] Step S4072, calculate the average value and the standard deviation of the k8 defect feature difference values closest to 0 in the feature difference value sequence, and mark them as G1 and G2 in order; obtain the defect feature difference value of the first suspected area and mark it as Q; if Q is not in [G1-p*G2, G1+p*G2], mark the corresponding defect suspected area as a defective area, otherwise mark it as a non-defective area, where p is a set proportion coefficient; in this embodiment, k8 is 10 and p is 2; because the grid in the surface defect preliminary inspection processing is relatively large, although it is determined that a certain grid area has a defect in the processing, the defect is often relatively small, so most of the grid areas are normal areas, that is, most of the grid areas divided in the surface defect two-inspection processing in the possible defect area are normal areas; and the defect feature difference values of the normal areas should fluctuate around 0, so these normal area defect feature difference values can be screened out for comparison and analysis to determine the defect area;

[0089] Step S408, repeat to obtain all defective areas in the two-inspection grid images 1-4, and mark the corresponding positions in the two-inspection images 1, 2, 3 and 4 as medical film defect conditions;

[0090] In the specific implementation process, the surface defect preliminary inspection processing is to detect whether the medical film surface has defects, and the surface defect secondary inspection processing is to further identify the position of the defects and the involved area.

[0091] Embodiment 2, please refer to Figure 4 As shown in the figure, Figure 4 An example of a schematic diagram of an electronic device can include: a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface, the memory complete the communication among each other through the communication bus. The memory stores computer readable instructions, and the processor can call the instructions in the memory, when the computer readable instructions are executed by the processor, run as a step in a kind of surface image precision identification method for medical instrument production, to realize the following functions: based on different angles, first image acquisition processing is carried out on medical film, and first surface image data is obtained;According to the first surface image data, surface defect preliminary inspection processing is carried out, and the surface condition of medical film is obtained;According to the surface condition of medical film, second image acquisition processing is carried out, and second surface image data is obtained;According to the second surface image data, surface defect secondary inspection processing is carried out, and the defect condition of medical film is obtained.

[0092] In addition, the logic instructions in the memory described above can be realized in the form of software functional units and sold or used as independent products when used, which can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the parts that make contributions to the prior art or parts of the technical solutions can be embodied in the form of software products, and the computer software product stored in a storage medium includes a plurality of instructions for making a computer device (which can be a personal computer, server or network device, etc.) execute all or part of the steps of the method described in various embodiments of the present application. The foregoing storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk and various program code storage media.

[0093] Embodiment 3, the present application also provides a computer readable storage medium, the present application provides a storage medium, which stores a computer program, and the computer program is executed by the processor, runs as a step in a kind of surface image precision identification method for medical instrument production described above, to realize the following functions: based on different angles, first image acquisition processing is carried out on medical film, and first surface image data is obtained;According to the first surface image data, surface defect preliminary inspection processing is carried out, and the surface condition of medical film is obtained;According to the surface condition of medical film, second image acquisition processing is carried out, and second surface image data is obtained;According to the second surface image data, surface defect secondary inspection processing is carried out, and the defect condition of medical film is obtained.

[0094] Through the description of the above embodiments, the embodiments of the present application can be provided as a method, a system or a computer program product. Based on such understanding, the above technical solutions can be embodied in the form of a software product, which can be stored in a computer readable storage medium, such as a ROM / RAM, a magnetic disk, an optical disk, etc., and includes a plurality of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute the methods described in the various embodiments or some parts of the embodiments.

[0095] In the embodiments provided by the present application, it should be understood that the disclosed system or method can be implemented in other manners. The above described embodiments are merely exemplary, for example, the division of modules or units can be different from the above, the implementation can be combined or integrated in other manners, and some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the modules or units can be electrical, mechanical or other forms.

[0096] Finally, it should be noted that the above embodiments are merely used to illustrate the technical solutions of the present application, rather than limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still make modifications to the technical solutions recorded in the foregoing embodiments, or make equivalent replacements to some technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A surface image precision recognition method for medical device production, characterized by, The method comprises the following steps: The first image acquisition processing is performed on the medical film based on different angles to obtain first surface image data; The surface defect preliminary inspection processing is performed according to the first surface image data to obtain the surface condition of the medical film; The second image acquisition processing is performed according to the surface condition of the medical film to obtain second surface image data; The surface defect secondary inspection processing is performed according to the second surface image data to obtain the defect condition of the medical film; The surface defect preliminary inspection processing is performed according to the first surface image data to obtain the surface condition of the medical film, which comprises the following sub-steps: The size of the division grid is set as b1, and the first preliminary inspection image 1 and the first preliminary inspection image 2 are respectively subjected to grid division processing, and after the processing, the to-be-inspected grid image 1 and the to-be-inspected grid image 2 are obtained in sequence; The grid division processing comprises: for any one image of the medical film, denoted as a first division image, the image area corresponding to the medical film in the first division image is divided, denoted as a medical film area, and the image area of the non-medical film area is removed respectively, and after the removal, a second division image is obtained; The second division image is subjected to grid division by using the division grid, and the divided grid areas are sequentially denoted as C1-Cn from left to right and from top to bottom; The defect grid screening processing is performed on the to-be-inspected grid image 1 and the to-be-inspected grid image 2 respectively to obtain the preliminary inspection grid image 1 and the preliminary inspection grid image 2; The defect grid screening processing comprises: for any one to-be-inspected grid image, denoted as a first grid image, for any one grid area in the first grid image, denoted as a grid Ci; the gray values of all pixels in the grid Ci are arranged in ascending order, denoted as a Ci gray sequence; The threshold ratios k1% and k2% are set, and k2%>k1%; the smallest k2% gray value and the largest k2% gray value in the Ci gray sequence are removed, and the average value of the remaining gray values is calculated, denoted as a first reference value; the average value of the smallest k1% gray value in the Ci gray sequence is calculated, denoted as a first defect value; the average value of the largest k1% gray value in the Ci gray sequence is calculated, denoted as a second defect value; the absolute value of the difference between the first defect value and the first reference value is calculated, denoted as a first characteristic value; and the absolute value of the difference between the second defect value and the first reference value is calculated, denoted as a second characteristic value; the larger value between the first characteristic value and the second characteristic value is marked as the defect characteristic value of the grid Ci, denoted as a Ci defect characteristic value; Obtain the defect feature values of all grid regions in the first grid image, and sort them in ascending order, denoted as the first feature value sequence; set a threshold proportion k3%, remove the smallest k3% of the defect feature values and the largest k3% of the defect feature values in the first feature value sequence, and calculate the average and standard deviation of the remaining defect feature values, denoted as D0 and D1 in order; for any defect feature value in the first feature value sequence, denoted as TD, if TD satisfies TD<[D0-k4*D1] or satisfies TD>[D0+k4*D1], mark the grid region corresponding to TD as a defective grid, otherwise mark the grid region corresponding to TD as a normal grid; wherein k4 is a set threshold proportion; repeat the process of obtaining all defective grids and normal grids in the first grid image; If there is no defective grid in the preliminary inspection grid image 1 and the preliminary inspection grid image 2, mark the medical film to be identified as having no defects, otherwise mark it as having defects.

2. The surface image precision recognition method for medical instrument production according to claim 1, characterized in that, The first image acquisition and processing based on different angles to obtain the first surface image data includes the following sub-steps: Set up a medical film image acquisition device, including: setting an image acquisition device directly above the geometric center of the medical film, and uniformly setting four identical light sources obliquely above the medical film, denoted as the first light source, the second light source, the third light source and the fourth light source in clockwise order, and making the four light sources have the same rotation angle in the clockwise direction.

3. The surface image precision recognition method for medical instrument production according to claim 2, characterized in that, The first image acquisition and processing based on different angles to obtain the first surface image data further includes the following sub-steps: For any one medical film to be identified, according to the medical film image acquisition device, only the first light source is turned on, and the light intensity of the first light source is set to A0; then an image of the medical film is acquired by the image acquisition device, denoted as the initial debugging image; Calculate the average gray value of all pixel points in the initial debugging image, denoted as H0; determine whether H0 satisfies H1<H0<H2, if yes, set the light intensity A0 as the appropriate light intensity; if not, according to the size of A0 increased or decreased corresponding to H0≤H1 or H0≥H2, until the appropriate light intensity is obtained, wherein H1 is the set dark gray threshold, and H2 is the set bright gray threshold; and obtain the light intensity corresponding to H0=H1 and H0=H2, denoted as Am and Aw in order; According to the medical film image acquisition device, only the first light source is turned on, and the light intensity of the first light source is set to the appropriate light intensity, and an image of the medical film is acquired by the image acquisition device, denoted as the first preliminary inspection image 1; Then only the second light source is turned on, and the light intensity of the second light source is set to the appropriate light intensity, and an image of the medical film is acquired by the image acquisition device, denoted as the first preliminary inspection image 2; after completion, the first preliminary inspection image 1 and the first preliminary inspection image 2 are denoted as the first surface image data.

4. The surface image precision recognition method for medical instrument production according to claim 3, characterized in that, The second image acquisition and processing based on the surface condition of the medical film to obtain the second surface image data includes the following sub-steps: For the defective medical film to be identified, second surface image data is collected by using a medical film image acquisition device; including: setting the light intensity of the first light source, the second light source, the third light source and the fourth light source as E1, E2, E3 and E4 in order, wherein, Aw>E1>E2>E3>E4>Am; sequentially turning on only the first light source, the second light source, the third light source and the fourth light source, and collecting the surface image of the medical film each time, obtaining the second inspection image 1, the second inspection image 2, the second inspection image 3 and the second inspection image 4 in order, and recording as the second surface image data.

5. The surface image precision recognition method for medical instrument production according to claim 4, characterized in that, According to the second surface image data, the surface defect double inspection processing is performed to obtain the medical film defect condition, including the following sub-steps: The size of the divided grid is set as b2, and the second inspection image 1, the second inspection image 2, the second inspection image 3 and the second inspection image 4 are respectively subjected to grid division processing, and after the processing is completed, the second inspection grid image 1, the second inspection grid image 2, the second inspection grid image 3 and the second inspection grid image 4 are obtained in order, and recorded as the second inspection grid image 1-4; According to the position area of the defect grid in the first inspection grid image 1 and the first inspection grid image 2, the corresponding position area in the second inspection grid image 1-4 is recorded as the possible defect area; And the area outside the possible defect area in the second inspection grid image 1-4 is recorded as the normal area, and the first reference processing is performed on the normal area; including: for any one normal area, arranging the gray values of all pixel points in the normal area in order from small to large, recording as the first normal sequence, dividing the first normal sequence into k5 sub-sequences, and removing the first sub-sequence and the last sub-sequence, obtaining the second normal sequence after the processing is completed, calculating the average value of the second normal sequence, and recording as the second inspection reference gray value corresponding to the second inspection grid image.

6. The surface image precision recognition method for medical instrument production according to claim 5, characterized in that, According to the second surface image data, the surface defect double inspection processing is performed to obtain the medical film defect condition, including the following sub-steps: The grid areas in the possible defect area of the second inspection grid image 1-4 are sorted according to the sequence number of the corresponding image, recorded as the grid area sequence; for any one grid area sequence, the first defect processing is performed; The first defect processing includes: for any one grid area in the grid area sequence, recording as the first grid area; arranging the gray values corresponding to all pixel points in the first grid area in order from small to large, recording as the first gray sequence, removing the smallest k6 gray values and the largest k6 gray values in the first gray sequence, and then obtaining the average value of the smallest k7 gray values and the average value of the largest k7 gray values in the remaining first gray sequence, recording as the minimum average value and the maximum average value in order; The difference between the minimum average value and the corresponding second inspection reference gray value is calculated, recorded as the first difference value, and the difference between the maximum average value and the corresponding second inspection reference gray value is calculated, recorded as the second difference value; the absolute value of the larger one of the first difference value and the second difference value is marked as the defect feature difference value of the corresponding grid area; the defect feature difference values of all grid areas in the grid area sequence are repeatedly obtained, and the grid area corresponding to the defect feature difference value with the largest absolute value is marked as the defect suspected area; Repeating the acquisition of all defect suspected areas in the second inspection grid image 1-4; and performing second defect processing on all defect suspected areas; The second defect processing includes: for any one defect suspected area, denoted as a first suspected area, acquiring defect feature difference values of f1 grid areas closest to the defect suspected area in the second inspection grid image where the first suspected area is located, denoted as a feature difference value sequence, calculating an average value and a standard deviation of k8 defect feature difference values closest to 0 in the feature difference value sequence, denoted as G1 and G2 respectively in order; acquiring a defect feature difference value of the first suspected area, denoted as Q; if Q is not in [G1-p*G2, G1+p*G2], marking the corresponding defect suspected area as a defective area, otherwise marking it as a non-defective area, wherein p is a set proportion coefficient; Repeating the acquisition of all defective areas in the second inspection grid image 1-4, and marking the corresponding positions in the second inspection image 1, the second inspection image 2, the second inspection image 3 and the second inspection image 4, denoted as a medical film defect situation.

7. An electronic device, comprising: The computer program is executed by the processor to run the steps in the method of any one of claims 1-6.

8. A storage medium having stored thereon a computer program, characterized in that The computer program is executed by the processor to run the steps in the method of any one of claims 1-6.

Citation Information

Patent Citations

  • Defect detection method and system for processing and forming of injection molded part

    CN114926441A

  • Photovoltaic aluminum frame surface defect detection system

    CN119125167A