A method for detecting curling of synthetic leather on-line
By installing a machine vision inspection device on the synthetic leather production line to monitor the edges of the cloth in real time, the problem of finished product scrapping caused by the hem width exceeding the threshold has been solved, and the quality control efficiency and product quality of the production line have been improved.
Patent Information
- Application Number
- CN202110793717.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-08-07
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2039-08-07
AI Technical Summary
On the synthetic leather wet gluing automated production line, the problem that the hem width exceeds the threshold causes the finished product to be scrapped. The existing manual inspection method has problems of missed detection and late discovery, which increases production costs and reduces the quality of synthetic leather.
Design an online detection device for synthetic leather hemming, which uses machine vision technology to monitor the edge of the cloth in real time, and realizes real-time detection of the hem width through components such as support rods, image acquisition modules, backlights, front light sources, alarm lights, and industrial computers. and alarm to avoid missed detection and delayed discovery due to manual inspection.
It realizes real-time monitoring and rapid alarm of the hem width of synthetic leather, reduces the scrapping of finished products caused by the hem width exceeding the threshold, and improves the quality control efficiency and product quality of the production line.
Smart Images

Figure CN113567447B
Abstract
Description
[0001] This patent application is a divisional application with application number 201910726981.0 filed on August 7, 2019, and is titled "An online detection device and method for wet-coated synthetic leather curling." Technical Field
[0002] The invention relates to synthetic leather detection, in particular to an online detection method for synthetic leather curling. Background Art
[0003] On the synthetic leather wet glue coating automated production line, the glued fabric may curl and the curl width may exceed the threshold. Curling width exceeding the threshold will directly affect the quality of the synthetic leather. In serious cases, it will cause the finished product of dozens of meters or even longer to be scrapped. The main reason for the curl width exceeding the threshold is that the fabric is stretched by the front and rear rollers when it is transmitted on the rollers, and its side sometimes rolls up. Because the glue has not dried yet, the rolled area and the glued area will stick together and the width of the bonding area is too wide.
[0004] However, manufacturers currently monitor the situation through manual inspections. Each production line is equipped with an inspector and there are three places to check the edge of the cloth. When the inspector finds that the curling width exceeds the threshold, the production line will be suspended first. If the situation is not serious, it will be cut off with a blade, and a thin flat clip will be clamped at the junction of the curling width exceeding the threshold and the normal section of the cloth edge, and then the equipment will be started. The purpose of placing the clip is to greatly reduce the probability of the curling width exceeding the threshold again at the edge of the nearby cloth; if the situation is serious, the folded cloth will be pulled back to its original state, and a thin flat clip will be clamped at the junction of the curling width exceeding the threshold and the normal section of the cloth edge, and then the equipment will be started; and this section of defective cloth will be cut off during the final inspection of the finished product.
[0005] However, the above-mentioned monitoring method through manual inspection has the following two defects: (1) Since the monitoring section of the production line is long, about 100 meters, and the three monitoring points are separated by more than 30 meters, the manual inspection method may miss detection, that is, the curling width exceeds the threshold but is not discovered until the final inspection of the finished product at the end of the production line; (2) The discovery is not timely, resulting in the length of the curling width exceeding the threshold being too long. If the front side is turned over and the curling becomes wider, the curling width will also increase. The above two defects increase production costs and reduce the quality of synthetic leather. Summary of the invention
[0006] The purpose of the present invention is to solve the deficiencies of the prior art and provide an online detection method for curling of synthetic leather, which has a simple structure and is easy to use.
[0007] A synthetic leather curling online detection device, characterized in that it includes a support rod, a support chassis, a first crossbar, a second crossbar, a backlight source, a short rod, a support rod, a front light source, a picture acquisition module, an alarm light, an industrial computer and an electrical control cabinet; the support rod is arranged on the support chassis, the support chassis is arranged on the ground, and the support rods are erected on the left and right sides of the detection point; the first crossbar is arranged between the support rods; the backlight source is arranged on the first crossbar; the short rod is arranged on the support rod, and a support rod is arranged between the short rod and the support rod; the second crossbar is arranged between the short rods; the picture acquisition module, the front light source and the alarm light are arranged on the second crossbar; the industrial computer and the electrical control cabinet are arranged on the support rod, and the industrial computer is electrically connected to the picture acquisition module and the front light source.
[0008] Furthermore, the cross bar 1 is parallel to the ground and is located above the cloth; the illumination surface of the backlight source is parallel to the cloth, and the backlight source is always on during the operation of the device; the short rod is vertically arranged to the support rod; the support rod, the short rod and the connecting part of the support rod form a right triangle; the cross bar 2 is located below the cloth and is parallel to the ground.
[0009] Furthermore, the image acquisition module includes an area array camera, a lens, a protective cover and a fixing part; the shooting surface of the image acquisition module is parallel to the cloth; the front light source is arranged on the left and right sides of the image acquisition module, and the irradiation surface of the front light source is parallel to the cloth.
[0010] A detection method based on the above device, the detection method specifically comprises the following steps:
[0011] 101) Turn on the detection system and enter the startup interface; the detection system receives the initialization instruction and enters the initialization process; the initialization process includes the industrial computer controlling the image acquisition module to continuously acquire images; the initialization process ends and enters the initialization interface;
[0012] 201) The detection system receives the setting instruction, enters the parameter setting interface, and inputs the parameters in the parameter setting interface; if the parameter setting is successful, it returns to the initialization interface;
[0013] 301) The detection system receives the detection instruction and enters the detection process, which includes out-of-bounds detection, burr detection on the edge of the cloth, and margin detection;
[0014] 302) First, an out-of-bounds detection is performed on a frame of image collected; if it is judged to be out-of-bounds, the detection system changes from a normal state to an out-of-bounds state, saves and displays the frame of image, and the alarm light sends an alarm signal. The detection process of the frame of image ends, and the detection system starts to perform an out-of-bounds detection on the next frame of image; if it is judged to be not out-of-bounds, the edge of the cloth is detected for the frame of image.
[0015] 303) If the detection result of step 302) is not out of bounds, the frame image is detected for whether there is burrs on the edge of the cloth; if the detection result of the detection of whether there is burrs on the edge of the cloth is burrs, the detection system determines that the frame image is normal, displays the frame image, and the detection process of the frame image ends, and the detection system starts to perform out-of-bounds detection on the next frame image; if the detection result is no burrs, the detection system determines that the frame image is curled, and the detection system changes from a normal state to a curled state, displays the frame image, and the detection process of the frame image ends, and the detection system starts to directly perform margin detection on the next frame image;
[0016] 304) If the detection result of step 303) is that there is no burr, the detection system enters the curling state, and the detection system starts to directly perform margin detection on the next frame of image; if the detection result of the margin detection is that the margin does not exceed the threshold, the detection system determines that the frame of image is normal, displays the frame of image, and the detection process of the frame of image ends, and the detection system performs out-of-bounds detection on the next frame of image; if the detection result is that the margin exceeds the threshold, the detection system determines that the curling width of the frame of image exceeds the threshold, and the detection system is switched to the curling width exceeding the threshold state, and the frame of image is saved and displayed, and the alarm light sends an alarm signal, the detection process of the frame of image ends, and the detection system directly performs margin detection on the next frame of image;
[0017] 401) The detection system receives a detection process end instruction, ends the detection process, and returns to the initialization interface. The detection system receives an abnormality record instruction and enters an abnormality record interface; the abnormality record interface can view images and abnormality records saved in the detection process;
[0018] 501) The detection system receives an exit instruction and shuts down.
[0019] Furthermore, the out-of-bounds detection includes the acquisition module acquiring an image in a 24-bit BMP format with a set pixel size; selecting a frame of the image to convert it into a grayscale image and performing mean filtering; dividing the image after mean filtering into N equal parts, and setting the first row of a certain area after N equal parts as parameter i; and the detection system determining whether the value of parameter i is less than the total number of rows;
[0020] If the value of i is less than the total number of rows, determine whether the currently acquired image is a left image or a right image; if it is a left image, set parameter j to the ith row and the first column; set the pixel value of the ith row and the 0th column to 255; set the absolute value of the difference between the pixel values of the ith row and the 0th column and j to be greater than the set threshold number of times to 0, and the absolute value of the difference between the pixel values is not greater than the set threshold number of times to 0; the set threshold is 127; if it is a right image, set parameter j to the ith row and the first column; set the pixel value of the ith row and the 0th column to 0; set the absolute value of the difference between the pixel values of the ith row and the 0th column and j to be greater than the set threshold number of times to 0, and the absolute value of the difference between the pixel values is not greater than the set threshold number of times to 0;
[0021] If the j value is less than (total number of columns - 1), find the absolute value of the difference between the pixel values in the 0th column of the i-th row and j, and determine whether the absolute value is greater than the set threshold;
[0022] If the absolute value of the difference between the pixel values of the 0th column of the i-th row and j is greater than the set threshold, then determine whether the number of times the absolute value is greater than the set threshold is greater than 0; if the number of times the absolute value is greater than the set threshold is not greater than 0, save the j value, and add 1 to the number of times the absolute value is greater than the set threshold; if the number of times the absolute value is greater than the set threshold is greater than 0, add 1 to the number of times the absolute value is greater than the set threshold, and determine whether the number of times the absolute value is greater than the set threshold is greater than the set value. If so, save the i value, if not, add 1 to j; the j plus 1 is the number of columns of j plus one;
[0023] If the absolute value of the difference between the pixel values of the 0th column of the i-th row and j is not greater than the set threshold, then determine whether the number of times the absolute value is greater than the set threshold is greater than 0; if the number of times the absolute value is greater than the set threshold is not greater than 0, j is increased by 1; if the number of times the absolute value is greater than the set threshold is greater than 0, the number of times the absolute value is not greater than the set threshold is increased by 1, and it is determined whether the number of times the absolute value is not greater than the set threshold is greater than the set value, if not, j is increased by 1; if so, delete the j value saved in the i-th row, the number of times the absolute value is not greater than the set threshold is reset to zero, and the number of times the absolute value is greater than the set threshold is reset to zero;
[0024] If the i value is equal to the total number of rows, determine whether the number of saved rows is greater than 2; if so, count the j-th column values of each i-row, remove the maximum value and calculate the average value, which is the column value of the located edge of the cloth, and the process ends; if not, it is determined to be out of bounds, and the process ends.
[0025] Furthermore, the detection of whether the edge of the cloth has burrs includes the detection system extracting the area to be detected according to the located cloth edge column value, and the area to be detected is represented by the letter ROI; then converting the ROI into a grayscale image, and performing Sober edge detection and thresholding processing on the ROI; extracting all edge contour pixel points, finding the contour with the longest contour perimeter, and forming a contour point set with the pixel points on the contour; traversing the contour point set to find the maximum distance between two points; judging whether the longest perimeter is greater than a set multiple of the maximum distance; if so, judging it as a burr, and the burr detection ends; if not, judging it as no burr, and the burr detection ends;
[0026] The image thresholding process is to use the maximum inter-class variance method to determine the threshold k of the optimal gray value of the image * ; then use k * -1 for image thresholding, greater than k * The grayscale value of the pixel with -1 is set to 255, and the grayscale values of the other pixels are set to 0.
[0027] The optimal threshold k obtained by the maximum inter-class variance method * that is
[0028]
[0029] Where k is the assumed gray value threshold, is the between-class variance.
[0030] Furthermore, the Sober edge detection process is as follows:
[0031] (a) Assume that matrix A represents the pixel value matrix of the ROI area;
[0032] (b) Calculate the derivative G in the horizontal direction (x) x and the derivative in the vertical direction (y) G y ;
[0033] Horizontal direction: Convolve A with a kernel of size 3, as shown in formula (1):
[0034]
[0035] Vertical direction: Convolve A with a kernel of size 3, as shown in formula (2):
[0036]
[0037] The grayscale values of each pixel in the horizontal and vertical directions of the image are combined by the following formula (3) to calculate the grayscale value G of the pixel;
[0038]
[0039] Furthermore, the margin detection includes the following steps: the image acquisition module acquires a frame of image and sends it to the detection system; the detection system converts the image into a grayscale image and performs grayscale value detection; the grayscale value detection specifically adjusts the camera exposure according to the grayscale setting threshold and determines whether the average grayscale value of the image has been adjusted to the set threshold; if not, returns to the acquisition module to acquire a frame of image and continues to adjust and determine; if so, then performs bilateral filtering on the image; then performs Sober edge detection and thresholding on the image to extract image edge pixels; uses the extracted image edge pixels to perform Hough line transform to find all straight lines in the image Segments are collected, and the straight line segments with slopes greater than the set slope are saved, and it is determined whether the number of saved straight line segments is greater than 1; if the number of saved straight line segments is not greater than 1, the detection result is that the margin does not exceed the threshold, and this detection ends; if the number of saved straight line segments is greater than 1, then it is determined whether the image processed this time is the left image; if it is the left image, the horizontal coordinate values of the midpoints of each straight line segment are compared, and the two straight line segments with the smallest and second smallest horizontal coordinate values of the midpoint are found; if it is not the left image, it means that the image is the right image, then the horizontal coordinate values of the midpoints of each straight line segment are compared, and the two straight line segments with the largest and second largest horizontal coordinate values of the midpoint are found;
[0040] Calculate the distance between the two straight line segments and determine whether the distance is greater than the set margin threshold; if so, proceed to the detection result that the margin exceeds the threshold and the detection ends; if not, proceed to the detection result that the margin does not exceed the threshold and the detection ends.
[0041] Furthermore, the implementation idea of the Hough line transform to find straight line segments is as follows:
[0042] First, the straight line is represented by the polar coordinate system. The expression of the straight line is shown in formula (4), where r represents the polar diameter and θ represents the polar angle;
[0043]
[0044] Simplifying formula (4) yields formula (5):
[0045] r=xcosθ+ysinθ (5)
[0046] Next, for a given point (x0, y0), a cluster of straight lines passing through the point can be uniformly defined as:
[0047] r θ =x0cosθ+y0sinθ (6)
[0048] This means that for every pair (r θ ,θ) represents the straight line passing through the point (x0, y0);
[0049] For a given invariant point (x0, y0), r θIt changes with the change of θ; draw all the straight lines passing through the point (x0, y0) on the plane θ-r to obtain a sine curve;
[0050] The above operation is performed on all edge pixels in the image. If the number of curves intersecting at a point on the plane θ-r exceeds a certain threshold, then it can be considered that the parameter pair represented by this intersection is a straight line in the original image; then the reverse calculation is performed using formula (4).
[0051] Furthermore, the abnormal records include out-of-bounds information records and curling width exceeding threshold information records; when the detection system is in the out-of-bounds state and the normal state, only burr detection and out-of-bounds detection are performed; when the detection system is in the curling state and the curling width exceeding threshold state, only margin detection is performed; when the detection process performs out-of-bounds detection in the normal state, the counting and judgment function of the number of out-of-bounds and no-burr edge detections is added; when the detection process performs burr edge detection in the out-of-bounds state, the counting and judgment function of the number of burr edge and no-burr edge detections is added; when the detection process performs burr edge detection in the out-of-bounds state, the counting and judgment function of the number of times the burr edge and no-burr edge detections are added; when the detection process performs margin detection in the curling state, the counting and judgment function of the number of times the margin exceeds the threshold and the number of times the margin does not exceed the threshold is added; when the detection process performs margin detection in the curling width exceeding threshold state, the counting and judgment function of the number of times the margin does not exceed the threshold is added.
[0052] The beneficial effects of adopting the present invention are:
[0053] The present invention designs an online detection device for wet-coated synthetic leather curling, which adopts an online detection method based on machine vision to monitor the left and right sides of the cloth in the process of wet-coating of synthetic leather in real time. By installing one device at each of the three places where the edge of the cloth can be viewed on the production line, real-time monitoring is carried out, and the monitoring data is transmitted to the workshop monitoring room in real time. When it is detected that the curling width exceeds the threshold, the device saves and displays the image, and the alarm automatically alarms, and the abnormal state of the production line is fed back to the control room in time, so as to realize real-time monitoring and rapid processing; in other cases, the device can also save the image for viewing at any time.
[0054] The present invention uses machines to replace manual labor, thus avoiding the possibility of missed inspections or untimely discovery of problems in manual inspections, thereby ensuring the quality of produced cloth.
[0055] The edge of the cloth is determined and verified through grayscale value detection, which facilitates the detection of edge burrs and curling. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] Figure 1 It is a schematic diagram of the structure of the present invention;
[0057] Figure 2 This is a flow chart of the human-computer interaction interface operation of the present invention;
[0058] Figure 3 It is the overall flow chart of the detection of the present invention;
[0059] Figure 4 This is a flow chart of out-of-bounds detection and edge positioning of the present invention;
[0060] Figure 5 This is a flow chart of burr detection of the present invention;
[0061] Figure 6 This is a flow chart of margin detection of the present invention;
[0062] Figure 7 This is a gray value detection flow chart of the present invention.
[0063] Explanation of the accompanying reference numerals: support rod 1, supporting chassis 2, cross bar one 3, backlight source 4, short rod 5, cross bar two 6, image acquisition module 7, front light source 8, alarm light 9, industrial computer 10, electrical control cabinet 11, support rod 12. DETAILED DESCRIPTION
[0064] The present invention will be further described below with reference to the accompanying drawings and specific embodiments.
[0065] Embodiment 1:
[0066] like Figure 1As shown, an online detection device for curling of synthetic leather with wet gluing includes a support rod 1, a support chassis 2, a cross bar 1 3, a backlight source 4, a short rod 5, a cross bar 2 6, a picture acquisition module 7, a front light source 8, an alarm light 9, an industrial computer 10, an electrical control cabinet 11, and a support rod 12. There are two support rods 1, and the two support rods 1 are erected on the left and right sides of the detection point respectively. The support rods 1 are arranged on the support chassis 2. The support chassis 2 is arranged on the ground. The support rods 1 and the support chassis 2 constitute the load-bearing support structure of the entire detection device. The cross bar 1 3 is arranged between the support rods 1, and the cross bar 1 3 is arranged parallel to the ground and located above the cloth. The cross bar 3 is provided with a backlight source 4. There are two backlight sources 4, and the irradiation surface of the backlight source 4 is parallel to the lower surface of the cloth. The backlight source 4 is in a constant light state during the entire detection process. The short rod 5 is arranged on the support rod 1, and the short rod 5 is perpendicular to the front end surface of the support rod 1, and the front end surface is the side of the cloth entering the detection device. A support rod 12 is arranged between the short rod 5 and the support rod 1, and the support rod 12 is arranged at the lower end surface of the short rod 5 and the front end surface of the support rod 1. The support rod 12 arranged on the same side of the detection point and the connecting part of the support rod 1 and the short rod 5 form a right triangle structure, so that the structure of the short rod 5 is more solid and the load-bearing capacity is stronger. The second crossbar 6 is arranged between the support rods 5, and the second crossbar 6 is arranged parallel to the ground and the second crossbar is located below the cloth. The image acquisition module 7, the front light source 8 and the alarm light 9 are arranged on the second crossbar 6. The image acquisition module 7 includes a surface array camera, a lens, a protective cover and a fixing. The shooting surface of the image acquisition module is parallel to the cloth. There are two image acquisition modules 7, and the two image acquisition modules are respectively used to collect images of the edges on both sides of the cloth. The front light source 8 is arranged on the left and right sides of the image acquisition module 7. The front light source 8 is only lit when the operating state of the detection system is the curling state or the curling width exceeds the threshold state, and it is turned off in other states. The irradiation surface of the front light source 8 is parallel to the cloth surface. The alarm light 9 is used for alarm reminder. When the detection system is running in an out-of-bounds state or the curling width exceeds the threshold value, the alarm light 9 sends out an alarm signal. The specific alarm signal is an alarm sound and the normal green light turns into a red light. The industrial computer 10 and the electrical control cabinet 11 are arranged on the front end face of the support rod 1, below the short rod 5. The industrial computer 10 is electrically connected to the image acquisition module 7 and the front light source 8. The image collected by the image acquisition module 7 is transmitted to the industrial computer 10, and the industrial computer 10 can also control the switch of the front light source 8. The electrical control cabinet 11 is used to convert the input 220V mains power into the voltage and current required by each component in the detection device, and output the converted voltage and current to each component.
[0067] like Figure 2As shown, an online detection method for wet-coated synthetic leather curling is provided, and the detection method relies on the above-mentioned detection device. The detection method includes a detection system; after the detection system is turned on, it enters a power-on interface, and the power-on interface includes an initialization button and an exit button. The exit button of the power-on interface can shut down the detection system. Clicking the initialization button sends an initialization instruction, and the detection system receives the initialization instruction and enters the initialization process. The initialization process includes the industrial computer 10 sending a signal, and the image acquisition module 7 receives the signal sent by the industrial computer 10 and starts to collect images. After the initialization process is completed, the initialization interface is entered. The image collected by the image acquisition module 7 can be displayed in real time on the initialization interface.
[0068] The initialization interface includes a setting button, a detection button, an abnormal record button and an exit button. Click the setting button to issue a setting instruction, the detection system receives the setting instruction, and enters the parameter setting interface. The parameter setting interface includes a confirmation button and a cancel button. Click the confirmation button to successfully set the parameters and return to the initialization interface. Click the cancel button to fail to set the parameters and return to the initialization interface. The parameter setting is specifically a manual setting. Click the detection button to issue a detection instruction, the detection system receives the detection instruction, enters the detection interface and starts the detection process. The detection interface includes a stop button. Click the stop button to issue a stop instruction, the detection system receives the stop instruction, ends the detection process and returns to the initialization interface; otherwise, the detection process continues. Click the abnormal record button to issue an abnormal record instruction, the detection system receives the abnormal record instruction, and enters the abnormal record interface. The images and abnormal records saved in the detection process can be viewed in the abnormal record interface. The abnormal records include the out-of-bounds information record of the cloth and the record of the curling width exceeding the threshold. The abnormal record interface includes a return button. Clicking the return button can exit the abnormal record interface and return to the initialization interface; the exit button of the initialization interface can shut down the detection system. The initial state of the detection system is a normal state.
[0069] like Figure 3 As shown, the detection process is specifically that the detection system first performs a bounds detection on a frame of image collected by the acquisition module 7. If the detection system determines that the frame of image is out of bounds, the detection system changes from a normal state to an out-of-bounds state, the detection system saves the frame of image and displays the frame of image on the display interface and marks the frame of image as out of bounds, and the alarm light 9 sends an alarm signal, the detection process of the frame of image ends, and the detection system starts to perform an out-of-bounds detection on the next frame of image; if it is determined to be out of bounds, the edge of the cloth is detected for the frame of image. If the state of the detection system is out of bounds at this time, it changes to a normal state, otherwise it remains unchanged.
[0070] The edge of the cloth is detected for burrs. If the detection result is burrs, the detection system determines that the frame image is normal, displays the frame image and marks the frame image as normal, the detection process of the frame image ends, and the detection system starts the detection process of the next frame image starting with out-of-bounds detection; if the detection result is no burrs, the detection system determines that the frame image is a curled edge, the detection system changes from a normal state to a curled edge state, displays the frame image on the display interface and marks the frame image as a curled edge, the detection process of the frame image ends, the detection system starts to detect the next frame image, and directly performs margin detection on the next frame image.
[0071] The margin detection, if the detection result is that the margin does not exceed the threshold, the detection system determines that the frame image is normal, displays the frame image on the display interface and marks the frame image as normal, the frame image detection process ends, the detection system turns to normal state, and the detection system starts the detection process starting with out-of-bounds detection for the next frame image; if the detection result is that the margin exceeds the threshold, the detection system determines that the frame image is that the curling width exceeds the threshold, if the detection system is in the curling state, the detection system turns to the curling width exceeding the threshold state, otherwise the detection system maintains the curling width exceeding the threshold state, the detection system saves the frame image, displays the frame image on the display interface and marks the frame image as the margin exceeds the threshold, and the alarm light 9 sends an alarm signal, the frame image detection process ends, the detection system starts to detect the next frame image, and directly performs margin detection on the next frame image.
[0072] In order to reduce the misjudgment of out-of-bounds and no burrs when the detection system is in a normal state, the detection process adds the function of counting and judging the number of times the above two judgment processes are detected. In order to reduce the misjudgment of burrs and no burrs when the detection system is in an out-of-bounds state, the detection process adds the function of counting and judging the number of times the above two judgment processes are detected. In order to reduce the misjudgment of the margin exceeding the threshold and the margin not exceeding the threshold when the detection system is in a curling state, the detection process adds the function of counting and judging the number of times the above two judgment processes are detected. In order to reduce the misjudgment of the margin not exceeding the threshold when the detection system is in a curling width exceeding the threshold, the detection process adds the function of counting and judging the number of times the above judgment processes are detected. When the detection system is in a normal state, if the detection result is that the number of consecutive occurrences of the out-of-bounds situation exceeds the set threshold, the detection system enters the out-of-bounds state; if the detection result is that the number of consecutive occurrences of the no burrs situation exceeds the set threshold, the detection system enters the curling state. When the detection system is in the out-of-bounds state, if the number of consecutive occurrences of the detection result of burrs exceeds the set threshold, the detection system enters the normal state; if the number of consecutive occurrences of the detection result of no burrs exceeds the set threshold, the detection system enters the curling state. When the detection system is in the curling state, if the number of consecutive occurrences of the detection result of the margin not exceeding the threshold exceeds the set threshold, the detection system enters the normal state; if the number of consecutive occurrences of the detection result of the margin exceeding the threshold exceeds the set threshold, the detection system enters the curling width exceeding threshold state. When the detection system is in the curling width exceeding threshold state, if the number of consecutive occurrences of the detection result of the margin not exceeding the threshold exceeds the set threshold, the detection system enters the normal state.
[0073] The process of out-of-bounds detection is as follows Figure 4As shown. First, the image acquisition module 7 acquires the image of the cloth production line, and the image is a 24-bit BMP format image with a set pixel size. The detection system selects a frame of image from the acquired image, converts the image into a grayscale image and performs mean filtering. The process of converting the image into a grayscale image includes converting the 24-bit image into an 8-bit 3-channel image, and then converting the obtained 8-bit 3-channel image into a single-channel 256-color image. The mean filtering is to filter the grayscale image using the neighborhood mean method, and the domain mean processing of the image can make the overall display of the image smoother. Specifically, the neighborhood mean method can be described as first selecting a target pixel, and the target pixel is combined with the 8 surrounding pixels around the target pixel to form a filtering template, and then the grayscale value of the target pixel is replaced by the average grayscale value of all pixels in the filtering template. The total pixels are 9 pixels including the target pixel. Next, the filtered grayscale image is divided into N equal parts, and the first row of a certain area after N equal parts is set as parameter i. Therefore, the value range of parameter i is the 0th row, the (total number of rows / N)th row, ..., the (total number of rows-(total number of rows / N))th row of the total number of rows. In this embodiment, the value of N is set to 5. The detection system determines whether the value of parameter i is less than the total number of rows. If so, it determines whether the currently acquired image is a left image or a right image. The left image is a picture obtained by the image acquisition module set on the left; the right image is a picture obtained by the image acquisition module set on the right. If it is a left image, set parameter j to the i-th row and the first column; set the pixel value of the i-th row and the 0th column to 255; set the absolute value of the difference between the pixel values of the i-th row and the 0th column and j to be greater than the set threshold number of times to 0, and the absolute value of the difference between the pixel values is not greater than the set threshold number of times to 0. In this embodiment, the set threshold is 127. If it is the right image, set parameter j to row i, column 1; set the pixel value of row i, column 0 to 0; set the absolute value of the difference between the pixel values of row i, column 0 and j to be greater than the set threshold to 0, and the absolute value of the difference between the pixel values is not greater than the set threshold to 0. If the j value is less than (total number of columns - 1), calculate the absolute value of the difference between the pixel values of row i, column 0 and j. Determine whether the absolute value is greater than the set threshold.
[0074] If the absolute value of the difference between the pixel values of the 0th column of the i-th row and j is greater than the set threshold, then determine whether the number of times the absolute value is greater than the set threshold is greater than 0. If the number of times the absolute value is greater than the set threshold is not greater than 0, save the j value, and add 1 to the number of times the absolute value is greater than the set threshold; if the number of times the absolute value is greater than the set threshold is greater than 0, add 1 to the number of times the absolute value is greater than the set threshold, and determine whether the number of times the absolute value is greater than the set threshold is greater than the set value. If so, save the i value, if not, add 1 to j. The j plus 1 is the number of columns of j plus one. After j is added by 1 for the first time, j is the pixel value of the 2nd column of the i-th row, and so on.
[0075] If the absolute value of the difference between the pixel values of the 0th column of the i-th row and j is not greater than the set threshold, then determine whether the number of times the absolute value is greater than the set threshold is greater than 0. If the number of times the absolute value is greater than the set threshold is not greater than 0, j is increased by 1; if the number of times the absolute value is greater than the set threshold is greater than 0, then the number of times the absolute value is not greater than the set threshold is increased by 1, and it is determined whether the number of times the absolute value is not greater than the set threshold is greater than the set value, if not, j is increased by 1; if so, the j value saved in the i-th row is deleted, the number of times the absolute value is not greater than the set threshold is reset to zero, and the number of times the absolute value is greater than the set threshold is reset to zero.
[0076] If the i value is equal to the total number of rows, then determine whether the number of saved rows is greater than 2. If so, count the j-th column values of each i-th row, remove the maximum value and calculate the average value, which is the column value of the located cloth edge, and the process ends; if not, it is determined to be out of bounds, and the process ends.
[0077] The process of detecting whether there is burr on the edge of the cloth is as follows Figure 5 As shown. The detection system can extract the region to be detected (ROI) according to the located column value of the cloth edge. Specifically, if the column value is less than 1 / 20 of the total number of columns in the image, the ROI is a rectangular area, the upper left corner starting point of the rectangle is the origin of the image, the coordinates are (0, 0), the length = the total number of rows in the image, the width = (the total number of columns in the image) - (the located column value) + (1 / 20 of the total number of columns in the image). If the column value is greater than 19 / 20 of the total number of columns in the image, the ROI is a rectangular area, the upper left corner starting point of the rectangle has the coordinates ((located column value - (1 / 20 of the total number of columns in the image)), 0), the length = the total number of rows in the image, the width = (the total number of columns in the image) - (the located column value) + (1 / 20 of the total number of columns in the image). If the column value is not less than 1 / 20 of the total number of columns in the image and not greater than 19 / 20 of the total number of columns in the image, the ROI is a rectangular area with the coordinates of the starting point of the upper left corner of the rectangle being ((the positioned column value - (1 / 20 of the total number of columns in the image)), 0), the length = the total number of rows in the image, and the width = 1 / 10 of the total number of columns in the image.
[0078] Convert the ROI into a grayscale image, and then perform Sober edge detection on the ROI.
[0079] The Sober edge detection process is as follows:
[0080] (1) Assume that matrix A represents the pixel value matrix of the ROI area;
[0081] (2) Calculate the derivative G in the horizontal direction (x) x and the derivative in the vertical direction (y) G y ;
[0082] Horizontal direction: Convolve A with a kernel of size 3, as shown in formula (1):
[0083]
[0084] Vertical direction: Convolve A with a kernel of size 3, as shown in formula (2):
[0085]
[0086] The grayscale values of each pixel in the horizontal and vertical directions of the image are combined by the following formula (3) to calculate the grayscale value G of the pixel.
[0087]
[0088] Then, the ROI after edge detection is subjected to image thresholding. The image thresholding uses the maximum inter-class variance method to determine the threshold k of the optimal grayscale value of the image. * The principle of the maximum inter-class variance method is that the larger the inter-class variance between the background and the target, the greater the difference between the two parts of the image, which means that the probability of misclassification of the two parts of the image is the smallest, and then the optimal threshold k of the gray value of the image thresholding is obtained. * . Find k * Then, use k * -1 for image thresholding, greater than k * The grayscale value of the pixel with a gray value of -1 is set to 255, and the grayscale values of the remaining pixels are set to 0. After thresholding, the grayscale image becomes a black and white image, with a grayscale value of 0 representing black and a grayscale value of 255 representing white.
[0089] Then, extract all edge contour pixel points, find the contour with the longest contour perimeter, and use the pixel points on this contour to form a contour point set. Traverse the contour point set to find the maximum spacing between two points. Determine whether the longest perimeter is greater than the set multiple of the maximum spacing (the multiple value is set to 2.1 in this embodiment). If so, it is judged as a burr and the burr detection ends; if not, it is judged as no burr and the burr detection ends.
[0090] The maximum inter-class variance method is implemented as follows:
[0091] The grayscale image to be tested has 256 grayscale values [1, 2, ..., 256]. The number of pixels with grayscale value i is ni, so the total number of pixels is
[0092] Using the normalized grayscale value histogram and considering it as the probability distribution of this image, the probability that a random pixel has a grayscale value of i is pi:
[0093] pi=ni / N,pi≥0,
[0094] Now assume that these pixels are divided into two categories: C0 and C1 by a threshold with a grayscale value of k; C0 represents pixels with grayscale values of [1, 2, ..., k], and C1 represents pixels with grayscale values of [k+1, ..., 256]. Then, the probability that a random pixel belongs to C0 is set to ω0; the probability that a random pixel belongs to C1 is set to ω1; the average grayscale value of pixels in C0 is μ0; the average grayscale value of pixels in G1 is μ1. The specific calculation is shown in formulas (5) to (8):
[0095]
[0096]
[0097]
[0098]
[0099] Among them, ω(k) represents the probability that the grayscale value of a random pixel belongs to [1, 2, ..., k]; μ(k) represents the average grayscale value of the set of pixels whose grayscale values belong to [1, 2, ..., k].
[0100]
[0101]
[0102] And μ T Represents the average gray value of the entire image.
[0103]
[0104] For any chosen k, we have:
[0105] ω0μ0+ω1μ1=μ T ,ω0+ω1=1. (12)
[0106] The η in the following formula (13) is selected as the measurement standard for evaluating the "goodness" (separability) of selecting k as the threshold
[0107]
[0108] in, represents the between-class variance; Represents the total variance of grayscale values:
[0109]
[0110] According to formula (12), we can get:
[0111]
[0112] Use the following formula to select different k values to search sequentially, and find the optimal threshold k according to equations (9) and (10): * , so that η reaches the maximum value. Substituting equations (4) and (11) into equations (14) and (15), it is not difficult to observe that the total variance of the gray value is The value of does not change with the value of k, so making η reach the maximum value is equivalent to making Reach the maximum.
[0113]
[0114]
[0115] Therefore, the optimal threshold k * From formula (18),
[0116]
[0117] The margin detection process is as follows Figure 6 As shown. The image acquisition module 7 collects a frame of image and sends it to the detection system. The detection system converts the image into a grayscale image and performs grayscale value detection. The grayscale value detection is specifically to adjust the camera exposure according to the grayscale setting threshold and determine whether the average grayscale value of the image has been adjusted to the set threshold. If not, return to the image acquisition module 7 to collect a frame of image and continue to adjust and judge; if so, the average grayscale value of the image is already within the set threshold range, and then bilateral filtering is performed on the image to make the boundary between the glued area and the un-glueized area of the edge of the cloth clearer. Then perform Sober edge detection and threshold processing on the image to extract the edge pixel points of the image. Using the extracted edge pixel points, use Hough line transform to find all the straight line segments in the image, and save the straight line segments with a slope greater than the set slope. Then determine whether the number of saved straight line segments is greater than 1. If the number of saved straight line segments is not greater than 1, go to the detection result that the margin does not exceed the threshold, and this detection ends; if the number of saved straight line segments is greater than 1, then determine whether the image processed this time is the left image. If it is the left image, compare the horizontal coordinate values of the midpoints of each straight line segment and find the two straight line segments with the smallest and second smallest horizontal coordinate values of the midpoints; if it is not the left image, it means that the image is the right image, then compare the horizontal coordinate values of the midpoints of each straight line segment and find the two straight line segments with the largest and second largest horizontal coordinate values of the midpoints. Find the spacing between these two straight line segments and determine whether this spacing is greater than the set margin threshold. If so, go to the detection result of the margin exceeding the threshold, and this detection ends; if not, go to the detection result of the margin not exceeding the threshold, and this detection ends.
[0118] The implementation idea of the Hough line transform to find straight line segments is as follows:
[0119] First, the straight line is represented by the polar coordinate system. The expression of the straight line is as shown in equation (19), where r represents the polar diameter and θ represents the polar angle;
[0120]
[0121] Simplified:
[0122] r=xcosθ+ysinθ (20)
[0123] Next, for a given point (x0, y0), a cluster of straight lines passing through the point can be uniformly defined as:
[0124] r θ =x0cosθ+y0sinθ (21)
[0125] This means that for every pair (r θ ,θ) represents the straight line passing through the point (x0, y0).
[0126] For a given invariant point (x0, y0), r θ As θ changes, a sine curve will be obtained by drawing all straight lines passing through the point (x0, y0) on the polar coordinate to polar diameter and angle plane. The horizontal axis of the polar coordinate to polar diameter and angle plane is θ, and the vertical axis is r, that is, the plane θ-r described below.
[0127] The above operation can be performed on all points in the image. If the curves obtained after the above operation on two different points intersect in the plane θ-r, it means that they pass through the same straight line.
[0128] What Hough line transform does is to track each point in the image to the intersection of the curves in the plane θ-r. If the number of curves intersecting at a point exceeds a certain threshold, then it can be considered that the parameter pair represented by this intersection is a straight line in the original image. Then, the straight line can be obtained by reverse calculation using formula (19).
[0129] The gray value detection process is as follows Figure 7 As shown. According to the located column value of the cloth edge, select an area in the grayscale image. The selected area is a rectangular area, the starting point of the upper left corner of the rectangle is the coordinate point ((total number of image columns - (total number of image columns - located column value) / 10), 0) in the image, the length = the total number of rows in the image, the width = (total number of image columns - located column value) / 10. Then, traverse all the pixels in the area and calculate the average grayscale value. Determine whether the average grayscale value is within the set threshold range. In this embodiment, the threshold range is set to 70-80. If the average grayscale value of the selected area is within the set threshold range, it is judged that the grayscale value is appropriate and the detection ends; if the average grayscale value of the selected area is not within the set threshold range, it is judged that the grayscale value is too large or too small, and the detection ends.
[0130] The above description is only a specific embodiment of the present invention and does not limit the present invention in any form. Simple modifications, equivalent changes or modifications made without departing from the technical solution of the present invention all fall within the protection scope of the present invention.
Claims
1. A method for online detection of synthetic leather curling, characterized in that: The detection method specifically comprises the following steps: 101) Turn on the detection system and enter the startup interface; the detection system receives the initialization instruction and enters the initialization process; the initialization process includes the industrial computer controlling the image acquisition module to continuously acquire images; the initialization process ends and enters the initialization interface; 201) The detection system receives the setting instruction, enters the parameter setting interface, and inputs the parameters in the parameter setting interface; if the parameter setting is successful, it returns to the initialization interface; 301) The detection system receives the detection instruction and enters the detection process, which includes out-of-bounds detection, burr detection on the edge of the cloth, and margin detection; 302) First, an out-of-bounds detection is performed on a frame of image collected; if it is judged to be out-of-bounds, the detection system changes from a normal state to an out-of-bounds state, saves and displays the frame of image, and the alarm light sends an alarm signal. The detection process of the frame of image ends, and the detection system starts to perform an out-of-bounds detection on the next frame of image; if it is judged to be not out-of-bounds, the edge of the cloth is detected for the frame of image. 303) If the detection result of step 302) is not out of bounds, the frame image is detected for whether there is burrs on the edge of the cloth; if the detection result of the detection of whether there is burrs on the edge of the cloth is burrs, the detection system determines that the frame image is normal, displays the frame image, and the detection process of the frame image ends, and the detection system starts to perform out-of-bounds detection on the next frame image; if the detection result is no burrs, the detection system determines that the frame image is curled, and the detection system changes from a normal state to a curled state, displays the frame image, and the detection process of the frame image ends, and the detection system starts to directly perform margin detection on the next frame image; 304) If the detection result of step 303) is that there is no burr, the detection system enters the curling state, and the detection system starts to directly perform margin detection on the next frame of image; if the detection result of the margin detection is that the margin does not exceed the threshold, the detection system determines that the frame of image is normal, displays the frame of image, and the detection process of the frame of image ends, and the detection system performs out-of-bounds detection on the next frame of image; if the detection result is that the margin exceeds the threshold, the detection system determines that the curling width of the frame of image exceeds the threshold, and the detection system is switched to the curling width exceeding the threshold state, and the frame of image is saved and displayed, and the alarm light sends an alarm signal, the detection process of the frame of image ends, and the detection system directly performs margin detection on the next frame of image; The out-of-bounds detection includes a collection module collecting an image in a 24-bit BMP format with a set pixel size; Select a frame of image to convert it into grayscale image and perform mean filtering; The image after mean filtering is divided into N equal parts, and the first row of a certain area after N equal parts is set as parameter i; the detection system determines whether the value of parameter i is less than the total number of rows; If the value of i is less than the total number of rows, then determine whether the currently acquired image is the left image or the right image; If it is the left image, set parameter j to the i-th row and the first column; set the pixel value of the i-th row and the 0th column to 255; set the absolute value of the difference between the pixel values of the i-th row and the 0th column and j to be greater than the set threshold number of times to 0, and the absolute value of the difference between the pixel values is not greater than the set threshold number of times to 0; the set threshold is 127; if it is the right image, set parameter j to the i-th row and the first column; set the pixel value of the i-th row and the 0th column to 0; set the absolute value of the difference between the pixel values of the i-th row and the 0th column and j to be greater than the set threshold number of times to 0, and the absolute value of the difference between the pixel values is not greater than the set threshold number of times to 0; If the j value is less than the difference of the total number of columns minus 1, find the absolute value of the difference between the pixel values of the 0th column of the i-th row and j, and determine whether the absolute value is greater than the set threshold; If the absolute value of the difference between the pixel values of the 0th column of the i-th row and j is greater than the set threshold, then determine whether the number of times the absolute value is greater than the set threshold is greater than 0; if the number of times the absolute value is greater than the set threshold is not greater than 0, save the j value, and add 1 to the number of times the absolute value is greater than the set threshold; if the number of times the absolute value is greater than the set threshold is greater than 0, add 1 to the number of times the absolute value is greater than the set threshold, and determine whether the number of times the absolute value is greater than the set threshold is greater than the set value. If so, save the i value, if not, add 1 to j; the j plus 1 is the number of columns of j plus one; If the absolute value of the difference between the pixel values of the 0th column of the i-th row and j is not greater than the set threshold, then determine whether the number of times the absolute value is greater than the set threshold is greater than 0; if the number of times the absolute value is greater than the set threshold is not greater than 0, j is increased by 1; if the number of times the absolute value is greater than the set threshold is greater than 0, the number of times the absolute value is not greater than the set threshold is increased by 1, and it is determined whether the number of times the absolute value is not greater than the set threshold is greater than the set value, if not, j is increased by 1; if so, delete the j value saved in the i-th row, the number of times the absolute value is not greater than the set threshold is reset to zero, and the number of times the absolute value is greater than the set threshold is reset to zero; If the i value is equal to the total number of rows, then determine whether the number of rows saved is greater than 2; if so, count the j-th column values of each i-th row, remove the maximum value and calculate the average value, which is the column value of the located cloth edge, and the process ends; if not, it is determined to be out of bounds, and the process ends; The detection of whether there is burr on the edge of the cloth includes the detection system extracting the area to be detected according to the located cloth edge column value, and the area to be detected is represented by the letter ROI; then converting the ROI into a grayscale image, and performing Sober edge detection and thresholding processing on the ROI; extracting all edge contour pixel points, finding the contour with the longest contour perimeter, and forming a contour point set with the pixel points on the contour; traversing the contour point set to find the maximum distance between two points; judging whether the longest perimeter is greater than a set multiple of the maximum distance; if so, it is judged as burr, and the burr detection ends; if not, it is judged as no burr, and the burr detection ends; The image thresholding process is to use the maximum inter-class variance method to determine the optimal threshold k of the image gray value. * ; then use k * -1 for image thresholding, greater than k * The grayscale value of the pixel with -1 is set to 255, and the grayscale values of the other pixels are set to 0; The optimal threshold k obtained by the maximum inter-class variance method * that is Where k is the assumed gray value threshold, is the between-class variance; 401) The detection system receives a detection process end instruction, ends the detection process, and returns to the initialization interface. The detection system receives an abnormality record instruction and enters an abnormality record interface; the abnormality record interface can view images and abnormality records saved in the detection process; 501) the detection system receives the exit instruction, and the detection system is shut down; The margin detection in step 304) includes the following steps: the image acquisition module acquires a frame of image and sends it to the detection system; the detection system converts the image into a grayscale image and performs grayscale value detection; the grayscale value detection specifically adjusts the camera exposure according to the grayscale setting threshold and determines whether the image average grayscale value has been adjusted to the set threshold; if not, returns to the acquisition module to acquire a frame of image and continues to adjust and determine; if so, then bilateral filtering is performed on the image; then Sober edge detection and thresholding are performed on the image to extract image edge pixels; using the extracted image edge pixels, Hough line transform is performed to find all straight lines in the image. Line segments, and save the line segments with slopes greater than the set slope, and determine whether the number of saved line segments is greater than 1; if the number of saved line segments is not greater than 1, go to the detection result that the margin does not exceed the threshold, and this detection ends; if the number of saved line segments is greater than 1, then determine whether the image processed this time is the left image; if it is the left image, compare the horizontal coordinate values of the midpoints of each line segment, and find out the two line segments with the smallest and second smallest horizontal coordinate values of the midpoint; if it is not the left image, it means that the image is the right image, then compare the horizontal coordinate values of the midpoints of each line segment, and find out the two line segments with the largest and second largest horizontal coordinate values of the midpoint; Find the distance between the two straight line segments and determine whether the distance is greater than the set margin threshold; if so, go to the detection result that the margin exceeds the threshold and the detection ends; if not, go to the detection result that the margin does not exceed the threshold and the detection ends; Among them, the grayscale value detection is to select an area in the grayscale image according to the located cloth edge column value. The selected area is a rectangular area, the starting point of the upper left corner of the rectangle is the coordinate point ((total number of image columns - (total number of image columns - located column value) / 10), 0) in the image, the length = the total number of rows in the image, the width = (total number of image columns - located column value) / 10; then, traverse all the pixel points in the area, calculate the average grayscale value, and judge whether the average grayscale value is within the set threshold range; if the average grayscale value of the selected area is within the set threshold range, it is judged that the grayscale value is appropriate, and the grayscale value detection ends; if the average grayscale value of the selected area is not within the set threshold range, it is judged that the grayscale value is too large or too small, and the grayscale value detection ends; The detection device used in the detection method includes a support rod, a support chassis, a crossbar 1, a crossbar 2, a backlight source, a short rod, a support rod, a front light source, a picture acquisition module, an alarm light, an industrial computer and an electrical control cabinet; the support rod is arranged on the support chassis, the support chassis is arranged on the ground, and the support rod is erected on the left and right sides of the detection point; the crossbar 1 is arranged between the support rods; the backlight source is arranged on the crossbar 1; the short rod is arranged on the support rod, and a support rod is arranged between the short rod and the support rod; the crossbar 2 is arranged between the short rods; the picture acquisition module, the front light source and the alarm light are arranged on the crossbar 2; the industrial computer and the electrical control cabinet are arranged on the support rod, and the industrial computer is electrically connected to the picture acquisition module and the front light source; The image acquisition module includes an area array camera, a lens, a protective cover and a fixing part. The shooting surface of the image acquisition module is parallel to the cloth. There are two image acquisition modules in total. The two image acquisition modules are respectively used to acquire images of the edges of both sides of the cloth. The front light source is arranged on the left and right sides of the image acquisition module.
2. The method for online detection of synthetic leather curling according to claim 1, characterized in that: The extraction process of the area to be detected is as follows: if the column value is less than 1 / 20 of the total number of columns of the image, the ROI is a rectangular area, the starting point of the upper left corner of the rectangle is the origin of the image, the coordinates are (0,0), the length = the total number of rows of the image, the width = (the total number of columns of the image) - (the located column value) + (1 / 20 of the total number of columns of the image); if the column value is greater than 19 / 20 of the total number of columns of the image, the ROI is a rectangular area, the starting point of the upper left corner of the rectangle is in the image The coordinates are ((the located column value - (1 / 20 of the total number of columns of the image)), 0), the length = the total number of rows of the image, the width = (the total number of columns of the image) - (the located column value) + (1 / 20 of the total number of columns of the image); If the column value is not less than 1 / 20 of the total number of columns in the image and not greater than 19 / 20 of the total number of columns in the image, the ROI is a rectangular area with the coordinates of the starting point of the upper left corner of the rectangle being ((the positioned column value - (1 / 20 of the total number of columns in the image)), 0), the length = the total number of rows in the image, and the width = 1 / 10 of the total number of columns in the image.
3. The method for online detection of synthetic leather curling according to claim 1, characterized in that: The thresholding process of the image is to determine the optimal threshold k of the image gray value by using the maximum inter-class variance method. * ; then use k * -1 for image thresholding, greater than k * The grayscale value of the pixel with -1 is set to 255, and the grayscale values of the other pixels are set to 0; The optimal threshold k is calculated by the maximum inter-class variance method * The specific process is as follows: The grayscale image to be tested has 256 grayscale values [1, 2, ..., 256]; the number of pixels with grayscale value i is ni, so the total number of pixels is Using the normalized grayscale value histogram and considering it as the probability distribution of this image, the probability that a random pixel has a grayscale value of i is pi: By setting a threshold value of grayscale k, these pixels are divided into two categories: C0 and C1; C0 represents pixels with grayscale values [1, 2, ..., k], and C1 represents pixels with grayscale values [k+1, ..., 256]; then, the probability that a random pixel belongs to C0 is set to ω0; the probability that a random pixel belongs to C1 is set to ω1; the average grayscale value of pixels in C0 is μ0; the average grayscale value of pixels in C1 is μ1; the specific calculation is shown in the following formula: Among them, ω(k) represents the probability that the grayscale value of a random pixel belongs to [1,2,...,k]; μ(k) represents the average grayscale value of the set of pixels whose grayscale values belong to [1,2,...,k]: And μ T Represents the average gray value of the entire image: For any chosen k, we have: ω0μ0+ω1μ1=μ T ,ω0+ω1=1 (15); The η in the following formula is selected as the measurement standard for evaluating the separation of selecting k as the threshold: in, represents the between-class variance; Represents the total variance of grayscale values; According to formula (15), we can get: Use the following formula to select different k values to search sequentially, and find the optimal threshold k according to equations (12) and (13): * , so that η reaches the maximum value; Substituting equations (7) and (14) into equations (17) and (18), the total variance of the gray value is obtained The value of does not change with the value of k, so making η reach the maximum value is equivalent to making reach the maximum; Optimal threshold k * for: Where k is the set gray value threshold, is the between-class variance.
4. The method for online detection of synthetic leather curling according to claim 1, characterized in that: The Sober edge detection process is as follows: (a) Assume that matrix A represents the pixel value matrix of the ROI area; (b) Calculate the derivative G in the horizontal direction (x) x and the derivative in the vertical direction (y) G y ; Horizontal direction: Convolve A with a kernel of size 3, as shown in formula (1): Vertical direction: Convolve A with a kernel of size 3, as shown in formula (2): The grayscale values of each pixel in the horizontal and vertical directions of the image are combined by the following formula (3) to calculate the grayscale value G of the pixel; 5. The method for online detection of synthetic leather curling according to claim 1, characterized in that: The implementation idea of the Hough line transform to find straight line segments is as follows: First, the straight line is represented by the polar coordinate system. The expression of the straight line is shown in formula (4), where r represents the polar diameter and θ represents the polar angle; Simplifying formula (4) yields formula (5): r=xcosθ+ysinθ (5) Next, for a given point (x0, y0), a cluster of straight lines passing through the point can be uniformly defined as: r θ =x0cosθ+y0sinθ (6) This means that for every pair (r θ ,θ) represents the straight line passing through the point (x0,y0); For a given invariant point (x0, y0), the polar radius r θ It changes with the change of polar angle θ; draw all straight lines passing through the point (x0, y0) on the plane θ-r to obtain a sine curve; the plane θ-r is the polar coordinate to polar diameter polar angle plane; The above operation is performed on all edge pixels in the image. If the number of curves intersecting at a point on the plane θ-r exceeds a certain threshold, then it can be considered that the parameter pair represented by this intersection is a straight line in the original image; then the reverse calculation is performed using formula (4).
6. According to the online detection method for curling of synthetic leather described in claim 1, the abnormal records include out-of-bounds information records and curling width exceeding threshold information records; when the detection system is in the out-of-bounds state and the normal state, only burr detection and out-of-bounds detection are performed; when the detection system is in the curling state and the curling width exceeding threshold state, only margin detection is performed; when the detection process performs out-of-bounds detection in the normal state, the counting and judgment function of the number of out-of-bounds and no-burr edge detections is added; when the detection process performs burr edge detection in the out-of-bounds state, the counting and judgment function of the number of burr edge and no-burr edge detections is added; when the detection process performs burr edge detection in the out-of-bounds state, the counting and judgment function of the number of times the burr edge is detected and the number of times the margin is not exceeded the threshold is added; when the detection process performs margin detection in the curling state, the counting and judgment function of the number of times the margin is not exceeded the threshold is added.
