Disclosure of Invention
The invention aims to at least solve the technical problems in the prior art, and particularly innovatively provides a metal surface rust resistance test bench and a rust resistance evaluation method. For the invention, the research content mainly relates to image processing, machine vision technology, materials science, electrical control, sensing and detection technology, data mining and computer technology, the main method is to accelerate corrosion through a built metal surface rust resistance test platform, collect surface images through an acquisition platform, construct a metal surface rust segmentation method by fusing super-pixel segmentation SLIC, principal component analysis, fuzzy C mean value and the like to extract a rust area, calculate a rust ratio index and compare the rust ratio index with a threshold value as a termination condition, and count the total experimental duration of each metal sample after the experiment is finished as a quantitative index of the rust resistance for evaluating the surface rust resistance of the metal sample.
In order to achieve the technical features, the invention is realized as follows: the utility model provides a metal surface rust resistance performance testboard which characterized in that: the device comprises an execution device for carrying the environment of the corrosion process of the metal sample; the execution device is matched with the input device and is used for acquiring data in the corrosion process of the metal sample; the input device and the execution device are integrally arranged inside the space environment cover;
the input device is connected with the signal input end of the control device, the signal output end of the control device is connected with the output device, and the output device is connected with the execution device;
the device also comprises a data acquisition platform for acquiring and analyzing the data of the metal sample after rusting.
The execution device controls the temperature, humidity, air pressure, PH value and water level information in the space environment cover according to the instruction of the control device, is used for assisting and accelerating the generation of corrosion on the surface of the metal sample, and comprises a test box, the space environment cover, a V-shaped frame, a support rod, a spray tower, a salt spray collection funnel and the metal sample to be detected; the test box is characterized in that a supporting rod is arranged inside the test box, a V-shaped frame is fixed on the supporting rod, a metal sample is placed on the V-shaped frame, a spraying tower used for controlling humidity is arranged inside the test box, and a salt fog collecting funnel is arranged inside the test box.
The input device comprises a PH detection sensor, a temperature sensor, a humidity sensor, an air pressure sensor and a water level detection sensor, wherein various sensors in the input device are respectively connected to the input end of the PLC controller and used for collecting environmental information, facilitating centralized monitoring of space environmental data and sensing the running state of equipment.
Output device includes water inlet switch, spray switch, air compressor, heater, alarm lamp and bee calling organ, output device is connected to the output of PLC controller for various environment that the simulation metal is located at equipment, alarm lamp and bee calling organ are used for playing the warning effect when the system produces the trouble.
The control device comprises a PLC (programmable logic controller) and an HMI (human machine interface) touch screen, wherein the HMI touch screen is connected with a port in the PLC through a ROFINET interface by adopting a network cable so as to realize communication with the PLC.
The data acquisition platform comprises a light source, a camera bracket and a computer; in a data acquisition platform: the metal sample to be tested is placed under a surface light source, the camera is matched with the camera support to collect image data information, and the image data information is connected to the signal input end of the computer through the USB serial port, so that the collection of the image data is completed.
The method for testing the rust resistance of the surface of the metal sample by adopting the metal surface rust resistance testing table comprises the following steps:
firstly, uniformly wiping the surface of a metal sample, cleaning the surface of the metal sample by using acetone and drying the surface of the metal sample by blowing, and putting the metal samples of the same specification and different models on a V-shaped frame and a supporting rod when testing the anti-rust performance of the metal surface, wherein the total area of each metal sample selected during testing is fixed and equal; after all the test samples are placed, closing the space environment cover; inputting environmental parameter information through an HMI (human machine interface), and accelerating the corrosion of a metal sample by a PLC (programmable logic controller) through an output device and an execution device to start testing; because salt fog exists in the space environment cover, the precision and the service life of the camera can be seriously damaged, and real-time monitoring is difficult to realize, data are acquired by adopting a mode of periodic shutdown inspection, the test platform is stopped at intervals to sequentially take out metal samples and finish data acquisition in the data acquisition platform, then the metal samples are sequentially put back into the test platform to be started again for operation, and the test is finished when the corrosion ratio indexes of all the metal samples to be tested reach a preset threshold value.
The metal surface rust resistance performance evaluation method is carried out on the metal sample prepared by the metal surface rust resistance performance test bench, detecting the image data collected by the data collection platform, dividing the rusty area according to the metal surface image, counting the number of the whole pixels of the sample and the number of the pixels of the rusty area, obtaining the corrosion ratio index between the two through the number of the pixel points, comparing the corrosion ratio index with a preset threshold value, judging that the experiment termination condition is reached at the moment if the corrosion ratio is greater than the preset threshold value, the performance test experiment of the sample is completed, the total experiment duration of each metal sample is counted after the experiment is completed and is used as a quantitative index of the rust resistance performance to evaluate the surface rust resistance performance of the metal sample, the time interval from the beginning of the experiment to the time when the rust ratio reaches the threshold value of each metal sample can reflect the rust resistance performance of the metal rust, and the longer the time difference is, the better the rust resistance performance is.
The method for evaluating the rust resistance of the metal surface specifically comprises the following steps:
step 1: collecting image data of the surface of a metal sample; taking out the metal sample in the metal surface rust resistance test platform, placing the metal sample in a data acquisition platform, acquiring image data, transmitting the image data to a computer, and waiting for subsequent operation;
step 2: carrying out preprocessing operation on the image; because a small part of background interference and noise influence exists in the acquired image, the interference of the part can be eliminated by adopting a filtering and denoising method in a preprocessing stage, and redundant background parts are cut off, so that the image only contains a metal sample part; in addition, details are enhanced through an enhancement algorithm, and detail information of a rusty part highlights the difference between a rusty area and a non-rusty area, so that the detection accuracy is improved;
and step 3: performing coarse segmentation on the image by using a superpixel segmentation SLIC algorithm; dividing the preprocessed image into grids, roughly dividing the grids by adopting an SLIC method, dividing the image to be processed into a plurality of homogeneous sub-areas, namely superpixels, and converting the acquired color image into a CIELAB color space from a traditional RGB space; for each pixel point, 5-dimensional feature vectors are formed by the XY coordinate information of the spatial position of each pixel point and three color space components of lab, then a distance measurement standard is constructed for the 5-dimensional feature vectors, and local clustering is carried out on image pixels to obtain compact and approximately uniform super-pixel blocks; the distance measure is formulated as follows:
in the formula: d
cRepresents the color distance,/
i、a
i、b
iRespectively representing the lab space color value, l, of the pixel point i
j、a
j、b
jRespectively representing the lab space color values of the pixel point j; d
sRepresents the spatial distance, x
i,y
iIs the coordinate position, x, of pixel point i
j,y
jIs the coordinate position of pixel point j; d' represents a distance metric; n is a radical of
cRepresents the maximum color distance, usually replaced by a fixed value, for controlling the compactness of the super-pixel;
the maximum space distance in the class, N (f) is the total number of pixel points in the image, and n is the number of divided grids;
and 4, step 4: constructing a characteristic index and establishing a characteristic matrix; for each super-pixel block, the color information and the texture feature description area information of the pixel points in the area are counted;
let f (x, y), x ═ 1,2,. and M; and y is 1,2,.. N, the gray level of the image is L, a gradient operator is adopted to extract a gradient image g (x, y) of the super pixel region, the gradient image is subjected to gray level discretization, and the number of gray levels is LgEstablishing a gray level-gradient co-occurrence matrix, wherein the expression is as follows:
{Hij,i=0,1,...,L-1;j=0,1,...,Lg-1}
in the formula: hijRepresenting the number of elements in the set { (x, y) | f (x, y) ═ i, G (x, y) ═ j }; l isgIs the number of gray levels; x is 1,2,. said, M; n is the pixel width of the image, and N is the pixel height of the image;
by using the gray-gradient co-occurrence matrix, the following 17 commonly used texture characteristic parameters are established: small gradient dominance, large gradient dominance, gray distribution heterogeneity, gradient distribution heterogeneity, energy, gray average, gradient average, gray mean square error, gradient mean square error, gray smoothness, gradient smoothness, correlation, gray entropy, gradient entropy, mixed entropy, inertia, and inverse difference moment;
as all the collected images are color images, the characteristic indexes are calculated for 3 color channels of each super pixel block respectively, so that 3 × 17-51 characteristic parameters can be obtained in total, and the size of the established characteristic matrix is n × 51, wherein n is the number of the super pixel blocks;
and 5: performing principal component analysis to reduce the dimension of the index data; if the 51 characteristic parameters for describing the super-pixel block are obtained from step 4, if the parameters are directly used to jointly represent the information of the super-pixel area, the computational complexity of the problem will rise suddenly, and in addition, the 51 parameters are not independent, but rather, the parameters are often influenced and correlated, and there are many overlapping parts between them, so that the method of principal component analysis needs to be firstly used to perform dimension reduction processing on the indexes, thereby reducing the workload and simultaneously keeping most of the information represented by the indexes;
the step 5, the specific process includes the detailed steps of constructing an original data matrix, standardizing data, calculating a correlation coefficient matrix, calculating an eigenvalue and an eigenvector, calculating a principal component contribution rate, calculating an accumulated contribution rate, and calculating a principal component value;
considering the current cumulative contribution rate alphatWhen the content is more than or equal to 85 percent, the main components of the part contain most of information representing the original index, and the main component value can be calculated by taking out the part and is used for the subsequent initial data of the rust image segmentation;
step 6: partitioning an rusting area by a fuzzy C-means clustering algorithm; performing clustering analysis on the super-pixel blocks by taking the main components subjected to dimensionality reduction as characteristic indexes, and clustering the super-pixel blocks with similar main component values into a class; because the metal surface corrosion often presents the characteristic appearance such as unevenness, rusty scale and the like, the color also often presents dark red or even brown, and the color is greatly different from the color of the metal surface in a rusty area, the rusty area and a non-rusty area are classified according to the index formed by the main component values; in the digital image, the pixel value is 0 to represent black, 255 to represent white, and the rust characteristic is often dark red or even brown, so the pixel value is often close to black 0, namely the characteristic index value of the rust area is often smaller, and the main component value of the rust area is also often smaller, so the maximum main component average value of the area is calculated in each classified class, and the class with the minimum maximum main component average value is screened to be the rust area under the normal condition;
and 6, initializing parameters, initializing a membership matrix and a clustering center of the superpixel block, updating the membership matrix and the clustering center, performing cyclic iteration to obtain a final membership matrix, screening the category of the rust area and the like.
And 7: calculating the corrosion ratio and judging whether the corrosion ratio reaches a threshold value; counting the total number of pixel points of the metal sample in the image preprocessed in the step 2, counting the number of the pixel points of the corrosion region according to the corrosion region image obtained by screening after the segmentation in the step 6, and calculating the corrosion ratio of the metal sample according to the number; respectively calculating the rust ratio index of each tested metal sample, comparing the rust ratio index with a preset threshold value, and if the rust ratio is greater than the threshold value, judging that the metal sample reaches the experiment termination condition at the moment, and completing the rust resistance test of the metal sample; if the corrosion ratio is smaller than the threshold value, judging that the metal sample does not reach the experiment termination condition, and still putting the metal sample back to the test platform to wait for the subsequent continuous test;
and 8: after the performance test is finished, evaluating the anti-rust performance; and when the rust ratio indexes of all the metal samples exceed the preset threshold value, the performance test is finished. And after the experiment is finished, counting the total experiment duration of each metal sample as a quantitative index of the rust resistance for evaluating the surface rust resistance of the metal sample, namely counting the time from the first time of running of the test platform to the last time of taking out each metal sample for the experiment, wherein the time difference between the two times is the result of the rust resistance test of the metal sample, and the longer the time difference is, the better the rust resistance of the metal sample is.
10. The method for evaluating the rust resistance of the metal surface according to claim 9, wherein the image processing-based metal surface rust segmentation method in the steps 2 to 7 comprises: the method comprises the steps of roughly dividing a preprocessed image by adopting a superpixel division algorithm, constructing a characteristic matrix by using a gray-gradient co-occurrence matrix, reducing dimensions of indexes by using a principal component analysis method, and accurately clustering and analyzing superpixel blocks by using a fuzzy C mean algorithm to form a set of rust region division method combining the superpixel division algorithm, the principal component analysis method and the fuzzy C mean algorithm.
Thus, the whole process of designing the metal surface rust resistance test bench, dividing the rust area and evaluating the rust resistance test is completed. The metal surface rust resistance test bench and the rust area detection and identification method designed by the invention can achieve the following technical effects by adopting the technical scheme:
1. the test board is suitable for testing the rust resistance of the metal surface, and can better reflect the rust resistance of the surfaces of different metal samples. The test platform adopts various sensors to monitor environmental information in the space environment cover, controls the input and output module by combining a PLC (programmable logic controller) with an HMI (human machine interface) interactive interface, and accelerates the generation of corrosion on the surface of a metal sample to be tested by an execution device; the data acquisition platform adopts an industrial camera to acquire metal surface images and transmit the metal surface images to a computer, so that an integrated metal surface rust resistance performance test experiment platform is formed.
2. The superpixel segmentation SLIC algorithm can greatly reduce the calculation amount of the algorithm, meanwhile, the characteristic information of the extraction region based on the superpixel block is less interfered by noise in an image, and the method has the advantages of small calculation amount, high operation speed, high segmentation efficiency and the like. According to the method, a set of rust region segmentation method is constructed by combining a super pixel segmentation algorithm (SLIC), a Principal Component Analysis (PCA) and a fuzzy C mean algorithm (FCM), so that a rust region can be segmented accurately from an acquired image, and the defects of low segmentation precision, low operation speed and low processing efficiency in the traditional image processing during rust region segmentation are overcome.
3. And quantifying the divided rust areas to calculate a rust ratio index, and judging whether an experiment termination condition is reached or not by comparing the rust ratio index with a preset threshold value, wherein the experiment time of each sample can reflect the rust resistance of the surface of the sample in a salt spray environment to a certain extent, so that the rust ratio index can be used as a test link for detecting the rust resistance in product quality detection.
In conclusion, the invention is based on the designed test bench for the rust resistance of the metal surface, the rust is accelerated by the test platform, the image of the metal surface is collected by the data collection platform, a set of rust region segmentation method is constructed by combining a superpixel segmentation algorithm (SLIC), a Principal Component Analysis (PCA) and a fuzzy C mean algorithm (FCM), the rust region is segmented from the image, the rust ratio index is calculated as a judgment condition for the test completion, the total time length of the test of the metal sample is counted to reflect the rust resistance of the metal sample, the integrated method for testing the rust resistance of the metal surface, which is constructed by 'test platform accelerated rust test → data collection platform image → fusion of multi-method segmentation of the rust region → calculation of the rust ratio index → statistics of the test time length to evaluate the rust resistance', is formed, meanwhile, the rust region can be automatically segmented and the rust ratio can be calculated by means of machine vision and image processing technology in the, the defects of strong subjectivity, low reliability, difficult quantification and the like of the traditional contact type measuring method are overcome, and a new thought method is provided for the detection and quality evaluation of the surface rust resistance of the metal member.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are illustrative only for the purpose of explaining the present invention, and are not to be construed as limiting the present invention.
As shown in the attached figure 1, the test bench for the rust resistance of the metal surface mainly comprises a test platform and a data acquisition platform. The test platform is used for testing the rust resistance of the surface of the metal sample and accelerating the generation of rust on the surface of the metal sample by controlling environmental factors, and comprises an input device, a control device, an output device and an execution device; the data acquisition platform is used for acquiring image data of a metal sample of the test platform, judging whether the sample reaches an experiment termination condition or not through the segmentation of a corrosion region and a corrosion ratio index, and mainly comprises a light source, a camera support and a computer. The flow of the whole metal surface rust resistance test experiment is shown in the attached figure 2.
The input device comprises a PH detection sensor, a temperature sensor, a humidity sensor, an air pressure sensor and a water level detection sensor, and is respectively used for detecting the PH parameter, the temperature and humidity value and the pressure value of the environment in the space environment cover and whether the PH parameter, the temperature and humidity value and the pressure value reach the limited water level height, and the input device is connected to an input module of the PLC controller;
the control device adopts a PLC controller and an HMI touch screen, as shown in the attached figure 3, the PLC controller part in the figure: the module 0 is a power supply module with the rated power of 70W; the module 1 is a CPU module and adopts Siemens S7-1500 series 1516-3 PN/DP; the module 2 is a 16-bit digital quantity input module; the module 3 is a 4-bit analog input module; the modules 4 and 5 are respectively a 16-bit digital quantity output module and a 4-bit analog quantity output module; the module 6 is temporarily not used, and other modules can be supplemented subsequently according to actual needs. The HMI touch screen adopts KTP700 Basic PN matched with the PLC controller, and the PROFINET interface of the HMI and the port 1 of the interface 1 in the PLC can be connected through a network cable, so that the communication between the PLC controller and the HMI interactive interface is realized.
The output device comprises a water inlet switch, a spray switch, an air compressor, a heater, an alarm lamp, a buzzer and the like, can be used for adjusting the temperature, the humidity and the air pressure of the environment, monitoring the water level change, detecting and early warning faults and the like, and is connected to an output module of the PLC;
the execution device comprises a test box, a space environment cover, a V-shaped frame, a support rod, a spraying tower, a salt spray collecting funnel, a metal sample to be detected and the like, and is mainly used for better execution of an auxiliary experiment in the anti-rust performance test. The space environment cover can separate an external environment from an internal working environment of the test platform, so that the interference of the external environment to an experiment in the running process of the experiment table is avoided, and the monitoring and control of the experiment environment are facilitated; the V-shaped frame and the supporting rod are used for placing a metal sample to be tested, and the installation position and the placing mode of the V-shaped frame and the supporting rod are shown in the attached figure 4; the spraying tower sprays the configured salt fog into the space environment cover according to the state of the spraying switch; the salt fog collector is used for collecting salt fog in a space environment, facilitates the system to monitor the salt fog amount in the environment and adjust the spraying state in real time, also belongs to an input device, and is connected to an analog input module of the PLC.
The following describes an embodiment of the metal surface rust resistance test bench according to the present invention in detail with reference to fig. 1 and 2. Firstly, wiping and cleaning the surfaces of metal samples to be tested with the same size and uniform specification, cleaning and drying the surfaces by acetone, and sequentially placing the metal samples in a test platform according to the attached drawing 4; then, the input device and the output device in the test platform are connected with the PLC controller, and meanwhile, the HMI touch screen is connected with the PLC controller, and the specific connection mode is shown in figure 3. And finally, closing the space environment cover, setting preset environment parameters on an interactive interface, accelerating the corrosion of the surface of the metal sample by inputting and outputting a simulated salt spray environment, sequentially taking out the metal sample at regular time (the specific time length can be set according to the specific type and the number of the metal sample to be tested), placing the metal sample in a data acquisition platform, acquiring image data by the acquisition platform through a camera, transmitting the image data to a computer, and waiting for the subsequent detection and evaluation steps. Thus, the experimental operation and the process of the metal surface rust resistance test bench in a timing period are completed.
An example of the method for evaluating the rust resistance of a metal surface according to the present invention will be described in detail with reference to FIGS. 2 and 5. The main purpose of this embodiment is to segment the rust area on the metal surface in the image according to the image data collected by the above experimental table, calculate the rust ratio index, and determine whether the metal sample has reached the experimental termination condition by comparing with the rust ratio threshold (self-set according to the actual test condition characteristics). For the metal samples reaching the experiment termination condition, counting the experiment duration as the quantitative index of the anti-rust performance; and (4) putting the metal sample which does not reach the termination condition back to the testing platform of the experiment table again to continue the experiment until the termination condition is met. Finally, the anti-rusting performance of the metal samples can be evaluated according to the total experiment duration of the metal samples, the time interval from the beginning of the experiment to the time when the rusting ratio reaches the threshold value of each metal sample can reflect the anti-rusting performance of the metal rusting, and the longer the time difference is, the better the anti-rusting performance is. The embodiment comprises the following specific steps:
step 1: collecting image data of the surface of a metal sample; taking out the metal sample in the metal surface rust resistance test platform, placing the metal sample in a data acquisition platform, acquiring image data, transmitting the image data to a computer, and waiting for subsequent operation;
step 2: carrying out preprocessing operation on the image; because a small part of background interference and noise influence exists in the acquired image, the interference of the part can be eliminated by adopting a filtering and denoising method in a preprocessing stage, and redundant background parts are cut off, so that the image only contains a metal sample part; in addition, details are enhanced through an enhancement algorithm, and detail information of a rusty part highlights the difference between a rusty area and a non-rusty area, so that the detection accuracy is improved;
and step 3: performing coarse segmentation on the image by using a superpixel segmentation SLIC algorithm; dividing the preprocessed image into grids, roughly dividing the grids by adopting an SLIC method, dividing the image to be processed into a plurality of homogeneous sub-areas, namely superpixels, and converting the acquired color image into a CIELAB color space from a traditional RGB space; for each pixel point, 5-dimensional feature vectors are formed by the XY coordinate information of the spatial position of each pixel point and three color space components of lab, then a distance measurement standard is constructed for the 5-dimensional feature vectors, and local clustering is carried out on image pixels to obtain compact and approximately uniform super-pixel blocks; the distance measure is formulated as follows:
in the formula: d
cRepresents the color distance,/
i、a
i、b
iRespectively representing the lab space color value, l, of the pixel point i
j、a
j、b
jRespectively representing the lab space color values of the pixel point j; d
sRepresents the spatial distance, x
i,y
iIs the coordinate position, x, of pixel point i
j,y
jIs the coordinate position of pixel point j; d' represents a distance metric; n is a radical of
cRepresents the maximum color distance, usually replaced by a fixed value, for controlling the compactness of the super-pixel;
the maximum space distance in the class, N (f) is the total number of pixel points in the image, and n is the number of divided grids;
and 4, step 4: constructing a characteristic index and establishing a characteristic matrix; for each super-pixel block, the color information and the texture feature description area information of the pixel points in the area are counted;
let f (x, y), x ═ 1,2,. and M; and y is 1,2,.. N, the gray level of the image is L, a gradient operator is adopted to extract a gradient image g (x, y) of the super pixel region, the gradient image is subjected to gray level discretization, and the number of gray levels is LgEstablishing a gray level-gradient co-occurrence matrix, wherein the expression is as follows:
{Hij,i=0,1,...,L-1;j=0,1,...,Lg-1}
in the formula: hijRepresenting the number of elements in the set { (x, y) | f (x, y) ═ i, G (x, y) ═ j }; l isgIs the number of gray levels; x is 1,2,. said, M; n is the pixel width of the image, and N is the pixel height of the image;
by using the gray-gradient co-occurrence matrix, the following 17 commonly used texture characteristic parameters are established: small gradient dominance, large gradient dominance, gray distribution heterogeneity, gradient distribution heterogeneity, energy, gray average, gradient average, gray mean square error, gradient mean square error, gray smoothness, gradient smoothness, correlation, gray entropy, gradient entropy, mixed entropy, inertia, and inverse difference moment;
as all the collected images are color images, the characteristic indexes are calculated for 3 color channels of each super pixel block respectively, so that 3 × 17-51 characteristic parameters can be obtained in total, and the size of the established characteristic matrix is n × 51, wherein n is the number of the super pixel blocks;
and 5: performing principal component analysis to reduce the dimension of the index data; if the 51 characteristic parameters for describing the super-pixel block are obtained from step 4, if the parameters are directly used to jointly represent the information of the super-pixel area, the computational complexity of the problem will rise suddenly, and in addition, the 51 parameters are not independent, but rather, the parameters are often influenced and correlated, and there are many overlapping parts between them, so that the method of principal component analysis needs to be firstly used to perform dimension reduction processing on the indexes, thereby reducing the workload and simultaneously keeping most of the information represented by the indexes;
the step 5, the specific process includes the detailed steps of constructing an original data matrix, standardizing data, calculating a correlation coefficient matrix, calculating an eigenvalue and an eigenvector, calculating a principal component contribution rate, calculating an accumulated contribution rate, and calculating a principal component value;
considering the current cumulative contribution rate alphatWhen the content is more than or equal to 85 percent, the main components of the part contain most of information representing the original index, and the main component value can be calculated by taking out the part and is used for the subsequent initial data of the rust image segmentation;
step 6: partitioning an rusting area by a fuzzy C-means clustering algorithm; performing clustering analysis on the super-pixel blocks by taking the main components subjected to dimensionality reduction as characteristic indexes, and clustering the super-pixel blocks with similar main component values into a class; because the metal surface corrosion often presents the characteristic appearance such as unevenness, rusty scale and the like, the color also often presents dark red or even brown, and the color is greatly different from the color of the metal surface in a rusty area, the rusty area and a non-rusty area are classified according to the index formed by the main component values; in the digital image, the pixel value is 0 to represent black, 255 to represent white, and the rust characteristic is often dark red or even brown, so the pixel value is often close to black 0, namely the characteristic index value of the rust area is often smaller, and the main component value of the rust area is also often smaller, so the maximum main component average value of the area is calculated in each classified class, and the class with the minimum maximum main component average value is screened to be the rust area under the normal condition;
and 6, initializing parameters, initializing a membership matrix and a clustering center of the superpixel block, updating the membership matrix and the clustering center, performing cyclic iteration to obtain a final membership matrix, screening the category of the rust area and the like.
And 7: calculating the corrosion ratio and judging whether the corrosion ratio reaches a threshold value; counting the total number of pixel points of the metal sample in the image preprocessed in the step 2, counting the number of the pixel points of the corrosion region according to the corrosion region image obtained by screening after the segmentation in the step 6, and calculating the corrosion ratio of the metal sample according to the number; respectively calculating the rust ratio index of each tested metal sample, comparing the rust ratio index with a preset threshold value, and if the rust ratio is greater than the threshold value, judging that the metal sample reaches the experiment termination condition at the moment, and completing the rust resistance test of the metal sample; if the corrosion ratio is smaller than the threshold value, judging that the metal sample does not reach the experiment termination condition, and still putting the metal sample back to the test platform to wait for the subsequent continuous test;
and 8: after the performance test is finished, evaluating the anti-rust performance; and when the rust ratio indexes of all the metal samples exceed the preset threshold value, the performance test is finished. And after the experiment is finished, counting the total experiment duration of each metal sample as a quantitative index of the rust resistance for evaluating the surface rust resistance of the metal sample, namely counting the time from the first time of running of the test platform to the last time of taking out each metal sample for the experiment, wherein the time difference between the two times is the result of the rust resistance test of the metal sample, and the longer the time difference is, the better the rust resistance of the metal sample is.
Wherein, step 1 is used for collecting the image data; step 2-step 6 are used for detecting and segmenting rust areas in the image; step 7, judging the termination condition of the test; and 8, carrying out quantitative evaluation on the rust resistance of the test metal sample. Thereby completing the test evaluation of the rusty area segmentation and the rusty resistance of the metal surface.
Thus, the whole process of designing the metal surface rust resistance test bench, dividing the rust area and evaluating the rust resistance test is completed.
The invention is not limited to the metal surface rust resistance test bench and the rust resistance performance test method described above, and it should be noted that a set of rust region segmentation method is constructed by combining a superpixel segmentation algorithm (SLIC), a Principal Component Analysis (PCA) and a fuzzy C-means algorithm (FCM) in the test process, and the main content of the invention is also the invention. The foregoing description of the specific embodiments is intended to describe and illustrate the technical solutions of the present invention, and the above specific embodiments are merely illustrative and not restrictive.