A visual modeling method, device, equipment and storage medium
By acquiring template images and carton types, determining the position and feature information of printed icons, and generating visual models, the problem of long template production time and high management costs in existing technologies is solved, thereby improving the production efficiency and inspection accuracy of packaging boxes.
Patent Information
- Application Number
- CN202210966923.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-11
- Publication Date
- 2026-01-09
- Estimated Expiration
- 2042-08-11
AI Technical Summary
Existing visual modeling methods require a significant amount of time to create templates in packaging box production, and the resulting large number of images or templates increases management costs.
By acquiring template images and carton types, the location and feature information of printed icons are determined, and a visual model matching the carton type is generated.
It enables the rapid generation of visual models that match various carton types, improving production efficiency and inspection accuracy.
Smart Images

Figure CN115330869B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the field of visual modeling, and in particular, to a visual modeling method, device, equipment and storage medium. BACKGROUND
[0002] In industrial production, packaging boxes are used in large quantities. Visual inspection is required at each stage of packaging box production to determine whether the printing of the packaging box is qualified. The visual inspection requires a visual model corresponding to the packaging box at each stage. Existing modeling methods are usually based on a manual modeling method based on a photographed image or an automatic modeling method based on a template file at each stage. Both methods require a large amount of time to create templates, and the generated images or templates are numerous, increasing management costs. SUMMARY
[0003] The present disclosure provides a visual modeling method, device, equipment and storage medium to at least solve the above technical problems in the prior art.
[0004] According to a first aspect of the present disclosure, a visual modeling method is provided, the method comprising: obtaining a template image, the template image comprising a printed icon; obtaining a carton type; determining position information of the printed icon according to the carton type; determining feature information corresponding to the position information based on the position information, the feature information being used to represent a feature of the printed icon; and generating a visual model according to the position information and the feature information.
[0005] In an implementable manner, the obtained carton type is a printed carton, and correspondingly, the position information of the printed icon is determined according to the carton type, comprising: binarizing the template image to obtain a binarized image; and determining first position information of the printed icon relative to the template image according to the binarized image.
[0006] In an implementable manner, the obtained carton type is a die-cut carton, and correspondingly, the position information of the printed icon is determined according to the carton type, comprising: determining a die-cut line corresponding to the template image according to the template image; determining an effective printing area corresponding to the die-cut line according to the die-cut line; and determining second position information of the printed icon relative to the effective printing area according to the effective printing area.
[0007] In an implementation, when the carton type is a fitted carton, the position information of the printed icon is determined according to the carton type, including: determining a die-cut line corresponding to the template image according to the template image; determining an effective printing area corresponding to the die-cut line according to the die-cut line; determining a folding line corresponding to the template image according to the template image; cutting the effective printing area into a plurality of cut images according to the folding line; determining a folding direction corresponding to the folding line according to the folding line, and determining a positional relationship between the cut images according to the folding direction and the cut images; splicing the cut images based on the positional relationship to obtain a fitted carton image; and determining third position information of the printed icon relative to the fitted carton image according to the fitted carton image.
[0008] In an implementation, the die-cut line corresponding to the template image is determined according to the template image, including: obtaining line information in the template image, the line information at least including the die-cut line; and extracting the die-cut line corresponding to a first color in the line information based on the first color corresponding to the die-cut line.
[0009] In an implementation, the folding line corresponding to the template image is determined according to the template image, including: obtaining line information in the template image, the line information at least including the folding line; and extracting the folding line corresponding to a second color in the line information based on the second color corresponding to the folding line, wherein the second color is different from the first color.
[0010] In an implementation, the feature information corresponding to the position information is determined based on the position information, including: determining a feature extraction manner corresponding to the position information based on the position information and the printed icon; and extracting the feature information corresponding to the printed icon according to the feature extraction manner, wherein the feature extraction manner at least includes: a first feature extraction manner for extracting line features; and a second feature extraction manner for extracting texture features.
[0011] According to a second aspect of the present disclosure, a visual modeling device is provided, including: an acquisition module configured to acquire a template image, the template image including a printed icon; the acquisition module is further configured to acquire a carton type; a determination module configured to determine position information of the printed icon according to the carton type; the determination module is further configured to determine feature information corresponding to the position information based on the position information, the feature information being used to represent features of the printed icon; and a generation module configured to generate a visual model according to the position information and the feature information.
[0012] In an implementation, the paper box type obtained is a printed paper box, and the determination module is further configured to: binarize the template image to obtain a binarized image; and determine first position information of the printed icon relative to the template image according to the binarized image.
[0013] In an implementation, the paper box type obtained is a die-cut paper box, and the determination module is further configured to: determine a die-cut line corresponding to the template image according to the template image; determine an effective printing area corresponding to the die-cut line according to the die-cut line; and determine second position information of the printed icon relative to the effective printing area according to the effective printing area.
[0014] In an implementation, the paper box type obtained is a die-cut paper box, and the determination module is further configured to: determine a die-cut line corresponding to the template image according to the template image; determine an effective printing area corresponding to the die-cut line according to the die-cut line; determine a folding line corresponding to the template image according to the template image; cut the effective printing area into a plurality of cut images according to the folding line; determine a folding direction corresponding to the folding line according to the folding line, and determine a positional relationship between the cut images according to the folding direction and the cut images; splice the cut images based on the positional relationship to obtain a die-cut paper box image; and determine third position information of the printed icon relative to the die-cut paper box image according to the die-cut paper box image.
[0015] In an implementation, the determination module is further configured to: obtain line information in the template image, the line information at least including a die-cut line; and extract the die-cut line corresponding to a first color from the line information based on the first color corresponding to the die-cut line.
[0016] In an implementation, the determination module is further configured to: obtain line information in the template image, the line information at least including a folding line; and extract the folding line corresponding to a second color from the line information based on the second color corresponding to the folding line, wherein the second color is different from the first color.
[0017] In an implementation, the determination module is further configured to: determine a feature extraction manner corresponding to the position information based on the position information and the printed icon; extract feature information corresponding to the printed icon according to the feature extraction manner; and the feature extraction manner at least includes: a first feature extraction manner for extracting line features; and a second feature extraction manner for extracting texture features.
[0018] According to a third aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to the present disclosure.
[0019] According to a fourth aspect of the present disclosure, a non-transitory computer readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to perform the method according to the present disclosure.
[0020] The template image and the carton type are acquired, the position information of the printed icon in the template image is determined according to the carton type, the feature information corresponding to the position information is determined based on the position information, and the visual model is generated according to the position information and the feature information. The visual model can be quickly generated according to the carton type and the template image, the generated visual model is matched with various carton types, and the production efficiency is improved.
[0021] It should be understood that the content described in this part is not intended to identify key or important features of the embodiments of the present disclosure, nor is it used to limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS
[0022] The above and other objects, features and advantages of the exemplary embodiments of the present disclosure will be more apparent from the following detailed description read in conjunction with the accompanying drawings, in which:
[0023] In the drawings, identical or corresponding reference numerals indicate identical or corresponding parts.
[0024] Figure 1 An implementation flowchart of a visual modeling method according to an embodiment of the present disclosure is shown Figure One ;
[0025] Figure 2 An implementation flowchart of a visual modeling method according to an embodiment of the present disclosure is shown Figure Two ;
[0026] Figure 3 An implementation flowchart of a visual modeling method according to an embodiment of the present disclosure is shown Figure Three ;
[0027] Figure 4 An implementation flowchart of a visual modeling method according to an embodiment of the present disclosure is shown Figure Four ;
[0028] Figure 5An implementation flowchart of the visual modeling method of the embodiment of the present disclosure is shown Figure Five ;
[0029] Figure 6 An implementation flowchart of the visual modeling method of the embodiment of the present disclosure is shown
[0030] Figure 7 An implementation flowchart of the visual modeling method of the embodiment of the present disclosure is shown DETAILED DESCRIPTION
[0031] In order to make the objectives, characteristics and advantages of the present disclosure more obvious and easy to understand, the technical solutions in the embodiments of the present disclosure will be described clearly and completely below with reference to the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present disclosure.
[0032] Figure 1 An implementation flowchart of the visual modeling method of the embodiment of the present disclosure is shown Figure One ; Figure 2 An implementation flowchart of the visual modeling method of the embodiment of the present disclosure is shown Figure Two ; please refer to Figure 1 and Figure 2 ;
[0033] According to a first aspect of the present disclosure, a visual modeling method is provided, the method comprising: step 101, acquiring a template image, the template image comprising a printed icon; step 102, acquiring a carton type; step 103, determining position information of the printed icon according to the carton type; step 104, determining feature information corresponding to the position information based on the position information, the feature information being used to represent a feature of the printed icon; and step 105, generating a visual model according to the position information and the feature information.
[0034] The template image and the carton type are acquired, the position information of the printed icon in the template image is determined according to the carton type, the feature information corresponding to the position information is determined based on the position information, and the visual model is generated according to the position information and the feature information. The visual model can be quickly generated according to the carton type and the template image, the generated visual model is matched with various carton types, and the production efficiency is improved.
[0035] In steps 101-102 of the present disclosure, the template image refers to a template image used for printing in industrial production, and the template image includes information such as printed icons, folding lines, and die-cut lines. The template image is printed to obtain an initial printed product, and the required printed product, which can be a carton, is obtained through subsequent processing. The template image can be pre-input by a worker to adapt to flexible production in the industry. The type of carton is obtained, and the type of carton refers to the type of carton in the production stage. The type of carton at least includes: printed carton, die-cut carton, and attached carton. Corresponding to the printing, die-cutting, and attaching processes of the printing process, respectively.
[0036] In steps 103-104 of the present disclosure, the position information of the printed icon is determined according to the type of carton. The position information refers to the position of the printed icon in the carton. The shape and size information of the carton corresponding to the type of carton can be determined, and the position of the printed icon in the template image is determined to generate the position information. Based on the position information, the feature information corresponding to the position information is extracted from the printed icon corresponding to the position information. Specifically, the feature information refers to the feature of the printed icon. Specifically, it can be an ORB feature, a SIFT feature, a color feature, a corner feature, a texture feature, a barcode feature, and the like. Further, the feature extraction can include: determining the feature extraction method corresponding to the position information based on the position information and the printed icon; extracting the feature information corresponding to the printed icon according to the feature extraction method; the feature extraction method at least includes: a first feature extraction method for extracting line features; a second feature extraction method for extracting texture features. Specifically, different feature extraction methods can be used according to different features, for example, a barcode is recognized based on the line feature of the icon to extract barcode information features. Based on the texture feature, simple texture icons and complex texture icons are distinguished, and canny texture information is extracted for simple texture icons, and ORB features are extracted for complex textures. Thus, the visual detection of various products can be adapted, and the precision and accuracy of the printing detection can be improved.
[0037] In step 105, the position information and the feature information corresponding to the position information are merged and stored to obtain a visual model. When visual detection is required, the corresponding visual model is selected according to the template image, and the obtained picture is detected. The detection process specifically includes: obtaining an original image, pre-processing the original image to obtain a to-be-detected image, and performing visual detection on the to-be-detected image through the visual model. When the feature information on the to-be-detected image is consistent with the feature of the visual model, it is determined to be qualified.
[0038] Figure 3 The implementation flowchart of the visual modeling method of the embodiment of the present disclosure is shown Figure Three ; please refer to Figure 3 ;
[0039] In an implementable manner, the obtained carton type is a printed carton, and correspondingly, the step 103 of determining the position information of the printed icon according to the carton type includes: a step 201 of binarizing the template image to obtain a binarized image; and a step 202 of determining first position information of the printed icon relative to the template image according to the binarized image.
[0040] In the steps 201-202, a method of determining the position information when the carton type is a printed carton is provided; the template image is binarized to obtain a binarized image, and specifically, the maximum inter-class variance method can be used for binarization, and the Blob analysis and morphological image processing are used based on the template image to extract the position of the printed icon as the first position information. By the features of the printed icon, a corresponding feature extraction method is used for feature extraction. The printed carton refers to a carton obtained after printing according to a printed image.
[0041] Figure 4 An implementation flowchart of the visual modeling method of the embodiment of the present disclosure is shown Figure Four ; remove reference Figure 4 ;
[0042] In an implementable manner, the obtained carton type is a die-cut carton, and correspondingly, the step 103 of determining the position information of the printed icon according to the carton type includes: a step 301 of determining a die-cut line corresponding to the template image according to the template image; a step 302 of determining an effective printing area corresponding to the die-cut line according to the die-cut line; and a step 303 of determining second position information of the printed icon relative to the effective printing area according to the effective printing area.
[0043] In steps 301-303, according to the template image, the die cutting line in the template image is obtained, the die cutting line refers to the die cutting line used in the die cutting process. Specifically, the die cutting line corresponds to a specified color, for example, black, so according to the color extraction method, the die cutting line feature in the template image can be obtained. The line information in the template image includes at least the die cutting line; based on the first color corresponding to the die cutting line, the die cutting line corresponding to the first color in the line information is extracted, and the line information also includes the fitting line, the inner folding line and the outer folding line, etc. The first color can be black. Further, the die cutting line feature is used as feature information to generate model information, and according to the die cutting line feature, the offset detection algorithm can be performed on the to-be-tested image to detect whether the to-be-tested image has an offset in the printing process. When the offset is detected, it is determined that the detection is unqualified. According to the die cutting line, the maximum circumscribed rectangle corresponding to the die cutting line is obtained, wherein the circumscribed rectangle refers to the maximum rectangle circumscribed with the die cutting line and parallel to the boundary of the template image. The area corresponding to the maximum rectangle is the effective printing area, and the remaining area is the redundant image area, which is removed. According to the effective printing area, the second position information corresponding to the printed icon is determined, that is, the position information of the printed icon in the effective area, the second position information determines the feature information corresponding to the die cutting carton, and the model information is generated according to the feature information and the position information.
[0044] Figure 5 The implementation flowchart of the visual modeling method of the embodiment of the present disclosure is shown Figure Five ; please refer to Figure 5 ;
[0045] In an implementation manner, the carton type is a fitting carton, and correspondingly, in step 103, the position information of the printed icon is determined according to the carton type, including: in step 401, according to the template image, the die cutting line corresponding to the template image is determined; in step 402, according to the die cutting line, the effective printing area corresponding to the die cutting line is determined; in step 403, according to the template image, the folding line corresponding to the template image is determined; in step 404, according to the folding line, the effective printing area is cut into a plurality of cut images; in step 405, the folding direction corresponding to the folding line is determined according to the folding line, and the position relationship between the cut images is determined according to the folding direction and the cut images; in step 406, the cut images are spliced based on the position relationship to obtain a fitting carton image; in step 407, according to the fitting carton image, the third position information of the printed icon relative to the fitting carton image is determined.
[0046] In steps 401-402, according to the die-cutting line, the template image is segmented to obtain an effective printing area and a redundant image area, and the redundant image area is removed; wherein the die-cutting line can be extracted according to the color, and the color corresponding to the die-cutting line is extracted to determine the position of the die-cutting line, and a maximum circumscribed rectangle parallel to the edge of the template image and circumscribed with the die-cutting line is determined according to the position of the die-cutting line; the area corresponding to the maximum circumscribed rectangle is the effective printing area.
[0047] In steps 403-407, the folding line is determined according to the template image. Specifically, line information in the template image is obtained, and the line information at least includes the folding line; based on the second color corresponding to the folding line, the folding line corresponding to the second color in the line information is extracted, wherein the second color is different from the first color. The second color can include red and green, and specifically, the folding line includes an inner folding line and an outer folding line, and the folding line corresponding to the color is determined by a color extraction method, for example, the red color corresponds to the inner folding line, and the green color corresponds to the outer folding line. The information of the folding line can be obtained by identifying the positions of the red line and the green line. The effective printing area is cut into a plurality of cut images according to the folding line, and the cut image represents the image corresponding to the folded carton; the folding direction corresponding to the folding line is determined according to the color of the folding line, so as to determine the positional relationship between the cut images, and the cut images are spliced according to the positional relationship, so as to obtain the image corresponding to the fitted carton, i.e. the fitted carton image. According to the fitted carton image, the printed icon is identified to obtain third position information corresponding to the printed icon. Specifically, the fitted carton can refer to the state of the carton with two sides fitted, and correspondingly, the cut image can be two or three; when the cut image is two, the cut images correspond to the front and back of the fitted carton respectively; when the cut image is three, one of the cut images corresponds to the front, and the combined image of the other two cut images corresponds to the back, and the two cut images are located on both sides of the front image. Based on the third position information, feature information corresponding to the third position information is obtained, and a visual model is generated according to the third position information and the feature information. Further, the feature information includes a fitting line feature and a folding line feature.
[0048] Figure 6 The structure schematic diagram of the visual modeling device of the embodiment of the present disclosure is shown; please refer to Figure 6 ;
[0049] According to a second aspect of the present disclosure, a visual modeling device is provided, comprising: an acquisition module 501 configured to acquire a template image, the template image comprising a printed icon; the acquisition module 501 is further configured to acquire a carton type; a determination module 502 configured to determine position information of the printed icon according to the carton type; the determination module 502 is further configured to determine feature information corresponding to the position information based on the position information, the feature information being used to represent a feature of the printed icon; and a generation module 503 configured to generate a visual model according to the position information and the feature information.
[0050] In an implementation, the acquired carton type is a printed carton, and correspondingly, the determination module 502 is further configured to binarize the template image to obtain a binarized image; and determine first position information of the printed icon relative to the template image according to the binarized image.
[0051] In an implementation, the acquired carton type is a die-cut carton, and correspondingly, the determination module 502 is further configured to: determine a die-cut line corresponding to the template image according to the template image; determine an effective printing area corresponding to the die-cut line according to the die-cut line; and determine second position information of the printed icon relative to the effective printing area according to the effective printing area.
[0052] In an implementation, the acquired carton type is a fitted carton, and correspondingly, the determination module 502 is further configured to: determine a die-cut line corresponding to the template image according to the template image; determine an effective printing area corresponding to the die-cut line according to the die-cut line; determine a folding line corresponding to the template image according to the template image; cut the effective printing area into a plurality of cut images according to the folding line; determine a folding direction corresponding to the folding line according to the folding line; determine a positional relationship between the cut images according to the folding direction and the cut images; splice the cut images based on the positional relationship to obtain a fitted carton image; and determine third position information of the printed icon relative to the fitted carton image according to the fitted carton image.
[0053] In an implementation, the determination module 502 is further configured to acquire line information in the template image, the line information at least comprising the die-cut line; and extract the die-cut line corresponding to a first color in the line information based on the first color corresponding to the die-cut line.
[0054] In an implementation, the determination module 502 is further configured to acquire line information in the template image, the line information at least comprising the folding line; and extract the folding line corresponding to a second color in the line information based on the second color corresponding to the folding line, wherein the second color is different from the first color.
[0055] In an implementable manner, the determining module 502 is further configured to determine a feature extraction manner corresponding to the position information based on the position information and the printed icon; and extract feature information corresponding to the printed icon according to the feature extraction manner, wherein the feature extraction manner at least includes: a first feature extraction manner for extracting line features; and a second feature extraction manner for extracting texture features.
[0056] According to embodiments of the present disclosure, the present disclosure further provides an electronic device and a readable storage medium.
[0057] Figure 7 A schematic block diagram of an example electronic device 600 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, tablets, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular telephones, smart phones, wearable devices, and other similar computing devices. The components shown here, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present disclosure described and / or claimed in this document.
[0058] As shown in Figure 7 The electronic device 600 includes a computing unit 601 that can perform various appropriate actions and processes according to computer programs stored in a read-only memory (ROM) 602 or loaded into a random access memory (RAM) 603 from a storage unit 608. Various programs and data required for the operation of the electronic device 600 can also be stored in the RAM 603. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0059] Various components in the electronic device 600 are connected to the I / O interface 605, including: an input unit 606, such as a keyboard, a mouse, etc.; an output unit 607, such as various types of displays, a speaker, etc.; a storage unit 608, such as a magnetic disk, an optical disk, etc.; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the electronic device 600 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunication networks.
[0060] The computing unit 601 can be various general and / or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 601 performs various methods and processes described above, such as the visual modeling method. For example, in some embodiments, the visual modeling method can be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 608. In some embodiments, part or all of the computer program can be loaded and / or installed onto the device 600 via the ROM 602 and / or the communication unit 609. When the computer program is loaded onto the RAM 603 and executed by the computing unit 601, one or more steps of the visual modeling method described above can be performed. Alternatively, in other embodiments, the computing unit 601 can be configured to perform the visual modeling method by any other suitable means, such as by means of firmware.
[0061] Various implementations of the systems and techniques described above can be realized in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a programmable logic device (PLD), a computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.
[0062] Program code for carrying out methods of the present disclosure can be written in any combination of one or more programming languages. The program code can be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the program code, when executed by the processor or controller, produces the functions / operations specified in the flowcharts and / or the block diagrams. The program code can be entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine or entirely on a remote machine or server.
[0063] In the context of this disclosure, a machine-readable medium can be a tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include but is not limited to an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0064] To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
[0065] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.
[0066] The computer system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0067] It should be understood that the various forms of flow shown above can be used to reorder, add, or delete steps. For example, the steps described in the present disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions of the present disclosure can be achieved, which is not limited herein.
[0068] In addition, the terms "first", "second" are only for descriptive purposes, and cannot be understood as indicating or implying the importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined with "first", "second" can explicitly or implicitly include at least one of the features. In the description of the present disclosure, the meaning of "multiple" is two or more, unless otherwise specifically limited.
[0069] The above is only a specific embodiment of the present disclosure, but the protection scope of the present disclosure is not limited thereto, and any person skilled in the art can easily think of changes or replacements within the technical scope disclosed by the present disclosure, which should be covered within the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be subject to the protection scope of the claims.
Claims
1. A method of visual modeling, characterized by, The method comprises: obtaining a template image, the template image comprising a printed icon; obtaining a carton type; determining position information of the printed icon according to the carton type; determining feature information corresponding to the position information based on the position information, the feature information being used to represent features of the printed icon; generating a visual model according to the position information and the feature information; wherein, when the obtained carton type is a printed carton, the determination of the position information of the printed icon according to the carton type comprises: binarizing the template image to obtain a binary image; determining first position information of the printed icon relative to the template image according to the binary image; when the obtained carton type is a die-cut carton, the determination of the position information of the printed icon according to the carton type comprises: determining a die-cut line corresponding to the template image according to the template image; determining an effective printing area corresponding to the die-cut line according to the die-cut line; determining second position information of the printed icon relative to the effective printing area according to the effective printing area; when the obtained carton type is a fitted carton, the determination of the position information of the printed icon according to the carton type comprises: determining a die-cut line corresponding to the template image according to the template image; determining an effective printing area corresponding to the die-cut line according to the die-cut line; determining a folding line corresponding to the template image according to the template image; cutting the effective printing area into a plurality of cut images according to the folding line; determining a folding direction corresponding to the folding line according to the folding line, and determining a positional relationship between the cut images according to the folding direction and the cut images; splicing the cut images based on the positional relationship to obtain a fitted carton image; determining third position information of the printed icon relative to the fitted carton image according to the fitted carton image.
2. The method of claim 1, wherein, The determination of the die-cut line corresponding to the template image according to the template image comprises: obtaining line information in the template image, the line information at least comprising the die-cut line; extracting the die-cut line corresponding to a first color from the line information based on the first color corresponding to the die-cut line.
3. The method of claim 1, wherein, The determination of the folding line corresponding to the template image according to the template image comprises: obtaining line information in the template image, the line information at least comprising the folding line; extracting the folding line corresponding to a second color from the line information based on the second color corresponding to the folding line, wherein the second color is different from the first color.
4. The method of claim 1, wherein, The determination of the feature information corresponding to the position information based on the position information comprises: determining a feature extraction mode corresponding to the position information based on the position information and the printed icon; extracting feature information corresponding to the printed icon according to the feature extraction mode; the feature extraction mode at least comprises: a first feature extraction mode for extracting line features; and a second feature extraction mode for extracting texture features.
5. A visual modeling device, characterized by, The device comprises: an obtaining module configured to obtain a template image, the template image comprising a printed icon; the obtaining module is further configured to obtain a carton type; determining a position information of the printed icon according to the carton type; the determining module is further configured to determine feature information corresponding to the position information based on the position information, the feature information being used to represent a feature of the printed icon; generating a visual model according to the position information and the feature information; when the obtained carton type is a printed carton, the determining module is configured to binarize the template image to obtain a binarized image, and determine first position information of the printed icon relative to the template image according to the binarized image; when the obtained carton type is a die-cut carton, the determining module is configured to determine a die-cut line corresponding to the template image according to the template image, determine an effective printing area corresponding to the die-cut line according to the die-cut line, and determine second position information of the printed icon relative to the effective printing area according to the effective printing area; when the obtained carton type is a laminated carton, the determining module is configured to determine a die-cut line corresponding to the template image according to the template image, determine an effective printing area corresponding to the die-cut line according to the die-cut line, determine a folding line corresponding to the template image according to the template image, cut the effective printing area into a plurality of cut images according to the folding line, determine a folding direction corresponding to the folding line according to the folding line, determine a positional relationship between the cut images according to the folding direction and the cut images, splice the cut images based on the positional relationship to obtain a laminated carton image, and determine third position information of the printed icon relative to the laminated carton image according to the laminated carton image.
6. An electronic device, comprising: comprise: at least one processor; and a memory connected with the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-4.
7. A non-transitory computer-readable storage medium having stored thereon computer instructions, wherein, The computer instructions are used to enable the computer to perform the method of any one of claims 1-4.
Citation Information
Patent Citations
Method, system and apparatus for coordinating production of goods
CN109997158A
Intelligent operation regulation and control management system for packaging bag image-text printing production line
CN113589772A