Paper direction detection method based on machine vision
Through the paper direction detection method based on machine vision, the positive and negative situations of printed packaging paper are automatically detected, which solves the problem of paper reversal caused by manual loading, and improves production efficiency and automation.
Patent Information
- Application Number
- CN202510545562.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-28
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2045-04-28
AI Technical Summary
During the printing process, due to the artificial loading, the subsequent die-cutting, folding and other processes cannot be carried out normally, affecting the processing efficiency of the product.
The paper direction detection method based on machine vision is adopted to obtain the overall preview image of the printed wrapping paper by light source, and determine whether it rotates and centers are symmetrical. Different detection and recognition strategies are adopted to automatically detect the positive and negative situations of the paper according to the image type and the identification of hidden dangers.
It realizes automatic detection of the positive and negative situations of paper, saves labor resources, avoids possible mistakes caused by manual inspection, and improves the production efficiency and automation of printing and packaging.
Smart Images

Figure CN120070441A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of anti-paper detection, and in particular to a method for detecting the direction of paper based on machine vision. Background Art
[0002] The printed packaging paper needs to be conveyed to processes such as bronzing, die-cutting, and folding. Since the paper is usually manually loaded during the printing process, it is easy to have the phenomenon of the paper being placed upside down. The front and back ends of the paper may be placed upside down during the paper feeding process in the conveying process, which will cause the subsequent die-cutting, folding and other processes to not proceed normally. The upside-down paper flowing into the subsequent production process will affect the processing efficiency of the product. Therefore, it is necessary to detect whether the conveyed packaging paper is placed upside down.
[0003] Chinese Patent Publication No.: CN103489195A discloses a method for detecting the direction of the pattern on the body of a metal can. The steps are as follows: ⑴ Extract the feature points of the plane image of the metal sheet; ⑵ Collect the pattern on the can body; ⑶ Extract the feature points of the pattern on the body of the metal can; ⑷ Direction discrimination. The present invention realizes the discrimination of the pattern direction through the comparison of the coordinates and similarity of the feature points and the registration points, so as to judge whether the welding direction of the body of the metal can is correct. The judgment accuracy is high, the degree of automation is high, the detection speed is effectively improved, and the production efficiency is accelerated. It can be seen that the method for detecting the direction of the pattern on the body of the metal can has the following problems: There are various possibilities for the pattern on the body of the metal can, and the detection is not comprehensive enough. Summary of the Invention
[0004] Therefore, the present invention provides a method for detecting the direction of paper based on machine vision to overcome the problem that the paper is placed upside down during the manual feeding process in the prior art, which affects the processing efficiency of the product after flowing into the subsequent production process.
[0005] To achieve the above object, the present invention provides a method for detecting the direction of paper based on machine vision, including: Run the light source at the initial power to illuminate the surface of the printed packaging paper, obtain the overall preview image of the printed packaging paper, and judge whether the image on the surface of the printed packaging paper is rotationally centrosymmetric; For a non-rotationally centrosymmetric image, determine that the image type of the to-be-printed input image is a pattern and text type or a pure color type, and frame and identify the pattern symbols and text; Determine the type of recognition hidden danger for the direction recognition of the printed packaging paper, and adopt different detection and recognition strategies according to the image type and the type of recognition hidden danger; When the overall preview image is a single surface image, determine the standard point image area and its corresponding detection area, move the vision camera to the corresponding detection area to obtain the area detection image, and judge its matching degree with the standard point image; When the overall preview image contains several identical image regions, several pattern symbols and texts in any one of the image regions are extracted, the average similarity between them and the pattern symbols and texts in the corresponding region detection image is calculated, and the direction state of the printed packaging paper is judged; According to the identified hidden danger type, the movement error and angle deviation of the vision camera, determine the reason why the direction of the printed packaging paper is inconsistent with the process requirement direction, take corresponding adjustment measures, re-determine the direction state of the printed packaging paper, or reduce the initial power of the light source, adjust the position of the vision camera according to the error situation, or adjust the angle of the vision camera according to the deviation situation; When the input image to be printed is of a pure color type, and the corresponding points of the positioning color sensor meet the detection conditions, determine the direction of the printed packaging paper according to the contrast color difference between the target color and the inspection color.
[0006] Further, the process of judging whether the image on the surface of the printed packaging paper is rotationally centrosymmetric includes, Determine the center point of the overall preview image, and rotate the overall preview image 180 degrees around the center point; Compare the original overall preview image with the rotated overall preview image, calculate the difference between the two images. If both the mean square error and the structural similarity index meet the similarity judgment conditions, then judge that the overall preview image is a rotationally centrosymmetric image, and the printed packaging paper is rotationally centrosymmetric; The similarity judgment conditions are that the mean square error is less than the error threshold, and the structural similarity index is greater than the index threshold.
[0007] Further, the process of determining the image type of the input image to be printed includes, For a non-rotationally centrosymmetric image, input the input image to be printed into a trained model, If the input image to be printed contains text or pattern symbols, then frame and identify the pattern symbols and texts in the input image to be printed, and confirm that the image type is the pattern text type; If the input image to be printed does not contain text or pattern symbols, then confirm that the image type of the input image to be printed is the pure color type.
[0008] Further, if the image type of the input image to be printed is the pattern text type, and the overall preview image is a single surface image, according to the frame selection and recognition result of the input image to be printed, divide the corresponding regions of the pattern symbols and texts in the overall preview image; Determine any one of the regions meeting the standard conditions as the standard point image region, move the vision camera to the corresponding detection region to take a picture, and obtain the region detection image; The standard conditions are that the region has the largest area and is not in the exposure region.
[0009] Further, slide the region detection image on the standard point image region, and calculate the similarity of the overlapping region between the region detection image and the standard point image. If the squared difference matching value is less than the matching evaluation value, it is determined that the similarity of the overlapping region between the region detection image and the standard point image is large, and the region detection image matches the standard point image.
[0010] Further, when the overall preview image contains several identical image regions, divide the overall preview image into several image regions; Extract several pattern symbols and texts in any one of the image regions, and calculate the average similarity between them and the pattern symbols and texts in the input image to be printed. If the average similarity is greater than the first standard value, it is determined that the printed packaging paper is in the first direction state, and the direction of the printed packaging paper is consistent with the direction required by the process. If the average similarity is less than or equal to the first standard value and greater than the second standard value, it is determined that the printed packaging paper is in the second direction state, and the direction of the printed packaging paper needs further analysis with respect to the direction required by the process. If the average similarity is less than or equal to the second standard value, it is determined that the printed packaging paper is in the third direction state, and the direction of the printed packaging paper is opposite to the direction required by the process.
[0011] Further, when the printed packaging paper is in the second direction state, if there is an obvious recognition hazard in the printed packaging paper, it is determined that the reason for the printed packaging paper being in the second direction state is exposure. Extract several pattern symbols and texts in another image region to calculate the average similarity, and re-determine the direction state of the printed packaging paper, and reduce the initial power of the light source.
[0012] Further, when there is a hidden recognition hazard in the printed packaging paper, according to the center point of the region to which the pattern symbols and texts belong and the position of the vision camera, detect the position difference between the focus of the vision camera and the center point. If the position difference is greater than the critical difference, it is determined that the reason for the printed packaging paper being in the second direction state is an error in the movement of the vision camera, and adjust the position of the vision camera according to the error situation. If the position difference is less than or equal to the critical difference, it is determined that the reason for the printed packaging paper being in the second direction state is an angular deviation caused by the jitter of the vision camera, and adjust the angle of the vision camera according to the deviation situation.
[0013] Further, the process of determining the type of recognition hazard for direction recognition of the printed packaging paper includes: Obtain the overall detection image of the printed packaging paper, extract the brightness features in the image, and use the threshold segmentation method to divide the image into an exposure region and a non-exposure region. Detect the exposure ratio of the exposed area in the overall area. If the exposure ratio is less than or equal to the standard ratio, it is determined that there is a hidden recognition risk for the printed packaging paper. If the exposure ratio is greater than the standard ratio, it is determined that there is an obvious recognition risk for the printed packaging paper.
[0014] Further, when the image type of the input image to be printed is a pure color type, locate the detection point of the color sensor at the corresponding position on the printed packaging paper; When the corresponding position meets the detection conditions, obtain the target color of the overall preview image at the corresponding position, and calculate the comparison color difference between it and the inspection color recognized by the color sensor; If the comparison color difference is less than the color difference evaluation value, it is determined that the inspection color is consistent with the target color, and the direction of the printed packaging paper is correct; If the comparison color difference is greater than or equal to the color difference evaluation value, it is determined that the inspection color is inconsistent with the target color, and the direction of the printed packaging paper is opposite; The detection condition is that the color at the corresponding position is different from the color at the symmetric position on the other side of the printed packaging paper.
[0015] Compared with the prior art, the beneficial effect of the present invention is that the printed packaging paper needs to be transported to processes such as hot stamping, die cutting, and folding. During the transportation process, the front and rear ends of the paper may be placed in the reverse direction when feeding the paper, which will cause the subsequent die cutting, folding and other processes to not proceed normally. Therefore, it is necessary to detect whether the transported packaging paper is placed in the reverse direction. This method saves labor resources by automatically detecting the front and back of the paper, avoids mistakes that may be caused by manual detection, and improves the production efficiency and automation degree of printed packaging.
[0016] Further, when the image existing on the surface of the printed packaging paper is a centrosymmetric figure, there is no need to determine the front and back of the printed packaging paper. In the initial stage of this method, the overall preview image of the printed packaging paper is rotated centrally and then compared to confirm whether the printed packaging paper is rotationally centrosymmetric, avoiding unnecessary calculations and saving resources to speed up the transportation efficiency.
[0017] Further, due to the reason of the light source illumination that brightens the paper surface, there is an exposure phenomenon that affects image acquisition and subsequent paper direction recognition. This method classifies the recognition risk types of the printed packaging paper into obvious recognition risks and hidden recognition risks through the exposure ratio of the exposed area in the overall area, avoiding adverse effects on the analysis links that are vulnerable to light factors in subsequent different detection and recognition strategies, and increasing the adaptability and accuracy of paper direction detection and recognition.
[0018] Furthermore, the template matching method used in this method is relatively sensitive to noise and light changes. On the one hand, by moving the vision camera to an area that meets the standard conditions, that is, an area where there is no exposure phenomenon and is not affected by exposure, the adverse impact of light changes on the template matching method is avoided, and the robustness is improved through preprocessing. On the other hand, for the case where the surface image of the printed packaging paper is a single surface image, the standard point image area is determined according to the clearest symbol or text in the image, and the vision camera is correspondingly moved to the corresponding area to obtain the area detection image, and the matching degree of the area detection image in the standard point image area is judged, avoiding the situation of large errors and inaccurate judgments that are likely to occur when analyzing and judging the entire printed packaging paper. At the same time, the situation of incorrect direction recognition due to the symmetric and asymmetric patterns and texts in various directions of the input image to be printed itself is excluded, improving the accuracy and adaptability of paper direction recognition for the specific application scenario of this method.
[0019] Furthermore, when the pre-input image to be printed is small, the overall preview image will contain several identical image areas, and the image symbols and texts on them are also exactly the same. Therefore, the direction of one of the several identical image areas can represent the direction of the entire printed packaging paper, and there will be no situation of incorrect direction recognition due to the symmetric and asymmetric patterns and texts in various directions of the input image to be printed itself. This method determines the direction state of the printed packaging paper by comparing any image area in the overall preview image with several pattern symbols and texts in the corresponding area. At the same time, due to reasons such as vibrations generated during the printing, transportation, and alignment processes and light source exposure, the vision camera is inevitably affected. Therefore, after determining the reasons and correspondingly adjusting the vision camera and the light source, the direction state of the printed packaging paper is determined again, avoiding the situation of incorrect direction recognition caused by the production process, further improving the accuracy of direction detection, and reducing the analysis error.
[0020] Furthermore, correspondingly, there is also a situation where the image on the surface of the printed packaging paper consists only of colors. This method locates the detection points of the color sensor at the corresponding positions on the printed packaging paper and makes corresponding comparisons, avoiding the situation of incorrect direction recognition due to the same color in the symmetric area, and improving the adaptability and accuracy of direction detection for the specific application scenario of the printed packaging paper. Brief Description of the Drawings
[0021] Figure 1 It is a schematic flow chart of the paper direction detection method based on machine vision in the embodiment of the present invention; Figure 2 It is a schematic structural diagram of the detection structure applied to the printing production line in the embodiment of the present invention; Figure 3It is a schematic diagram for determining the orientation state of printed packaging paper in an embodiment of the present invention; Figure 4 It is a schematic diagram for frame selection of pattern symbols and text in an embodiment of the present invention; In the figure: 1 - Vision camera. Detailed implementation manners
[0022] In order to make the objectives and advantages of the present invention clearer, the present invention will be further described below in conjunction with embodiments; it should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0023] The preferred implementation manners of the present invention will be described below with reference to the accompanying drawings. Those skilled in the art should understand that these implementation manners are only used to explain the technical principles of the present invention and do not limit the protection scope of the present invention.
[0024] It should be noted that in the description of the present invention, the terms indicating directions or positional relationships such as "upper", "lower", "left", "right", "inner", "outer", etc. are based on the directions or positional relationships shown in the drawings. This is only for convenience of description and does not indicate or imply that the device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the present invention.
[0025] In addition, it should be noted that in the description of the present invention, unless otherwise clearly defined and limited, the terms "installation", "connection", and "connection" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be directly connected or indirectly connected through an intermediate medium, and it can be the communication inside two elements. For those skilled in the art, the specific meanings of the above terms in the present invention can be understood according to specific situations.
[0026] Please refer to Figures 1 - 4 as shown Figure 1 It is a schematic flowchart of a method for detecting the orientation of paper based on machine vision in an embodiment of the present invention; Figure 2 It is a schematic structural diagram of a detection structure applied to a printing production line in an embodiment of the present invention; Figure 3 It is a schematic diagram for determining the orientation state of printed packaging paper in an embodiment of the present invention; Figure 4 It is a schematic diagram for frame selection of pattern symbols and text in an embodiment of the present invention.
[0027] The present invention provides a method for detecting the orientation of paper based on machine vision, including: Step S1, use the light source to operate at the initial power, illuminate the surface of the printed packaging paper, obtain an overall preview image of the printed packaging paper, and determine whether the overall preview image is rotationally centrosymmetric; Step S2, for a non-rotationally centrosymmetric image, determine that the image type of the input image to be printed is a pattern and text type or a pure color type, and perform frame selection and recognition on the pattern symbols and text; Step S3, determine the type of recognition hidden danger for direction recognition of the printed packaging paper, and adopt different detection and recognition strategies according to the image type and the type of recognition hidden danger; Step S4, when the overall preview image is a single surface image, determine the standard point image area and its corresponding detection area, move the vision camera to the corresponding detection area to obtain the area detection image, and judge its matching degree with the standard point image; Step S5, when the overall preview image contains several identical image areas, extract several pattern symbols and text in any one of the image areas, calculate their average similarity with the pattern symbols and text in the corresponding area detection image, and judge the direction state of the printed packaging paper; Step S6, according to the type of recognition hidden danger, the movement error of the vision camera, and the angle deviation, determine the reason why the direction of the printed packaging paper is inconsistent with the process requirement direction, and take corresponding adjustment measures; Step S7, when the input image to be printed is of the pure color type, when the corresponding position of the positioning color sensor meets the detection conditions, determine the direction of the printed packaging paper according to the contrast color difference between the target color and the inspection color.
[0028] In this embodiment, the printed packaging paper needs to be transported to processes such as hot stamping, die cutting, and folding. Before the transportation process, the printed packaging paper needs to be placed in the correct direction; There is a short pause gap during the transportation process of the printed packaging paper to feed the printed packaging paper one by one, and the direction detection is performed during this pause gap.
[0029] Specifically, the printed packaging paper needs to be transported to processes such as hot stamping, die cutting, and folding. During the transportation process, the front and back ends of the paper may be placed in reverse when loading the paper, which will cause the subsequent processes such as die cutting and folding to not proceed normally. Therefore, it is necessary to detect whether the transported packaging paper is placed in reverse. This method saves labor resources by automatically detecting the front and back of the paper, avoids mistakes that may be caused by manual detection, and improves the production efficiency and automation degree of printed packaging.
[0030] Step S1, use a high-brightness LED light source to illuminate the surface of the printed packaging paper, and use a high-resolution CCD or CMOS camera to perform real-time image acquisition on the paper, Obtain the overall preview image of the printed packaging paper, classify the printed packaging paper according to the overall preview image of the printed packaging paper, and determine whether the printed packaging paper is rotationally centrosymmetric; In implementation, the image existing on the surface of the printed packaging paper is printed according to the overall preview image, and the overall preview image is obtained by typesetting the paper for the to-be-printed input image input in advance. The image existing on the surface of the printed packaging paper may be divided into several image areas identical to the to-be-printed input image according to the specific printing requirements of the to-be-printed input image, or be a single surface image.
[0031] Determine the center point of the overall preview image, and use the rotation function in an image processing library (such as OpenCV) to rotate the overall preview image 180 degrees around the center point; Compare the original overall preview image with the rotated overall preview image, and use the mean square error (MSE) and structural similarity index (SSIM) to calculate the difference between the two images. If both the mean square error and the structural similarity index meet the similarity determination conditions, then determine that the overall preview image is a rotationally centrosymmetric image, and the printed packaging paper is rotationally centrosymmetric; If both the mean square error and the structural similarity index do not meet the determination conditions, then determine that the overall preview image is not a rotationally centrosymmetric image, and the printed packaging paper is not rotationally centrosymmetric; Specifically, the similarity determination conditions are that the mean square error is less than the error threshold, and the structural similarity index is greater than the index threshold. The error threshold and the index threshold can be preset according to specific requirements.
[0032] Specifically, in the case where the image existing on the surface of the printed packaging paper is a centrosymmetric figure, there is no need to determine the front and back of the printed packaging paper. In the initial stage of this method, by comparing the overall preview image of the printed packaging paper after central rotation, it is confirmed whether the printed packaging paper is rotationally centrosymmetric, avoiding unnecessary calculations, saving resources, and accelerating the transportation efficiency.
[0033] Step S2: Classify the non-rotationally centrosymmetric image to determine the image type, and adopt different detection and recognition strategies according to the image type. For the non-rotationally centrosymmetric image, input the to-be-printed input image into the trained YOLO model, and use the trained YOLO model to determine the image type of the to-be-printed input image. If the to-be-printed input image contains text or pattern symbols, then frame and recognize the pattern symbols and text in the to-be-printed input image, and confirm that the image type is the pattern and text type. If the to-be-printed input image does not contain text or pattern symbols, then confirm that the image type of the to-be-printed input image is the pure color type.
[0034] Step S3, determine the type of recognition hidden danger of the printed packaging paper, and adopt different detection and recognition strategies according to the image type and the type of recognition hidden danger; Obtain the overall detection image of the printed packaging paper, extract the brightness features in the image, and use the threshold segmentation method to divide the image into an exposure area and a non-exposure area; In implementation, the selection of the threshold in the threshold segmentation method can be determined automatically according to histogram analysis or using the Otsu method.
[0035] Detect the exposure ratio of the exposure area in the overall area. If the exposure ratio is less than or equal to the standard ratio, it is determined that there is a hidden recognition hidden danger in the printed packaging paper; If the exposure ratio is greater than the standard ratio, it is determined that there is an obvious recognition hidden danger in the printed packaging paper; Among them, the standard ratio is 23%.
[0036] Specifically, due to the illumination of the light source that brightens the paper surface, there is an exposure phenomenon that affects image acquisition and subsequent paper orientation recognition. This method classifies the type of recognition hidden danger of the printed packaging paper into obvious recognition hidden danger and hidden recognition hidden danger according to the exposure ratio of the exposure area in the overall area, avoiding adverse effects on the analysis links vulnerable to light factors in subsequent different detection and recognition strategies, and increasing the adaptability and accuracy of paper orientation detection and recognition.
[0037] Step S4, adopt different detection and recognition strategies according to the image type. If the image type of the input image to be printed is a pattern and text type, its detection and recognition strategy is to determine the standard point image area and its corresponding detection area, and obtain the area detection image to judge its matching degree with the standard point image; According to the specific printing situation and the type of recognition hidden danger of the overall preview image, determine the areas to which the pattern symbols and text belong; If the overall preview image is a single surface image, according to the results of the pattern symbols and text recognized by frame selection in the input image to be printed, divide the areas to which the pattern symbols and text belong correspondingly in the overall preview image; Determine any area that meets the standard conditions as the standard point image area, and the image within the standard point image area is the standard point image; Determine the detection area of the printed packaging paper corresponding to the standard point image area in the overall preview image on the fixing frame, move the vision camera to the detection area to take a picture, and obtain the area detection image; The standard conditions are that the area is the largest and the area does not belong to the exposure area.
[0038] Slide the region detection image over the standard point image region, calculate the similarity of the overlapping region between the region detection image and the standard point image, and determine the matching degree; Use the matchTemplate function in OpenCV for normalized squared difference matching. If the squared difference matching value is less than the matching evaluation value, it is determined that the similarity of the overlapping region between the region detection image and the standard point image is large, and the region detection image matches the standard point image; If the squared difference matching value is greater than or equal to the matching evaluation value, it is determined that the similarity of the overlapping region between the region detection image and the standard point image is small, and the region detection image does not match the standard point image; Among them, the matching evaluation value is 0.1.
[0039] Specifically, the template matching method adopted by this method is relatively sensitive to noise and light changes. On the one hand, by moving the vision camera to an area that meets the standard conditions, that is, an area that is not affected by exposure, the adverse impact of light changes on the template matching method is avoided, and the robustness is improved through preprocessing. On the other hand, for the case where the surface image of the printed packaging paper is a single surface image, the standard point image region is determined according to the clearest symbol or text in the image, and the vision camera is correspondingly moved to the corresponding area to obtain the region detection image, and the matching degree of the region detection image in the standard point image region is judged, avoiding the large error and inaccurate judgment that are likely to occur when analyzing and judging the whole printed packaging paper. At the same time, the situation of incorrect direction recognition due to the symmetric and asymmetric patterns and texts in various directions of the input image to be printed is excluded, improving the accuracy and adaptability of paper direction recognition for the specific application scenario of this method.
[0040] Step S5, if the overall preview image contains several identical image regions, divide the overall preview image into several image regions, and extract several pattern symbols and texts in any one of the image regions. Move the vision camera to the corresponding area of the printed packaging paper corresponding to any one of the image regions on the fixed frame to take a region detection image, and calculate the average similarity between the pattern symbols and texts in the region detection image and the extracted several pattern symbols and texts. If the average similarity is greater than the first standard value, it is determined that the printed packaging paper is in the first direction state, and the direction of the printed packaging paper is consistent with the direction required by the process; If the average similarity is less than or equal to the first standard value and greater than the second standard value, it is determined that the printed packaging paper is in the second direction state, and the direction of the printed packaging paper needs further analysis compared with the direction required by the process; If the average similarity is less than or equal to the second standard value, it is determined that the printed packaging paper is in the third direction state, and the direction of the printed packaging paper is opposite to the direction required by the process; Among them, the first standard value is greater than the second standard value.
[0041] When the printed packaging paper is in the second direction state, if there are obvious recognition hazards on the printed packaging paper, it is determined that the reason for the printed packaging paper to be in the second direction state is exposure. Extract a number of pattern symbols and texts in another image area to calculate the average similarity, determine the direction state of the printed packaging paper for the second time, and reduce the initial power of the light source; If there are hidden recognition hazards on the printed packaging paper, according to the center points of the areas to which the pattern symbols and texts belong and the position of the vision camera, detect the position difference between the focus of the vision camera and the center point. Step S6, according to the type of recognition hazard, the movement error of the vision camera, and the angular deviation, determine the reason why the direction of the printed packaging paper is inconsistent with the direction required by the process, and take corresponding adjustment measures; If the position difference is greater than the critical difference, it is determined that the reason for the printed packaging paper to be in the second direction state is that there is an error in the movement of the vision camera, and the position of the vision camera is adjusted according to the error situation; If the position difference is less than or equal to the critical difference, it is determined that the reason for the printed packaging paper to be in the second direction state is that the vision camera shakes to generate an angular deviation, and the angle of the vision camera is adjusted according to the deviation situation; Among them, the critical difference is 0.2mm.
[0042] Specifically, when the input image to be printed is small in advance, the overall preview image will contain several identical image areas, and the image symbols and texts on them are also exactly the same. Therefore, the direction of one of the several identical image areas can represent the direction of the overall printed packaging paper, and there will be no situation where the direction recognition is incorrect due to the symmetric and asymmetric pattern texts in various directions in the input image to be printed itself; this method determines the direction state of the printed packaging paper by comparing any image area in the overall preview image with several pattern symbols and texts in the corresponding area. At the same time, due to reasons such as the vibration generated during the printing and transportation alignment process and the exposure of the light source, the vision camera is inevitably affected. Therefore, after determining the reason and adjusting the vision camera and the light source accordingly, the direction state of the printed packaging paper is determined for the second time, avoiding the situation where the direction recognition is incorrect during the production process, further improving the accuracy of direction detection, and reducing the analysis error.
[0043] Step S7, adopt different detection and recognition strategies according to the image type. If the image type of the input image to be printed is a pure color type, its detection and recognition strategy is to locate the detection point of the color sensor at the corresponding position on the printed packaging paper. When the corresponding position meets the detection condition, obtain the target color of the overall preview image at the corresponding position, and calculate the contrast color difference between it and the inspection color recognized by the color sensor. The detection condition is that the color at the corresponding position is different from the color at the symmetric position on the other side of the printed packaging paper. Specifically, the center point of the determined image at the corresponding position is rotated around the center to determine the symmetric position. If the contrast color difference is less than the color difference evaluation value, it is determined that the inspection color is consistent with the target color, and the direction of the printed packaging paper is correct. If the contrast color difference is greater than or equal to the color difference evaluation value, it is determined that the inspection color is inconsistent with the target color, and the direction of the printed packaging paper is opposite. Among them, the color difference evaluation value is 0.8.
[0044] Specifically, correspondingly, there is also a situation where the image on the surface of the printed packaging paper is only composed of colors. By locating the detection point of the color sensor at the corresponding position on the printed packaging paper and making corresponding comparisons, this method avoids the situation where the colors in the symmetric area are the same, resulting in incorrect direction recognition, and improves the adaptability and accuracy of direction detection for this specific application scenario of printed packaging paper.
[0045] So far, the technical solution of the present invention has been described in combination with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present invention.
[0046] The above are only the preferred embodiments of the present invention and are not used to limit the present invention; for those skilled in the art, the present invention can have various changes and modifications. Any modification, equivalent substitution, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A paper direction detection method based on machine vision, characterized in that: include: Using the light source to operate at the initial power, the surface of the printed packaging paper is illuminated, an overall preview image of the printed packaging paper is obtained, and it is determined whether the image on the surface of the printed packaging paper is rotationally symmetrical; For a non-rotationally symmetrical image, determine whether the image type of the input image to be printed is a pattern text type or a pure color type, and perform frame selection and recognition on the pattern symbols and text; Determine the identification risk types for direction identification of printed packaging paper, and adopt different detection and identification strategies according to the image type and identification risk type; When the overall preview image is a single surface image, determine the standard point image area and its corresponding detection area, move the visual camera to the corresponding detection area to obtain the regional detection image to determine its matching degree with the standard point image; When the overall preview image contains several identical image regions, several patterns, symbols and characters in any image region are extracted, and the average similarity between the patterns, symbols and characters in the corresponding regional detection image is calculated to determine the orientation state of the printed packaging paper; According to the identified hidden danger type and the movement error and angle offset of the visual camera, determine the reason why the direction of the printed packaging paper is inconsistent with the direction required by the process, take corresponding adjustment measures, determine the direction state of the printed packaging paper again, or reduce the initial power of the light source to adjust the position of the visual camera according to the error situation, or adjust the angle of the visual camera according to the offset situation; The input image to be printed is of pure color type. When the corresponding point of the positioning color sensor meets the detection conditions, the direction of printing and packaging paper is determined according to the contrast color difference between the target color and the inspection color.
2. The paper direction detection method based on machine vision according to claim 1, characterized in that: The process of determining whether the image on the surface of the printed packaging paper is rotationally symmetrical includes: Determine the center point of the overall preview image, and rotate the overall preview image 180 degrees around the center point; Compare the original overall preview image with the rotated overall preview image, calculate the difference between the two images, and if the mean square error and the structural similarity index both meet the similarity judgment conditions, then the overall preview image is judged to be a rotationally symmetrical image, and the printed packaging paper is rotationally symmetrical; The similarity determination condition is that the mean square error is less than an error threshold, and the structural similarity index is greater than an index threshold.
3. The paper direction detection method based on machine vision according to claim 1, characterized in that: The process of determining the image type of the input image to be printed includes: For non-rotationally symmetric images, the input image to be printed is fed into the trained model. If the input image to be printed contains text or pattern symbols, then select and identify the pattern symbols and text in the input image to be printed, and confirm that the image type is a pattern text type; If the input image to be printed does not contain any text or pattern symbol, it is determined that the image type of the input image to be printed is a pure color type.
4. The paper direction detection method based on machine vision according to claim 3 is characterized in that: If the image type of the input image to be printed is a pattern and text type, and the overall preview image is a single surface image, the areas of pattern symbols and text are correspondingly divided in the overall preview image according to the frame selection recognition result of the input image to be printed; Determine any area that meets the standard conditions as a standard point image area, move the visual camera to the corresponding detection area to take pictures, and obtain the area detection image; The standard condition is that the region has the largest area and is not in the exposure area.
5. The paper direction detection method based on machine vision according to claim 4, characterized in that: Slide the region detection image on the standard point image region, calculate the similarity of the overlapping region between the region detection image and the standard point image, If the square difference matching value is less than the matching evaluation value, it is determined that the region detection image matches the standard point image.
6. The paper direction detection method based on machine vision according to claim 4, characterized in that: When the overall preview image includes a plurality of identical image regions, dividing the overall preview image into a plurality of image regions; Extract several patterns, symbols and words in any image area, and calculate their average similarity with the patterns, symbols and words in the input image to be printed. If the average similarity is greater than the first standard value, it is determined that the printed packaging paper is in the first direction state, and the direction of the printed packaging paper is consistent with the direction required by the process; If the average similarity is less than or equal to the first standard value and greater than the second standard value, it is determined that the printed packaging paper is in the second direction state, and the direction of the printed packaging paper and the direction of the process requirement need to be analyzed; If the average similarity is less than or equal to the second standard value, it is determined that the printed packaging paper is in the third orientation state, and the direction of the printed packaging paper is opposite to the direction required by the process.
7. The paper direction detection method based on machine vision according to claim 6, characterized in that: When the printed packaging paper is in the second orientation state, if there is a hidden danger of explicit identification of the printed packaging paper, it is determined that the reason why the printed packaging paper is in the second orientation state is exposure, A plurality of pattern symbols and characters in another image area are extracted to calculate the average similarity, the direction state of the printed packaging paper is determined for the second time, and the initial power of the light source is reduced.
8. The paper direction detection method based on machine vision according to claim 7, characterized in that: When there are hidden identification risks in printed packaging paper, the position difference between the focus and the center point of the visual camera is detected according to the center point of the area where the pattern symbols and texts belong and the position of the visual camera. If the position difference is greater than the critical difference, it is determined that the printed packaging paper is in the second direction state because there is an error in the movement of the visual camera, and the position of the visual camera is adjusted according to the error; If the position difference is less than or equal to the critical difference, it is determined that the printed packaging paper is in the second direction state because the visual camera shakes and produces an angle offset, and the visual camera angle is adjusted according to the offset.
9. The paper direction detection method based on machine vision according to claim 1, characterized in that: The process of determining the types of identification hazards for orientation identification of printed packaging paper includes, Obtain the overall inspection image of printed packaging paper, extract the brightness features in the image, and use the threshold segmentation method to divide the image into exposed areas and non-exposed areas; The exposure ratio of the detected exposed area in the overall area is determined. If the exposure ratio is less than or equal to the standard ratio, it is determined that the printed packaging paper has hidden identification risks. If the exposure ratio is greater than the standard ratio, it is determined that the printed packaging paper has obvious identification risks.
10. The paper direction detection method based on machine vision according to claim 1, characterized in that: When the image type of the input image to be printed is a pure color type, the detection point of the positioning color sensor is at a corresponding point of the printed packaging paper; When the corresponding point meets the detection condition, the target color of the overall preview image at the corresponding point is obtained, and the contrast color difference between the target color and the inspection color recognized by the color sensor is calculated; If the contrast color difference is less than the color difference evaluation value, it is judged that the inspection color is consistent with the target color and the direction of the printed packaging paper is correct; If the contrast color difference is greater than or equal to the color difference evaluation value, it is judged that the inspection color is inconsistent with the target color, and the direction of printing and packaging paper is opposite; The detection condition is that the color of the corresponding point is different from the color of the symmetrical point on the other side of the printed packaging paper.
Citation Information
Patent Citations
Method for detecting can body pattern direction of metal can
CN103489195A
System and method for detecting pre-printing state of paper of printing machine
CN117092117A
Corrugated board defect detection method, medium and equipment
CN119273677A
Method and device for detecting whether paper is suitable for printing or not and electronic equipment
CN119494831A
Ink jet recording device and printing method
JP2019181768A