Thermal Paper Rewinding Alignment Detection Method and System Based on Image and Sensor Fusion

By gradation, binarization and outline extraction of thermal paper rolling maps and combined with sensor data, the problem of inability to determine the cause of rolling in the prior art is solved, the accuracy and tension judgment of alignment detection are achieved, and the accuracy of rolling detection is improved.

CN120288559BActive Publication Date: 2025-08-05SUZHOU GUANWEI THERMAL PAPER CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510767269.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-10
Publication Date
2025-08-05
Estimated Expiration
2045-06-10

AI Technical Summary

Technical Problem

The existing roll-up alignment detection technology can only determine whether the roll-up is aligned, and cannot determine the cause of the incompleteness, resulting in inaccurate detection results.

Method used

By graying, binarizing and contour extraction of the thermal paper rolling diagram, combining the data of the velocity sensor and the angular velocity sensor, the actual thickness and width are calculated, and whether it is abnormal is judged based on the predicted thickness and width, and the tension is judged too large or too small.

Benefits of technology

It can not only detect whether the winding is aligned, but also determine the inconsistency caused by excessive or too small tension, which improves the accuracy of the test results and prevents inconsistency caused by tension.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120288559B_ABST
    Figure CN120288559B_ABST
Patent Text Reader

Abstract

The present invention discloses a thermal paper reel alignment detection method and system based on image and sensor fusion, which relates to the technical field of reel alignment detection and comprises the following steps: gray-scaling and binarizing a thermal paper reel image to obtain a reel binarized image; performing contour extraction on the reel binarized image to obtain a reel contour image; obtaining the thickness and width of the reeled thermal paper based on the reel contour image, and marking them as actual thickness and actual width respectively; calculating and obtaining a predicted reeled thermal paper thickness based on data from a velocity sensor and an angular velocity sensor, and marking it as predicted thickness; marking the width of the thermal paper as predicted width; and judging whether the actual thickness and actual width are abnormal based on the predicted thickness and predicted width. The present invention is used to solve the problem that in the existing reel alignment detection technology, only judging whether the reel is aligned but failing to judge the cause of the alignment, resulting in inaccurate detection results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of winding alignment detection, and in particular to a method and system for detecting the winding alignment of thermal paper based on image and sensor fusion. Background Art

[0002] After the thermal paper is produced, it needs to be rolled onto a reel. Rolling up the thermal paper not only saves space but also facilitates transportation. However, uneven rolling may occur during rolling. Uneven rolling may cause damage to the thermal paper during transportation. Therefore, it is necessary to check whether the thermal paper is aligned.

[0003] The main reason for uneven winding of thermal paper is inaccurate control of the tension. If the motor power of the reel remains unchanged, the thickness of the wound thermal paper will change, that is, the force arm increases, which will cause the tension to change. When the tension is too large, the thermal paper roll will form a large contraction force due to the residual tension of each layer of paper, leaving horizontal dents on the paper surface, resulting in uneven winding; if the tension is too small, the thermal paper roll will become loose, and gaps will easily appear between the layers of paper, resulting in the overall roll being not compact, resulting in uneven winding; therefore, when detecting uneven winding of thermal paper, it is necessary to determine whether the tension is too large or too small, so as to quickly adjust the equipment to align the thermal paper. For example, in the patent application with application publication number CN114882036A, a winding abnormality detection method for a fiber fabric winding device is disclosed. The winding abnormality in this scheme may also be caused by uneven tension. The existing winding alignment detection technology only determines whether the winding is aligned but fails to determine the cause of the alignment, resulting in inaccurate detection results. Summary of the Invention

[0004] The present invention aims to solve at least one of the technical problems in the prior art to a certain extent, by gray-scaling, binarizing and contour extracting the thermal paper winding image to obtain a winding contour image, obtaining the actual thickness and actual width based on the winding contour image, calculating the predicted thickness based on the data of the speed sensor and the angular velocity sensor, marking the width of the thermal paper as the predicted width, and judging whether the actual thickness and actual width are abnormal based on the predicted thickness and predicted width, so as to solve the problem that the existing winding alignment detection technology only judges whether the winding is aligned but fails to judge the reason for the alignment, resulting in inaccurate detection results.

[0005] To achieve the above objectives, in a first aspect, the present application provides a method for detecting the alignment of a thermal paper roll based on image and sensor fusion, comprising the following steps:

[0006] Acquire an image of thermal paper rolled up on a reel, marked as a thermal paper rolling image;

[0007] Gray-scale and binarization processing is performed on the thermal paper winding image to obtain a winding binary image; contour extraction is performed on the winding binary image to obtain a winding contour image;

[0008] The thickness and width of the rolled thermal paper are obtained based on the roll profile, and are marked as actual thickness and actual width respectively;

[0009] The predicted thickness of the reeled thermal paper is calculated based on the data from the speed sensor and the angular velocity sensor, and is marked as the predicted thickness; the width of the thermal paper is marked as the predicted width;

[0010] Based on the predicted thickness and predicted width, it is determined whether the actual thickness and actual width are abnormal.

[0011] Furthermore, grayscale and binarization processing is performed on the thermal paper winding image to obtain a winding binary image, which includes the following sub-steps:

[0012] Get the RGB value of each pixel in the thermal paper winding image and mark it as winding RGB value;

[0013] Use the grayscale conversion formula to convert the RGB value of the roll to the grayscale value of the roll;

[0014] The winding RGB value of each pixel in the thermal paper winding image is replaced with the winding grayscale value to obtain the winding grayscale image.

[0015] Furthermore, grayscale and binarization processing of the thermal paper winding image to obtain a winding binary image further includes the following sub-steps:

[0016] Divide the grayscale value of the roll-up from 0 to 255 into h ranges, marked as interval ranges;

[0017] Count the frequency of the rolled grayscale value in each interval range respectively, and mark it as range frequency;

[0018] Draw a histogram with the rolled grayscale value as the X-axis and the range frequency as the Y-axis, marked as rolled grayscale histogram;

[0019] Calculate the difference in range frequencies between adjacent interval ranges, marked as adjacent difference, and the calculation formula is: Xc i =F i -F i+1 ;

[0020] where Xc i is the adjacent difference, F i is the frequency of the i-th detection grayscale interval, F i+1 is the frequency of the i+1th detection grayscale interval, where i is an integer from 1 to h, and the size of i represents the size of the interval range corresponding to the range frequency;

[0021] If Xc i Less than 0 and Xc i+1 Greater than 0, Xc i Medium F i+1Mark the interval ranges as peak ranges; get all peak ranges;

[0022] Get the minimum value of each peak interval and mark it as the peak value;

[0023] The peak range with the smallest peak value is marked as the first peak range;

[0024] The peak range with the largest peak value is marked as the second peak range;

[0025] Mark the interval range between the first peak range and the second peak range as the middle interval range;

[0026] Get the middle interval range with the smallest range frequency and mark it as the threshold range;

[0027] Get the middle value of the threshold range and mark it as the segmentation threshold;

[0028] In the curled grayscale image, all curled grayscale values greater than the segmentation threshold are set to 0, and all curled grayscale values smaller than the segmentation threshold are set to 255 to obtain a curled binary image.

[0029] Furthermore, performing contour extraction on the rolled-up binary image to obtain a rolled-up contour image further includes the following sub-steps:

[0030] Get the pixel with a grayscale value of 0 in the binarization, mark it as the initial pixel, and establish a c*c neighborhood with the initial pixel as the center pixel, marked as the adjacent neighborhood;

[0031] Get the number of pixels with grayscale value 0 in the adjacent neighborhood, marked as the number of neighborhoods;

[0032] Set the boundary pixel threshold according to the size of the adjacent neighborhood;

[0033] If the number of neighbors is less than the boundary pixel threshold, the grayscale value of the initial pixel is set to 255;

[0034] Mark pixels with a grayscale value of 0 and adjacent to a grayscale value of 255 as edge pixels;

[0035] In the curled binary image, the grayscale values of all boundary pixels are set to 0, and the grayscale values of all pixels except the boundary pixels are set to 255 to obtain the curled contour image.

[0036] Furthermore, obtaining the thickness and width of the rolled thermal paper based on the roll profile and marking them as actual thickness and actual width respectively includes the following sub-steps:

[0037] Establish a plane rectangular coordinate system, marked as the winding coordinate system; place the winding profile in the first quadrant of the winding coordinate system, so that the lower left corner of the winding profile coincides with the origin of the winding coordinate system, and the wide side and long side of the winding profile coincide with the Y axis and X axis of the winding coordinate system respectively;

[0038] Use a line parallel to the X-axis to divide the winding profile into N areas with equal vertical intervals, marked as horizontal strip areas, set the length of the horizontal strip area to the length of the winding profile, and set the width of the horizontal strip area to Kh;

[0039] Get the edge pixels of each horizontal strip area as 0, and the maximum and minimum values of the horizontal coordinates, marked as horizontal maximum and horizontal minimum respectively;

[0040] Calculate the difference between the maximum and minimum horizontal values of all horizontal strips, and mark it as the horizontal difference;

[0041] The actual mean of all horizontal differences is obtained using the filtered mean method and marked as the actual width.

[0042] Furthermore, the screening mean method includes:

[0043] Get the range of the horizontal difference value, divide the range of the horizontal difference value into d equal ranges, and mark them as horizontal split ranges;

[0044] Count the frequency of each horizontal division range and mark it as horizontal division frequency;

[0045] A histogram is created with the horizontal difference as the X-axis and the horizontal frequency as the Y-axis, and is labeled as a horizontal difference histogram;

[0046] The horizontal frequency of the left and right horizontal division ranges in the horizontal difference histogram are marked as the left horizontal starting frequency and the right horizontal starting frequency respectively. Starting from the left horizontal starting frequency, the horizontal frequency of the horizontal difference histogram is continuously judged to the right to see whether it is less than the horizontal frequency threshold. If it is less than, the horizontal frequency is deleted from the histogram. If it is greater than, the judgment is stopped.

[0047] In the horizontal difference histogram, starting from the right horizontal starting frequency, continue to the left to determine whether the horizontal frequency is less than the horizontal frequency threshold. If it is less than, delete the horizontal frequency in the histogram. If it is greater than, stop judging.

[0048] Get the remaining horizontal difference values in the horizontal difference histogram and mark them as filtered horizontal difference values;

[0049] Calculate the mean of the filtered horizontal differences and mark it as the actual mean.

[0050] Furthermore, obtaining the thickness and width of the rolled thermal paper based on the roll profile and marking them as actual thickness and actual width respectively further includes the following sub-steps:

[0051] The winding profile is divided into M regions with equal horizontal intervals by a line parallel to the Y axis, marked as vertical strip regions, and the length of the vertical strip region is set to the width of the winding profile, and the width of the vertical strip region is set to Kc;

[0052] Get the edge pixels of each vertical strip area as 0, and the maximum and minimum values of the vertical coordinates, marked as vertical maximum and vertical minimum respectively;

[0053] Calculate the difference between the maximum and minimum vertical values of all vertical strips, and mark it as the vertical difference;

[0054] The actual mean of all longitudinal differences is obtained using the filtered mean method and marked as the actual thickness.

[0055] Furthermore, the predicted thickness of the rolled thermal paper is calculated based on the data from the speed sensor and the angular velocity sensor, which is marked as predicted thickness and includes the following sub-steps:

[0056] The speed sensor is used to obtain the transmission speed of the thermal paper when it is rolled up, which is marked as linear speed;

[0057] The angular velocity of the scroll is obtained using an angular velocity sensor, which is marked as rotational angular velocity;

[0058] Get the predicted thickness, the calculation formula is:

[0059] Dy=Dg+2*v / w;

[0060] Where Dy is the predicted thickness, Dg is the reel diameter, v is the linear velocity, and w is the angular velocity.

[0061] Furthermore, judging whether the actual thickness and the actual width are abnormal based on the predicted thickness and the predicted width includes the following steps:

[0062] Calculate the absolute value of the difference between the predicted width and the actual width, and mark it as the actual width difference;

[0063] Determine whether the actual width difference is greater than the width change threshold. If it is greater than or equal to the threshold, the thermal paper roll is not aligned. If it is less than the threshold, the thermal paper roll is aligned.

[0064] Calculate the absolute value of the difference between the predicted thickness and the actual thickness, and mark it as the actual thickness difference;

[0065] Determine whether the actual thickness difference is greater than the thickness change threshold. If it is greater than or equal to and satisfies the actual thickness greater than the predicted thickness, the tension is too small. If it is greater than and satisfies the actual thickness less than the predicted thickness, the tension is too large. If it is less than, the tension is normal.

[0066] In a second aspect, the present application also provides a thermal paper reel alignment detection system based on image and sensor fusion, comprising: an image acquisition module, an image processing module, an actual data acquisition module, a predicted data acquisition module, and an abnormality judgment module;

[0067] The image acquisition module is used to acquire an image of the thermal paper rolled on the reel, which is marked as a thermal paper rolling image;

[0068] The image processing module is used to perform grayscale and binarization processing on the thermal paper winding image to obtain a winding binary image; and perform contour extraction on the winding binary image to obtain a winding contour image;

[0069] The actual data acquisition module is used to obtain the thickness and width of the rolled thermal paper based on the roll profile, and mark them as actual thickness and actual width respectively;

[0070] The predicted data acquisition module is used to calculate and obtain the predicted thickness of the rolled thermal paper based on the data of the speed sensor and the angular velocity sensor, which is marked as the predicted thickness; and mark the width of the thermal paper as the predicted width;

[0071] The abnormality judgment module is used to judge whether the actual thickness and the actual width are abnormal based on the predicted thickness and the predicted width.

[0072] Beneficial effects of the present invention: The present invention performs grayscale conversion, binarization processing, and contour extraction on a thermal paper winding image to obtain a winding contour image, obtains the actual thickness and actual width based on the winding contour image, calculates the predicted thickness based on data from a speed sensor and an angular velocity sensor, marks the width of the thermal paper as the predicted width, and judges whether the actual thickness and actual width are abnormal based on the predicted thickness and predicted width. The advantage of the present invention is that it can not only detect winding unevenness, but also judge whether the tension is too high or too low. Too high or too low tension can also cause winding unevenness. Therefore, it can not only judge whether the unevenness is caused by excessive or insufficient tension, but also prevent the uneven winding caused by tension, thereby improving the accuracy of the detection result;

[0073] The present invention sets a screening mean method, which has the advantage of eliminating inaccuracies in actual width and actual thickness caused by abnormal noise pixels, improving the accuracy of obtaining actual width and actual thickness, and improving the accuracy of subsequent detection results. BRIEF DESCRIPTION OF THE DRAWINGS

[0074] Figure 1 It is a principle block diagram of the system of the present invention;

[0075] Figure 2 Schematic diagram of the rolled-up grayscale histogram of the present invention;

[0076] Figure 3 A schematic diagram of the horizontal strip area division of the present invention;

[0077] Figure 4 A schematic diagram of the longitudinal strip area division of the present invention;

[0078] Figure 5 Schematic diagram of the horizontal difference value histogram of the present invention;

[0079] Figure 6 Flow chart of the steps of the method of the present invention. DETAILED DESCRIPTION

[0080] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0081] Example 1, please refer to Figure 1 As shown, the present application provides a thermal paper reel alignment detection system based on image and sensor fusion, including an image acquisition module, an image processing module, an actual data acquisition module, a predicted data acquisition module, and an abnormality judgment module;

[0082] The image acquisition module is used to acquire an image of the thermal paper rolled on the reel, which is marked as a thermal paper rolling image; the thermal paper rolling image is an image of the front side of the thermal paper rolled on the reel;

[0083] The image processing module is used to grayscale and binarize the thermal paper winding image to obtain a winding binary image; and to perform contour extraction on the winding binary image to obtain a winding contour image;

[0084] The image processing module is equipped with a grayscale processing strategy, which includes:

[0085] Get the RGB value of each pixel in the thermal paper winding image and mark it as winding RGB value;

[0086] Use the grayscale conversion formula to convert the RGB value of the winding into the grayscale value of the winding. There are many grayscale conversion formulas. Since thermal paper is white, the weighted average method can be used here to convert the RGB value of the winding into the grayscale value of the winding.

[0087] The winding RGB value of each pixel in the thermal paper winding image is replaced with the winding grayscale value to obtain the winding grayscale image.

[0088] The image processing module is configured with a binarization strategy, which includes:

[0089] Divide the grayscale value of the winding paper from 0 to 255 into h ranges, marked as interval ranges. The size of h is set so that the subsequent winding grayscale histogram can have a bimodal distribution, so as to find the threshold value of the thermal paper grayscale value.

[0090] Count the frequency of the rolled grayscale value in each interval range respectively, and mark it as range frequency;

[0091] Draw a histogram with the rolled grayscale value as the X-axis and the range frequency as the Y-axis, marked as rolled grayscale histogram;

[0092] Calculate the difference in range frequencies between adjacent interval ranges, marked as adjacent difference, and the calculation formula is: Xc i =F i -F i+1 ;

[0093] where Xc i is the adjacent difference, F i is the frequency of the i-th detection grayscale interval, F i+1 is the frequency of the i+1th detection grayscale interval, where i is an integer from 1 to h, and the size of i represents the size of the interval range corresponding to the range frequency;

[0094] If Xc i Less than 0 and Xc i+1 Greater than 0, Xc i Medium F i+1 Mark the interval ranges as peak ranges; get all peak ranges;

[0095] Get the minimum value of each peak interval and mark it as the peak value;

[0096] The peak range with the smallest peak value is marked as the first peak range;

[0097] The peak range with the largest peak value is marked as the second peak range;

[0098] Mark the interval range between the first peak range and the second peak range as the middle interval range;

[0099] Get the middle interval range with the smallest range frequency and mark it as the threshold range;

[0100] Get the middle value of the threshold range and mark it as the segmentation threshold;

[0101] In the curled grayscale image, all curled grayscale values greater than the segmentation threshold are set to 0, and all curled grayscale values less than the segmentation threshold are set to 255 to obtain a curled binary image;

[0102] Mark all pixels with a grayscale value of 0 in the curled binary image as curled contours;

[0103] In practical applications, please refer to Figure 2 As shown, the rolled-up grayscale value of 0-255 is evenly divided into 8 interval ranges, the first peak range is (63, 95), the second peak range is (191, 223), and the middle interval range with the smallest range frequency is (127, 159), that is, the threshold range is (127, 159), and the middle value of the threshold range is 143, that is, the segmentation threshold is 143; in the rolled-up grayscale image, all rolled-up grayscale values greater than 143 are set to 0, and all rolled-up grayscale values 143 are set to 255 to obtain the rolled-up binary image.

[0104] The actual data acquisition module is used to obtain the thickness and width of the rolled thermal paper based on the roll profile, which are marked as actual thickness and actual width respectively;

[0105] The actual data acquisition module is configured with an actual width acquisition strategy, which includes:

[0106] Establish a plane rectangular coordinate system, marked as the winding coordinate system; place the winding profile in the first quadrant of the winding coordinate system, so that the lower left corner of the winding profile coincides with the origin of the winding coordinate system, and the wide side and long side of the winding profile coincide with the Y axis and X axis of the winding coordinate system respectively; because the winding profile has the same size as the original camera image, but the image has most of its pixels set to 255, the lower left corner and edge of the winding profile can be used as reference points;

[0107] Use a line parallel to the X-axis to divide the winding profile into N areas with equal vertical intervals, marked as horizontal strip areas, set the length of the horizontal strip area to the length of the roll profile, and set the width of the horizontal strip area to Kh; divide the horizontal strip area to better analyze the width of the thermal paper winding. If there is a deviation in the winding, because the winding rotates during winding, the uneven contour range is large and obvious. In order to save calculation and comparison, the horizontal strip area can be divided;

[0108] Get the edge pixels of each horizontal strip area as 0, and the maximum and minimum values of the horizontal coordinates, marked as horizontal maximum and horizontal minimum respectively;

[0109] Calculate the difference between the maximum and minimum horizontal values of all horizontal strips, and mark it as the horizontal difference;

[0110] The actual mean of all horizontal differences is obtained using the screening mean method and marked as the actual width;

[0111] In practical applications, please refer to Figure 3As shown, the winding contour map is divided into 10 horizontal strips with a line parallel to the X-axis, the length of the horizontal strip is set to the length of the winding contour map, the width of the horizontal strip is set to 2 cm, and the horizontal difference is calculated. Taking a horizontal strip area as an example, the horizontal maximum and minimum values are 65 cm and 15 cm respectively, and the horizontal difference is 50 cm; the actual width is 50.2 cm obtained by using the screening mean method.

[0112] Screening mean methods include:

[0113] Get the range of the horizontal difference value, divide the range of the horizontal difference value into d equal ranges, and mark them as horizontal split ranges;

[0114] Count the frequency of each horizontal division range and mark it as horizontal division frequency;

[0115] A histogram is created with the horizontal difference as the X-axis and the horizontal frequency as the Y-axis, and is labeled as a horizontal difference histogram;

[0116] In the horizontal difference histogram, the horizontal frequency of the left and right horizontal division ranges are marked as the left horizontal starting frequency and the right horizontal starting frequency respectively. Starting from the left horizontal starting frequency, the horizontal frequency is continuously judged to the right to see whether it is less than the horizontal frequency threshold. If it is less, the horizontal frequency is deleted from the histogram. If it is greater, the judgment is stopped. The horizontal frequency threshold is set according to the size of N. For example, if N=10, the horizontal frequency threshold can be set to 2.

[0117] In the horizontal difference histogram, starting from the right horizontal starting frequency, continue to the left to determine whether the horizontal frequency is less than the horizontal frequency threshold. If it is less than, delete the horizontal frequency in the histogram. If it is greater than, stop judging; the horizontal frequency deleted in the histogram is marked as a smaller horizontal frequency; because the extraction of the winding profile may be affected by noise, there will be individual affected data, and these abnormal data that are too large or too small need to be deleted. Here, the data is judged to be smaller in frequency and data;

[0118] Get the remaining horizontal difference values in the horizontal difference histogram and mark them as filtered horizontal difference values;

[0119] Calculate the mean of the filtered horizontal differences and mark it as the actual mean;

[0120] In practical applications, please refer to Figure 5As shown, obtain the range of horizontal difference values, divide the range of horizontal difference values into 4 horizontal division ranges, the left horizontal starting frequency is 1, judge that the left horizontal starting frequency 1 is less than the horizontal division frequency threshold 2, then delete the horizontal division frequency in the histogram, obtain the next horizontal division frequency 2 to the right, judge that the horizontal division frequency 2 is not less than the horizontal division frequency threshold 2, and stop judging; obtain the right horizontal starting frequency 2, judge that the horizontal division frequency 2 is not less than the horizontal division frequency threshold 2, and stop judging; obtain the remaining filtered horizontal difference values of the horizontal difference histogram, such as 50.2cm and 50.21cm, and calculate the mean of the filtered horizontal difference values to be 50.2cm, then the actual mean is 50.2cm;

[0121] Count the frequency of each horizontal division range and mark it as horizontal division frequency;

[0122] A histogram is created with the horizontal difference as the X-axis and the horizontal frequency as the Y-axis, and is labeled as a horizontal difference histogram;

[0123] The horizontal frequency of the left and right horizontal division ranges in the horizontal difference histogram are marked as the left horizontal starting frequency and the right horizontal starting frequency respectively. Starting from the left horizontal starting frequency, the horizontal frequency of the horizontal difference histogram is continuously judged to the right to see whether it is less than the horizontal frequency threshold. If it is less than, the horizontal frequency is deleted from the histogram. If it is greater than, the judgment is stopped.

[0124] The actual data acquisition module is configured with an actual thickness acquisition strategy, which includes:

[0125] The winding profile is divided into M regions with equal intervals of horizontal coordinates by a line parallel to the Y axis, marked as vertical strip regions, and the length of the vertical strip region is set to the width of the winding profile, and the width of the vertical strip region is set to Kc; in order to save calculation and comparison, the vertical strip region can be divided;

[0126] Get the edge pixels of each vertical strip area as 0, and the maximum and minimum values of the vertical coordinates, marked as vertical maximum and vertical minimum respectively;

[0127] Calculate the difference between the maximum and minimum vertical values of all vertical strips, and mark it as the vertical difference;

[0128] The actual mean of all longitudinal differences is obtained using the filtered mean method and marked as the actual thickness.

[0129] The prediction data acquisition module is used to calculate and obtain the predicted thickness of the rolled thermal paper based on the data of the speed sensor and the angular velocity sensor, which is marked as the predicted thickness; and the width of the thermal paper is marked as the predicted width;

[0130] In practical applications, please refer to Figure 4As shown, the winding profile is divided into 26 longitudinal strips along a line parallel to the Y axis. The length of the longitudinal strip is set to the width of the roll profile, and the width of the longitudinal strip is set to 2 cm. The longitudinal difference is calculated. Taking one longitudinal strip as an example, the longitudinal maximum and minimum values are 36 cm and 16 cm respectively, so the longitudinal difference is 20 cm. The actual thickness is obtained as 22 cm using the screening mean method, similar to the actual width acquisition method.

[0131] The prediction data acquisition module is configured with a prediction thickness acquisition strategy, which includes:

[0132] The speed sensor is used to obtain the transmission speed of the thermal paper when it is rolled up, which is marked as linear speed;

[0133] The angular velocity of the scroll is obtained using an angular velocity sensor, which is marked as rotational angular velocity;

[0134] Get the predicted thickness, the calculation formula is:

[0135] Dy=Dg+2*v / w;

[0136] Where Dy is the predicted thickness, Dg is the reel diameter, v is the linear velocity, and w is the angular velocity;

[0137] The abnormality judgment module is used to judge whether the actual thickness and actual width are abnormal based on the predicted thickness and predicted width;

[0138] In actual application, the acquired data Dg is 10cm, v is 18cm / s, and w is 1rad / s; then the predicted thickness is: Dy=Dg+2*v / w=10+2*18 / 1=46cm;

[0139] The abnormality judgment module is configured with an abnormality judgment strategy, which includes:

[0140] Calculate the absolute value of the difference between the predicted width and the actual width, and mark it as the actual width difference;

[0141] Determine whether the actual width difference is greater than the width change threshold. If it is greater than or equal to the threshold, the thermal paper is not rolled up. If it is less than the threshold, the thermal paper is aligned. For example, if the width change threshold is 2cm, it means that the actual width difference is greater than 2cm, which means that the thermal paper is not rolled up.

[0142] Calculate the absolute value of the difference between the predicted thickness and the actual thickness, and mark it as the actual thickness difference;

[0143] Determine whether the actual thickness difference is greater than the thickness change threshold. If it is greater than or equal to and meets the condition that the actual thickness is greater than the predicted thickness, the tension is too low. If it is greater than and meets the condition that the actual thickness is less than the predicted thickness, the tension is too high. If it is less than, the tension is normal. For example, if the thickness change threshold is 2cm, it means whether the actual thickness difference is greater than 2cm, which means the tension is normal or not.

[0144] The absolute value of the difference between the predicted width of 46 cm and the actual width of 50.2 cm is calculated to be 4.2 cm. The actual width difference is 4.2 cm. The actual width difference of 4.2 cm is greater than the width change threshold of 2 cm, indicating that the thermal paper roll is not aligned. The predicted width of the thermal paper is 20 cm. The absolute value of the difference between the predicted width of 20 cm and the actual width of 22 cm is calculated to be 2 cm. The actual width difference is 2 cm. It is determined that the actual width difference of 2 cm is equal to the thickness change threshold of 2 cm, and the actual width of 22 cm is greater than the predicted width of 20 cm, indicating that the tension is too low.

[0145] Example 2, please refer to Figure 6 As shown, the present application provides a thermal paper reel alignment detection method based on image and sensor fusion, comprising the following steps:

[0146] Step S1, obtaining an image of thermal paper rolled up on a reel, marked as a thermal paper rolling image;

[0147] Step S2: grayscale and binarize the thermal paper winding image to obtain a winding binary image; and perform contour extraction on the winding binary image to obtain a winding contour image. Step S2 includes the following sub-steps:

[0148] Step S201, obtaining the RGB value of each pixel in the thermal paper winding image, and marking it as the winding RGB value;

[0149] Step S202, converting the rolled RGB value into a rolled gray value using a gray conversion formula;

[0150] Step S203, replacing the winding RGB value of each pixel in the thermal paper winding image with the winding grayscale value to obtain a winding grayscale image;

[0151] Step S204, divide the grayscale value of the rolled-up image from 0 to 255 into h ranges, marked as interval ranges;

[0152] Step S205, counting the frequency of the rolled grayscale value in each interval range respectively, and marking it as range frequency;

[0153] Step S206, plotting a histogram with the rolled grayscale value as the X-axis and the range frequency as the Y-axis, and marking it as rolled grayscale histogram;

[0154] Step S207, calculate the difference in range frequencies between adjacent interval ranges, marked as adjacent difference, and the calculation formula is: Xc i =F i -F i+1 ; where Xc i is the adjacent difference, F i is the frequency of the i-th detection grayscale interval, F i+1 is the frequency of the i+1th detection grayscale interval, where i is an integer from 1 to h, and the size of i represents the size of the interval range corresponding to the range frequency;

[0155] Step S208, if Xc i Less than 0 and Xc i+1 Greater than 0, Xc i Medium F i+1 Mark the interval ranges as peak ranges; get all peak ranges;

[0156] Step S209, obtaining the minimum value of each peak interval and marking it as the peak value;

[0157] Step S210: Mark the peak range with the smallest peak value as the first peak range; mark the peak range with the largest peak value as the second peak range;

[0158] Step S211, marking the interval range between the first peak range and the second peak range as the middle interval range;

[0159] Step S212: obtaining the middle interval range with the smallest range frequency, marking it as the threshold range; obtaining the middle value of the threshold range, marking it as the segmentation threshold;

[0160] Step S213: In the curled grayscale image, all curled grayscale values greater than the segmentation threshold are set to 0, and all curled grayscale values less than the segmentation threshold are set to 255, to obtain a curled binary image;

[0161] Step S214: Obtain a pixel with a grayscale value of 0 in the binarization, mark it as the initial pixel, and establish a c*c neighborhood with the initial pixel as the center pixel, and mark it as the adjacent neighborhood;

[0162] Step S215, obtaining the number of pixels with a grayscale value of 0 in the adjacent neighborhood, and marking it as the neighborhood number;

[0163] Step S216, setting a boundary pixel threshold according to the size of the adjacent neighborhood;

[0164] Step S217: If the number of neighborhoods is less than the boundary pixel threshold, the grayscale value of the initial pixel is set to 255;

[0165] Step S218: Mark pixels with a grayscale value of 0 and adjacent to a grayscale value of 255 as edge pixels;

[0166] In step S219, the grayscale values of all boundary pixels in the curled binary image are set to 0, and the grayscale values of all pixels except the boundary pixels are set to 255 to obtain a curled contour image.

[0167] Step S3, obtaining the thickness and width of the rolled thermal paper based on the roll profile, and marking them as actual thickness and actual width respectively; Step S3 includes the following sub-steps:

[0168] Step S301: Establish a plane rectangular coordinate system, labeled as the winding coordinate system; place the winding profile in the first quadrant of the winding coordinate system, so that the lower left corner of the winding profile coincides with the origin of the winding coordinate system, and the wide side and long side of the winding profile coincide with the Y axis and X axis of the winding coordinate system respectively;

[0169] Step S302: Divide the winding profile into N regions with equal vertical intervals along a line parallel to the X-axis, marking them as horizontal strips, setting the length of the horizontal strips to the length of the winding profile, and setting the width of the horizontal strips to Kh;

[0170] Step S303: Obtain the maximum and minimum values of the horizontal coordinates of each horizontal strip area with the edge pixel being 0, and mark them as horizontal maximum value and horizontal minimum value respectively;

[0171] Step S304: Calculate the difference between the horizontal maximum value and the horizontal minimum value of all horizontal strips, and mark it as the horizontal difference value;

[0172] Step S305, using the mean screening method to obtain the actual mean of all horizontal differences, marked as the actual width; Step S305 includes the following sub-steps:

[0173] Step S30501: Obtain the range of the horizontal difference value, divide the range of the horizontal difference value into d equal ranges, and mark them as horizontal division ranges;

[0174] Step S30502: Count the frequency of each horizontally divided range and mark it as the horizontal frequency;

[0175] Step S30503: Create a histogram with the horizontal difference as the X-axis and the horizontal frequency as the Y-axis, and mark it as the horizontal difference histogram;

[0176] Step S30504: Mark the horizontal frequency values of the left and right horizontal division ranges in the horizontal difference histogram as the left horizontal starting frequency and the right horizontal starting frequency, respectively. Starting from the left horizontal starting frequency and moving rightward, determine whether the horizontal frequency values are less than the horizontal frequency threshold. If so, delete the horizontal frequency value from the histogram. If so, stop determining.

[0177] Step S30505: Starting from the right horizontal starting frequency in the horizontal difference histogram and moving leftward, determine whether the horizontal frequency is less than the horizontal frequency threshold. If so, delete the horizontal frequency in the histogram; if so, stop determining.

[0178] Step S30506, obtaining the remaining horizontal difference values in the horizontal difference value histogram and marking them as filtered horizontal difference values;

[0179] Step S30507, calculate the mean of the filtered horizontal differences and mark it as the actual mean.

[0180] Step S306: Divide the winding profile into M regions with equal horizontal axis intervals along a line parallel to the Y axis, marking them as vertical strip regions, setting the length of the vertical strip regions to the width of the winding profile, and setting the width of the vertical strip regions to Kc;

[0181] Step S307 , obtaining the maximum and minimum values of the vertical coordinates of each vertical strip region with the edge pixel being 0, and marking them as vertical maximum value and vertical minimum value respectively;

[0182] Step S308, calculating the difference between the maximum vertical value and the minimum vertical value of all vertical strip areas, and marking it as the vertical difference;

[0183] Step S309: Use the mean screening method to obtain the actual mean of all longitudinal differences, and mark it as the actual thickness.

[0184] Step S4, based on the data from the velocity sensor and the angular velocity sensor, calculate and obtain the predicted thickness of the rolled thermal paper, which is marked as the predicted thickness; and mark the width of the thermal paper as the predicted width. Step S4 includes the following sub-steps:

[0185] Step S401, using a speed sensor to obtain the transmission speed of the thermal paper during winding, which is marked as linear speed;

[0186] Step S402: using an angular velocity sensor to obtain the angular velocity of the scroll, which is marked as rotational angular velocity;

[0187] Step S403: Get the predicted thickness. The calculation formula is: Dy=Dg+2*v / w; where Dy is the predicted thickness, Dg is the reel diameter, v is the linear speed, and w is the rotational angular speed.

[0188] Step S5, judging whether the actual thickness and actual width are abnormal based on the predicted thickness and predicted width; Step S5 includes the following sub-steps:

[0189] Step S501, calculating the absolute value of the difference between the predicted width and the actual width, and marking it as the actual width difference;

[0190] Step S502, determining whether the actual width difference is greater than a width change threshold, if it is greater than or equal to the width change threshold, the thermal paper roll is not aligned, if it is less than the width change threshold, the thermal paper roll is aligned;

[0191] Step S503, calculating the absolute value of the difference between the predicted thickness and the actual thickness, and marking it as the actual thickness difference;

[0192] Step S504, determine whether the actual thickness difference is greater than the thickness change threshold. If it is greater than or equal to and satisfies the condition that the actual thickness is greater than the predicted thickness, the tension is too small. If it is greater than and satisfies the condition that the actual thickness is less than the predicted thickness, the tension is too large. If it is less than, the tension is normal.

[0193] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program code. The storage medium may be implemented by any type of volatile or non-volatile storage device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0194] In the embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interface, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

Claims

1. A thermal paper reel alignment detection method based on image and sensor fusion, characterized in that: The steps include: Acquire an image of thermal paper rolled up on a reel, marked as a thermal paper rolling image; Gray-scale and binarization processing is performed on the thermal paper winding image to obtain a winding binary image; contour extraction is performed on the winding binary image to obtain a winding contour image; The thickness and width of the rolled thermal paper are obtained based on the roll profile, and are marked as actual thickness and actual width respectively; The predicted thickness of the reeled thermal paper is calculated based on the data from the speed sensor and the angular velocity sensor, and is marked as the predicted thickness; the width of the thermal paper is marked as the predicted width; Determine whether the actual thickness and actual width are abnormal based on the predicted thickness and predicted width; Obtaining the thickness and width of the rolled thermal paper based on the roll profile and marking them as actual thickness and actual width respectively includes the following sub-steps: Establish a plane rectangular coordinate system, marked as the winding coordinate system; place the winding profile in the first quadrant of the winding coordinate system, so that the lower left corner of the winding profile coincides with the origin of the winding coordinate system, and the wide side and long side of the winding profile coincide with the Y axis and X axis of the winding coordinate system respectively; Use a line parallel to the X-axis to divide the winding profile into N areas with equal vertical intervals, marked as horizontal strip areas, set the length of the horizontal strip area to the length of the winding profile, and set the width of the horizontal strip area to Kh; Get the edge pixels of each horizontal strip area as 0, and the maximum and minimum values of the horizontal coordinates, marked as horizontal maximum and horizontal minimum respectively; Calculate the difference between the maximum and minimum horizontal values of all horizontal strips, and mark it as the horizontal difference; The actual mean of all horizontal differences is obtained using the screening mean method and marked as the actual width; Determining whether the actual thickness and actual width are abnormal based on the predicted thickness and predicted width includes the following steps: Calculate the absolute value of the difference between the predicted width and the actual width, and mark it as the actual width difference; Determine whether the actual width difference is greater than the width change threshold. If it is greater than or equal to the threshold, the thermal paper roll is not aligned. If it is less than the threshold, the thermal paper roll is aligned. Calculate the absolute value of the difference between the predicted thickness and the actual thickness, and mark it as the actual thickness difference; Determine whether the actual thickness difference is greater than the thickness change threshold. If it is greater than or equal to and satisfies the actual thickness greater than the predicted thickness, the tension is too small. If it is greater than and satisfies the actual thickness less than the predicted thickness, the tension is too large. If it is less than, the tension is normal.

2. The thermal paper reel alignment detection method based on image and sensor fusion according to claim 1 is characterized in that: Grayscale and binarization processing of the thermal paper winding image to obtain a winding binary image includes the following sub-steps: Get the RGB value of each pixel in the thermal paper winding image and mark it as winding RGB value; Use the grayscale conversion formula to convert the RGB value of the roll to the grayscale value of the roll; The winding RGB value of each pixel in the thermal paper winding image is replaced with the winding grayscale value to obtain the winding grayscale image.

3. The thermal paper reel alignment detection method based on image and sensor fusion according to claim 2, characterized in that: Grayscale and binarization processing of the thermal paper winding image to obtain a winding binary image also includes the following sub-steps: Divide the grayscale value of the roll-up from 0 to 255 into h ranges, marked as interval ranges; Count the frequency of the rolled grayscale value in each interval range respectively, and mark it as range frequency; Draw a histogram with the rolled grayscale value as the X-axis and the range frequency as the Y-axis, marked as rolled grayscale histogram; Calculate the difference in range frequencies between adjacent interval ranges, marked as adjacent difference, and the calculation formula is: Xc i =F i -F i+1 ; where Xc i is the adjacent difference, F i is the frequency of the i-th detection grayscale interval, F i+1 is the frequency of the i+1th detection grayscale interval, where i is an integer from 1 to h, and the size of i represents the size of the interval range corresponding to the range frequency; If Xc i Less than 0 and Xc i+1 Greater than 0, Xc i Medium F i+1 Mark the interval ranges as peak ranges; get all peak ranges; Get the minimum value of each peak interval and mark it as the peak value; The peak range with the smallest peak value is marked as the first peak range; The peak range with the largest peak value is marked as the second peak range; Mark the interval range between the first peak range and the second peak range as the middle interval range; Get the middle interval range with the smallest range frequency and mark it as the threshold range; Get the middle value of the threshold range and mark it as the segmentation threshold; In the curled grayscale image, all curled grayscale values greater than the segmentation threshold are set to 0, and all curled grayscale values smaller than the segmentation threshold are set to 255 to obtain a curled binary image.

4. The thermal paper reel alignment detection method based on image and sensor fusion according to claim 3 is characterized in that: Performing contour extraction on the rolled-up binary image to obtain a rolled-up contour image also includes the following sub-steps: Get the pixel with a grayscale value of 0 in the binarization, mark it as the initial pixel, and establish a c*c neighborhood with the initial pixel as the center pixel, marked as the adjacent neighborhood; Get the number of pixels with grayscale value 0 in the adjacent neighborhood, marked as the number of neighborhoods; Set the boundary pixel threshold according to the size of the adjacent neighborhood; If the number of neighbors is less than the boundary pixel threshold, the grayscale value of the initial pixel is set to 255; Mark pixels with a grayscale value of 0 and adjacent to a grayscale value of 255 as edge pixels; In the curled binary image, the grayscale values of all boundary pixels are set to 0, and the grayscale values of all pixels except the boundary pixels are set to 255 to obtain the curled contour image.

5. The thermal paper reel alignment detection method based on image and sensor fusion according to claim 4 is characterized in that: Screening mean methods include: Get the range of the horizontal difference value, divide the range of the horizontal difference value into d equal ranges, and mark them as horizontal split ranges; Count the frequency of each horizontal division range and mark it as horizontal division frequency; A histogram is created with the horizontal difference as the X-axis and the horizontal frequency as the Y-axis, and is labeled as a horizontal difference histogram; The horizontal frequency of the left and right horizontal division ranges in the horizontal difference histogram are marked as the left horizontal starting frequency and the right horizontal starting frequency respectively. Starting from the left horizontal starting frequency, the horizontal frequency of the horizontal difference histogram is continuously judged to the right to see whether it is less than the horizontal frequency threshold. If it is less than, the horizontal frequency is deleted from the histogram. If it is greater than, the judgment is stopped. In the horizontal difference histogram, starting from the right horizontal starting frequency, continue to the left to determine whether the horizontal frequency is less than the horizontal frequency threshold. If it is less than, delete the horizontal frequency in the histogram. If it is greater than, stop judging. Get the remaining horizontal difference values in the horizontal difference histogram and mark them as filtered horizontal difference values; Calculate the mean of the filtered horizontal differences and mark it as the actual mean.

6. The thermal paper reel alignment detection method based on image and sensor fusion according to claim 5, characterized in that: Obtaining the thickness and width of the rolled thermal paper based on the roll profile and marking them as actual thickness and actual width respectively also includes the following sub-steps: The winding profile is divided into M regions with equal horizontal intervals by a line parallel to the Y axis, marked as vertical strip regions, and the length of the vertical strip region is set to the width of the winding profile, and the width of the vertical strip region is set to Kc; Get the edge pixels of each vertical strip area as 0, and the maximum and minimum values of the vertical coordinates, marked as vertical maximum and vertical minimum respectively; Calculate the difference between the maximum and minimum vertical values of all vertical strips, and mark it as the vertical difference; The actual mean of all longitudinal differences is obtained using the filtered mean method and marked as the actual thickness.

7. The thermal paper reel alignment detection method based on image and sensor fusion according to claim 6, characterized in that: The predicted thickness of the rewound thermal paper is calculated based on the data from the speed sensor and the angular velocity sensor, which is marked as predicted thickness and includes the following sub-steps: The speed sensor is used to obtain the transmission speed of the thermal paper when it is rolled up, which is marked as linear speed; The angular velocity of the scroll is obtained using an angular velocity sensor, which is marked as rotational angular velocity; Get the predicted thickness, the calculation formula is: Dy=Dg+2*v / w; Where Dy is the predicted thickness, Dg is the reel diameter, v is the linear velocity, and w is the angular velocity.

8. A thermal paper reel alignment detection system based on image and sensor fusion, used to implement the thermal paper reel alignment detection method based on image and sensor fusion according to any one of claims 1 to 7, characterized in that: It includes image acquisition module, image processing module, actual data acquisition module, predicted data acquisition module and abnormality judgment module; The image acquisition module is used to acquire an image of the thermal paper rolled on the reel, which is marked as a thermal paper rolling image; The image processing module is used to perform grayscale and binarization processing on the thermal paper winding image to obtain a winding binary image; and perform contour extraction on the winding binary image to obtain a winding contour image; The actual data acquisition module is used to obtain the thickness and width of the rolled thermal paper based on the roll profile, and mark them as actual thickness and actual width respectively; The predicted data acquisition module is used to calculate and obtain the predicted thickness of the rolled thermal paper based on the data of the speed sensor and the angular velocity sensor, which is marked as the predicted thickness; and mark the width of the thermal paper as the predicted width; The abnormality judgment module is used to judge whether the actual thickness and the actual width are abnormal based on the predicted thickness and the predicted width.

Citation Information

Patent Citations

  • Winding anomaly detection method for fiber fabric winding device

    CN114882036A

  • BOPP film thickness control method based on image processing

    CN107310133A

  • Base material processing apparatus and detection method

    CN108621589A