Paper Orientation Detection Method Based on Machine Vision
Through machine vision detection of paper direction, the production efficiency problem caused by paper backward is solved, automated inspection is realized, and the production efficiency and accuracy of printing and packaging paper is improved.
Patent Information
- Application Number
- CN202510545562.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-28
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2045-04-28
AI Technical Summary
During the printing process, the paper is easily put backward, resulting in the subsequent production process being unable to proceed normally, affecting the processing efficiency, and the existing technology cannot fully detect the paper direction.
Using a paper direction detection method based on machine vision, the overall preview image is obtained by brightening the paper surface by a light source, judging the symmetry of the rotation center, box selection to identify pattern symbols and text, adopt different detection strategies according to the image type, use visual cameras and color sensors to judge the paper direction, and adjust the light source and camera position to ensure accuracy.
Automatically detect paper direction, avoid manual errors, improve production efficiency and automation, enhance the adaptability and accuracy of inspection, and reduce resource waste.
Smart Images

Figure CN120070441B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of anti-paper detection, and particularly relates to a method for detecting the direction of paper based on machine vision. Background Art
[0002] The printed packaging paper needs to be transported to processes such as gilding, 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 backwards. When placing the paper during the conveying process, the front and rear ends of the paper may be placed backwards, which will cause the subsequent processes such as die-cutting and folding to not proceed normally. The paper placed backwards flowing into the subsequent production process will affect the processing efficiency of the product. Therefore, it is necessary to detect whether the transported packaging paper is placed backwards.
[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 planar 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, thereby judging whether the welding direction of the body of the metal can is correct. The judgment accuracy is high, the automation degree 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:
[0004] 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
[0005] 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 backwards during the manual loading process in the prior art, which affects the processing efficiency of the product after flowing into the subsequent production process.
[0006] To achieve the above object, the present invention provides a method for detecting the direction of paper based on machine vision, including:
[0007] 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;
[0008] For non-rotationally centrosymmetric images, 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;
[0009] 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;
[0010] 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;
[0011] When the overall preview image contains several identical image areas, extract several pattern symbols and texts in any one of the image areas, calculate the average similarity of the pattern symbols and texts in it and those in the corresponding area detection image, and judge the direction state of the printed packaging paper;
[0012] According to the identified hidden danger type, the movement error and angle deviation of the vision camera, judge the reason why it is impossible to determine whether the direction of the printed packaging paper is consistent or opposite to the process requirement direction, take corresponding adjustment measures, determine the direction state of the printed packaging paper for the second time, 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;
[0013] When the input image to be printed is of a pure color type, when the corresponding position of the 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.
[0014] Further, the process of judging whether the image on the surface of the printed packaging paper is rotationally centrosymmetric includes,
[0015] Determine the center point of the overall preview image, and rotate the overall preview image 180 degrees around the center point;
[0016] 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;
[0017] 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.
[0018] Further, the process of determining the image type of the input image to be printed includes,
[0019] For a non-rotationally centrosymmetric image, input the input image to be printed into a trained model,
[0020] 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;
[0021] 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.
[0022] Further, if the image type of the input image to be printed is a pattern text type and the overall preview image is a single-surface image, according to the frame selection recognition result of the input image to be printed, the regions belonging to the pattern symbols and the text are correspondingly divided in the overall preview image;
[0023] Determine any one of the regions belonging to the standard condition 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;
[0024] The standard condition is the region belonging to the largest area and not in the exposure region.
[0025] 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.
[0026] 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.
[0027] Further, when the overall preview image contains several identical image regions, divide the overall preview image into several image regions;
[0028] Extract several pattern symbols and text in any one of the image regions, and calculate the average similarity between them and the pattern symbols and text in the input image to be printed.
[0029] 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;
[0030] 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;
[0031] 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.
[0032] Further, when the printed packaging paper is in the second direction state, if there is an obvious recognition risk for the printed packaging paper, it is determined that the reason for the printed packaging paper to be in the second direction state is exposure.
[0033] Extract several pattern symbols and text 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.
[0034] Further, when there are potential hidden identification risks in the printed packaging paper, based on 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 points.
[0035] 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 the error in the movement of the vision camera, and adjust the position of the vision camera according to the error situation;
[0036] 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 the angular deviation caused by the jitter of the vision camera, and adjust the angle of the vision camera according to the deviation situation.
[0037] Further, the process of determining the type of hidden identification risk for direction identification of the printed packaging paper includes
[0038] 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 exposed area and a non-exposed area;
[0039] 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 are potential hidden identification risks in the printed packaging paper. If the exposure ratio is greater than the standard ratio, it is determined that there are obvious identification risks in the printed packaging paper.
[0040] 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;
[0041] When the corresponding position meets the detection conditions, obtain the target color at the corresponding position of the overall preview image, and calculate the comparison color difference between it and the inspection color identified by the color sensor;
[0042] 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;
[0043] 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;
[0044] 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.
[0045] Compared with the prior art, the beneficial effects of the present invention are as follows. The printed packaging paper needs to be transported to processes such as gilding, die-cutting, and folding. During the conveying 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 processes such as die-cutting and folding to not proceed normally. Therefore, it is necessary to detect whether the conveyed packaging paper is placed in the reverse direction. This method saves labor resources through automatic detection of 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 printing and packaging.
[0046] Furthermore, 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. At the initial stage, this method compares the overall preview image of the printed packaging paper after central rotation, so as to confirm whether the printed packaging paper is rotationally centrosymmetric, avoiding redundant calculations and saving resources and accelerating the transportation efficiency.
[0047] Furthermore, due to 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 hidden danger types of the printed packaging paper into obvious recognition hidden dangers and hidden recognition hidden dangers according to the exposure ratio of the exposure area in the overall area, avoiding adverse effects on the analysis links that are vulnerable to light factors in different subsequent detection and recognition strategies, and increasing the adaptability and accuracy of paper direction detection and recognition.
[0048] Furthermore, 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 where there is no exposure phenomenon and is not affected by exposure, the adverse effects of light changes on the template matching method are 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, and at the same time excluding the situation of roughly identifying the direction of any pattern or text but resulting in incorrect direction recognition due to the symmetric and asymmetric patterns and texts existing in the input image to be printed in various directions, improving the accuracy and adaptability of paper direction recognition for the specific application scenario of this method.
[0049] Furthermore, when the input image to be printed is small in advance, the overall preview image will contain several identical image regions, and the image symbol texts on them are also exactly the same. Therefore, the direction of any one of the several identical image regions 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 or asymmetric pattern 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 region in the overall preview image with several pattern symbols and texts in the corresponding region. At the same time, due to reasons such as the vibration generated during the printing, transportation, and alignment process and the light source exposure, the vision camera is inevitably affected. Therefore, after adjusting the vision camera and the light source accordingly to determine the cause, it avoids the situation where the direction recognition is incorrect due to the production process when determining the direction state of the subsequent printed packaging paper, further improving the accuracy of direction detection and reducing the analysis error.
[0050] 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 a comparison accordingly, avoiding the situation where the colors in the symmetric regions are the same, resulting in incorrect direction recognition, and improving the adaptability and accuracy of direction detection for this specific application scenario of the printed packaging paper. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 It is a schematic flowchart of the method for detecting the direction of paper based on machine vision in an embodiment of the present invention;
[0052] Figure 2 It is a schematic structural diagram of the detection structure applied to a printing production line in an embodiment of the present invention;
[0053] Figure 3 It is a schematic determination diagram for determining the direction state of the printed packaging paper in an embodiment of the present invention;
[0054] Figure 4 It is a schematic diagram for identifying and framing the pattern symbols and texts in an embodiment of the present invention;
[0055] In the figure: 1 - vision camera. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0056] In order to make the purpose 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.
[0057] The preferred embodiments of the present invention will be described below with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are only used to explain the technical principle of the present invention and do not limit the protection scope of the present invention.
[0058] It should be noted that in the description of the present invention, the terms indicating the direction or positional relationship such as "upper", "lower", "left", "right", "inner", "outer", etc. are based on the direction or positional relationship shown in the drawings. This is only for convenience of description, rather than indicating or implying that the device or element must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it should not be construed as a limitation to the present invention.
[0059] In addition, it should be noted that in the description of the present invention, unless otherwise clearly specified 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.
[0060] Please refer to Figures 1-4 as shown Figure 1 It is a schematic flowchart of the method for detecting the paper direction based on machine vision in an embodiment of the present invention; Figure 2 It is a schematic structural diagram of the detection structure applied to a printing production line in an embodiment of the present invention; Figure 3 It is a schematic determination diagram for determining the direction state of printed packaging paper in an embodiment of the present invention; Figure 4 It is a schematic diagram for frame selection and recognition of pattern symbols and text in an embodiment of the present invention.
[0061] The present invention provides a method for detecting the paper direction based on machine vision, including:
[0062] Step S1, use the light source to operate at the initial power, illuminate the surface of the printed packaging paper, obtain the overall preview image of the printed packaging paper, and determine whether the overall preview image is rotationally centrosymmetric;
[0063] Step S2, 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 perform frame selection and recognition on the pattern symbols and text;
[0064] 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;
[0065] 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;
[0066] Step S5, the overall preview image contains several identical image regions. Extract several pattern symbols and texts in any one of the image regions, calculate the average similarity between them and the pattern symbols and texts in the corresponding region detection image, and determine the direction state of the printed packaging paper.
[0067] Step S6, based on the identified hidden danger type, the movement error and angle deviation of the vision camera, determine the reasons why it is impossible to determine whether the direction of the printed packaging paper is the same as or opposite to the process requirement direction, and take corresponding adjustment measures.
[0068] Step S7, when the input image to be printed is of a pure color type and the corresponding point position of the positioning color sensor meets the detection conditions, determine the direction of the printed packaging paper according to the comparison color difference between the target color and the inspection color.
[0069] In this embodiment, the printed packaging paper needs to be conveyed to processes such as hot stamping, die cutting, and folding. Before the conveying process, the printed packaging paper needs to be placed in the correct direction.
[0070] There is a short pause gap during the conveying process of the printed packaging paper to feed the printed packaging paper one by one, and the direction detection is carried out during this pause gap.
[0071] Specifically, the printed packaging paper needs to be conveyed to processes such as hot stamping, die cutting, and folding. During the conveying process, the front and rear 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 conveyed 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.
[0072] 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.
[0073] 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.
[0074] In the 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 typeset for the paper for the pre-input image to be printed. The image existing on the surface of the printed packaging paper may be divided into several image regions identical to the image to be printed according to the specific printing requirements of the image to be printed, or be a single surface image.
[0075] 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;
[0076] Compare the original overall preview image with the rotated overall preview image, and use the mean squared error (MSE) and structural similarity index (SSIM) to calculate the difference between the two images.
[0077] If both the mean squared 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.
[0078] If both the mean squared 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.
[0079] Specifically, the similarity determination conditions are that the mean squared 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.
[0080] 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 redundant calculations, saving resources, and accelerating the transportation efficiency.
[0081] 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.
[0082] For a non-rotationally centrosymmetric image, input the image to be printed into a trained YOLO model, and use the trained YOLO model to determine the image type of the image to be printed.
[0083] If the image to be printed contains text or pattern symbols, then box and recognize the pattern symbols and text in the image to be printed, and confirm that the image type is the pattern text type.
[0084] If the image to be printed does not contain text or pattern symbols, then confirm that the image type of the image to be printed is the pure color type.
[0085] 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.
[0086] 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 exposed area and a non-exposed area;
[0087] In implementation, the threshold selection in the threshold segmentation method can be determined automatically according to histogram analysis or using the Otsu method.
[0088] Detect the exposure proportion of the exposed area in the overall area. If the exposure proportion is less than or equal to the standard proportion, it is determined that there is a hidden recognition risk for the printed packaging paper;
[0089] If the exposure proportion is greater than the standard proportion, it is determined that there is an obvious recognition risk for the printed packaging paper;
[0090] Among them, the standard proportion is 23%.
[0091] 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 recognition risk types of the printed packaging paper into obvious recognition risks and hidden recognition risks according to the exposure proportion 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 orientation detection and recognition.
[0092] 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;
[0093] According to the specific printing situation and the existing recognition risk types of the overall preview image, determine the areas to which the pattern symbols and text belong,
[0094] If the overall preview image is a single-surface image, according to the results of the pattern symbols and text identified by frame selection in the input image to be printed, divide the corresponding areas to which the pattern symbols and text belong in the overall preview image;
[0095] Determine any one of the areas that meet the standard conditions as the standard point image area, and the image within the standard point image area is the standard point image;
[0096] 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;
[0097] The standard condition is that the area is the largest and the area does not fall within the exposed area.
[0098] 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;
[0099] Use the matchTemplate function in OpenCV for normalized sum of squared differences matching. If the sum of squared differences 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;
[0100] If the sum of squared differences 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;
[0101] Among them, the matching evaluation value is 0.1.
[0102] 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 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 to-be-printed input image itself is excluded when roughly recognizing the direction of any pattern or text, improving the accuracy and adaptability of paper direction recognition for the specific application scenario of this method.
[0103] 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,
[0104] Move the vision camera to the corresponding area of the printed packaging paper corresponding to any one of the image regions on the fixing 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,
[0105] 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;
[0106] 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 required by the process need to be further analyzed;
[0107] 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;
[0108] Among them, the first standard value is greater than the second standard value.
[0109] When the printed packaging paper is in the second direction state, if there is an obvious recognition hidden danger in the printed packaging paper, it is determined that the reason for the printed packaging paper to be in the second direction state is exposure,
[0110] Extract several 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;
[0111] If there is a hidden recognition hidden danger in the printed packaging paper, according to the center point of the area to which the pattern symbol and text belong and the position of the vision camera, detect the position difference between the vision camera focus and the center point,
[0112] 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 direction required by the process, and take corresponding adjustment measures;
[0113] 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;
[0114] 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 angle deviation, and the angle of the vision camera is adjusted according to the deviation situation;
[0115] Among them, the critical difference is 0.2mm.
[0116] 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 symbol texts on them are also exactly the same. Therefore, the direction of any 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 or 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 vibrations during the printing, transportation, and alignment process and light source exposure, the vision camera is inevitably affected. Therefore, after adjusting the vision camera and light source accordingly to determine the reasons, it avoids the situation where the direction recognition is incorrect due to the production process when determining the subsequent direction state of the printed packaging paper, further improving the accuracy of direction detection and reducing the analysis error.
[0117] 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.
[0118] 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.
[0119] 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.
[0120] Specifically, perform a central rotation on the center point of the determined image at the corresponding position to determine the symmetric position.
[0121] 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.
[0122] 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.
[0123] Among them, the color difference evaluation value is 0.8.
[0124] Specifically, correspondingly, there are also cases where the images on the surface of the printed packaging paper are only composed of colors. This method locates the detection point of the color sensor at the corresponding position on the printed packaging paper and makes corresponding comparisons, avoiding the situation where the colors in the symmetric areas are the same, resulting in incorrect direction recognition, and improving the adaptability and accuracy of direction detection for this specific application scenario of the printed packaging paper.
[0125] So far, the technical solution of the present invention has been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easily understood by those skilled in the art 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.
[0126] 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 within the protection scope of the present invention.
Claims
1. A method for detecting the orientation of a paper based on machine vision, characterized in that, Including: Use the light source to operate at the initial power, brighten the surface of the printed packaging paper, obtain an overall preview image of the printed packaging paper, and determine 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 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; 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; 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 an area detection image, and judge its matching degree with the standard point image; When the overall preview image contains several identical image areas, extract several pattern symbols and text in any one image area, calculate the average similarity of the pattern symbols and text in it and the pattern symbols and text in the corresponding area detection image, and judge the direction state of the printed packaging paper; According to the type of recognition hidden danger, the movement error of the vision camera, and the angle deviation, judge the reason why it is impossible to determine whether the direction of the printed packaging paper is consistent or opposite to 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 and 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 the pure color type, when the corresponding position of the color sensor for positioning 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.
2. The method for detecting the paper orientation based on machine vision according to claim 1, wherein 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 determination conditions, then judge that the overall preview image is a rotationally centrosymmetric image, and the printed packaging paper is rotationally centrosymmetric; 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.
3. The method for detecting the paper orientation 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 a non-rotationally centrosymmetric image, input the input image to be printed into the trained model; If the input image to be printed contains text or pattern symbols, frame and recognize the pattern symbols and text in the input image to be printed, and confirm that the image type is the pattern and text type; If the input image to be printed does not contain text or pattern symbols, confirm that the image type of the input image to be printed is the pure color type.
4. The method for detecting the direction of a paper based on machine vision according to claim 3, wherein If the image type of the input image to be printed is the pattern and 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, the area to which the pattern symbols and text belong is correspondingly divided in the overall preview image; Determine any of the regions belonging to 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 condition is that the region has the largest area and does not fall within the exposure region among the regions belonging to it.
5. The method for detecting the direction of a printed packaging paper based on machine vision according to claim 4, wherein 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 region detection image matches the standard point image.
6. The method for detecting the direction of a printed packaging paper based on machine vision according to claim 4, wherein When the overall preview image contains several identical image regions, divide the overall preview image into several image regions; Extract several pattern symbols and characters in any one of the image regions, and calculate their average similarity with the pattern symbols and characters 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 to be analyzed 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.
7. The method for detecting the direction of a printed packaging paper based on machine vision according to claim 6, wherein When the printed packaging paper is in the second direction state, if there is an obvious recognition risk for 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 characters in another image region to calculate the average similarity, re-determine the direction state of the printed packaging paper, and reduce the initial power of the light source.
8. The method for detecting the direction of a printed packaging paper based on machine vision according to claim 7, wherein When there is a hidden recognition risk for the printed packaging paper, according to the center points of the regions to which the pattern symbols and characters 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.
9. The method for detecting the paper direction based on machine vision according to claim 1, characterized in that The process of determining the type of recognition risk 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 proportion of the exposure area in the overall area. If the exposure proportion is less than or equal to the standard proportion, it is determined that there is a hidden recognition risk for the printed packaging paper. If the exposure proportion is greater than the standard proportion, it is determined that there is an obvious recognition risk for the printed packaging paper.
10. The method for detecting the paper direction 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, 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 contrast color difference between it and the inspection color recognized by the color sensor; 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; 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.
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