Facial paper positioning method and system

Through the method of positioning paper, the PLC module and camera detection and positioning smoke packet paper are used to solve the problem of complex and inefficient efficiency in the existing technologies, and achieve more efficient noodle paper positioning and processing.

CN119379649APending Publication Date: 2025-01-28CHINA CRAFTSMAN ROBOT (GUANGDONG) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411509109.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-28
Publication Date
2025-01-28

AI Technical Summary

Technical Problem

In the existing tobacco and bread paper processing technology, the template matching plan is complex and the matching speed is slow, resulting in low work efficiency.

Method used

Adopt the method of positioning paper, detect the facial paper through the PLC module, take pictures and transmit images of the camera, perform adaptive dual -value and morphological processing, obtain the external maximum rectangle of the white box, position the paper gap, and set the gap threshold to determine Essence

Benefits of technology

The quality of the picture is improved, the configuration is simplified, the processing speed is improved, the efficiency is improved, and the difficulty of subsequent processing has been reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119379649A_ABST
    Figure CN119379649A_ABST
Patent Text Reader

Abstract

The invention is suitable for the field of cigarette packet production, and provides a surface paper positioning method and system, whether surface paper exists or not is detected through a PLC module, when the surface paper exists, a camera is triggered to take a picture, and a picture obtained through photographing is transmitted through an interface; carrying out pre-processing on the received image, wherein the pre-processing comprises self-adaptive binarization and morphological processing; searching a white frame existing in the image through an algorithm, when interference exists on the boundary of the white frame, obtaining coordinates of all points on the boundary of the white frame, obtaining an external maximum rectangle of the white frame, and marking the external maximum rectangle as a region of interest; and positioning the position of the region of interest on the surface paper, setting a surface paper gap threshold value, comparing the positioned gap size with the threshold value, and judging the qualification of the surface paper. Through the method, the picture quality is optimized, the region of interest is more obvious, a traditional geometric scheme is adopted, a template matching scheme is not adopted, configuration is simple, the processing speed is high, and convenience is brought to subsequent processing work.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of cigarette pack production, and in particular relates to a facial paper positioning method and system. Background Art

[0002] Cigarette wrapper paper refers to the tobacco packaging material used in cigarette manufacturing. It is one of the outer packaging of cigarettes. Cigarette wrapper paper is mainly used to wrap tobacco leaves for cigarettes, protecting them, maintaining their humidity and preventing them from falling off. The selection and characteristics of cigarette wrapper paper have an important impact on the taste, combustion performance and appearance quality of cigarettes. The process of manufacturing cigarette wrapper paper also requires high precision to ensure the stability and consistency of the quality of cigarette wrapper paper.

[0003] At present, when processing cigarette pack face paper, most of the solutions adopted are template matching, which has complex configuration and slow template matching speed for the face paper, which is not conducive to subsequent processing and greatly reduces work efficiency. Summary of the invention

[0004] The purpose of the present invention is to provide a method for positioning a surface paper, aiming to solve the technical problems existing in the prior art identified in the background technology.

[0005] The present invention is achieved by a method for positioning facial paper, the method comprising: S10, detecting whether there is tissue paper through the PLC module, and when tissue paper is present, triggering the camera to take a photo, and transmitting the image obtained through the interface; S20, performing pre-processing on the received image, including adaptive binarization and morphological processing; S30, searching for a white frame in the image through an algorithm, and when there is interference on the boundary of the white frame, obtaining the coordinates of all points on the boundary of the white frame, and obtaining the maximum circumscribed rectangle of the white frame, and marking the maximum circumscribed rectangle as the region of interest; S40, locating the position of the interest area on the tissue paper, setting a tissue paper gap threshold, comparing the gap size obtained by locating with the threshold, and determining the eligibility of the tissue paper.

[0006] As a further solution of the present invention, the pre-processing of the received image specifically includes: S21, adaptively binarize the image to distinguish the paper from the background; S22, identifying interference points in the image and removing the interference points through morphological processing.

[0007] As a further solution of the present invention, the positioning of the interest area on the tissue paper specifically includes: S41, obtaining four corner points of the circumscribed maximum rectangle and sorting them to obtain four corner points Corner 1, Corner 2, Corner 3 and Corner 4; S42, obtaining four straight lines through the four corner points respectively, and obtaining the characteristic positioning points and directions of the paper using a boundary algorithm; Get the line A through angle 1 and angle 2, find the distance between all points in the circumscribed maximum rectangle and the line A, set the length threshold, select qualified points to form the point set APoints, and then get the precise line AA through the fitting line algorithm. The obtained line AA almost coincides with the line A, but with higher accuracy, which can reach the sub-pixel level; Similarly, find the lines BB, CC, and DD through angle 2 and angle 3, angle 3 and angle 4, and angle 4 and angle 1 respectively; The precise point 22 and the precise point 11 are obtained through the intersection of the straight lines AA and BB and the intersection of AA and DD. The midpoint and the heading are obtained by using the precise point 11 and the precise point 22, which are the characteristic positioning point and direction of the tissue paper. S43, finding three sets of extreme endpoints a1 and a2, b1 and b2, and d1 and d2, and respectively finding the distance between a2 and 22 and the distance between b1 and 22, and defining them as the first notch pixel distance of the tissue paper; Define a paper gap size threshold, such as 0.9, and compare the first gap pixel distance with the gap size threshold to determine the eligibility of the paper gap. If the ratio of the physical size of the paper gap to the pixel ratio is within the range of 0.9, the paper is considered to be preliminarily qualified. S44, for the sake of safety, calculate the distance between a1 and 11 and the distance between d2 and 11 respectively, and do a double verification, which is defined as the second gap pixel distance of the tissue paper, and compare the second gap pixel distance with the gap size threshold to determine the eligibility of the tissue paper gap. If both double verifications are passed, the tissue paper is considered qualified, and the data can be sent to the robot for subsequent material discharge operations.

[0008] Another object of the present invention is to provide a tissue paper positioning system, the system comprising: The tissue paper detection module is used to detect whether tissue paper exists through the PLC module. When tissue paper exists, the camera is triggered to take a photo, and the image obtained by the photo is transmitted through the interface; An image processing module, used for pre-processing the received image, including adaptive binarization and morphological processing; The region positioning module is used to search for white frames in the image through an algorithm. When there is interference on the boundary of the white frame, the coordinates of all points on the boundary of the white frame are obtained, and the maximum circumscribed rectangle of the white frame is obtained, and the maximum circumscribed rectangle is marked as the region of interest. The qualification judgment module is used to locate the position of the interest area on the face paper, set the face paper gap threshold, compare the gap size obtained by positioning with the threshold, and judge the qualification of the face paper.

[0009] As a further solution of the present invention, the image processing module specifically includes: A background distinguishing unit, used for adaptively binarizing the image to distinguish the paper from the background; The interference optimization unit is used to identify interference points in the image and remove them through morphological processing.

[0010] As a further solution of the present invention, the qualification determination module specifically includes: A corner point positioning unit is used to obtain the four corner points of the circumscribed maximum rectangle and sort them to obtain four corner points Corner 1, Corner 2, Corner 3 and Corner 4; The edge positioning unit is used to obtain four straight lines through four corner points respectively, and obtain the characteristic positioning points and directions of the surface paper by using the boundary algorithm; Obtain straight line A through angle 1 and angle 2, find the distance between all points in the circumscribed maximum rectangle and straight line A, set the length threshold, select qualified points to form a point set APoints, and then obtain the precise straight line AA through the straight line fitting algorithm; Similarly, find the lines BB, CC, and DD through angle 2 and angle 3, angle 3 and angle 4, and angle 4 and angle 1 respectively; The precise point 22 and the precise point 11 are obtained through the intersection of the straight lines AA and BB and the intersection of AA and DD. The midpoint and the heading are obtained by using the precise point 11 and the precise point 22, which are the characteristic positioning point and direction of the tissue paper. The gap determination unit is used to find three sets of extreme endpoints a1 and a2, b1 and b2, d1 and d2, and respectively find the distance between a2 and 22 and the distance between b1 and 22, and define them as the first gap pixel distance of the paper; A paper gap size threshold is defined, and the first gap pixel distance is compared with the gap size threshold to determine the eligibility of the paper gap.

[0011] As a further solution of the present invention, the qualification determination module further includes: The optimization judgment unit is used to respectively calculate the distance between a1 and 11 and the distance between d2 and 11, and define them as the second gap pixel distance of the tissue paper, and compare the second gap pixel distance with the gap size threshold to determine the eligibility of the tissue paper gap.

[0012] The beneficial effects of the present invention are: Through this method, the image quality is optimized, the region of interest is made more obvious, and the traditional geometric scheme is adopted instead of the template matching scheme. The configuration is simple and the processing speed is fast, which brings convenience to the subsequent processing work and improves the work efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 A flowchart of a method for positioning tissue paper provided by an embodiment of the present invention; Figure 2 A paper diagram of a paper positioning method provided by an embodiment of the present invention; Figure 3 This is an example diagram of paper surface positioning of the paper surface positioning method provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0014] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0015] It is understood that the terms "first", "second", etc. used in this application may be used herein to describe various elements, but unless otherwise specified, these elements are not limited by these terms. These terms are only used to distinguish a first element from another element. For example, without departing from the scope of this application, a first xx script may be referred to as a second xx script, and similarly, a second xx script may be referred to as a first xx script.

[0016] A method for positioning facial paper, the method comprising: S10, detecting whether there is tissue paper through the PLC module, and when tissue paper is present, triggering the camera to take a photo, and transmitting the image obtained through the interface; The software runs on an industrial computer, and the camera is connected to the industrial computer via a network cable. When the PLC module detects the presence of tissue paper, it triggers the camera to take a photo. After the camera takes a successful photo, it is transmitted to the visual positioning software through the interface.

[0017] S20, performing pre-processing on the received image, including adaptive binarization and morphological processing; Specific: S21, adaptively binarize the image to distinguish the facial paper from the background. Through this processing, a preliminary distinction can be made between the facial paper and the background.

[0018] S22, identifying interference points in the image and removing the interference points through morphological processing. In some cases, there are interference points on the belt, and morphological processing is required to further remove the interference points to obtain more accurate tissue data.

[0019] S30, searching for white boxes in the image through an algorithm. Sometimes, due to interference, it is necessary to find an area of ​​the box, perform screening, and then find the largest box. When there is interference on the boundary of the white box, obtain the coordinates of all points on the boundary of the white box, and obtain the maximum circumscribed rectangle of the white box. This rectangle can surround the entire tissue paper, and mark the maximum circumscribed rectangle as the region of interest. like Figure 2 and Figure 3 As shown, S40, the position of the interest area on the tissue paper is located, and a tissue paper gap threshold is set, and the gap size obtained by the location is compared with the threshold to determine the eligibility of the tissue paper.

[0020] Specific: S41, obtaining four corner points of the circumscribed maximum rectangle and sorting them to obtain four corner points Corner 1, Corner 2, Corner 3 and Corner 4; S42, obtaining four straight lines through the four corner points respectively, and obtaining the characteristic positioning points and directions of the paper using a boundary algorithm; Get the line A through angle 1 and angle 2, find the distance between all points in the circumscribed maximum rectangle and the line A, set the length threshold, select qualified points to form the point set APoints, and then get the precise line AA through the fitting line algorithm. The obtained line AA almost coincides with the line A, but with higher accuracy, which can reach the sub-pixel level; Similarly, find the lines BB, CC, and DD through angle 2 and angle 3, angle 3 and angle 4, and angle 4 and angle 1 respectively; The precise point 22 and the precise point 11 are obtained through the intersection of the straight lines AA and BB and the intersection of AA and DD. The midpoint and the heading are obtained by using the precise point 11 and the precise point 22, which are the characteristic positioning point and direction of the tissue paper. S43, finding three sets of extreme endpoints a1 and a2, b1 and b2, and d1 and d2, and respectively finding the distance between a2 and 22 and the distance between b1 and 22, and defining them as the first notch pixel distance of the tissue paper; Define a paper gap size threshold, such as 0.9, and compare the first gap pixel distance with the gap size threshold to determine the eligibility of the paper gap. If the ratio of the physical size of the paper gap to the pixel ratio is within the range of 0.9, the paper is considered to be preliminarily qualified. S44, for the sake of safety, calculate the distance between a1 and 11 and the distance between d2 and 11 respectively, and do a double verification, which is defined as the second gap pixel distance of the tissue paper, and compare the second gap pixel distance with the gap size threshold to determine the eligibility of the tissue paper gap. If both double verifications are passed, the tissue paper is considered qualified, and the data can be sent to the robot for subsequent material discharge operations.

[0021] A tissue paper positioning system, the system comprising: The tissue paper detection module is used to detect whether tissue paper exists through the PLC module. When tissue paper exists, the camera is triggered to take a photo, and the image obtained by the photo is transmitted through the interface; An image processing module, used for pre-processing the received image, including adaptive binarization and morphological processing; The region positioning module is used to search for white frames in the image through an algorithm. When there is interference on the boundary of the white frame, the coordinates of all points on the boundary of the white frame are obtained, and the maximum circumscribed rectangle of the white frame is obtained, and the maximum circumscribed rectangle is marked as the region of interest. The qualification judgment module is used to locate the position of the interest area on the face paper, set the face paper gap threshold, compare the gap size obtained by positioning with the threshold, and judge the qualification of the face paper.

[0022] In the embodiment of the present invention, the image processing module specifically includes: A background distinguishing unit, used for adaptively binarizing the image to distinguish the paper from the background; The interference optimization unit is used to identify interference points in the image and remove them through morphological processing.

[0023] In the embodiment of the present invention, the qualification determination module specifically includes: A corner point positioning unit is used to obtain the four corner points of the circumscribed maximum rectangle and sort them to obtain four corner points Corner 1, Corner 2, Corner 3 and Corner 4; The edge positioning unit is used to obtain four straight lines through four corner points respectively, and obtain the characteristic positioning points and directions of the surface paper by using the boundary algorithm; Obtain straight line A through angle 1 and angle 2, find the distance between all points in the circumscribed maximum rectangle and straight line A, set the length threshold, select qualified points to form a point set APoints, and then obtain the precise straight line AA through the straight line fitting algorithm; Similarly, find the lines BB, CC, and DD through angle 2 and angle 3, angle 3 and angle 4, and angle 4 and angle 1 respectively; The precise point 22 and the precise point 11 are obtained through the intersection of the straight lines AA and BB and the intersection of AA and DD. The midpoint and the heading are obtained by using the precise point 11 and the precise point 22, which are the characteristic positioning point and direction of the tissue paper. The gap determination unit is used to find three sets of extreme endpoints a1 and a2, b1 and b2, d1 and d2, and respectively find the distance between a2 and 22 and the distance between b1 and 22, and define them as the first gap pixel distance of the paper; A paper gap size threshold is defined, and the first gap pixel distance is compared with the gap size threshold to determine the eligibility of the paper gap.

[0024] In the embodiment of the present invention, the qualification determination module further includes: The optimization judgment unit is used to respectively calculate the distance between a1 and 11 and the distance between d2 and 11, and define them as the second gap pixel distance of the tissue paper, and compare the second gap pixel distance with the gap size threshold to determine the eligibility of the tissue paper gap.

[0025] It should be understood that, although each step in the flow chart of each embodiment of the present invention is shown in sequence according to the indication of the arrow, these steps are not necessarily performed in sequence according to the order indicated by the arrow. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be performed in other orders. Moreover, at least a portion of the steps in each embodiment may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these sub-steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of other steps or sub-steps or stages of other steps.

[0026] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0027] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0028] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.

[0029] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for positioning facial paper, characterized in that: The method comprises: S10, detecting whether there is tissue paper through the PLC module, and when tissue paper is present, triggering the camera to take a photo, and transmitting the image obtained through the interface; S20, performing pre-processing on the received image, including adaptive binarization and morphological processing; S30, searching for a white frame in the image through an algorithm, and when there is interference on the boundary of the white frame, obtaining the coordinates of all points on the boundary of the white frame, and obtaining the maximum circumscribed rectangle of the white frame, and marking the maximum circumscribed rectangle as the region of interest; S40, locating the position of the interest area on the tissue paper, setting a tissue paper gap threshold, comparing the gap size obtained by locating with the threshold, and determining the eligibility of the tissue paper.

2. The method according to claim 1, characterized in that The pre-processing of the received image specifically includes: S21, adaptively binarize the image to distinguish the paper from the background; S22, identifying interference points in the image and removing the interference points through morphological processing.

3. The method according to claim 1, characterized in that The positioning of the interest area on the tissue paper specifically includes: S41, obtaining four corner points of the circumscribed maximum rectangle and sorting them to obtain four corner points Corner 1, Corner 2, Corner 3 and Corner 4; S42, obtaining four straight lines through the four corner points respectively, and obtaining the characteristic positioning points and directions of the paper using a boundary algorithm; Obtain straight line A through angle 1 and angle 2, find the distance between all points in the circumscribed maximum rectangle and straight line A, set the length threshold, select qualified points to form a point set APoints, and then obtain the precise straight line AA through the straight line fitting algorithm; Similarly, find the lines BB, CC, and DD through angle 2 and angle 3, angle 3 and angle 4, and angle 4 and angle 1 respectively; The precise point 22 and the precise point 11 are obtained through the intersection of the straight lines AA and BB and the intersection of AA and DD. The midpoint and the heading are obtained by using the precise point 11 and the precise point 22, which are the characteristic positioning point and direction of the tissue paper. S43, finding three sets of extreme endpoints a1 and a2, b1 and b2, and d1 and d2, and respectively finding the distance between a2 and 22 and the distance between b1 and 22, and defining them as the first notch pixel distance of the tissue paper; A paper gap size threshold is defined, and the first gap pixel distance is compared with the gap size threshold to determine the eligibility of the paper gap.

4. The method according to claim 3, characterized in that Locating the position of the region of interest on the tissue paper also includes: S44, respectively calculating the distance between a1 and 11 and the distance between d2 and 11, and defining them as the second gap pixel distance of the tissue paper, and comparing the second gap pixel distance with the gap size threshold to determine the eligibility of the tissue paper gap.

5. A tissue paper positioning system, characterized in that: The system comprises: The tissue paper detection module is used to detect whether tissue paper exists through the PLC module. When tissue paper exists, the camera is triggered to take a photo, and the image obtained by the photo is transmitted through the interface; An image processing module, used for pre-processing the received image, including adaptive binarization and morphological processing; The region positioning module is used to search for white frames in the image through an algorithm. When there is interference on the boundary of the white frame, the coordinates of all points on the boundary of the white frame are obtained, and the maximum circumscribed rectangle of the white frame is obtained, and the maximum circumscribed rectangle is marked as the region of interest. The qualification judgment module is used to locate the position of the interest area on the face paper, set the face paper gap threshold, compare the gap size obtained by positioning with the threshold, and judge the qualification of the face paper.

6. The system according to claim 5, characterized in that The image processing module specifically includes: A background distinguishing unit, used for adaptively binarizing the image to distinguish the paper from the background; The interference optimization unit is used to identify interference points in the image and remove them through morphological processing.

7. The system according to claim 5, characterized in that The qualification determination module specifically includes: A corner point positioning unit is used to obtain the four corner points of the circumscribed maximum rectangle and sort them to obtain four corner points Corner 1, Corner 2, Corner 3 and Corner 4; The edge positioning unit is used to obtain four straight lines through four corner points respectively, and obtain the characteristic positioning points and directions of the surface paper by using the boundary algorithm; Obtain straight line A through angle 1 and angle 2, find the distance between all points in the circumscribed maximum rectangle and straight line A, set the length threshold, select qualified points to form a point set APoints, and then obtain the precise straight line AA through the straight line fitting algorithm; Similarly, find the lines BB, CC, and DD through angle 2 and angle 3, angle 3 and angle 4, and angle 4 and angle 1 respectively; The precise point 22 and the precise point 11 are obtained through the intersection of the straight lines AA and BB and the intersection of AA and DD. The midpoint and the heading are obtained by using the precise point 11 and the precise point 22, which are the characteristic positioning point and direction of the tissue paper. The gap determination unit is used to find three sets of extreme endpoints a1 and a2, b1 and b2, d1 and d2, and respectively find the distance between a2 and 22 and the distance between b1 and 22, and define them as the first gap pixel distance of the paper; A paper gap size threshold is defined, and the first gap pixel distance is compared with the gap size threshold to determine the eligibility of the paper gap.

8. The system according to claim 7, characterized in that The qualification determination module also includes: The optimization judgment unit is used to respectively calculate the distance between a1 and 11 and the distance between d2 and 11, and define them as the second gap pixel distance of the tissue paper, and compare the second gap pixel distance with the gap size threshold to determine the eligibility of the tissue paper gap.