Bundling correction method, device and equipment of smoke stack and storage medium
By encoding the tobacco boxes and using image recognition technology, the shape of the tobacco stacks is automatically corrected, solving the problem of low efficiency in manual adjustment in existing technologies and achieving efficient stack shape correction.
Patent Information
- Application Number
- CN202210401372.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-18
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2042-04-18
AI Technical Summary
In existing technologies, multiple manual adjustments are required during the stacking of tobacco stacks, resulting in a waste of manpower and time. Furthermore, the adjustment parameters rely on experience, leading to low efficiency.
By encoding the cigarette boxes, a robotic arm is used to collect top-view images to identify the overall outer contour and the outer contour of individual cigarette boxes. Combined with the IOU Loss algorithm and operators such as edges_sub_pix, the position of the cigarette boxes is corrected step by step to achieve the standard stack shape.
It achieves automated stacking shape correction, avoids error accumulation, reduces manual intervention and time consumption, and improves stacking efficiency.
Smart Images

Figure CN115424148B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of tobacco transportation packaging, in particular to a method and device for correcting the shape of a tobacco stack, an equipment and a storage medium. BACKGROUND
[0002] Stacking before transportation is the initial link of finished product tobacco transportation, and the neatness of the stack and the tightness of the tobacco boxes will affect the damage of the tobacco boxes during transportation.
[0003] In related technologies, the stacking of the tobacco boxes is usually performed by first using a mechanical hand to stack, and then manually adjusting. The process of manual adjustment is as follows: four people are stationed at the four corners of the stack to observe the stacking condition, when the stack is not tight, the adjustment parameters are estimated and input into the system. The disadvantage of this method is that the adjustment parameters are estimated values, and it takes at least three stacking processes to complete an adjustment process, the first stacking process is to observe the position and adjust the parameters, the second stacking process is to observe the effect and optimize the adjustment parameters after adjusting the parameters, and the third stacking process is to verify the effect, which wastes a lot of manpower and time. SUMMARY
[0004] To solve or partially solve the problems in related technologies, the present application provides a method and device for correcting the shape of a tobacco stack, an equipment and a storage medium.
[0005] The present application provides a method for correcting the shape of a tobacco stack, which comprises the following steps:
[0006] S01), encoding each tobacco box constituting the tobacco stack, and constructing a predetermined position set of the stack corresponding to different encodings;
[0007] S02), a mechanical hand stacks the tobacco boxes according to the predetermined position set, and respectively collects the overhead images of each layer of the stack during the stacking process;
[0008] S03), overall outer contour recognition and single tobacco box outer contour recognition are performed according to the overhead images;
[0009] S04), comparing the recognized overall outer contour with a reference overall outer contour to determine whether the single-side distance between the overall outer contour and the reference overall outer contour exceeds a first preset threshold value, if yes, determining that the side is an abnormally large side; and correcting the predetermined position set by correcting the predetermined positions of each tobacco box corresponding to the encoding of the abnormally large side by a first preset distance towards the center of the stack along a direction perpendicular to the abnormally large side;
[0010] The identified single bale box outer contour is positionally compared with the reference single bale box outer contour, and it is judged whether the single bale box outer contour and the reference overall outer contour have a single-side spacing exceeding a second preset threshold value, and if so, the side is judged to be an abnormally small side; the predetermined positions of the codes corresponding to each bale box involved in the abnormally small side are corrected by a second preset distance along a direction perpendicular to the abnormally small side towards a reference position;
[0011] S05), repeating steps S02 to S04 according to the corrected predetermined position set; until the single-side spacing of the overall outer contour and the reference overall outer contour does not exceed the first preset threshold value, and the single-side spacing of the single bale box outer contour and the reference overall outer contour does not exceed the second preset threshold value, the pile shape correction is completed.
[0012] Further, the step S03 is specifically:
[0013] The overall contour and single bale box contour of each layer of bale boxes are identified by using the cv2.findcontours contour recognition algorithm on the top view image, and then the IOU Loss algorithm is used to correct the contour positions, and the overall outer contour and single bale box outer contour of each layer of bale boxes are identified.
[0014] Further, the step S04 is specifically:
[0015] The overall outer contour and single bale box outer contour images of each layer identified in step S03 are algorithmically curved, and the operator edges_sub_pix is used to extract the sub-pixel edges of the corresponding overall outer contour and single bale box outer contour;
[0016] The midpoint of each side of the overall outer contour sub-pixel edge is taken as a single-side position representative point, the operator distance_contours_xld is used to calculate the distance between the single-side position representative point of the overall outer contour of the same layer and the reference overall outer contour, and the distance is taken as the single-side spacing; it is judged whether the single-side spacing exceeds the first preset threshold value, and if so, the side is judged to be an abnormally large side; the predetermined positions of the codes corresponding to each bale box involved in the abnormally large side are corrected by a first preset distance along a direction perpendicular to the abnormally large side towards the center of the bale pile;
[0017] The midpoint of each edge of the sub-pixel edge of the single baffle box outer contour is taken as a single edge position representative point, the distance between the single edge position representative point of the single baffle box outer contour of the same layer and the reference single baffle box outer contour is calculated by using the operator create_distance_transform_xld and pply_distance_transform_xld, and the distance is taken as a single edge spacing; whether the single edge spacing exceeds a second preset threshold value is judged, if yes, the edge is judged as an abnormal small edge; the predetermined position of the encoding corresponding to each baffle box involved in the abnormal small edge is adjusted by a second preset distance along a direction perpendicular to the abnormal small edge towards the reference position.
[0018] Further, the reference overall outer contour and the reference single baffle box outer contour are obtained by the following method:
[0019] The standard top view of each layer of baffle boxes in a standard stack shape is collected, and the image collection position is the same as that in step S02;
[0020] After the overall contour and the single baffle box contour of each layer of baffle boxes in a standard stack shape are recognized by using the cv2.findcontours contour recognition algorithm, the contour positions are corrected by using the IOU Loss algorithm, and the reference overall outer contour and the reference single baffle box outer contour of each layer of baffle boxes are recognized.
[0021] The reference overall outer contour and the reference single baffle box outer contour of each layer are subjected to algorithm bending, and the sub-pixel edges of the corresponding overall outer contour and single baffle box outer contour are extracted by using the operator edges_sub_pix.
[0022] Further, the method further comprises:
[0023] S06), the number of position correction times of each numbered baffle box is recorded, and when the number of position correction times in a unit time exceeds a preset value, an equipment abnormality warning is sent.
[0024] Further, the size of the baffle box is 452mm*254mm*570mm, and the stacking mode is that 10 baffle boxes are stacked in each layer, and three layers form a stack.
[0025] Further, the first preset threshold value is 10mm, and the first preset distance is 5mm; the second threshold value is 10mm, and the second preset distance is 5mm.
[0026] In another aspect of the present application, a stack shape correction device for a baffle stack is also provided, which comprises:
[0027] A predetermined position construction unit is configured to encode each baffle box constituting the baffle stack, and construct a predetermined position set of the baffle stack corresponding to different encodings.
[0028] A stacking monitoring unit is configured to control the manipulator to stack the tobacco cases according to the set of predetermined positions and collect a top view image of each layer of the stack during the stacking process.
[0029] A contour recognition unit is configured to perform overall contour recognition and single tobacco case contour recognition according to the top view image.
[0030] A predetermined position correction unit is configured to compare the recognized overall contour with a reference overall contour, determine whether the single-side distance between the overall contour and the reference overall contour exceeds a first preset threshold, and if so, determine that the side is an abnormally large side; correct the set of predetermined positions by correcting the encoded predetermined positions of each tobacco case involved in the abnormally large side by a first preset distance towards the center of the stack along a direction perpendicular to the abnormally large side.
[0031] A predetermined position correction unit is configured to compare the recognized overall contour with a reference overall contour, determine whether the single-side distance between the overall contour and the reference overall contour exceeds a first preset threshold, and if so, determine that the side is an abnormally large side; correct the set of predetermined positions by correcting the encoded predetermined positions of each tobacco case involved in the abnormally large side by a first preset distance towards the center of the stack along a direction perpendicular to the abnormally large side.
[0032] A correction completion unit is configured to determine that the stack shape correction is completed when the single-side distance between the overall contour and the reference overall contour does not exceed the first preset threshold, and the single-side distance between the single tobacco case contour and the reference overall contour does not exceed the second preset threshold.
[0033] In another aspect of the present application, a stack shape correction device for a tobacco stack is provided, which includes:
[0034] A memory is configured to store a computer program.
[0035] A processor is configured to call and execute the computer program to implement the steps of the stack shape correction method of any one of the above.
[0036] In another aspect of the present application, a computer readable storage medium is provided, which includes a software program adapted to be executed by a processor to implement the steps of the stack shape correction method of any one of the above.
[0037] Compared with the prior art, the stack shape correction method, device, equipment and storage medium provided by the present application can have the following beneficial effects:
[0038] Through image acquisition, contour recognition and contour comparison, the position of the tobacco box is self-corrected step by step, and finally the stack shape is arranged to a standard state, thereby effectively avoiding accumulation of errors. Moreover, the degree of human participation is low, and the technical experience dependence of manual correction is avoided, and the time-consuming is long.
[0039] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. BRIEF DESCRIPTION OF DRAWINGS
[0040] The above and other objects, features and advantages of the present application will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings in which like reference characters refer to like parts throughout the several views, and wherein:
[0041] Figure 1 is a stack shape correction method step schematic diagram of a tobacco stack shown by an embodiment of the present application;
[0042] Figure 2 is a stack shape correction device structure schematic diagram of a tobacco stack shown by an embodiment of the present application;
[0043] Figure 3 is a stack shape correction device structure schematic diagram of a tobacco stack shown by an embodiment of the present application. DETAILED DESCRIPTION
[0044] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of protection of the present application.
[0045] The terms used in the present application are only for the purpose of describing specific embodiments, and are not intended to limit the present application. The singular forms "a", "said" and "the" used in the present application and the appended claims are also intended to include the plural forms, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein means and includes any or all possible combinations of one or more associated listed items.
[0046] It should be understood that although the terms "first", "second", "third", etc. are used to describe various information in the present application, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, the first information can also be called the second information, and similarly, the second information can also be called the first information without departing from the scope of the present application. Therefore, the features defined as "first", "second" can explicitly or implicitly include one or more of the features. In the description of the present application, the meaning of "a plurality of" is two or more, unless otherwise specifically limited.
[0047] The present application provides a method for correcting the shape of a tobacco stack, which can realize self-correction of the shape of the tobacco stack, gradually arrange the shape of the stack to a standard state, and solve the problems of high dependence on technical experience and long time consumption in manual correction. Figure 1 The method for correcting the shape of a tobacco stack provided by the embodiments of the present application comprises the following steps:
[0048] S01), encoding each tobacco box constituting a tobacco stack, and constructing a predetermined position set of a code stack corresponding to different encodings;
[0049] S02), a manipulator codes the tobacco boxes according to the predetermined position set, and respectively collects the overhead images of each layer of tobacco boxes in the stack during the coding process;
[0050] S03), overall outer contour recognition and single tobacco box outer contour recognition are performed according to the overhead images;
[0051] S04), the recognized overall outer contour is compared with a reference overall outer contour, whether the single-side distance between the overall outer contour and the reference overall outer contour exceeds a first preset threshold value is judged, if yes, the side is judged as an abnormally large side; the predetermined positions of the encodings of each tobacco box involved in the abnormally large side are corrected by a first preset distance towards the center of the stack along a direction perpendicular to the abnormally large side to correct the predetermined position set;
[0052] The recognized single tobacco box outer contour is compared with a reference single tobacco box outer contour in position, whether the single-side distance between the single tobacco box outer contour and the reference overall outer contour exceeds a second preset threshold value is judged, if yes, the side is judged as an abnormally small side; the predetermined positions of the encodings of each tobacco box involved in the abnormally small side are corrected by a second preset distance towards the reference position along a direction perpendicular to the abnormally small side to correct the predetermined position set;
[0053] S05), repeating steps S02 to S04 according to the modified predetermined position set; until the single-side interval between the overall outer contour and the reference overall outer contour is not more than the first preset threshold value, and the single-side interval between the single cigarette case outer contour and the reference overall outer contour is not more than the second preset threshold value, the pile shape correction is completed.
[0054] In the above pile shape correction method, step S01 is to encode each cigarette case constituting the cigarette pile in advance, and to construct a predetermined position set corresponding to the coded pile. The purpose of this step is to facilitate the subsequent repetitive stacking operation, and to provide original position information for subsequent position correction. For example, taking the commonly used stacking method as an example, there are 10 cigarette cases per layer, and three layers form a pile, i.e. a total of 30 cigarette cases per pile, then the 30 cigarette cases to be stacked are sequentially encoded, such as encoding: 01, 02, 03…30. At the same time, a predetermined position set corresponding to different encodings is constructed. In the embodiment of the present application, the composition of the predetermined position set can be as shown in Table 1:
[0055] Table 1: Data of predetermined position set
[0056] Encoding predetermined position 01 coordinates (X1, Y1, Z1) 02 coordinates (X2, Y2, Z2) 03 coordinates (X3, Y3, Z3) …… …… N Coordinates (X n , Y n , Z n )]]>
[0057] The set of encodings and their corresponding positions obtained in step S01 is used to send to the manipulator, and then step S02 is performed, the manipulator stacks the coded cigarette cases according to the above-mentioned predetermined position set, and collects the overhead image of each layer of the pile during the stacking process. Specifically, the overhead image collecting device can use an image capture device, such as Hikvision DS-2CD1221D-I3(F), which is set above the cigarette pile and fixed in position to ensure that each image collection is in the same position. Preferably, the image capture device can be associated with the working program of the manipulator to trigger the image capture device to take pictures after each layer of the cigarette case on the tray is placed. Those skilled in the art can understand that the original images of the reference overall outer contour and the reference single cigarette case outer contour used in the subsequent operation are also obtained in the same way, i.e. using the same image capture device to collect images of each layer of the standard cigarette pile at the same position. This ensures the accuracy of the subsequent position comparison. In this scheme, the size of the cigarette case is preferably 452mm x 254mm x 570mm; the stacking method is: 10 cigarette cases per layer, and three layers form a pile.
[0058] For the top view image obtained through step S02, contour recognition needs to be performed through step S03. The contour recognition of this step includes overall outer contour recognition and single tobacco box outer contour recognition. The overall outer contour recognition is performed to evaluate the overall outer contour of the tobacco box of the layer, so as to avoid the tobacco box collapse caused by the too large outer contour. The single tobacco box contour recognition is performed to evaluate the position of each tobacco box, so as to improve the accuracy of the placement position. Further, this step specifically can be:
[0059] After the overall contour and single tobacco box contour of the top view image of each layer of tobacco box are recognized by using the cv2.findcontours contour recognition algorithm, the contour position is corrected by using the IOU Loss algorithm, and the overall outer contour and single tobacco box outer contour of each layer of tobacco box are recognized. The cv2.findcontours and IOU Loss algorithm are used to correct the contour position in the present application, so as to realize the accurate contour recognition and contour correction.
[0060] After the contour recognition is performed through step S03, the contour position comparison can be performed, and then it is judged whether the predetermined position corresponding to each code needs to be adjusted. This step includes two position comparisons, which are the position comparison of the overall outer contour and the position comparison of the single tobacco box outer contour. For the position comparison of the overall outer contour, the recognized overall outer contour is compared with the reference overall outer contour, and it is judged whether the single side distance between the overall outer contour and the reference overall outer contour exceeds the first preset threshold. If yes, the side is judged to be an abnormally large side. The predetermined positions of the codes of the tobacco boxes related to the abnormally large side are corrected by a first preset distance along the direction perpendicular to the abnormally large side towards the center of the tobacco stack, so as to correct the set of predetermined positions. When the single side distance between a side of the overall outer contour and the reference overall outer contour exceeds the first preset threshold, it indicates that the outer contour of the tobacco box of the layer is too large, and after the error is accumulated for many times, the tobacco box collapse may occur. The side is judged to be an abnormally large side, and the codes of the tobacco boxes located on the abnormally large side need to be corrected by a first preset distance in the direction perpendicular to the center of the tobacco stack. In the next time of mechanical stacking, the tobacco boxes with the codes are placed by using the corrected predetermined positions. The first preset distance is preferably one third to one half of the first preset threshold, so as to ensure the correction efficiency and avoid the tobacco box extrusion, and is most preferably one half. The first preset threshold is preferably 10 mm, and the first preset distance is 5 mm.
[0061] Similarly, for the position comparison of the overall outer contour, the identified overall outer contour is compared with the reference overall outer contour to determine whether the single-side distance between the overall outer contour and the reference overall outer contour exceeds a first preset threshold value, and if so, the side is determined to be an abnormally large side; the predetermined positions of the codes corresponding to the bales involved in the abnormally large side are corrected by a first preset distance along a direction perpendicular to the abnormally large side and towards the center of the stack, to correct the set of predetermined positions; and the bales with the codes are placed using the corrected predetermined positions during the next time of mechanical stacking. The second preset distance is preferably one third to one half of the second preset threshold value, to ensure correction efficiency while avoiding bale extrusion, and is most preferably one half. The second threshold value is preferably 10 mm, and the second preset distance is 5 mm.
[0062] For the specific contour position comparison method in this step, the application preferably uses the following method:
[0063] The algorithm is curved for the overall outer contour and the single-bale outer contour images of each layer identified in step S03, and the operator edges_sub_pix is used to extract the sub-pixel edges of the overall outer contour and the single-bale outer contour, respectively.
[0064] The midpoint of each side of the overall outer contour sub-pixel edges is taken as a single-side position representative point, the distance between the single-side position representative point of the overall outer contour of the same layer and the reference overall outer contour is calculated using the operator distance_contours_xld, and the distance is taken as the single-side distance; it is determined whether the single-side distance exceeds a first preset threshold value, and if so, the side is determined to be an abnormally large side; and the predetermined positions of the codes corresponding to the bales involved in the abnormally large side are corrected by a first preset distance along a direction perpendicular to the abnormally large side and towards the center of the stack.
[0065] The midpoint of each side of the single-bale outer contour sub-pixel edges is taken as a single-side position representative point, the distance between the single-side position representative point of the single-bale outer contour of the same layer and the reference single-bale outer contour is calculated using the operators create_distance_transform_xld and pply_distance_transform_xld, and the distance is taken as the single-side distance; it is determined whether the single-side distance exceeds a second preset threshold value, and if so, the side is determined to be an abnormally small side; and the predetermined positions of the codes corresponding to the bales involved in the abnormally small side are adjusted by a second preset distance along a direction perpendicular to the abnormally small side and towards the reference position.
[0066] In the method, the operator edges_sub_pix is used to extract the sub-pixel edge first, and then the midpoint of each side of the sub-pixel edge is taken as a reference point (i.e. the single-side position representative point), and the distance between the reference point and the reference contour is calculated to obtain the corresponding single-side interval. For the calculation method of the distance between the reference point and the reference contour, the distance calculation of the overall outer contour is performed by using the operator distance_contours_xld, and the distance calculation of the single-bundle box outer contour is performed by using the operators create_distance_transform_xld and pply_distance_transform_xld, because the contrast of the contour of the single-bundle box is large, and therefore the operators create_distance_transform_xld and pply_distance_transform_xld are used to shorten the calculation time.
[0067] The reference overall outer contour and the reference single-bundle box outer contour involved in the step can be obtained in the same way as the overall outer contour and the single-bundle box outer contour described above, and specifically can be as follows:
[0068] A standard top view of each layer of the standard bundle shape of the tobacco box is collected, and the image collection position is the same as that in step S02;
[0069] After the overall contour and the single-bundle box contour of the standard top view of each layer of the standard bundle shape of the tobacco box are recognized by using the cv2.findcontours contour recognition algorithm, the contour positions are corrected by using the IOU Loss algorithm, and the reference overall outer contour and the reference single-bundle box outer contour of each layer of the tobacco box are recognized.
[0070] The reference overall outer contour and the reference single-bundle box outer contour of each layer are subjected to algorithm bending, and the operators edges_sub_pix are used to extract the sub-pixel edges of the overall outer contour and the single-bundle box outer contour, respectively.
[0071] In addition, the bundle shape correction method also preferably includes the following steps:
[0072] S06), the number of position correction times of each numbered tobacco box is recorded, and when the number of position correction times in a unit time exceeds a preset value, an equipment abnormality warning is sent. Through the step, the state diagnosis of the robot abnormality can be realized, and once the robot abnormality is diagnosed, the technical personnel can be notified in time for repair by sending a warning. For example, when the parameter correction deviation occurs more than 3 times in a single month during the stacking of the same model tobacco box, the system automatically prompts the equipment abnormality, and the related technical personnel is prompted by a short message.
[0073] As can be seen from the above, the bundle shape correction method provided by the embodiment of the application has the following advantages:
[0074] Through image acquisition, contour identification and contour comparison, the position of the tobacco case is self-corrected step by step, and finally the stack shape is arranged to a standard state, thereby effectively avoiding accumulation of errors. Moreover, the artificial participation degree is low, and the technical experience dependence degree of manual correction is avoided, and the time-consuming is long.
[0075] Corresponding to the method embodiment, in another aspect of the embodiment of the present application, a stack shape correction device of a tobacco stack is also provided, Figure 2 The structure diagram of the stack shape correction device of the tobacco stack provided by the embodiment of the present application is shown, and the stack shape correction device of the tobacco stack is Figure 1 The device corresponding to the stack shape correction method of the tobacco stack in the corresponding embodiment, that is, the virtual device is realized Figure 1 The stack shape correction method of the tobacco stack in the corresponding embodiment, each virtual module of the stack shape correction device of the tobacco stack can be executed by an electronic device, such as a network device, a terminal device, or a server. Specifically, the stack shape correction device of the tobacco stack in the embodiment of the present application includes:
[0076] A predetermined position construction unit 01 is configured to encode each tobacco case constituting a tobacco stack, and construct a predetermined position set of a code stack corresponding to different encodings;
[0077] A code stack monitoring unit 02 is configured to control a manipulator to stack the tobacco cases according to the predetermined position set, and acquire an overhead image of each layer of the tobacco cases in the stack during the stacking process;
[0078] A contour identification unit is configured to perform overall contour identification and single tobacco case contour identification according to the overhead image;
[0079] A predetermined position correction unit 03 is configured to compare the identified overall contour with a reference overall contour, determine whether the single-side distance between the overall contour and the reference overall contour exceeds a first preset threshold, if yes, determine that the side is an abnormally large side, and correct the predetermined position set by correcting the predetermined positions corresponding to the encodings of the tobacco cases involved in the abnormally large side by a first preset distance towards the center of the tobacco stack along a direction perpendicular to the abnormally large side;
[0080] And compare the identified single tobacco case contour with a reference single tobacco case contour, determine whether the single-side distance between the single tobacco case contour and the reference overall contour exceeds a second preset threshold, if yes, determine that the side is an abnormally small side, and correct the predetermined position set by correcting the predetermined positions corresponding to the encodings of the tobacco cases involved in the abnormally small side by a second preset distance towards the reference position along a direction perpendicular to the abnormally small side;
[0081] The correction completion unit 04 is configured to determine that the stack shape correction is completed when the single-side distance between the overall outer contour and the reference overall outer contour is less than a first preset threshold, and the single-side distance between the single tobacco box outer contour and the reference overall outer contour is less than a second preset threshold.
[0082] It should be noted that the specific implementation manner and technical effects of the stack shape correction device in the embodiments of the present application can refer to the corresponding stack shape correction method of the tobacco stack Figure 1 The corresponding stack shape correction method of the tobacco stack will not be described here.
[0083] Corresponding to the method embodiments, the embodiments of the present application also provide a stack shape correction device of a tobacco stack, such as a terminal, a server, etc. The server can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud service, cloud database, cloud computing, cloud function, cloud storage, network service, cloud communication, middleware service, domain name service, security service, CDN, and big data and artificial intelligence platform. The terminal can be a smart phone, a tablet computer, a notebook computer, a desktop computer, etc., but is not limited thereto.
[0084] An example diagram of a hardware structure block diagram of the stack shape correction device of the tobacco stack provided by the embodiments of the present application is shown in FIG. 1, which can include: Figure 3
[0085] a processor 1, a communication interface 2, a memory 3, and a communication bus 4;
[0086] The processor 1, the communication interface 2, and the memory 3 can communicate with each other through the communication bus 4;
[0087] Optionally, the communication interface 2 can be an interface of a communication module, such as an interface of a GSM module.
[0088] The processor 1 can be a central processing unit CPU, or a specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present application.
[0089] The memory 3 can include a high-speed RAM memory, and can also include a non-volatile memory, such as at least one disk memory.
[0090] The processor 1 is specifically configured to execute a computer program stored in the memory 3 to perform the following steps:
[0091] S01), encode each tobacco box constituting the tobacco stack, and construct a predetermined position set of the stack corresponding to different encodings;
[0092] S02), the manipulator stacks the tobacco boxes according to the predetermined position set, and respectively collects the overhead images of each layer of the stack during the stacking process;
[0093] S03), overall outer contour recognition and single tobacco box outer contour recognition are performed according to the overhead images;
[0094] S04), the identified overall outer contour is compared with the reference overall outer contour, whether the single side distance between the overall outer contour and the reference overall outer contour exceeds the first preset threshold value is judged, if yes, the side is judged as an abnormally large side; the predetermined position set is corrected by correcting the predetermined positions of each tobacco box corresponding to the encoding towards the center of the stack along the direction perpendicular to the abnormally large side by a first preset distance;
[0095] The identified single tobacco box outer contour is compared with the reference single tobacco box outer contour, whether the single side distance between the single tobacco box outer contour and the reference overall outer contour exceeds the second preset threshold value is judged, if yes, the side is judged as an abnormally small side; the predetermined position set is corrected by correcting the predetermined positions of each tobacco box corresponding to the encoding towards the reference position along the direction perpendicular to the abnormally small side by a second preset distance;
[0096] S05), steps S02 to S04 are repeated according to the corrected predetermined position set; when the single side distance between the overall outer contour and the reference overall outer contour does not exceed the first preset threshold value, and the single side distance between the single tobacco box outer contour and the reference overall outer contour does not exceed the second preset threshold value, the stack shape correction is completed.
[0097] In the embodiment of the application, a computer readable storage medium is also provided, which can store a program suitable for processor execution, and the program is used for:
[0098] S01), encode each tobacco box constituting the tobacco stack, and construct a predetermined position set of the stack corresponding to different encodings;
[0099] S02), the manipulator stacks the tobacco boxes according to the predetermined position set, and respectively collects the overhead images of each layer of the stack during the stacking process;
[0100] S03), overall outer contour recognition and single tobacco box outer contour recognition are performed according to the overhead images;
[0101] S04), comparing the recognized overall outer contour with the reference overall outer contour, judging whether the single-side distance between the overall outer contour and the reference overall outer contour exceeds a first preset threshold, and if yes, judging that the side is an abnormally large side; and correcting the predetermined position set by correcting the predetermined positions corresponding to each tobacco box involved in the abnormally large side by a first preset distance along a direction perpendicular to the abnormally large side and towards the center of the tobacco stack;
[0102] S04), comparing the recognized overall outer contour with the reference overall outer contour, judging whether the single-side distance between the overall outer contour and the reference overall outer contour exceeds a first preset threshold, and if yes, judging that the side is an abnormally large side; and correcting the predetermined position set by correcting the predetermined positions corresponding to each tobacco box involved in the abnormally large side by a first preset distance along a direction perpendicular to the abnormally large side and towards the center of the tobacco stack;
[0103] S05), repeating steps S02 to S04 according to the corrected predetermined position set; and completing the stack shape correction when the single-side distance between the overall outer contour and the reference overall outer contour does not exceed the first preset threshold, and the single-side distance between the single-tobacco-box outer contour and the reference overall outer contour does not exceed the second preset threshold.
[0104] Optionally, the refinement function and the extension function of the program can refer to the description above.
[0105] The product described above can execute the method provided by the embodiments of the present application, and has the corresponding function modules and beneficial effects of the execution method. Technical details not described in detail in the embodiments can refer to the method provided by other embodiments of the present application.
[0106] The product described above can execute the method provided by the embodiments of the present application, and has the corresponding function modules and beneficial effects of the execution method. Technical details not described in detail in the embodiments can refer to the method provided by the embodiments of the present application.
[0107] Those skilled in the art can appreciate that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be realized by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solutions. Those skilled in the art can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0108] In several embodiments provided in the present application, it should be understood that the disclosed system, device and method can be implemented by other means. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0109] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e. they can be located in one place or distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
[0110] In addition, the functional units in each embodiment of the present application can be integrated into one processing unit, or each unit can exist physically, or two or more units can be integrated into one unit.
[0111] It should be understood that the features in the embodiments of the present application can be combined with each other to achieve the purpose of solving the above technical problems.
[0112] If the functions are realized in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application or the part of the technical solutions that essentially contribute to the prior art can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for making a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.
[0113] The above description of the disclosed embodiments enables a person skilled in the art to implement or use the present application. Various modifications to the embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method of correcting the shape of a stack of cigarettes, characterized in that, The method comprises the following steps: S01), encoding each tobacco box constituting a tobacco stack, and constructing a predetermined position set corresponding to a code stack of different codes; S02), a manipulator stacks the tobacco boxes according to the predetermined position set, and collects a top view image of each layer of the stack during the stacking process; S03), overall contour recognition and single tobacco box contour recognition are performed according to the top view image; S04), the recognized overall contour is compared with a reference overall contour, and it is judged whether the single-side distance between the overall contour and the reference overall contour exceeds a first preset threshold value, if yes, it is judged that the side is an abnormally large side; the predetermined positions corresponding to the codes of the tobacco boxes involved in the abnormally large side are corrected by a first preset distance along a direction perpendicular to the abnormally large side towards the center of the tobacco stack to correct the predetermined position set; the recognized single tobacco box contour is compared with a reference single tobacco box contour in position, and it is judged whether the single-side distance between the single tobacco box contour and the reference overall contour exceeds a second preset threshold value, if yes, it is judged that the side is an abnormally small side; the predetermined positions corresponding to the codes of the tobacco boxes involved in the abnormally small side are corrected by a second preset distance along a direction perpendicular to the abnormally small side towards the reference position to correct the predetermined position set; S05), steps S02 to S04 are repeated according to the corrected predetermined position set; when the single-side distance between the overall contour and the reference overall contour does not exceed the first preset threshold value, and the single-side distance between the single tobacco box contour and the reference overall contour does not exceed the second preset threshold value, the stack shape correction is completed.
2. The method of claim 1, wherein, The step S03 is specifically: After the overall contour and the single tobacco box contour of each layer of tobacco box top view image are recognized by using the cv2.findcontours contour recognition algorithm, the IOU Loss algorithm is used to correct the contour position, and the overall contour and the single tobacco box contour of each layer of tobacco box are recognized.
3. The method of claim 2, wherein, The step S04 is specifically: The overall contour and the single tobacco box contour images of each layer recognized in step S03 are subjected to algorithm bending, and the operator edges_sub_pix is used to extract the sub-pixel edges of the corresponding overall contour and single tobacco box contour; the midpoint of each side of the overall contour sub-pixel edge is taken as a single-side position representative point, the operator distance_contours_xld is used to calculate the distance between the single-side position representative point of the overall contour of the same layer and the reference overall contour, and the distance is taken as the single-side distance; it is judged whether the single-side distance exceeds the first preset threshold value, if yes, it is judged that the side is an abnormally large side; the predetermined positions corresponding to the codes of the tobacco boxes involved in the abnormally large side are corrected by a first preset distance along a direction perpendicular to the abnormally large side towards the center of the tobacco stack. The midpoint of each edge of the sub-pixel edge of the single-leaf box outer contour is taken as a single-edge representative point, the distance between the single-leaf box outer contour of the same layer and the reference single-leaf box outer contour is calculated by using the operators create_distance_transform_xld and pply_distance_transform_xld, and the distance is taken as a single-edge spacing; whether the single-edge spacing exceeds a second preset threshold value is judged, and if so, the edge is determined to be an abnormally small edge; the predetermined positions of the codes corresponding to each tobacco box involved in the abnormally small edge are adjusted by a second preset distance in a direction perpendicular to the abnormally small edge and towards the reference position.
4. The method of claim 3, wherein The reference overall outer contour and the reference single-leaf box outer contour are obtained by the following method: A standard overhead view of each layer of tobacco boxes in a standard stack is collected, and the image collection position is the same as that in step S02; After the overall contour and the single-leaf box contour of each layer of tobacco boxes in a standard stack are identified by using the cv2.findcontours contour recognition algorithm, the contour positions are corrected by using the IOU Loss algorithm, and the reference overall outer contour and the reference single-leaf box outer contour of each layer of tobacco boxes are identified; The identified reference overall outer contour and the reference single-leaf box outer contour of each layer are subjected to algorithm bending, and the sub-pixel edges of the corresponding overall outer contour and single-leaf box outer contour are extracted by using the operator edges_sub_pix.
5. The method of claim 1, wherein, Further comprising: S06), record the number of position correction times of each numbered tobacco box, and when the number of position correction times per unit time exceeds a preset value, send a device abnormality warning.
6. The method of claim 1, wherein The size of the tobacco box is 452mm×254mm×570mm, and the stacking mode is that there are 10 tobacco boxes per layer, and three layers form a stack.
7. The pile-forming correction method according to any one of claims 1 to 6, characterized in that, The first preset threshold value is 10mm, and the first preset distance is 5mm; the second preset threshold value is 10mm, and the second preset distance is 5mm.
8. A stack shape correcting device for a smoke stack, characterized by comprising: Further comprising: A predetermined position construction unit is configured to encode each tobacco box constituting a tobacco stack and construct a predetermined position set of stacks corresponding to different codes; A stack monitoring unit is configured to control a manipulator to stack tobacco boxes according to the predetermined position set and collect an overhead image of each layer of tobacco boxes in the stack during the stacking process; A contour recognition unit is configured to perform overall contour recognition and single-leaf box contour recognition according to the overhead image; A predetermined position correction unit is configured to compare the identified overall contour with the reference overall contour, judge whether the single-edge spacing of the overall contour and the reference overall contour exceeds a first preset threshold value, and if so, determine that the edge is an abnormally large edge; and correct the predetermined position set by correcting the predetermined positions of the codes corresponding to each tobacco box involved in the abnormally large edge by a first preset distance towards the center of the tobacco stack in a direction perpendicular to the abnormally large edge. and the identified single bale box outer contour is positionally compared with a reference single bale box outer contour, it is determined whether the single bale box outer contour and the reference overall outer contour have a single-side spacing exceeding a second preset threshold value, and if so, the side is determined to be an abnormally small side; and a set of predetermined positions of encodings corresponding to each bale box involved in the abnormally small side are corrected by a second preset distance in a direction perpendicular to the abnormally small side from the predetermined positions toward a reference position; a correction completion unit configured to determine that the stack shape correction is completed when the single-side spacing between the overall outer contour and the reference overall outer contour does not exceed the first preset threshold value, and the single-side spacing between the single bale box outer contour and the reference overall outer contour does not exceed the second preset threshold value.
9. A stack shape correction device for a smoke stack, characterized by, The method comprises the steps of: a memory configured to store a computer program; a processor configured to call and execute the computer program to implement the steps of the stack shape correction method of the tobacco stack according to any one of claims 1 to 7.
10. A computer readable storage medium comprising a software program adapted to perform the steps of the stack shape correction method of the tobacco stack according to any one of claims 1 to 7 by a processor.
Citation Information
Patent Citations
Coordinate correction device for horizontal articulated robot
JP1997160618A
Robot control system, robot system, and marker processing method
JP2013010160A