Rectangular typesetting image cutting path acquisition method and device, equipment and storage medium
By acquiring rectangular image layout data, generating an ordered boundary list, and utilizing a region growing algorithm, the problem of complex and inefficient image cutting paths in existing technologies is solved, achieving efficient cutting of rectangular layout images.
Patent Information
- Application Number
- CN202410613933.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-17
- Publication Date
- 2025-11-18
AI Technical Summary
In existing technologies, image cutting paths are complex and inefficient, especially in the cutting process of rectangular layout images in inkjet printing.
By acquiring rectangular image layout data, an ordered list of rectangular boundaries is generated, and a region growing algorithm is used to grow the rectangular boundaries of the image to be printed, obtaining the final rectangular boundaries as the image cutting path.
It improves the speed and efficiency of image cutting, thereby increasing production efficiency.
Smart Images

Figure CN120976245A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to a method, apparatus, device, and storage medium for obtaining the cutting path of a rectangular layout image. Background Technology
[0002] In inkjet printing applications, to improve printing efficiency, as shown in Figure 1, before printing, multiple rectangular images to be printed are often arranged in a rectangular layout on the same canvas to form a single image before printing. Here, rectangular layout refers to arranging the rectangular images to be printed on the canvas so that their edges are parallel to the canvas edges, such as... Figure 1a As shown, each image to be printed is rectangular, with its X-axis edge parallel to the X-axis edge of the canvas, and its Y-axis edge parallel to the Y-axis edge of the canvas. After printing the entire image onto the printing medium, a cutting device is needed to cut the printing medium containing multiple images to obtain individual images. In existing technologies, image cutting is generally performed along the boundaries of each image, with each image corresponding to its own independent cutting path (e.g., ...). Figure 1b (As shown by the dashed line in the middle), this cutting path is relatively complex and inefficient. Summary of the Invention
[0003] In view of this, embodiments of the present invention provide a method, apparatus, device and storage medium for obtaining rectangular layout image cutting paths, in order to solve the problem of complex and inefficient image cutting paths in the prior art.
[0004] In a first aspect, embodiments of the present invention provide a method for obtaining the cutting path of a rectangular layout image, the method comprising:
[0005] Obtain rectangular image layout data, wherein the rectangular image layout data includes the position and size information of multiple rectangles to be printed in the rectangular layout, and the rectangular layout indicates that when the image to be printed is placed on the canvas, its side is parallel to the edge of the canvas;
[0006] The rectangular image layout data is sorted to generate an ordered list of rectangular boundaries;
[0007] According to the sorting in the ordered rectangular boundary list, the rectangular boundaries of each image to be printed are grown sequentially to obtain the final rectangular boundary after the region growing is completed.
[0008] Extract the final matrix boundary corresponding to each of the images to be printed as the image cutting path.
[0009] Preferably, the position information includes at least the coordinates of the top left corner vertex of the image to be printed, denoted as the top left corner coordinates, and the size information includes the width and height of the image to be printed.
[0010] Preferably, the sorting of the rectangular image layout data generates an ordered rectangular boundary list, which comprises:
[0011] determining the rectangular boundary of each of the to-be-printed images according to the rectangular image layout data;
[0012] sorting the rectangular boundary of each of the to-be-printed images to generate an ordered rectangular boundary list.
[0013] Preferably, the sorting of the rectangular boundary of each of the to-be-printed images to generate an ordered rectangular boundary list comprises:
[0014] obtaining the Y value and the X value in the top-left corner coordinate of the rectangular boundary of each of the to-be-printed images;
[0015] sorting the rectangular boundary of each of the to-be-printed images in the order of increasing Y value;
[0016] if there are multiple Y values that are the same, sorting the rectangular boundary of the to-be-printed images with the same Y value in the order of increasing X value;
[0017] storing the sorting value of the rectangular boundary of each of the to-be-printed images and its top-left corner coordinate and size information in a data list to generate the ordered rectangular boundary list.
[0018] Preferably, the region growing of the rectangular boundary of each of the to-be-printed images in the order of sorting in the ordered rectangular boundary list and obtaining the final rectangular boundary after the region growing is completed comprises:
[0019] S41: performing one region growing on the top-left corner coordinate and size information of the first rectangular boundary in the ordered rectangular boundary list;
[0020] S42: determining whether the first rectangular boundary after one region growing is completed intersects or overlaps with other rectangular boundaries in the ordered rectangular boundary list;
[0021] S43: if yes, marking the boundary of the first rectangular boundary that intersects or overlaps with other rectangular boundaries and stopping the growth of the boundary;
[0022] S44: in the same way, performing one region growing on the second, …, Nth rectangular boundary in the order of sorting, where N is the number of to-be-printed images;
[0023] S45: repeating steps S41 to S44 until the left boundary, the right boundary, the upper boundary, and the lower boundary of each of the rectangular boundaries stop growing, and obtaining the final rectangular boundary corresponding to each of the to-be-printed images.
[0024] Preferably, the extracting the top-left corner coordinate and size information of the first rectangular boundary in the ordered rectangular boundary list comprises:
[0025] extracting the top-left corner coordinate a, width W and height H of the first rectangular boundary in the ordered rectangular boundary list, where a=(x1, y1), W=w1, and H=h1;
[0026] performing region growing on the first rectangular boundary, i.e., changing the top-left corner coordinate of the first rectangular boundary to a=(x1-d, y1-d), and increasing the width and height of the first rectangular boundary to W=w1+2d and H=h1+2d respectively, where d represents a growing unit and d is a positive number.
[0027] In a second aspect, an embodiment of the present application provides an image cutting method, and the method comprises:
[0028] controlling a printing device to print the laid-out whole image onto a printing medium to obtain a printed image, where the laid-out whole image comprises a plurality of rectangular to-be-printed images arranged in a rectangular manner;
[0029] The rectangular-laid-out image cutting path acquisition method according to claim 1 acquires a final cutting path corresponding to the printed image.
[0030] According to the final cutting path, the printed image is cut.
[0031] In a third aspect, an embodiment of the present application provides a rectangular-laid-out image cutting path acquisition device, and the device comprises:
[0032] a third layout data acquisition module configured to acquire rectangular image layout data, where the rectangular image layout data comprises position information and size information of a plurality of rectangular to-be-printed images arranged in a rectangular manner, and the rectangular manner indicates that, when the to-be-printed images are placed on a canvas, the edges of the to-be-printed images are parallel to the edges of the canvas;
[0033] a sorting module configured to sort the rectangular image layout data to generate an ordered rectangular boundary list;
[0034] a region growing module configured to perform region growing on the rectangular boundary of each to-be-printed image according to the order in the ordered rectangular boundary list, and acquire a final rectangular boundary after the region growing is completed;
[0035] a cutting path determination module configured to extract the final matrix boundary corresponding to each to-be-printed image as an image cutting path.
[0036] In a fourth aspect, an embodiment of the present application provides a rectangular layout image cutting path acquisition device, comprising at least one processor, at least one memory, and computer program instructions stored in the memory, which, when executed by the processor, implement the method of the first aspect in the above-described embodiments.
[0037] In a fifth aspect, an embodiment of the present application provides a storage medium having computer program instructions stored thereon, which, when executed by a processor, implement the method of the first aspect in the above-described embodiments.
[0038] To sum up, the beneficial effects of the present application are as follows:
[0039] The rectangular layout image cutting path acquisition method, device, equipment and storage medium provided by the embodiments of the present application acquire rectangular image layout data, wherein the rectangular image layout data includes position information and size information of a plurality of rectangles of the rectangular layout image to be printed; the rectangular image layout data is sorted to generate an ordered rectangular boundary list; the rectangular boundaries of each of the rectangular layout images to be printed are sequentially subjected to region growing according to the order in the ordered rectangular boundary list, and the final rectangular boundary after the region growing is completed is acquired; and the final matrix boundary corresponding to each of the rectangular layout images to be printed is extracted as an image cutting path. The method of the present application generates a cutting path by using a region growing algorithm based on rectangular image layout data, and the cutting speed of the printed image after cutting using the cutting path can be greatly improved, and the production efficiency is improved. BRIEF DESCRIPTION OF DRAWINGS
[0040] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the embodiments of the present application will be briefly introduced as follows, and for those skilled in the art, other drawings can also be obtained without creative labor on the basis of these drawings, and these are within the protection scope of the present application.
[0041] Figure 1a is a schematic diagram of rectangular layout in the background art.
[0042] Figure 1b is a schematic diagram of cutting path in the background art.
[0043] Figure 2 is a flowchart of the rectangular layout image cutting path acquisition method of the embodiments of the present application.
[0044] Figure 3 is a schematic diagram of the position information and size information of the rectangular layout image to be printed in the embodiments of the present application.
[0045] Figure 4 is a schematic diagram of the region growing of the rectangular boundary of the rectangular layout image to be printed in the embodiments of the present application.
[0046] Figure 5 is a schematic diagram of region growing of a rectangular boundary of a to-be-printed image according to an embodiment of the present application.
[0047] Figure 6 is a schematic diagram of a cutting path according to an embodiment of the present application.
[0048] Figure 7 is a schematic diagram of a structure of a rectangular layout image cutting path acquisition device according to an embodiment of the present application.
[0049] Figure 8 is a schematic diagram of a structure of a rectangular layout image cutting path acquisition device according to an embodiment of the present application. DETAILED DESCRIPTION
[0050] The features and exemplary embodiments of various aspects of the present application will be described in detail below with reference to the drawings. To make the purpose, technical solutions and advantages of the present application more clear, the present application will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are configured only to explain the present application, and are not configured to limit the present application. The present application can be implemented without some of the specific details by those skilled in the art. The following description of the embodiments is only to provide a better understanding of the present application by showing examples of the present application.
[0051] It should be noted that, in this document, relational terms such as first and second and the like can be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without more limitations, an element defined by an "comprising" statement is not excluded from a process, method, article, or apparatus that includes the element unless more limitations appear in the statement.
[0052] Embodiment one
[0053] The embodiment of the present application provides a rectangular layout image cutting path acquisition method. The method generates a cutting path after image printing by using a region growing algorithm based on layout data of a rectangular image which has been completed in a canvas.
[0054] Referring to Figure 2 , the rectangular layout image cutting path acquisition method specifically includes the following steps:
[0055] S1: obtaining rectangular image layout data, wherein the rectangular image layout data comprises position information and size information of a plurality of rectangles of a rectangular layout of to-be-printed images, the rectangular layout indicating that the to-be-printed images are placed on a canvas with their edges parallel to the edges of the canvas;
[0056] S2: sorting the rectangular image layout data to generate an ordered rectangular boundary list;
[0057] S3: sequentially performing region growing on the rectangular boundaries of the to-be-printed images according to the order in the ordered rectangular boundary list and obtaining final rectangular boundaries after the region growing is completed;
[0058] S4: extracting the final rectangular boundaries corresponding to the to-be-printed images as image cutting paths.
[0059] Specifically, before image printing, first, the to-be-printed images of the rectangles are rectangularly laid out in the canvas of the image processing software (such as RIP software) of the printing device. Rectangular layout refers to a layout mode in which the to-be-printed images of the rectangles are placed on the canvas with their edges parallel to the edges of the canvas (i.e., the edges of the to-be-printed images in the X direction are parallel to the edges of the canvas in the X direction, and the edges of the to-be-printed images in the Y direction are parallel to the edges of the canvas in the Y direction), as shown in FIG. 1, the edges of the to-be-printed images are parallel to the edges of the canvas. If the to-be-printed images of the rectangles are not placed correctly on the canvas but are placed obliquely (i.e., the edges of the to-be-printed images are not parallel to the edges of the canvas), the to-be-printed images need to be adjusted to be placed with their edges parallel to the edges of the canvas. The rectangular image layout data herein includes the position information and size information of the to-be-printed images in the canvas. The position information can include the coordinates of the four vertices of the to-be-printed images, or at least the coordinates of the top-left corner, denoted as the top-left coordinates, and the size information includes the width and height of the to-be-printed images. For example, as shown in the table Figure 3 , the corresponding rectangular image layout data is [(x1, y1), w1, h1]; [(x2, y2), w2, h2]; [(x3, y2), w3, h3]. According to these information, the rectangular boundaries corresponding to the to-be-printed images can be determined. For example, the upper boundary of the to-be-printed image 1 is the line segment between the coordinate point (x1, y2) and the coordinate point (x1+w1, y2), and the left boundary is the line segment between the coordinate point (x1, y2) and the coordinate point (x1, y1+h1). After obtaining the rectangular boundaries of the to-be-printed images according to the rectangular image layout data, the rectangular boundaries are stored in a data list according to the order to generate an ordered rectangular boundary list.
[0060] Preferably, the sorting the rectangular boundaries of the to-be-printed images to generate an ordered rectangular boundary list comprises:
[0061] Obtain the Y and X values of the top-left corner coordinates of the rectangular boundary of each of the images to be printed;
[0062] Sort the rectangular boundaries of each image to be printed in ascending order of Y value;
[0063] If multiple Y values are the same, the rectangular boundaries of the images to be printed with the same Y values are sorted in ascending order of X values;
[0064] The sorting values of the rectangular boundaries of each of the images to be printed, along with their top-left corner coordinates and dimensions, are stored in a data list to generate the ordered rectangular boundary list.
[0065] For example, such as Figure 3 As shown, the Y-values of the top-left corner coordinates of images 1 and 2 are less than the Y-value of the top-left corner coordinate of image 3. Therefore, images 1 and 2 are placed before image 3. Since the Y-values of the top-left corner coordinates of images 1 and 2 are the same, they are sorted according to the X-values of their top-left corner coordinates. It is known that the X-value of image 1 is less than that of image 2, therefore image 1 is placed before image 2. By sorting, at least the top-left corner coordinates and size information of the rectangular boundaries of each image to be printed are stored in the form of a data list, resulting in an ordered rectangular boundary list. Since the ordered rectangular boundary list only stores the rectangular boundary information of each image to be printed, such as the top-left corner coordinates, width, and height of the rectangular boundary, it can save a lot of memory and reduce data complexity.
[0066] Preferably, the step of performing region growing on the rectangular boundaries of each of the images to be printed according to the order in the ordered rectangular boundary list and obtaining the final rectangular boundary after the region growing is completed includes:
[0067] S41: Extract the top-left corner coordinates and size information of the first rectangle boundary in the ordered rectangle boundary list and perform a region growing operation;
[0068] S42: Determine whether the first rectangular boundary after completing one region growth intersects or overlaps with other rectangular boundaries in the ordered rectangular boundary list;
[0069] S43: If so, mark the boundary in the first rectangular boundary that intersects or overlaps with other rectangular boundaries and stop the growth of that boundary;
[0070] S44: And so on, perform one region growth for the second, ..., Nth rectangular boundary in sequence, where N is the number of images to be printed;
[0071] S45: Repeat steps S41 to S44 until the left, right, top, and bottom boundaries of each rectangle stop growing, thus obtaining the final rectangle boundaries corresponding to each image to be printed.
[0072] For example, in the ordered list of rectangular boundaries, the rectangular boundary of image 1 to be printed is the first rectangular boundary, the rectangular boundary of image 2 to be printed is the second rectangular boundary, and the rectangular boundary of image 3 to be printed is the last rectangular boundary. First, the coordinates of the top-left corner, width, and height of the first rectangular boundary are extracted. Since no region generation has been performed yet, the coordinates of the top-left corner, width, and height of the first rectangular boundary correspond to the coordinates of the top-left corner, width, and height of image 1 to be printed, denoted as [(x1, y1), w1, h1]. After performing a region growing operation on this first rectangular boundary, the first rectangular boundary is expanded. Preferably, as follows... Figure 4 As shown, the top-left corner coordinate (denoted as a) of the first rectangular boundary is expanded outward by one growth unit d. Correspondingly, its width W and height H are each expanded by two growth units (2d). d is a positive number. For example, d = 1. After the region growth is performed on the first rectangular boundary, its corresponding top-left corner coordinate becomes a = (x1-d, yd), and its width and height become W = w1 + 2d and H = h1 + 2d, respectively. Based on the changed top-left corner coordinates and width / height, the positions of the left, right, top, and bottom boundaries of the first rectangle after one region growth can be determined. At this point, it is determined whether the left, right, top, and bottom boundaries of the grown first rectangle intersect or overlap with other rectangle boundaries in the ordered rectangle boundary list, such as the second rectangle boundary corresponding to image 2 and the third rectangle boundary corresponding to image 3. If they do not intersect or overlap, the region growth of the next two rectangle boundaries is then performed. After completing the region growth of the second and third rectangle boundaries, the region growth is performed again on the first, second, and third rectangle boundaries according to the above region growth rules. If the right boundary intersects with the left boundary of the second rectangle boundary after the first region growth, then in the next (second) region growth, the expansion of the right boundary is stopped, and only the top, left, and right boundaries are expanded. At this point, if... Figure 5As shown, the top-left corner coordinate of the first rectangular boundary is (x1-2d, y1-2d), and the width and height are w1+3d and h1+4d respectively. In addition, it is worth noting that if the right boundary of the first rectangular boundary intersects with the left boundary of the second rectangular boundary when the first rectangular boundary is subjected to the first region growing, then when the second rectangular boundary is subjected to region growing, the left boundary of the second rectangular boundary has already intersected with the right boundary of the first rectangular boundary after growing, and then the left boundary of the second rectangular boundary stops growing and only expands the other three boundaries. In addition, since the to-be-printed image 1 is located at the top-left corner of the canvas, if the upper boundary or the left boundary of the first rectangular boundary reaches the edge of the canvas when the first rectangular boundary is subjected to region growing, then the growing of the upper boundary and the left boundary also stops. After the first rectangular boundary completes the second region growing, the second rectangular boundary and the third rectangular boundary are subjected to region growing in the order, and the growing rules are similar to those of the first rectangular boundary, which will not be described herein.
[0073] After a plurality of times of region growing, if all the boundaries (the left boundary, the right boundary, the upper boundary and the lower boundary) of the first rectangular boundary stop growing, the top-left corner coordinate and the width and height of the first rectangular boundary at this time are recorded, so as to obtain the final rectangular boundary corresponding to the first rectangular boundary or the to-be-printed image 1. Similarly, after a plurality of times of region growing, if the left boundary, the right boundary, the upper boundary and the lower boundary of the second rectangular boundary and the third rectangular boundary cannot continue to grow, the boundary information of the second rectangular boundary and the third rectangular boundary after the last time of growing is recorded, so as to obtain the final rectangular boundary corresponding to each to-be-printed image.
[0074] After obtaining the final rectangular boundary corresponding to each to-be-printed image, when the final rectangular boundary is converted into an image cutting path, further path optimization is performed, for example, Figure 6 As shown, the cutting path corresponding to the to-be-printed image 1 is a cutting path composed of coordinates (x11, y11), (x12, y12), (x21, y21) and (x21, y21), and the cutting path corresponding to the to-be-printed image 2 is a cutting path composed of coordinates (x12, y12), (x13, y13), (x22, y22) and (x23, y23). In order to further improve the cutting efficiency, since the coordinate (x22, y22) is in the line segment between the coordinates (x21, y21) and (x23, y23), the cutting path [(x21, y21), (x22, y22)] and the cutting path [(x22, y22), (x23, y23)] can be combined into a cutting path [(x21, y21), (x23, y23)], so as to improve the cutting efficiency. Similarly, other combinable cutting paths are optimized, and finally the optimal cutting path is obtained.
[0075] As shown in Figure 6As shown, the final cutting path makes only one horizontal or vertical cutting line between any two adjacent rectangular images (as shown by the dashed line in Figure 6 The cutting path is independent of the images in Fig. 1, and the cutting efficiency is greatly improved, thereby greatly improving the cutting speed of the rectangular images.
[0076] In summary, the rectangular image cutting path acquisition method provided by the embodiment of the present application includes the following steps: obtaining rectangular image layout data, wherein the rectangular image layout data includes position information and size information of a plurality of rectangular images to be printed in rectangular layout; sorting the rectangular image layout data to generate an ordered rectangular boundary list; sequentially performing region growing on the rectangular boundary of each of the images to be printed according to the order in the ordered rectangular boundary list and obtaining the final rectangular boundary after the region growing is completed; and extracting the final rectangular boundary corresponding to each of the images to be printed as an image cutting path. The method provided by the present application generates a cutting path based on rectangular image layout data and using a region growing algorithm. The cutting speed of the printed image after using the cutting path for cutting is greatly improved, and the production efficiency is improved.
[0077] Embodiment two
[0078] Based on the above-mentioned embodiment one, the embodiment of the present application provides an image cutting method, which includes the following steps:
[0079] controlling a printing device to print the already laid out overall image onto a printing medium to obtain a printed image, wherein the already laid out overall image includes a plurality of rectangular images to be printed in rectangular layout;
[0080] The rectangular image cutting path acquisition method according to claim 1 acquires the final cutting path corresponding to the printed image;
[0081] cutting the printed image according to the final cutting path.
[0082] Specifically, after a plurality of rectangular images to be printed are laid out in rectangular layout in a canvas of image processing software of a printing device, an already laid out overall image is obtained, and an inkjet printing device is controlled to print the already laid out overall image onto a printing medium. The printing medium can be any one of paper, glass, acrylic, wood, metal, etc. The rectangular image cutting path acquisition method according to embodiment one is used to acquire the final cutting path corresponding to the printed image, and then the printed medium is cut according to the final cutting path, thereby obtaining a plurality of independent printed images.
[0083] The image cutting method of the embodiment two of the present application can greatly improve the cutting speed and production efficiency after the cutting path obtained by the rectangular image cutting path acquisition method in embodiment one is used to cut the printed image.
[0084] Embodiment three
[0085] Referring to Figure 7 The embodiment of the present application provides a rectangular layout image cutting path acquisition device 200, the device 200 comprises:
[0086] The data acquisition module 201 is used for acquiring rectangular image layout data, wherein the rectangular image layout data comprises position information and size information of a plurality of rectangles of a to-be-printed image in rectangular layout, and the rectangular layout indicates that the to-be-printed image is parallel to the edge of the canvas when the to-be-printed image is placed on the canvas;
[0087] The sorting module 202 is used for sorting the rectangular image layout data to generate an ordered rectangular boundary list;
[0088] The region growing module 203 is used for sequentially performing region growing on the rectangular boundary of each to-be-printed image according to the sorting in the ordered rectangular boundary list and acquiring a final rectangular boundary after the region growing is completed;
[0089] The cutting path determination module 204 is used for extracting the final matrix boundary corresponding to each to-be-printed image as an image cutting path.
[0090] In summary, the rectangular layout image cutting path acquisition device provided by the embodiment of the present application acquires rectangular image layout data, wherein the rectangular image layout data comprises position information and size information of a plurality of rectangles of a to-be-printed image in rectangular layout; sorts the rectangular image layout data to generate an ordered rectangular boundary list; sequentially performs region growing on the rectangular boundary of each to-be-printed image according to the sorting in the ordered rectangular boundary list and acquires a final rectangular boundary after the region growing is completed; and extracts the final matrix boundary corresponding to each to-be-printed image as an image cutting path. The method provided by the present application is based on rectangular image layout data, and uses a region growing algorithm to generate a cutting path. After the cutting path is used for cutting the printed image, the cutting speed can be greatly improved, and the production efficiency is improved.
[0091] Embodiment four
[0092] In addition, the rectangular layout image cutting path acquisition method provided by the embodiment of the present application can be implemented by a rectangular layout image cutting path acquisition device. Figure 8 The hardware structure schematic diagram of the rectangular layout image cutting path acquisition device provided by the embodiment of the present application is shown.
[0093] The rectangular layout image cutting path acquisition device can comprise a processor 301 and a memory 302 storing computer program instructions.
[0094] In particular, the processor 301 can include a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or can be configured to implement one or more integrated circuits that implement embodiments of the present application.
[0095] The memory 302 can include mass storage for data or instructions. By way of example, and not limitation, the memory 302 can include a hard disk drive (HDD), a floppy disk drive, flash memory, an optical disc (e.g., a compact disc (CD) or a digital versatile disc (DVD)), a tape drive, a USB drive, or a combination of two or more of these. The memory 302 can be removable and / or non-removable (or fixed) as appropriate. The memory 302 can be internal or external as appropriate. In certain embodiments, the memory 302 is non-volatile solid-state memory. In certain embodiments, the memory 302 includes read-only memory (ROM). Where appropriate, this ROM can be mask-programmed ROM, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), electrically alterable ROM (EAROM), or flash memory, or a combination of two or more of these.
[0096] The processor 301 implements any of the rectangular layout image cutting path acquisition methods described above by reading and executing computer program instructions stored in the memory 302.
[0097] In one example, the rectangular layout image cutting path acquisition device can further include a communication interface 303 and a bus 310. As shown, the processor 301, the memory 302, and the communication interface 303 are connected by the bus 310 and complete communication with each other. Figure 8
[0098] The communication interface 303 is mainly used to realize the communication between the modules, devices, units and / or equipment in the embodiments of the present application.
[0099] Bus 310 includes hardware, software, or both, coupling components of the rectangular layout image cutting path acquisition device to each other. By way of example, and not limitation, bus 310 can be an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand (IB) interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or another suitable bus or a combination of two or more of these. Where appropriate, bus 310 can include one or more buses. Although the present embodiment describes and shows a particular bus, the present embodiment contemplates any suitable bus or interconnect.
[0100] Embodiment Five
[0101] In addition, in combination with the rectangular layout image cutting path acquisition method in the above embodiments, the present embodiment can provide a computer readable storage medium to implement. The computer readable storage medium has computer program instructions stored thereon; the computer program instructions are executed by the processor 301 to implement any one of the rectangular layout image cutting path acquisition methods in the above embodiments.
[0102] To sum up, the rectangular layout image cutting path acquisition method, device, equipment and storage medium provided by the present embodiment, by acquiring rectangular image layout data, wherein the rectangular image layout data includes position information and size information of a plurality of rectangles of rectangular layout of to-be-printed images; sorting the rectangular image layout data to generate an ordered rectangular boundary list; sequentially performing region growing on the rectangular boundary of each to-be-printed image according to the order in the ordered rectangular boundary list and acquiring the final rectangular boundary after the region growing is completed; and extracting the final matrix boundary corresponding to each to-be-printed image as an image cutting path. The present method generates a cutting path based on rectangular image layout data and using a region growing algorithm, and the cutting speed of the printed image after using the cutting path for cutting can be greatly improved, and the production efficiency is improved.
[0103] It needs to be made clear that the present embodiment is not limited to the specific configurations and processes described above and shown in the drawings. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present embodiment is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between steps, after understanding the spirit of the present embodiment.
[0104] The functional blocks shown in the structural block diagrams described above can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application specific integrated circuits (ASICs), appropriate firmware, plug-ins, functional cards, and the like. When implemented in software, the elements of the present application are program or code segments that are used to perform the required tasks. The program or code segments can be stored in a machine-readable medium or transmitted through a data signal carried in a carrier wave over a transmission medium or communication link. A "machine-readable medium" includes any medium that can store or transport information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, and the like. The code segments can be downloaded via computer networks such as the Internet, intranets, and the like.
[0105] It should also be noted that the exemplary embodiments mentioned in the present application describe some methods or systems based on a series of steps or devices. However, the present application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiments, or in an order different from that in the embodiments, or several steps can be performed simultaneously.
[0106] The above description is merely a specific implementation of the present application. Those skilled in the art can clearly understand the specific working processes of the above-described system, modules and units for the convenience and brevity of description, and the corresponding processes in the foregoing method embodiments can be referred to, which will not be described here again. It should be understood that the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think of various equivalent modifications or replacements within the technical range disclosed by the present application, and these modifications or replacements should be covered within the protection scope of the present application.
Claims
1. A method for obtaining the cutting path of a rectangular layout image, characterized in that, The method includes: Obtain rectangular image layout data, wherein the rectangular image layout data includes the position and size information of multiple rectangles to be printed in the rectangular layout, and the rectangular layout indicates that when the image to be printed is placed on the canvas, its side is parallel to the edge of the canvas; The rectangular image layout data is sorted to generate an ordered list of rectangular boundaries; According to the sorting in the ordered rectangular boundary list, the rectangular boundaries of each image to be printed are grown sequentially to obtain the final rectangular boundary after the region growing is completed. Extract the final matrix boundary corresponding to each of the images to be printed as the image cutting path.
2. The method for obtaining the cutting path of a rectangular layout image according to claim 1, characterized in that, The position information includes at least the coordinates of the top left corner of the image to be printed, denoted as the top left corner coordinates, and the size information includes the width and height of the image to be printed.
3. The method for obtaining the cutting path of a rectangular layout image according to claim 2, characterized in that, The step of sorting the rectangular image layout data to generate an ordered list of rectangular boundaries includes: The rectangular boundaries of each image to be printed are determined based on the rectangular image layout data; The rectangular boundaries of each of the images to be printed are sorted to generate an ordered list of rectangular boundaries.
4. The method for obtaining the cutting path of a rectangular layout image according to claim 3, characterized in that, The step of sorting the rectangular boundaries of each of the images to be printed to generate an ordered list of rectangular boundaries includes: Obtain the Y and X values of the top-left corner coordinates of the rectangular boundary of each of the images to be printed; Sort the rectangular boundaries of each image to be printed in ascending order of Y value; If multiple Y values are the same, the rectangular boundaries of the images to be printed with the same Y values are sorted in ascending order of X values; The sorting values of the rectangular boundaries of each of the images to be printed, along with their top-left corner coordinates and dimensions, are stored in a data list to generate the ordered rectangular boundary list.
5. The method for obtaining the cutting path of a rectangular layout image according to claim 1, characterized in that, The step of performing region growing on the rectangular boundaries of each image to be printed according to the sorting in the ordered rectangular boundary list and obtaining the final rectangular boundary after the region growing is completed includes: S41: Extract the top-left corner coordinates and size information of the first rectangle boundary in the ordered rectangle boundary list and perform a region growing operation; S42: Determine whether the first rectangular boundary after completing one region growth intersects or overlaps with other rectangular boundaries in the ordered rectangular boundary list; S43: If so, mark the boundary in the first rectangular boundary that intersects or overlaps with other rectangular boundaries and stop the growth of that boundary; S44: And so on, perform one region growth for the second, ..., Nth rectangular boundaries in sequence, where N is the number of images to be printed; S45: Repeat steps S41 to S44 until the left, right, top, and bottom boundaries of each rectangle stop growing, thus obtaining the final rectangle boundaries corresponding to each image to be printed.
6. The method for obtaining the cutting path of a rectangular layout image according to claim 5, characterized in that, The step of extracting the top-left corner coordinates and size information of the first rectangle boundary in the ordered rectangle boundary list and performing a region growing operation includes: Extract the top-left corner coordinates a, width W, and height H of the first rectangle boundary in the ordered rectangle boundary list, and set a = (x1, y1), W = w1, and H = h1; The first rectangular boundary is grown once, that is, the coordinates of the upper left corner of the first rectangular boundary are changed to a = (x1-d, y1-d), and its width and height are increased to W = w1 + 2d and H = h1 + 2d respectively, where d represents the growth unit and d is a positive number.
7. An image segmentation method, characterized in that, The method includes: The printing device is controlled to transfer the layout of the overall image onto the printing medium to obtain the printed image, wherein the layout of the overall image includes multiple rectangular images to be printed arranged in a rectangular layout; The rectangular layout image cutting path acquisition method according to claim 1 obtains the final cutting path corresponding to the printed image; The printed image is cut according to the final cutting path.
8. A device for obtaining the cutting path of a rectangular layout image, characterized in that, The device includes: The layout data acquisition module is used to acquire rectangular image layout data, wherein the rectangular image layout data includes the position information and size information of multiple rectangles to be printed in the rectangular layout, and the rectangular layout indicates that when the image to be printed is placed on the canvas, its side is parallel to the edge of the canvas. The sorting module is used to sort the rectangular image layout data to generate an ordered list of rectangular boundaries; The region growing module is used to grow the rectangular boundaries of each of the images to be printed in sequence according to the sorting in the ordered rectangular boundary list and obtain the final rectangular boundary after the region growing is completed. The cutting path determination module is used to extract the final matrix boundary corresponding to each of the images to be printed as the image cutting path.
9. A device for obtaining the cutting path of a rectangular layout image, characterized in that, include: At least one processor, at least one memory, and computer program instructions stored in the memory, which, when executed by the processor, implement the method as described in any one of claims 1-7.
10. A storage medium storing computer program instructions thereon, characterized in that, The method as described in any one of claims 1-7 is implemented when the computer program instructions are executed by the processor.