Continuous dimming black mark detection method and device
By identifying changes in the quality characteristics of thermal paper and adjusting the black mark detection signal strength, the problem of reduced black mark detection accuracy in thermal printers is solved, and printing quality and stability are improved.
Patent Information
- Application Number
- CN202410918632.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-10
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2044-07-10
AI Technical Summary
In thermal printers, as the use time increases, the accuracy of black mark detection may decrease, resulting in poor print quality and urgent improvement.
By identifying changes in the quality characteristics of thermal paper, comparing the characteristics of the target thermal paper compatible with the printer, and adjusting the intensity of the black mark detection signal to ensure detection accuracy. Specific steps include obtaining the quality characteristics of the thermal paper, performing dimensional alignment and comparison, determining the signal intensity adjustment amount based on the degree of matching, and adjusting the signal intensity by adjusting the current component of the transmitter or the current intensity of the optocoupler transmitter.
It improves the accuracy of black mark detection and print quality, ensuring that the printer maintains high-performance output under different thermal paper conditions.
Smart Images

Figure CN118457065B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of printers, and in particular to a method and device for detecting a continuous dimming black mark. Background Art
[0002] In thermal printers, black mark usually refers to a special mark or ribbon, which is used to provide a reference point for the printer to accurately control the printed content and format. The black mark can be a rectangular block of black or other colors, usually printed on a specific position of the printing paper or label.
[0003] The black mark plays a positioning role in the printing process, helping the printer determine where to start printing or determine the specific position of the printed content. For example, on continuous printing paper or labels, the black mark can mark the starting position of each label to ensure that the printer can start printing the next label at the correct position.
[0004] In addition, in ticket printing, black marks can also be used to locate the printing position of certain important information, such as company logos, barcodes or other graphics and text that need to be placed accurately.
[0005] Technically, black mark detection is achieved through photoelectric sensors that detect the contrast difference between the black mark and other areas, thereby triggering the printer's positioning action. This technology is particularly important in automated printing processes because it ensures consistent and accurate printing.
[0006] Currently, in some commercial scenarios where thermal printers are used, the requirements for print quality are quite high. However, as the printer is used for a longer time, inaccurate black mark detection may occur, which urgently needs to be improved. Summary of the invention
[0007] Based on this, it is necessary to provide a continuous dimming black mark detection method and device that can improve the accuracy of printer black mark detection in order to solve the above technical problems.
[0008] In a first aspect, the present application provides a continuous dimming black mark detection method, comprising:
[0009] When it is recognized that the thermal paper in the printer has been changed, the quality characteristics corresponding to the changed thermal paper and the quality characteristics corresponding to the target thermal paper compatible with the printer are obtained;
[0010] Comparing the characteristic representative value of the quality characteristic corresponding to the changed thermal paper with the characteristic representative value of the quality characteristic corresponding to the target thermal paper to obtain the matching degree between the changed thermal paper and the target thermal paper;
[0011] According to the matching degree, determining whether it is necessary to adjust the current signal strength of the detection signal emitted by the transmitting end corresponding to the black mark detection component in the printer;
[0012] If adjustment is required, different intensity adjustment amounts are determined according to the matching degree between the changed thermal paper and the target thermal paper;
[0013] The current signal strength is adjusted according to different strength adjustment amounts.
[0014] In one of the embodiments, the characteristic dimension in the quality feature includes at least one of thermal coating quality, reflectivity, thickness and uniformity.
[0015] In one embodiment, comparing the characteristic representative value of the quality characteristic corresponding to the changed thermal paper with the characteristic representative value of the quality characteristic corresponding to the target thermal paper to obtain the matching degree between the changed thermal paper and the target thermal paper includes:
[0016] Align each feature dimension in the quality feature corresponding to the target thermal paper with each feature dimension in the quality feature corresponding to the target thermal paper;
[0017] The characteristic representative value of each characteristic dimension in the quality characteristics corresponding to the dimension-aligned changed thermal paper is compared with the characteristic representative value of each characteristic dimension in the quality characteristics corresponding to the target thermal paper to obtain the matching degree between the changed thermal paper and the target thermal paper.
[0018] In one embodiment, the characteristic representative value of each characteristic dimension in the quality characteristic corresponding to the dimension-aligned thermal paper is compared with the characteristic representative value of each characteristic dimension in the quality characteristic corresponding to the target thermal paper to obtain the matching degree between the changed thermal paper and the target thermal paper, including:
[0019] For any feature dimension, determining a feature difference between a feature representative value of the feature dimension in the thermal paper and a feature representative value of the feature dimension in the target thermal paper;
[0020] According to the weight value and the feature difference value corresponding to each feature dimension, the matching degree between the changed thermal paper and the target thermal paper is determined.
[0021] In one embodiment, the quality feature includes the quality of the thermal coating; obtaining the quality feature corresponding to the changed thermal paper after the change includes:
[0022] Get the thermal paper image of the changed thermal paper;
[0023] Determining texture parameters of the thermal paper image; the texture parameters include gray level co-occurrence matrix or local binary pattern;
[0024] According to the texture parameters, the quality of the thermal coating of the thermal paper is determined to be changed.
[0025] In one embodiment, the quality feature includes reflectivity; obtaining the quality feature corresponding to the changed thermal paper after the change includes:
[0026] Obtain the front image of the changed thermal paper and convert the front image into a grayscale image;
[0027] The reflectivity of the changed thermal paper is determined according to the difference in grayscale values between the printing area and the non-printing area in the changed thermal paper.
[0028] In one embodiment, the quality feature includes thickness; obtaining the quality feature corresponding to the changed thermal paper after the change includes:
[0029] Obtain a side image of the changed thermal paper;
[0030] According to the degree of perspective deformation of the side image, the thickness of the thermal paper is changed.
[0031] In one embodiment, the quality feature includes uniformity; obtaining the quality feature corresponding to the changed thermal paper after the change includes:
[0032] Get the thermal paper image of the changed thermal paper;
[0033] Divide the thermal paper image into multiple target areas and calculate the contrast value of each target area;
[0034] The contrast values of different areas of the target are compared, and based on the comparison results, the uniformity corresponding to the changed thermal paper is determined.
[0035] In one embodiment, adjusting the current signal strength includes:
[0036] The duty cycle of the pulse width modulation (PWM) of the current component in the transmitter is adjusted to control the current intensity of the optocoupler transmitter in the transmitter to adjust the current signal intensity.
[0037] In a second aspect, the present application also provides a continuous dimming black mark detection device, comprising:
[0038] A change detection module, for obtaining, when it is recognized that the thermal paper in the printer has been changed, quality characteristics corresponding to the changed thermal paper and quality characteristics corresponding to the target thermal paper compatible with the printer;
[0039] A confirmation module, used for comparing the characteristic representative value of the quality characteristic corresponding to the changed thermal paper with the characteristic representative value of the quality characteristic corresponding to the target thermal paper, to obtain a matching degree between the changed thermal paper and the target thermal paper;
[0040] A comprehensive module, used to determine whether it is necessary to adjust the current signal strength of the detection signal emitted by the transmitter corresponding to the black mark detection component in the printer according to the matching degree;
[0041] The adjustment module is used to determine different intensity adjustment amounts according to the matching degree between the changed thermal paper and the target thermal paper if adjustment is needed; and adjust the current signal intensity according to the different intensity adjustment amounts.
[0042] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0043] When it is recognized that the thermal paper in the printer has been changed, the quality characteristics corresponding to the changed thermal paper and the quality characteristics corresponding to the target thermal paper compatible with the printer are obtained;
[0044] Comparing the characteristic representative value of the quality characteristic corresponding to the changed thermal paper with the characteristic representative value of the quality characteristic corresponding to the target thermal paper to obtain the matching degree between the changed thermal paper and the target thermal paper;
[0045] According to the matching degree, determining whether it is necessary to adjust the current signal strength of the detection signal emitted by the transmitting end corresponding to the black mark detection component in the printer;
[0046] If adjustment is required, different intensity adjustment amounts are determined according to the matching degree between the changed thermal paper and the target thermal paper;
[0047] The current signal strength is adjusted according to different strength adjustment amounts.
[0048] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the following steps are implemented:
[0049] When it is recognized that the thermal paper in the printer has been changed, the quality characteristics corresponding to the changed thermal paper and the quality characteristics corresponding to the target thermal paper compatible with the printer are obtained;
[0050] Comparing the characteristic representative value of the quality characteristic corresponding to the changed thermal paper with the characteristic representative value of the quality characteristic corresponding to the target thermal paper to obtain the matching degree between the changed thermal paper and the target thermal paper;
[0051] According to the matching degree, determining whether it is necessary to adjust the current signal strength of the detection signal emitted by the transmitting end corresponding to the black mark detection component in the printer;
[0052] If adjustment is required, different intensity adjustment amounts are determined according to the matching degree between the changed thermal paper and the target thermal paper;
[0053] The current signal strength is adjusted according to different strength adjustment amounts.
[0054] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0055] When it is recognized that the thermal paper in the printer has been changed, the quality characteristics corresponding to the changed thermal paper and the quality characteristics corresponding to the target thermal paper compatible with the printer are obtained;
[0056] Comparing the characteristic representative value of the quality characteristic corresponding to the changed thermal paper with the characteristic representative value of the quality characteristic corresponding to the target thermal paper to obtain the matching degree between the changed thermal paper and the target thermal paper;
[0057] According to the matching degree, determining whether it is necessary to adjust the current signal strength of the detection signal emitted by the transmitting end corresponding to the black mark detection component in the printer;
[0058] If adjustment is required, different intensity adjustment amounts are determined according to the matching degree between the changed thermal paper and the target thermal paper;
[0059] The current signal strength is adjusted according to different strength adjustment amounts. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0061] Figure 1 It is a schematic diagram of the process of a continuous dimming black mark detection method in one embodiment;
[0062] Figure 2 FIG. 4 is a structural block diagram of a continuous dimming black mark detection device in an embodiment. DETAILED DESCRIPTION
[0063] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0064] Reflectivity difference: Black mark detection usually relies on the reflectivity difference between the paper and the black mark to identify the black mark position. If the reflectivity of the thermal paper used is significantly different from the reflectivity of the consumable type preset by the printer, the black mark detection sensor may not be able to accurately identify the black mark, resulting in detection errors.
[0065] Paper thickness and texture: Different thermal papers may have different thickness and texture, and these differences will affect the stability and consistency of the paper as it passes through the printer. If the thermal paper does not match the printer consumables type, it may cause the paper to jitter or deviate during printing, which in turn affects the accuracy of black mark detection.
[0066] Chemical coating: Thermal paper may be coated with special chemical coatings to develop color when heated. These coatings may affect the absorption and reflection of light, thereby interfering with the operation of the black mark detection sensor. If the thermal paper used does not match the type of consumables preset by the printer, its coating characteristics may be different, which in turn affects the detection accuracy.
[0067] Mechanical properties: The printer's black mark detection mechanism usually relies on the mechanical properties of the paper (such as stiffness, tensile strength, etc.). Mismatched thermal paper may cause differences in mechanical properties, causing the paper to behave inconsistently when passing through the detection component, thus affecting the accuracy of black mark detection.
[0068] In summary, in order to ensure the accuracy of black mark detection, it is very important to choose thermal paper that is compatible with the printer. When purchasing thermal paper, you should refer to the printer's specifications or consult the printer manufacturer to ensure that the selected thermal paper matches the printer's consumables type.
[0069] In an exemplary embodiment, Figure 1 As shown, a continuous dimming black mark detection method is provided, and the method is applied to a computer device as an example for explanation;
[0070] S101, when it is identified that the thermal paper in the printer has been changed, obtaining quality characteristics corresponding to the changed thermal paper and quality characteristics corresponding to the target thermal paper compatible with the printer.
[0071] Optionally, the change of thermal paper is identified by the sensor or software detection mechanism of the printer. This may include detecting the change of parameters such as paper type, thickness, surface characteristics, etc. Image processing technology is used to analyze the changed thermal paper sample. This includes collecting the image of the paper and performing pre-processing such as grayscale, denoising, etc. Through image analysis technology, the quality characteristics of the paper are extracted, such as grayscale distribution, texture characteristics, surface roughness, etc. These characteristics can reflect the properties of the paper such as uniformity, glossiness, ink absorption, etc.
[0072] Consult your printer's user manual or the manufacturer's specification sheet for information on the quality characteristics of the target thermal paper that your printer is compatible with. This may include the paper's recommended type, thickness range, surface treatment, etc.
[0073] S102, comparing the characteristic representative value of the quality characteristic corresponding to the changed thermal paper with the characteristic representative value of the quality characteristic corresponding to the target thermal paper, to obtain a matching degree between the changed thermal paper and the target thermal paper.
[0074] For the changed thermal paper and the target thermal paper, the characteristic representative values of their quality characteristics are extracted respectively. These characteristic representative values can be grayscale mean, texture intensity, surface roughness and other values that can reflect the quality characteristics of the paper. The characteristic representative values of the quality characteristics of the changed thermal paper are compared with the characteristic representative values of the quality characteristics of the target thermal paper, and the matching degree between the changed thermal paper and the target thermal paper is obtained by calculating the similarity or difference between the two.
[0075] S103: Determine whether it is necessary to adjust the current signal strength of the detection signal emitted by the transmitting end corresponding to the black mark detection component in the printer according to the matching degree.
[0076] Set a match threshold. This threshold is a critical value used to determine whether the match is high enough so that the signal strength does not need to be adjusted. The choice of the threshold should be based on a balance between print quality and printer performance. Compare the calculated match with the set threshold. If the match is higher than or equal to the threshold, it means that the changed thermal paper is very similar to the target thermal paper, and the printer may work properly without adjustment. If the match is lower than the threshold, it means that the changed thermal paper and the target thermal paper have differences in some quality characteristics, which may affect the printer's black mark detection accuracy and print quality. In this case, the current signal strength of the detection signal emitted by the transmitter corresponding to the black mark detection component in the printer needs to be adjusted to adapt to the changed thermal paper.
[0077] After deciding that the signal strength needs to be adjusted, the direction of adjustment needs to be further determined. For example, if the reflectivity of the thermal paper is lower, the signal strength may need to be increased to improve the detection sensitivity; conversely, if the reflectivity is higher, the signal strength may need to be reduced to avoid false detection.
[0078] S104: If adjustment is required, different intensity adjustment amounts are determined according to the matching degree between the changed thermal paper and the target thermal paper.
[0079] Based on the matching result, it is determined whether the printer settings need to be adjusted to adapt to the changed thermal paper. If adjustment is required, different adjustment strategies are adopted according to the quality characteristics of the changed thermal paper, and different intensity adjustment amounts are determined. These adjustment strategies may include adjusting the temperature of the print head, the printing speed, the printing pressure, etc.
[0080] S105: Adjust the current signal strength according to different strength adjustment amounts.
[0081] According to the intensity adjustment amount determined in S104, the current signal intensity of the printer is adjusted, which includes adjusting parameters such as voltage, current or power of the printing signal to ensure that the printing quality is compatible with the target thermal paper.
[0082] In the above method, after the printer changes the thermal paper, it automatically adjusts the black mark detection signal strength to adapt to the characteristics of the new paper. This helps to ensure that the printer can maintain high-performance printing output under various thermal paper conditions.
[0083] In an exemplary embodiment, the characteristic dimension in the quality characteristic includes at least one of thermal coating quality, reflectivity, thickness and uniformity.
[0084] The quality of thermal coating is a key factor in measuring the printing effect of thermal paper, which directly affects the clarity and durability of printing. Reflectivity reflects the ability of the paper surface to reflect light, which is particularly important for printing applications that require high brightness or specific visual effects.
[0085] Thickness is another important physical property of thermal paper, which affects the durability, feel and smoothness of paper feeding during printing. Uniformity is related to the overall consistency of the paper, including coating distribution, fiber arrangement, etc., which is crucial to ensure the stability of printing quality.
[0086] In actual applications, one or more of these feature dimensions may be selected based on specific needs. For example, in situations where high-definition printing is required, special attention may be paid to the quality and uniformity of the thermal coating; and in scenarios where there are specific requirements for paper brightness, reflectivity may become a key consideration. By selecting such feature dimensions, the quality of thermal paper can be evaluated more accurately and its performance in actual applications can be effectively guaranteed.
[0087] Specifically, the characteristic representative value of the quality characteristic corresponding to the changed thermal paper is compared with the characteristic representative value of the quality characteristic corresponding to the target thermal paper to obtain the matching degree between the changed thermal paper and the target thermal paper, including:
[0088] 11) Align each feature dimension in the quality feature corresponding to the more thermal paper with each feature dimension in the quality feature corresponding to the target thermal paper.
[0089] First, ensure that the quality characteristics of the changed thermal paper and the target thermal paper are consistent in each characteristic dimension. This means that if the four dimensions of thermal coating quality, reflectivity, thickness and uniformity are evaluated, the quality characteristic data of the two papers must contain information in these four dimensions.
[0090] If the data of two papers on certain feature dimensions are missing or inconsistent, corresponding data preprocessing is required, such as interpolation, normalization or standardization, to ensure dimension alignment.
[0091] 12) Compare the feature representative values of each feature dimension in the quality features corresponding to the changed thermal paper after dimension alignment with the feature representative values of each feature dimension in the quality features corresponding to the target thermal paper to obtain the matching degree between the changed thermal paper and the target thermal paper.
[0092] Once the dimension alignment is completed, the feature representative values of each feature dimension in the quality characteristics corresponding to the changed thermal paper are then compared one by one with the feature representative values of each feature dimension in the quality characteristics corresponding to the target thermal paper.
[0093] The comparison can be performed by calculating the difference or similarity between the two. For example, the absolute value difference, percentage difference, Euclidean distance, cosine similarity and other indicators can be used to measure the similarity between the representative values of two features.
[0094] According to the comparison results, the overall matching degree between the changed thermal paper and the target thermal paper is calculated. This can be achieved by comprehensively considering the comparison results of each feature dimension. For example, a weight can be assigned to each feature dimension, and then a weighted average is calculated based on the weight and the comparison results as the overall matching degree.
[0095] Specifically, the characteristic representative value of each characteristic dimension in the quality characteristics corresponding to the changed thermal paper after dimension alignment is compared with the characteristic representative value of each characteristic dimension in the quality characteristics corresponding to the target thermal paper to obtain the matching degree between the changed thermal paper and the target thermal paper, including:
[0096] 21) For any feature dimension, determine the feature difference between the feature representative value of the feature dimension in the thermal paper and the feature representative value of the feature dimension in the target thermal paper.
[0097] For each feature dimension, the difference between the feature representative value of the feature dimension in the changed thermal paper and the feature representative value of the feature dimension in the target thermal paper, ie, the feature difference, is calculated respectively.
[0098] The feature difference can be obtained through simple mathematical operations, such as subtraction, to reflect the similarity or difference between the two papers in the feature dimension.
[0099] 22) Determine the matching degree between the changed thermal paper and the target thermal paper according to the weight value and feature difference value corresponding to each feature dimension.
[0100] Furthermore, the quality characteristics include the quality of the thermal coating; obtaining the quality characteristics corresponding to the changed thermal paper after the change includes: obtaining a thermal paper image of the changed thermal paper; determining texture parameters of the thermal paper image; the texture parameters include a grayscale co-occurrence matrix or a local binary pattern; and determining the quality of the thermal coating of the changed thermal paper based on the texture parameters.
[0101] According to the weight value corresponding to each feature dimension and the calculated feature difference value, the overall matching degree between the changed thermal paper and the target thermal paper is determined.
[0102] The weight value reflects the importance of different feature dimensions in evaluating the matching degree and can be set according to the actual application scenario and requirements.
[0103] The calculation of the matching degree can consider using the weighted summation method, that is, multiplying the feature difference value of each feature dimension by its corresponding weight value, and then adding all the products to obtain a quantitative indicator of the overall matching degree.
[0104] The higher the value of the matching degree is, the higher the similarity between the changed thermal paper and the target thermal paper is, and the better the matching degree is; conversely, the lower the value of the matching degree is, the greater the difference between the two is, and the worse the matching degree is.
[0105] Furthermore, the quality characteristics include reflectivity; obtaining the quality characteristics corresponding to the changed thermal paper after the change includes: obtaining the front image of the changed thermal paper and converting the front image into a grayscale image; determining the reflectivity of the changed thermal paper based on the difference in grayscale values between the printed area and the non-printed area in the changed thermal paper.
[0106] First, obtain an image of the front side of the thermal paper. This can be done using a scanner, camera, or other image acquisition device, making sure the image is clear and undistorted.
[0107] Next, the acquired frontal image is converted into a grayscale image. A grayscale image is an image that contains only grayscale information. It removes the color information in the color image and only retains the brightness information. This conversion step can be completed using image processing software or algorithms, such as using the cvtColor function in the OpenCV library to convert a color image into a grayscale image.
[0108] Finally, the reflectivity of the thermal paper can be determined by changing the grayscale value difference between the printed area and the non-printed area of the thermal paper. The printed area usually has a lower grayscale value due to the presence of ink or carbon ribbon, while the non-printed area is the color of the thermal paper itself and has a higher grayscale value. By comparing the difference in grayscale values of these two areas, the reflectivity of the thermal paper can be evaluated. Specifically, the average or median of the grayscale values of the printed area and the non-printed area can be calculated, and the grayscale value of the printed area can be subtracted from the grayscale value of the non-printed area to obtain a relative index of reflectivity. This index can reflect the thermal paper's ability to reflect light, which in turn affects the printing effect and readability.
[0109] Furthermore, the quality characteristics include thickness; obtaining the quality characteristics corresponding to the changed thermal paper after the change includes: obtaining a side image of the changed thermal paper; and determining the thickness of the changed thermal paper according to the degree of perspective deformation of the side image.
[0110] Get a side image of the thermal paper. This can also be done by using a scanner, camera or other image acquisition device to ensure that the image is clear and accurately reflects the side morphology of the thermal paper.
[0111] Next, based on the acquired side image, the degree of perspective distortion of the image needs to be analyzed. Perspective distortion is the change in the shape of the object in the image due to factors such as shooting angle and distance. For the side image of thermal paper, its degree of perspective distortion is somewhat related to the thickness of the paper. Generally speaking, thicker paper will show greater perspective distortion in the side image.
[0112] Finally, by analyzing the perspective deformation degree of the side image, the thickness of the thermal paper can be determined. This can be achieved by comparing the perspective deformation degree of the side image of thermal papers of different thicknesses, or by establishing a mathematical model between the perspective deformation degree and thickness for calculation. Finally, the accurate value or relative index of the thickness of the thermal paper can be obtained for subsequent matching calculation and printing adjustment strategy formulation.
[0113] Furthermore, the quality characteristics include uniformity; obtaining the quality characteristics corresponding to the changed thermal paper includes: obtaining a thermal paper image of the changed thermal paper; dividing the thermal paper image into multiple target areas, and calculating the contrast value of each target area; comparing the contrast values of different target areas, and determining the uniformity corresponding to the changed thermal paper according to the comparison result.
[0114] Get an image of the thermal paper that has been changed. This can be done using a scanner, camera, or other image acquisition device, ensuring that the image is clear and accurately reflects the overall and detailed appearance of the thermal paper.
[0115] Next, the acquired thermal paper image is divided into multiple target areas. These target areas can be of a preset fixed size or shape, or can be adaptively divided according to the image content. The purpose of the division is to more carefully evaluate the uniformity of the thermal paper in different areas.
[0116] Then, calculate the contrast value of each target area. Contrast is a measure of the difference between light and dark areas in an image, which can reflect the uniformity of the thermal paper in that area. The contrast value can be obtained by calculating the difference or variation range of the pixel values in the target area.
[0117] Next, compare the contrast values of different target areas. By comparing, you can find the difference in uniformity between different areas of the thermal paper. If the contrast values of all target areas are similar, it means that the uniformity of the thermal paper is good; if the contrast values of some areas are significantly different from other areas, it means that the uniformity of the thermal paper in that area is poor.
[0118] Finally, according to the comparison results, the uniformity corresponding to the changed thermal paper is determined. The average value or standard deviation of the contrast values of all target areas can be calculated as a quantitative indicator of uniformity. The smaller the average value or the smaller the standard deviation, the better the uniformity of the thermal paper. This indicator can be used for subsequent matching calculations and printing adjustment strategy formulation.
[0119] In an exemplary embodiment, when the characteristic dimension in the quality characteristic includes thickness, different intensity adjustment amounts are determined according to the matching degree between the changed thermal paper and the target thermal paper, including:
[0120] Adopt an adjustment strategy corresponding to the thickness, which usually means that the thicker the paper, the greater the detection signal strength required, because thicker paper may cause more attenuation to the signal. The adjustment amount is proportional to the parameter value of the thickness. In other words, the thicker the thermal paper is, the greater the increase in signal strength.
[0121] In an exemplary embodiment, when the characteristic dimension in the quality characteristic includes thermal reflectivity, different intensity adjustment amounts are determined according to the matching degree between the changed thermal paper and the target thermal paper, including:
[0122] The higher the reflectivity, the stronger the signal reflected from the paper surface. Therefore, it may be necessary to reduce the signal strength at the transmitter to avoid interference caused by excessive reflection. The adjustment strategy corresponding to the reflectivity is adopted to determine the intensity adjustment amount, which is inversely proportional to the parameter value of the reflectivity. That is, the higher the reflectivity of the thermal paper is changed, the greater the reduction in signal strength.
[0123] In an exemplary embodiment, when the characteristic dimension in the quality feature includes the quality of the thermal coating, different intensity adjustment amounts are determined according to the matching degree between the changed thermal paper and the target thermal paper, including:
[0124] If the match is high, it means that the quality of the thermal coating of the change thermal paper is similar to that of the target thermal paper, and the signal strength may not need to be adjusted or only needs to be slightly adjusted; if the match is low, a larger adjustment may be required.
[0125] In an exemplary embodiment, when the characteristic dimension in the quality characteristic includes uniformity, different intensity adjustment amounts are determined according to the matching degree between the changed thermal paper and the target thermal paper, including:
[0126] The better the uniformity of the thermal paper, the smaller the intensity adjustment is usually. This is because thermal paper with good uniformity means that the thermal coating is more evenly distributed on the surface of the paper, and it can respond to the print signal more evenly when printing, so it does not require too large a signal strength to obtain a good printing effect. Therefore, in the case of high uniformity, usually only a small intensity adjustment is required, or even no adjustment is required.
[0127] In an exemplary embodiment, adjusting the current signal strength includes:
[0128] The duty cycle of the pulse width modulation (PWM) of the current component in the transmitter is adjusted to control the current intensity of the optocoupler transmitter in the transmitter to adjust the current signal intensity.
[0129] Specifically, adjusting the duty cycle of the pulse width modulation (PWM) of the current component in the transmitter includes:
[0130] The duty cycle of the pulse width modulation (PWM) of the current component in the transmitter is adjusted at a preset rate.
[0131] Specifically, first, according to the aforementioned thermal paper quality characteristics (such as thickness, reflectivity, etc.), determine whether the current signal strength needs to be adjusted, as well as the direction and value of the adjustment.
[0132] The PWM signal is a periodic square wave, and its duty cycle (i.e., the ratio of the duration of the high level to the entire cycle time) determines the average output power. By changing the duty cycle of the PWM signal, the average current intensity at the optocoupler transmitter can be controlled, thereby affecting the strength of the detection signal it emits. As the duty cycle increases, the average current intensity increases and the signal strength increases; as the duty cycle decreases, the average current intensity decreases and the signal strength weakens.
[0133] In order to avoid sudden current changes from impacting the circuit, the PWM duty cycle should be adjusted at a certain rate (i.e. step by step). This preset rate can be set according to specific application requirements and hardware limitations to ensure the smoothness of the adjustment process and the stability of the system. During the adjustment process, it is necessary to monitor the changes in signal strength in real time and make fine adjustments based on actual conditions.
[0134] If it is detected that the adjusted signal strength still does not meet the requirement, or the system performance is affected, the PWM duty cycle needs to be adjusted accordingly until the ideal signal strength is achieved.
[0135] In this way, the signal strength of the black mark detection component transmitter can be accurately controlled to adapt to thermal papers of different qualities, thereby improving the detection accuracy and print quality of the printer. At the same time, this method also has certain flexibility and adjustability, and can be optimized and improved according to actual conditions.
[0136] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0137] Based on the same inventive concept, the embodiment of the present application also provides a continuous dimming black mark detection device for implementing the continuous dimming black mark detection method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more continuous dimming black mark detection device embodiments provided below can refer to the limitations of the continuous dimming black mark detection method above, and will not be repeated here.
[0138] In an exemplary embodiment, Figure 2 As shown, a continuous dimming black mark detection device is provided, comprising:
[0139] The change detection module 11 is used to obtain the quality characteristics corresponding to the changed thermal paper and the quality characteristics corresponding to the target thermal paper compatible with the printer when it is recognized that the thermal paper in the printer has been changed;
[0140] A confirmation module 12 is used to compare the characteristic representative value of the quality characteristic corresponding to the changed thermal paper with the characteristic representative value of the quality characteristic corresponding to the target thermal paper to obtain a matching degree between the changed thermal paper and the target thermal paper;
[0141] The comprehensive module 13 is used to determine whether it is necessary to adjust the current signal strength of the detection signal emitted by the transmitting end corresponding to the black mark detection component in the printer according to the matching degree;
[0142] The adjustment module 14 is used to determine different intensity adjustment amounts according to the matching degree between the changed thermal paper and the target thermal paper if adjustment is needed; and adjust the current signal intensity according to the different intensity adjustment amounts.
[0143] Each module in the above-mentioned continuous dimming black mark detection device can be implemented in whole or in part by software, hardware and their combination. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the corresponding operations of each of the above modules.
[0144] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0145] When it is recognized that the thermal paper in the printer has been changed, the quality characteristics corresponding to the changed thermal paper and the quality characteristics corresponding to the target thermal paper compatible with the printer are obtained;
[0146] Comparing the characteristic representative value of the quality characteristic corresponding to the changed thermal paper with the characteristic representative value of the quality characteristic corresponding to the target thermal paper to obtain the matching degree between the changed thermal paper and the target thermal paper;
[0147] According to the matching degree, determining whether it is necessary to adjust the current signal strength of the detection signal emitted by the transmitting end corresponding to the black mark detection component in the printer;
[0148] If adjustment is required, different intensity adjustment amounts are determined according to the matching degree between the changed thermal paper and the target thermal paper;
[0149] The current signal strength is adjusted according to different strength adjustment amounts.
[0150] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0151] When it is recognized that the thermal paper in the printer has been changed, the quality characteristics corresponding to the changed thermal paper and the quality characteristics corresponding to the target thermal paper compatible with the printer are obtained;
[0152] Comparing the characteristic representative value of the quality characteristic corresponding to the changed thermal paper with the characteristic representative value of the quality characteristic corresponding to the target thermal paper to obtain the matching degree between the changed thermal paper and the target thermal paper;
[0153] According to the matching degree, determining whether it is necessary to adjust the current signal strength of the detection signal emitted by the transmitting end corresponding to the black mark detection component in the printer;
[0154] If adjustment is required, different intensity adjustment amounts are determined according to the matching degree between the changed thermal paper and the target thermal paper;
[0155] The current signal strength is adjusted according to different strength adjustment amounts.
[0156] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0157] When it is recognized that the thermal paper in the printer has been changed, the quality characteristics corresponding to the changed thermal paper and the quality characteristics corresponding to the target thermal paper compatible with the printer are obtained;
[0158] Comparing the characteristic representative value of the quality characteristic corresponding to the changed thermal paper with the characteristic representative value of the quality characteristic corresponding to the target thermal paper to obtain the matching degree between the changed thermal paper and the target thermal paper;
[0159] According to the matching degree, determining whether it is necessary to adjust the current signal strength of the detection signal emitted by the transmitting end corresponding to the black mark detection component in the printer;
[0160] If adjustment is required, different intensity adjustment amounts are determined according to the matching degree between the changed thermal paper and the target thermal paper;
[0161] The current signal strength is adjusted according to different strength adjustment amounts.
[0162] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0163] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0164] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A continuous dimming black mark detection method, characterized in that: The method comprises: When it is identified that the thermal paper in the printer has been changed, obtaining quality characteristics corresponding to the changed thermal paper and quality characteristics corresponding to the target thermal paper compatible with the printer; Aligning each characteristic dimension in the quality characteristics corresponding to the changed thermal paper with each characteristic dimension in the quality characteristics corresponding to the target thermal paper; For any characteristic dimension, determining a characteristic difference between a characteristic representative value of the characteristic dimension in the changed thermal paper and a characteristic representative value of the characteristic dimension in the target thermal paper; Determining the matching degree between the changed thermal paper and the target thermal paper according to the weight value and the feature difference value corresponding to each feature dimension; According to the matching degree, determining whether it is necessary to adjust the current signal strength of the detection signal emitted by the transmitting end corresponding to the black mark detection component in the printer; If adjustment is required, different intensity adjustment amounts are determined according to the matching degree between the changed thermal paper and the target thermal paper; Adjusting the current signal strength according to different strength adjustment amounts; The characteristic dimensions in the quality characteristics include at least one of the thermal-sensitive coating quality, reflectivity, thickness and uniformity.
2. The method according to claim 1, characterized in that The quality feature includes the quality of the thermal coating; the quality feature corresponding to the changed thermal paper after the change is obtained includes: Acquire the thermal paper image of the changed thermal paper; Determining texture parameters of the thermal paper image; the texture parameters include gray-level co-occurrence matrix or local binary pattern; The quality of the thermal coating of the changed thermal paper is determined according to the texture parameters.
3. The method according to claim 1, characterized in that The quality feature includes reflectivity; obtaining the quality feature corresponding to the changed thermal paper after the change includes: Acquire the front image of the changed thermal paper, and convert the front image into a grayscale image; The reflectivity of the changed thermal paper is determined according to the difference in grayscale values between the printing area and the non-printing area in the changed thermal paper.
4. The method according to claim 1, characterized in that: The quality feature includes thickness; obtaining the quality feature corresponding to the changed thermal paper after the change includes: Acquire a side image of the changed thermal paper; The thickness of the thermal paper to be changed is determined according to the perspective deformation degree of the side image.
5. The method according to claim 1, characterized in that The quality characteristics include uniformity; obtaining the quality characteristics corresponding to the changed thermal paper after the change includes: Acquire the thermal paper image of the changed thermal paper; Dividing the thermal paper image into a plurality of target areas, and calculating a contrast value of each target area; The contrast values of different areas of the target are compared, and based on the comparison results, the uniformity corresponding to the changed thermal paper is determined.
6. The method according to claim 1, characterized in that The adjusting the current signal strength includes: The duty cycle of the pulse width modulation (PWM) of the current component in the transmitting end is adjusted to control the current intensity of the optocoupler transmitting end in the transmitting end, so as to adjust the current signal intensity.
7. A continuous dimming black mark detection device, characterized in that: The device comprises: A change detection module, for obtaining, when recognizing that the thermal paper in the printer has been changed, quality characteristics corresponding to the changed thermal paper and quality characteristics corresponding to the target thermal paper compatible with the printer; A confirmation module, used for aligning each characteristic dimension in the quality characteristic corresponding to the changed thermal paper with each characteristic dimension in the quality characteristic corresponding to the target thermal paper; Comparing the characteristic representative value of the quality characteristic corresponding to the changed thermal paper with the characteristic representative value of the quality characteristic corresponding to the target thermal paper to obtain the matching degree between the changed thermal paper and the target thermal paper; For any characteristic dimension, determining a characteristic difference between a characteristic representative value of the characteristic dimension in the changed thermal paper and a characteristic representative value of the characteristic dimension in the target thermal paper; Determining the matching degree between the changed thermal paper and the target thermal paper according to the weight value and the feature difference value corresponding to each feature dimension; A comprehensive module, used for determining whether it is necessary to adjust the current signal strength of the detection signal emitted by the transmitting end corresponding to the black mark detection component in the printer according to the matching degree; An adjustment module, for determining different intensity adjustment amounts according to the matching degree between the changed thermal paper and the target thermal paper if adjustment is required; and adjusting the current signal intensity according to the different intensity adjustment amounts; The characteristic dimensions in the quality characteristics include at least one of the thermal-sensitive coating quality, reflectivity, thickness and uniformity.
Citation Information
Patent Citations
Photoelectric sensing device of printer
CN115107382A
Thermal paper printing identification method and device and thermal printer
CN115257198A
Black label detection equipment based on high-precision photoelectric sensor
CN117754997A
Black mark detector
JP1994141128A
Printer
JP2012030435A
