A material analysis and detection method based on image recognition technology
Through the automated material analysis method based on image recognition technology, the problems of visual impairment, high skill requirements and misjudgment in the existing technology are solved, and material analysis with high accuracy and simultaneous observation by multiple people is achieved, reducing labor intensity and mechanical errors.
Patent Information
- Application Number
- CN202111534072.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-15
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2041-12-15
AI Technical Summary
Existing materials analysis technology has problems such as visual impairment, high professional skill requirements, misjudgment and confusion caused by single-person observation, and cannot ensure the accuracy and reliability of analysis results.
An automated material analysis method based on image recognition technology is used to obtain standard spectral images by scanning part labels, and industrial cameras are used to collect spectral images for digital processing and comparison. Similarities are calculated to determine material types, reducing manual intervention and improving accuracy.
It reduces the need for professional skills, improves the accuracy of analysis results, reduces labor intensity and visual impairment, enables multiple people to observe and record in detail at the same time, reduces mechanical errors, and improves the reliability and accuracy of detection.
Smart Images

Figure CN114266741B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of material analysis, and in particular to a material analysis and detection method based on image recognition technology. Background Art
[0002] Spectral analysis technology is a technique that is based on each spontaneous transition of an element's atoms or ions from a high energy state to a low energy state. According to its spectrum, it can be visually found that there will be a spectral line with a certain wavelength corresponding to it. Among the many spectral lines emitted by the atoms or ions of each element, there are always some spectral lines with special wavelengths (colors) and intensities (brightness) that constitute the characteristic spectral lines of the element. Conversely, each spectral line in the spectrum must correspond to a spontaneous transition of an atom or ion of a certain element. Therefore, based on whether the characteristic spectral lines of the atoms or ions of an element appear in the spectrum, the presence or absence of the element in the sample can be determined.
[0003] The existing operation method is usually to place the part to be tested on the electrode, use the foot pedal switch to excite the electric spark, observe the spectrum through the eyepiece, and when different bands need to be observed, rotate the knob to adjust the image of different bands in the eyepiece. Therefore, the above-mentioned existing technology has the following main disadvantages: (1) Long-term spectral observation will lead to excessive eye use, which will cause certain damage to the eyesight of practitioners; (2) The professional skill level of practitioners is high, and relevant professional training is required, and the employee skill level growth cycle is extremely slow; (3) The eyepiece can only be observed by one person, and it is impossible to ensure whether the observer makes a misjudgment; (4) There are many aviation parts, which may cause problems such as mixing up the material grades of the previous and subsequent parts and mis-inspection and missed inspection of parts. Summary of the invention
[0004] In order to overcome the problems and shortcomings in the above-mentioned prior art, the present application proposes an automated material spectrum analysis method that does not rely on the professional skill level of the operator, not only has a high accuracy of the analysis results, but also will not cause damage to the operator's eyesight.
[0005] In order to achieve the above-mentioned invention object, the technical solution of this application is as follows:
[0006] A material analysis and detection method based on image recognition technology, the method specifically comprises the following steps:
[0007] Steps for obtaining information of the parts to be tested: Before testing, first scan the identification label of the parts to be tested, obtain the test quantity and brand of the parts to be tested, and finally determine the standard spectrum for comparison;
[0008] Spectral image acquisition steps: place the part to be tested on the detection platform of the spectroscope, start the switch, the computer host first excites the spectroscope to generate sparks, and then controls the servo motor to rotate, the servo motor drives the knob of the spectroscope to rotate to the specified position, the computer host controls the industrial camera to take pictures and converts the collected spectral image into a digital image with a coordinate relationship, and then uses the coordinate system to splice the collected multiple spectral images in sequence to form an inspection spectrum diagram of the part to be tested, and finally displays the inspection spectrum diagram on the display;
[0009] Spectral image comparison and result determination steps: compare the inspection spectrum of the current part to be tested with the standard spectrum image, calculate the similarity of the images, and then determine the result.
[0010] Furthermore, the spectral image comparison and result determination steps are specifically as follows:
[0011] Image digitization steps: Convert the RGB color value of each pixel on the inspection spectrum image of the part to be tested into the grayscale value of the pixel, and establish a grayscale value matrix based on the grayscale value of the above pixel
[0012]
[0013] Calculate the arithmetic mean of the grayscale values of each column of the matrix, and combine the grayscale value averages of each column to obtain the eigenvalue vector of the inspection spectrum image of the part to be tested
[0014] C=[g1,g2,g3,…,g n ] Formula (2);
[0015] Among them, g n Represents the nth eigenvalue of the inspection spectrum image of the part to be tested;
[0016] Image similarity matching step: Calculate the difference d between the nth eigenvalue of the inspection spectrum of the part to be tested and the standard spectrum n
[0017] d n =g n -g' n Formula (3);
[0018] Among them, g n represents the nth eigenvalue of the inspection spectrum image of the part to be tested, g' n Represents the nth eigenvalue of the standard spectrum image;
[0019] Compare the inspection spectrum of the part to be tested with the standard spectrum, and calculate the gray value difference L′ between the inspection spectrum of the part to be tested and the standard spectrum according to the Euclidean distance formula
[0020]
[0021] After multiple comparisons, the arithmetic mean of all calculated grayscale value differences is taken as the final value L of the grayscale value difference between the inspection spectrum of the tested part and the standard spectrum;
[0022] The final value L of the gray value difference between the inspection spectrum of the tested part and the standard spectrum is normalized according to the following expression:
[0023] V = L / (255 × sqrt (N)) Formula (5);
[0024] Where N represents the width of the image.
[0025] Finally, the similarity S between the inspection spectrum of the tested part and the standard spectrum is obtained through the following calculation expression:
[0026] S = 100% - V formula (6).
[0027] Furthermore, the calculation expression for converting the RGB color value of each pixel into the grayscale value of the pixel is as follows:
[0028]
[0029] Among them, R represents red, G represents green, and B represents blue.
[0030] Furthermore, when the display shows the spectral image, the standard spectral image and the inspection spectral image of the part to be tested are displayed together to facilitate manual confirmation of whether it is qualified.
[0031] A material analysis and detection device based on image recognition technology, the device includes a spectroscope, an industrial camera, a servo motor, a label identifier, a display and a computer host, the computer host is respectively connected to the spectroscope, the industrial camera, the servo motor, the label identifier and the display, and is a control terminal of the entire device, and is used to trigger the spectroscope, the industrial camera, the servo motor and the label identifier to work, receive data transmitted by the industrial camera and the label identifier and perform data processing, and realize human-computer information interaction with an operator through the display; the spectroscope is used to generate electric sparks and spectral images; the industrial camera is arranged on the eyepiece of the spectroscope, and is used to collect spectral images of parts to be tested; the output end of the servo motor is connected to the knob of the spectroscope, and is used to drive the knob to rotate; the label identifier is used to scan and identify the identification label of the part to be tested.
[0032] Furthermore, the industrial camera is arranged on the spectrum viewing scope via a camera mounting seat, and the camera mounting seat includes a lens adapter ring and a camera bracket, one end of the lens adapter ring is connected to the lens of the industrial camera, and the other end is connected to the eyepiece of the spectrum viewing scope, and the camera bracket is formed by two half-piece brackets being matched and connected, and the two half-piece brackets are surrounded and connected to form an enclosure, and the lens of the industrial camera and the eyepiece of the spectrum viewing scope are located in the enclosure, and the two half-piece brackets are fixedly connected by fastening bolts.
[0033] Beneficial effects of this application:
[0034] (1) Compared with the existing manual method of analyzing the spectrum of part materials, the present application reduces the difficulty and cycle of the development of professional and skilled personnel. The entire analysis process no longer depends on the professional skill level of the inspectors. The accuracy of the analysis results is higher. In addition, the labor intensity of the inspectors is reduced through the automatic collection and analysis of spectral images.
[0035] (2) When analyzing the spectrum of a part material, the present application no longer requires only one person to view the spectrum, but can project the spectrum onto a display screen for all personnel to view. Everyone can discuss and exchange ideas at the same time, thereby achieving rapid talent cultivation and reducing eye damage and fatigue caused by directly observing the spark spectrum.
[0036] (3) The data in the detection process of this application can be correlated and matched with product information, realize detailed digital records of the detection process, and achieve the effect of displaying, storable and traceable images of the detection process.
[0037] (4) During the spectral image comparison process, the present application adopts alignment measures for the spectral image to eliminate mechanical errors, so that the overall material analysis results are more accurate and have smaller errors. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 This is a flow chart of the application method;
[0039] Figure 2 This is a schematic diagram of the structure of the detection device of this application;
[0040] Figure 3 This is a schematic diagram of the industrial camera installation structure for this application.
[0041] In the attached figure:
[0042] 1. Spectrum viewing mirror; 2. Industrial camera; 3. Servo motor; 4. Label reader; 5. Display; 6. Computer host; 7. Camera mounting base; 71. Lens adapter ring; 72. Camera stand. DETAILED DESCRIPTION
[0043] The present application is further described in detail below in conjunction with examples, but the implementation methods of the present application are not limited thereto.
[0044] Example 1
[0045] This embodiment discloses a material analysis and detection method based on image recognition technology, which specifically includes the following steps:
[0046] Steps for obtaining information of the parts to be tested: before testing, first use a label reader to scan the identification label of the parts to be tested to obtain the test quantity and brand of the parts to be tested, and then the label reader transmits the above part information to the host computer, which searches and matches in the stored database according to the above part information, and finally determines the standard spectrum for comparison;
[0047] Spectral image acquisition steps: place the part to be tested on the detection platform of the spectroscope, start the switch, the computer host first excites the spectroscope to generate sparks, and then controls the servo motor to rotate, the servo motor drives the knob of the spectroscope to rotate to the specified position, the computer host controls the industrial camera to take pictures and converts the collected spectral image into a digital image with a coordinate relationship, and then uses the coordinate system to splice the collected multiple spectral images in sequence to form an inspection spectrum diagram of the part to be tested, and finally displays the inspection spectrum diagram on the display;
[0048] Spectral image comparison and result determination steps: the computer host compares the inspection spectrum of the current part to be tested with the standard spectrum image, calculates the similarity of the images, and then outputs the determination result and transmits the result to the display for display.
[0049] Example 2
[0050] This embodiment discloses a material analysis and detection method based on image recognition technology. On the basis of Embodiment 1, this embodiment further defines and explains the analysis and detection method. In this embodiment, in the spectral image acquisition step, the use of a coordinate system to sequentially stitch together the multiple spectral images acquired specifically refers to stitching together the rightmost edge of the first image and the left edge of the second image, and the height of the new image is the same as the height of the original two images. Figure 1 The width is the sum of the two images.
[0051] Furthermore, the spectral image comparison and result determination step specifically includes the following steps:
[0052] Image digitization steps: First, convert the RGB color value of each pixel on the inspection spectrum image of the part to be tested into the grayscale value of the pixel through the following calculation expression:
[0053] S = 100% - V formula (6).
[0054]
[0055] Among them, RGB refers to the three primary colors in optics, R represents red, G represents green, and B represents blue, and the value of each color is 0 to 255.
[0056] Then, according to the calculated gray value of the pixel point, the following gray value matrix is established:
[0057]
[0058] Finally, the arithmetic mean of the grayscale values of each column of the matrix is calculated, and the grayscale value averages of each column are combined to obtain the eigenvalue vector of the inspection spectrum image of the part to be tested as follows:
[0059] C=[g1,g2,g3,…,g n ] Formula (2);
[0060] Among them, g n Represents the nth eigenvalue of the inspection spectrum image of the part to be tested;
[0061] Image similarity matching steps: First, calculate the difference d between the nth eigenvalue of the inspection spectrum image of the part to be tested and the standard spectrum image according to the following calculation expression: n
[0062] d n =g n -g' n Formula (3);
[0063] Among them, g n represents the nth eigenvalue of the inspection spectrum image of the part to be tested, g' n Represents the nth eigenvalue of the standard spectrum image;
[0064] Then, the inspection spectrum of the part to be tested is compared with the standard spectrum. According to the Euclidean distance formula, the gray value difference L′ between the inspection spectrum of the part to be tested and the standard spectrum is calculated. The greater the distance between the two vectors, the smaller the similarity.
[0065]
[0066] After multiple comparisons, the arithmetic mean of all calculated grayscale value differences is taken as the final grayscale value difference L between the inspection spectrum of the part to be tested and the standard spectrum;
[0067] Since the value of L will increase the distance value as the image width increases, the distance data needs to be normalized so that images of different widths can be placed on a reference standard surface for comparison. The normalization formula is as follows:
[0068] V = L / (255 × sqrt (N)) Formula (5);
[0069] Where N represents the width of the image;
[0070] Finally, the similarity S between the inspection spectrum of the tested part and the standard spectrum is obtained by the following calculation expression:
[0071] S = 100% - V formula (6);
[0072] When the similarity reaches above 95%, it is considered that the material of the current part to be tested is the same material as the material represented by the standard spectrum; when the similarity is between 80% and 95%, manual intervention is required to make a judgment; when the similarity is less than 80%, it is considered that the material of the current part to be tested is not the same material as the material represented by the standard spectrum, and the two are not the same.
[0073] In this embodiment, since the motor may have some mechanical errors during actual use, when the collected inspection spectrum image is compared with the standard spectrum image, the actual result may deviate. Therefore, this embodiment uses multiple comparisons through image alignment to eliminate the above mechanical errors. The specific process is as follows:
[0074] First, the comparison range (X1, X2) of the standard spectrum is obtained. During the inspection, since the distance range when comparing the two images is based on the range of the standard spectrum, and the actual range of the inspection spectrum of the part to be tested obtained during production acquisition is larger than the range of the standard spectrum, a constant Δx is set to represent the allowable error range of the image, which is used to increase the contrast area of the image. The comparison range of the inspection spectrum of the part to be tested is expanded according to the constant Δx, and the expanded comparison range of the inspection spectrum of the part to be tested is (X1-Δx, X2+Δx). Therefore, the actual range of the inspection spectrum of the part to be tested is 2Δx more than the range of the standard spectrum. Therefore, the entire comparison process has changed, and the number of comparisons has increased from one to 2Δx times, that is to say:
[0075] During the first comparison, the range of the inspection spectrum of the part to be tested is (X1-Δx, X2-Δx);
[0076] During the second comparison, the range of the inspection spectrum of the part to be tested is (X1-Δx+1, X2-Δx+1);
[0077] …
[0078] During the 2nd Δx comparison, the range of the inspection spectrum of the part to be tested is (X1+Δx, X2+Δx);
[0079] Among them, 1 represents a pixel of the image;
[0080] Therefore, in actual detection, it is necessary to compare the comparison range of the inspection spectrum of the part to be tested each time with the comparison range of the standard spectrum, and use the Euclidean distance formula to calculate the grayscale value difference between the inspection spectrum of the part to be tested and the standard spectrum for each comparison. Eventually, 2Δx grayscale value differences will be obtained, and then the arithmetic mean is taken as the final value of the grayscale value difference between the inspection spectrum of the part to be tested and the standard spectrum. Finally, the arithmetic mean is normalized to calculate the similarity between the inspection spectrum of the part to be tested and the standard spectrum.
[0081] Example 3
[0082] This embodiment discloses a material analysis and detection device based on image recognition technology. Figure 2 , mainly includes a spectrum viewing mirror 1, an industrial camera 2, a servo motor 3, a label identifier 4, a display 5 and a computer host 6. The computer host 6 is respectively connected to the spectrum viewing mirror 1, the industrial camera 2, the servo motor 3, the label identifier 4 and the display 5, and is a control terminal of the entire device. The spectrum viewing mirror 1 is an existing technology and is a finished product sold on the market. The industrial camera 2 is set on the eyepiece of the spectrum viewing mirror 1 through a camera mounting seat 7. The output end of the servo motor 3 is connected to the knob on the spectrum viewing mirror 1, and the label identifier 4 is an RFID reader.
[0083] Further, refer to the attached manual Figure 2 The camera mounting seat 7 includes a lens adapter ring 71 and a camera bracket 72. One end of the lens adapter ring 71 is connected to the lens of the industrial camera 2, and the other end is connected to the eyepiece of the spectrum viewing mirror 1. The camera bracket 72 is formed by two half-piece brackets connected together. The two half-piece brackets are surrounded and connected to form an enclosure. The lens of the industrial camera 2 and the eyepiece of the spectrum viewing mirror 1 are located in the enclosure. The two half-piece brackets are fixedly connected by fastening bolts.
[0084] When conducting the test, first use the label identifier to scan the identification label of the part to be tested, so as to obtain the relevant information of the part to be tested, including the test quantity and the brand of the part, and then transmit the above information to the computer host. The computer host stores a sample standard database, which includes standard data information such as the brand of each type of material and the standard spectrum. The computer host searches and matches the material type of the corresponding part in the database according to the brand of the part to be tested that will be obtained at present, and finally determines and obtains the standard spectrum for comparison according to the material type of the part; then put the part to be tested on the detection platform of the spectroscope, start the switch, and the computer host first First, the spectroscope is stimulated to generate sparks. While generating electric sparks, the spectroscope will form a corresponding spectral image. Then the computer host controls the servo motor to rotate. The servo motor drives the knob of the spectroscope to rotate to the specified position. Then the computer host controls the industrial camera to take pictures and converts the collected spectral image into a digital image with a coordinate relationship. Then, the coordinate system is used to stitch the collected multiple spectral images in sequence to finally form an inspection spectrum diagram of the part to be tested, which is displayed on the monitor. Finally, the computer host compares the inspection spectrum diagram of the current part to be tested with the standard spectrum image, finally outputs the judgment result, and transmits the above result to the monitor.
[0085] In this embodiment, the sample standard database is initially established by manually inputting relevant standard data of the material. Later in use, the database is automatically learned, analyzed, and compared by the system, thereby realizing continuous automatic optimization of the database, continuously iterating the material standard data in the database, and ultimately further improving the detection accuracy.
[0086] In the description of the present application, it should be understood that the terms "center", "longitudinal", "lateral", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as limiting the scope of protection of the present application.
[0087] The above is only a preferred embodiment of the present application and does not constitute any form of limitation to the present application. Any simple modification or equivalent changes made to the above embodiments based on the technical essence of the present application shall fall within the protection scope of the present application.
Claims
1. A material analysis and detection method based on image recognition technology, characterized in that: The method specifically comprises the following steps: Steps for obtaining information of the parts to be tested: Before testing, first scan the identification label of the parts to be tested, obtain the test quantity and brand of the parts to be tested, and finally determine the standard spectrum for comparison; Spectral image acquisition steps: place the part to be tested on the detection platform of the spectroscope, start the switch, the computer host first excites the spectroscope to generate sparks, and then controls the servo motor to rotate, the servo motor drives the knob of the spectroscope to rotate to the specified position, the computer host controls the industrial camera to take pictures and converts the collected spectral image into a digital image with a coordinate relationship, and then uses the coordinate system to splice the collected multiple spectral images in sequence to form an inspection spectrum diagram of the part to be tested, and finally displays the inspection spectrum diagram on the display; Spectral image comparison and result determination steps: compare the inspection spectrum of the current part to be tested with the standard spectrum image, calculate the similarity of the images, and then determine the result; The spectral image comparison and result determination steps are specifically as follows: Image digitization steps: Convert the RGB color value of each pixel on the inspection spectrum image of the part to be tested into the grayscale value of the pixel, and establish a grayscale value matrix based on the grayscale value of the above pixel Calculate the arithmetic mean of the grayscale values of each column of the matrix, and combine the grayscale value averages of each column to obtain the eigenvalue vector of the inspection spectrum image of the part to be tested C=[g1,g2,g3,...,g n ] Formula (2); Among them, g n Represents the nth eigenvalue of the inspection spectrum image of the part to be tested; Image similarity matching step: Calculate the difference d between the nth eigenvalue of the inspection spectrum of the part to be tested and the standard spectrum n d n =g n -g' n Formula (3); Among them, g n represents the nth eigenvalue of the inspection spectrum image of the part to be tested, g' n Represents the nth eigenvalue of the standard spectrum image; Compare the inspection spectrum of the part to be tested with the standard spectrum, and calculate the gray value difference L′ between the inspection spectrum of the part to be tested and the standard spectrum according to the Euclidean distance formula After multiple comparisons, the arithmetic mean of all calculated grayscale value differences is taken as the final value L of the grayscale value difference between the inspection spectrum of the part to be tested and the standard spectrum; The final value L of the gray value difference between the inspection spectrum of the tested part and the standard spectrum is normalized according to the following expression: V = L / (255 × sqrt (N)) Formula (5); Where N represents the width of the image; Finally, the similarity S between the inspection spectrum of the tested part and the standard spectrum is obtained through the following calculation expression: S = 100% - V formula (6).
2. The material analysis and detection method based on image recognition technology according to claim 1, characterized in that: The calculation expression for converting the RGB color value of each pixel into the grayscale value of the pixel is as follows: Among them, R represents red, G represents green, and B represents blue.
3. The material analysis and detection method based on image recognition technology according to claim 1, characterized in that: When the monitor displays the spectral image, the standard spectral image and the inspection spectral image of the part to be tested are displayed together to facilitate manual confirmation of whether it is qualified.
4. The material analysis and detection method based on image recognition technology according to claim 1, characterized in that: The device for completing the method is a material analysis and detection device based on image recognition technology, which includes a spectroscope, an industrial camera, a servo motor, a label identifier, a display and a computer host. The computer host is respectively connected to the spectroscope, the industrial camera, the servo motor, the label identifier and the display, and is a control terminal of the entire device, which is used to trigger the spectroscope, the industrial camera, the servo motor and the label identifier to work, receive data transmitted by the industrial camera and the label identifier and perform data processing, and realize human-computer information interaction with the operator through the display; the spectroscope is used to generate electric sparks and spectral images; the industrial camera is arranged on the eyepiece of the spectroscope, and is used to collect spectral images of the parts to be tested; the output end of the servo motor is connected to the knob of the spectroscope, and is used to drive the knob to rotate; The label identifier is used to scan and identify the identification label of the part to be tested.
5. The material analysis and detection method based on image recognition technology according to claim 4 is characterized in that: The industrial camera is arranged on the spectrum viewing scope via a camera mounting seat, and the camera mounting seat comprises a lens adapter ring and a camera bracket, one end of the lens adapter ring is connected to the lens of the industrial camera, and the other end is connected to the eyepiece of the spectrum viewing scope, and the camera bracket is formed by two half-piece brackets being matched and connected, and the two half-piece brackets are surrounded and matched to form an enclosure, and the lens of the industrial camera and the eyepiece of the spectrum viewing scope are located in the enclosure, and the two half-piece brackets are fixedly connected by fastening bolts.
Citation Information
Patent Citations
Material detection system based on laser-induced fluorescence technology and use method
CN107870164A
