Special-shaped typesetting image cutting path acquisition method and device, equipment and storage medium
By obtaining the path coordinates of irregularly shaped images, and using a region growing algorithm to generate and optimize the cutting path, the problem of complex and inefficient cutting paths in existing technologies is solved, achieving more efficient image cutting.
Patent Information
- Application Number
- CN202410613956.2
- 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, the cutting path for irregularly shaped images is complex and inefficient, making it difficult to perform image cutting efficiently.
By acquiring the layout data of the image to be printed, a preliminary cutting path is generated using a region growing algorithm, and the final cutting path is obtained by optimizing it using a straight line fitting or Bézier curve algorithm.
It improves the efficiency and speed of image cutting, reduces cutting time, and increases production efficiency.
Smart Images

Figure CN120976246A_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 irregularly shaped typed images. Background Technology
[0002] In inkjet printing applications, to improve printing efficiency, such as Figure 1a As shown in 1b, before printing, multiple images to be printed (image 1, image 2, and image 3) are often arranged in the same canvas 4 to form a single image for printing. When images 1, 2, and 3 are arranged as shown in 1b, the images are arranged in the same canvas 4 to form a single image for printing. Figure 1a When an image is presented as an irregular shape, regardless of its orientation, at least one of its edges is not parallel to the edge of the canvas in the X or Y direction, or as shown below. Figure 1b As shown, even if the images 5 and 6 to be printed are regular images such as rectangles, but they are not placed upright on the canvas 4 but are placed at an angle, at least one of their edges is not parallel to the edge of the canvas 4 in the X or Y direction. This type of layout, where at least one side of the image to be printed is not parallel to the edge of the canvas, is called irregular layout. After printing the overall image obtained from the layout onto the printing medium, a cutting device is needed to cut the printing medium carrying multiple images to obtain individual images. In the prior art, when cutting images, edge-following cutting is generally performed according to the boundaries of each image, and each image corresponds to its own independent cutting path (e.g., ...). Figure 1c (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 the cutting path of irregularly shaped layout images, so as to solve the problem of complex and inefficient 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 an irregularly shaped layout image, the method comprising:
[0005] Obtain printable image layout data, wherein the printable image layout data includes path coordinates of multiple printable images with irregular layout, wherein the path coordinates are a set of coordinate points that make up the boundary of the printable image, and the irregular layout means that when the printable image is placed on the canvas, at least one side is not parallel to the edge of the canvas.
[0006] Based on the path coordinates of each of the images to be printed, obtain the boundary image corresponding to each of the images to be printed, wherein the boundary image is a bitmap;
[0007] Perform region growing on each of the boundary images to obtain a preliminary cutting path;
[0008] The initial cutting path is optimized to obtain the final cutting path.
[0009] Preferably, the layout data of the images to be printed also includes the coordinates of the upper left corner, width, and height of the smallest bounding rectangle of each image to be printed.
[0010] Preferably, before performing region growing on each of the boundary images to obtain the preliminary cutting path, the method further includes:
[0011] The boundary images of each image to be printed are sorted according to the coordinates of the upper left corner of the minimum bounding region of each image to be printed, thereby generating an ordered set of boundary images.
[0012] Preferably, the step of obtaining a preliminary cutting path by performing region growing on each of the boundary images includes:
[0013] S41: Extract the first boundary image from the ordered boundary image set, and obtain the pixel points in the first boundary image, which are denoted as the first boundary pixel points;
[0014] S42: Perform a region growth operation on the first boundary pixel point with one pixel as the growth unit;
[0015] S43: Determine whether the first boundary pixel after completing one region growing cycle overlaps with other boundary image pixels in the ordered boundary image set;
[0016] S44: If so, mark the first boundary pixel that overlaps with the other boundary image pixels and stop the growth of the first boundary pixel;
[0017] S45: And so on, perform one region growing operation on the second, ..., Nth boundary images in sequence, where N is the number of images to be printed;
[0018] S46: Repeat steps S41 to S45 until all pixels of each boundary image stop growing, to obtain an expanded image of each boundary image;
[0019] S47: Extract the contour paths of each of the extended images to obtain the preliminary cutting paths corresponding to each of the images to be printed.
[0020] Preferably, the step of performing one region growth on the first boundary pixel point using one pixel as the growth unit includes:
[0021] Select any pixel from the first boundary pixels as the first growth pixel;
[0022] Determine whether the pixels adjacent to the first growing pixel in the top, bottom, left, and right are within the first boundary image;
[0023] If not, determine whether the adjacent pixel is a first boundary pixel;
[0024] If not, mark the adjacent pixels as the first boundary pixels;
[0025] Similarly, the same operation is performed on all other first boundary pixels except the first grown pixel, thereby completing one region growth of the first boundary pixel.
[0026] Preferably, optimizing the initial cutting path to obtain the final cutting path includes:
[0027] The initial cutting path is optimized using a straight line fitting algorithm or a Bézier curve algorithm to obtain the final cutting path.
[0028] Secondly, embodiments of the present invention provide an image segmentation method, the method comprising:
[0029] The printing device is controlled to print a pre-formatted overall image onto a printing medium, wherein the pre-formatted overall image includes multiple irregularly shaped images to be printed;
[0030] The method for obtaining the cutting path of an irregularly shaped layout image according to claim 1 obtains the final cutting path;
[0031] The printing medium is cut according to the final cutting path.
[0032] Thirdly, embodiments of the present invention provide a device for obtaining the cutting path of an irregularly shaped typesetting image, the device comprising:
[0033] The data acquisition module is used to acquire the layout data of the image to be printed, wherein the layout data of the image to be printed includes the path coordinates of multiple images to be printed in an irregular layout, wherein the path coordinates are a set of coordinate points that make up the boundary of the image to be printed, and the irregular layout means that when the image to be printed is placed on the canvas, at least one side is not parallel to the edge of the canvas.
[0034] A boundary image acquisition module is used to acquire the boundary image corresponding to each of the images to be printed based on the path coordinates of each image to be printed, wherein the boundary image is a bitmap;
[0035] The cutting path acquisition module is used to perform region growing on each of the boundary images to obtain a preliminary cutting path;
[0036] The optimization module is used to optimize the initial cutting path to obtain the final cutting path.
[0037] Fourthly, embodiments of the present invention provide a device for obtaining the cutting path of irregularly shaped typesetting images, including: at least one processor, at least one memory, and computer program instructions stored in the memory, which implement the method of the first aspect of the above embodiments when the computer program instructions are executed by the processor.
[0038] Fifthly, embodiments of the present invention provide a storage medium storing computer program instructions thereon, which, when executed by a processor, implement the method of the first aspect described above.
[0039] In summary, the beneficial effects of the present invention are as follows:
[0040] The present invention provides a method, apparatus, device, and storage medium for obtaining cutting paths for irregularly shaped printed images. This involves acquiring layout data of images to be printed, including path coordinates of multiple irregularly shaped images, where the path coordinates are a set of coordinate points forming the boundaries of the images to be printed; obtaining boundary images corresponding to each image based on its path coordinates, where the boundary images are bitmaps; performing region growing on each boundary image to obtain a preliminary cutting path; and optimizing the preliminary cutting path to obtain a final cutting path. This method, based on the layout data of the images to be printed, utilizes a region growing algorithm to generate cutting paths. These cutting paths are shorter, and using them for cutting the printed image significantly reduces cutting time, increases cutting speed, and improves production efficiency. Attached Figure Description
[0041] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the embodiments of the present invention will be briefly introduced below. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort, and these are all within the protection scope of the present invention.
[0042] Figure 1a This is a schematic diagram of irregular typesetting in the background technology.
[0043] Figure 1b This is a schematic diagram of irregular typesetting in the background technology.
[0044] Figure 1c This is a schematic diagram of the cutting path in the background technology.
[0045] Figure 2 This is a flowchart illustrating the method for obtaining the cutting path of irregularly shaped typed images according to an embodiment of the present invention.
[0046] Figure 3 This is a schematic diagram of the path coordinates in an embodiment of the present invention.
[0047] Figure 4 This is a schematic diagram of the boundary image according to an embodiment of the present invention.
[0048] Figure 5 This is a schematic diagram of region growing on the first boundary image according to an embodiment of the present invention.
[0049] Figure 6 This is a schematic diagram of the preliminary cutting path according to an embodiment of the present invention.
[0050] Figure 7 This is a schematic diagram of the final cutting path in an embodiment of the present invention.
[0051] Figure 8 This is a schematic diagram of the structure of the irregularly shaped layout image cutting path acquisition device according to an embodiment of the present invention.
[0052] Figure 9 This is a schematic diagram of the structure of the irregularly shaped layout image cutting path acquisition device according to an embodiment of the present invention. Detailed Implementation
[0053] The features and exemplary embodiments of various aspects of the present invention will now be described in detail. To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only configured to explain the present invention and are not configured to limit the present invention. For those skilled in the art, the present invention can be practiced without some of these specific details. The following description of the embodiments is merely intended to provide a better understanding of the present invention by illustrating examples of the invention.
[0054] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes said element.
[0055] Example 1
[0056] This invention provides a method for obtaining the cutting path of an irregularly shaped layout image. The method is based on the layout data of the image to be printed, which has been laid out on the canvas, and uses a region growing algorithm to generate the cutting path after the image is printed.
[0057] Please see Figure 2 The method for obtaining the cutting path of the irregularly shaped layout image specifically includes the following steps:
[0058] S1: Obtain the layout data of the image to be printed, wherein the layout data of the image to be printed includes the path coordinates of multiple images to be printed in an irregular layout, wherein the path coordinates are a set of coordinate points that make up the boundary of the image to be printed, and the irregular layout means that when the image to be printed is placed on the canvas, at least one side is not parallel to the edge of the canvas.
[0059] S2: Based on the path coordinates of each of the images to be printed, obtain the boundary image corresponding to each of the images to be printed, wherein the boundary image is a bitmap;
[0060] S3: Perform region growing on each of the boundary images to obtain a preliminary cutting path;
[0061] S4: Optimize the initial cutting path to obtain the final cutting path.
[0062] Specifically, before printing, the images to be printed are first arranged on the canvas of the printing device's image processing software (such as RIP software). When the arrangement of the images to be printed is as follows... Figure 1a When using irregularly shaped layouts as shown in 1b, preferably, the layout data for the images to be printed includes at least the path coordinates of each image to be printed, or includes the position information and path coordinates of each image to be printed on the canvas. For example, the position information here is the coordinates of the top-left corner, width, and height of the smallest bounding rectangle of each image to be printed, and the path coordinates are the set of coordinate points that make up the boundary of the image to be printed. For example, such as... Figure 2As shown, the path coordinates of the image to be printed 1 are (x11, y11), (x12, y12), (x13, y13), (x14, y14), (x15, y15), (x16, y16), (x17, y17), (x18, y18), (x19, y19), (x20, y20). By obtaining the line segments between (x11, y11) and (x12, y12), (x12, y12) and (x13, y13), (x13, y13) and (x14, y14) ... (x20, y20) and (x11, y11), the outline of the image to be printed can be obtained. In this embodiment of the invention, the path coordinates of the image to be printed are converted into the boundary image (bitmap) corresponding to the image to be printed. The boundary image is then grown to obtain the preliminary cutting path corresponding to the image to be printed. Then, the preliminary cutting path is optimized to obtain the final cutting path.
[0063] Preferably, obtaining the boundary image corresponding to each of the images to be printed based on the path coordinates of each image to be printed includes:
[0064] The outline of the image to be printed is obtained based on the path coordinates, wherein the outline is a closed curve formed by the coordinate points in the path coordinates;
[0065] The boundary image in bitmap format is generated based on the contour.
[0066] For example, such as Figure 2 As shown, the outline of the image to be printed, 1, is composed of line segments between (x11, y11) and (x12, y12), (x12, y12) and (x13, y13), (x13, y13) and (x14, y14)...(x20, y20) and (x11, y11). A bitmap-format boundary image corresponding to the image to be printed, based on this outline, is generated. This boundary image is composed of pixels.
[0067] Preferably, before performing region growing on each bounding image to obtain the preliminary cutting path, the method further includes:
[0068] The boundary images of each image to be printed are sorted according to the coordinates of the upper left corner of the minimum bounding region of each image to be printed, thereby generating an ordered set of boundary images.
[0069] In this embodiment of the invention, the boundary images of each image to be printed are sorted, and subsequent region growing of each boundary image is performed sequentially according to the relevant sorting. Specifically:
[0070] Obtain the Y and X values of the top-left corner coordinates of the smallest bounding rectangle of each of the images to be printed;
[0071] The boundary images of each image to be printed are sorted in ascending order of Y value;
[0072] If multiple Y values are the same, the boundary images of the multiple images to be printed with the same Y values are sorted in ascending order of X values;
[0073] The sorting values of the boundary images of each of the images to be printed are stored to obtain the ordered boundary image set.
[0074] For example, as shown in Figure 1, the top-left corner Y-coordinate of the smallest bounding rectangle of image 2 to be printed has the smallest value, and this image is placed before images 1 and 3. Since the top-left corner Y-coordinates of the smallest bounding rectangles of images 1 and 3 are the same, they are arranged according to the size of the top-left corner X-coordinate. Therefore, the X-coordinate of image 1 is smaller than that of image 3, and image 1 should be placed before image 3. The boundary images corresponding to each image to be printed are stored in this sorted order, resulting in an ordered set of boundary images. Because the ordered boundary images only store the pixel information corresponding to the boundaries of each image to be printed, it saves a significant amount of memory and reduces data complexity compared to storing the entire image to be printed.
[0075] Preferably, the step of obtaining a preliminary cutting path by performing region growing on each of the boundary images includes:
[0076] S41: Extract the first boundary image from the ordered boundary image set, and obtain the pixel points in the first boundary image, which are denoted as the first boundary pixel points;
[0077] S42: Perform a region growth operation on the first boundary pixel point with one pixel as the growth unit;
[0078] S43: Determine whether the first boundary pixel after completing one region growing cycle overlaps with other boundary image pixels in the ordered boundary image set;
[0079] S44: If so, mark the first boundary pixel that overlaps with the other boundary image pixels and stop the growth of the first boundary pixel;
[0080] S45: And so on, perform one region growing operation on the second, ..., Nth boundary images in sequence, where N is the number of images to be printed;
[0081] S46: Repeat steps S41 to S45 until all pixels of each boundary image stop growing, to obtain an expanded image of each boundary image;
[0082] S47: Extract the contour paths of each of the extended images to obtain the preliminary cutting paths corresponding to each of the images to be printed.
[0083] For example, in an ordered set of boundary images, the boundary image of image 2 to be printed is the first boundary image, the boundary image of image 1 to be printed is the second boundary image, and the boundary image of image 3 to be printed is the third boundary image. First, the first boundary image is extracted, such as... Figure 4 As shown, each pixel in the first boundary image (denoted as the first boundary pixel) is obtained, and a region growing operation is performed on these pixels in units of one pixel. Preferably, the region growing operation on the first boundary pixel in units of one pixel includes:
[0084] Select any pixel from the first boundary pixels as the first growth pixel;
[0085] Determine whether the pixels adjacent to the first growing pixel in the top, bottom, left, and right are within the first boundary image;
[0086] If not, determine whether the adjacent pixel is a first boundary pixel;
[0087] If not, mark the adjacent pixels as the first boundary pixels;
[0088] Similarly, the same operation is performed on the other first boundary pixels in turn, thereby completing one region growth of the first boundary pixels.
[0089] For example, such as Figure 4 As shown, this is the first boundary image composed of multiple pixels. Figure 5 As shown, taking pixel 200 as an example, region growth is performed on pixel 200 in units of one pixel. In pixel 200, since the upper adjacent pixel is also a first boundary pixel, while the left adjacent pixel 202, right adjacent pixel 203, and lower adjacent pixel 204 are not first boundary pixels, these pixels are marked as first boundary pixels. Similarly, for pixel 300, since its upper, lower, and left adjacent pixels are all first boundary pixels, only the right adjacent pixel 304 meets the growth conditions, so the right adjacent pixel 304 is marked as a first boundary pixel. The same operation is performed on the other first boundary pixels, thus completing one region growth for each first boundary pixel.
[0090] After completing one region growing operation on the first boundary image, it is determined whether the first boundary pixel after the region growing operation overlaps with other boundary image pixels in the ordered boundary image set. If they overlap, the corresponding first boundary pixel stops growing, and in the next region growing operation, region growing is only performed on the non-overlapping first boundary pixels. Similarly, a region growing operation is performed on the second and third boundary images, using a similar method to the first boundary image, which will not be repeated here. After completing one region growing operation on the second and third boundary images, another region growing operation is performed on the first boundary image, and then another on the second and third boundary images.
[0091] After each region growing operation, it is determined whether the first boundary pixel overlaps with other boundary image pixels in the ordered boundary image set. If so, the first boundary pixel that overlaps with other boundary image pixels is marked, and the growth of that first boundary pixel is stopped. When all first boundary pixels have stopped growing, the region growing of the first boundary image is complete. Similarly, the region growing of the second boundary image and the third boundary image are performed sequentially to obtain the expanded images of each boundary image.
[0092] Extracting the contour paths of these extended images yields preliminary cutting paths, for example, such as... Figure 6 As shown. If the obtained preliminary cutting path is very close to the boundary of the image to be printed, in order to ensure that the image is not cut during cutting, preferably, the preliminary cutting path is optimized. For example, a straight line fitting algorithm or a Bézier curve fitting algorithm is used to optimize the preliminary cutting path (both straight line fitting algorithms and Bézier curve fitting algorithms are existing technologies and will not be described in detail here). For example, using a Bézier curve fitting algorithm to process the preliminary cutting path makes the cutting path smoother, resulting in... Figure 7 The final cutting path is shown.
[0093] In summary, the method for obtaining the cutting path of irregularly shaped images provided in this embodiment of the invention involves acquiring layout data of images to be printed, wherein the layout data includes path coordinates of multiple irregularly shaped images to be printed, and wherein the path coordinates are a set of coordinate points constituting the boundaries of the images to be printed; obtaining boundary images corresponding to each image to be printed based on the path coordinates of each image to be printed, wherein the boundary images are bitmaps; performing region growing on each boundary image to obtain a preliminary cutting path; and optimizing the preliminary cutting path to obtain a final cutting path. This method, based on the layout data of the images to be printed, utilizes a region growing algorithm to generate cutting paths. These cutting paths are shorter, and using them for cutting the printed image can significantly reduce cutting time, increase cutting speed, and improve production efficiency.
[0094] Example 2
[0095] Based on the above embodiment one, this embodiment of the invention provides an image segmentation method, the method comprising:
[0096] The printing device is controlled to transfer a pre-laid overall image onto a printing medium to obtain a printed image, wherein the pre-laid overall image includes multiple irregularly shaped images to be printed;
[0097] The method for obtaining the cutting path of an irregularly shaped typesetting image according to claim 1 obtains the final cutting path corresponding to the printed image;
[0098] The printed image is cut according to the image cutting path.
[0099] Specifically, before printing, multiple images to be printed are arranged in irregular shapes on the canvas of the image processing software of the printing device to obtain a pre-arranged overall image. The printing device is then controlled to perform inkjet printing, printing the pre-arranged overall image onto a printing medium, which can be any of paper, glass, acrylic, wood, metal, etc. According to the image cutting path acquisition method described in Embodiment 1, the final cutting path corresponding to the printed image is obtained, and then the printing medium is cut according to the cutting path to obtain multiple independent printed images.
[0100] The image cutting method of Embodiment 2 of the present invention obtains the cutting path according to the image cutting path acquisition method in Embodiment 1 and then cuts the printed image, which can greatly improve the cutting speed and increase production efficiency.
[0101] Example 3
[0102] Please see Figure 8 This invention provides a device 200 for obtaining the cutting path of irregularly shaped typesetting images, the device 200 comprising:
[0103] The data acquisition module 201 is used to acquire the layout data of the image to be printed, wherein the layout data of the image to be printed includes the path coordinates of multiple images to be printed in an irregular layout, wherein the path coordinates are a set of coordinate points that make up the boundary of the image to be printed, and the irregular layout means that when the image to be printed is placed on the canvas, at least one side is not parallel to the edge of the canvas.
[0104] The boundary image acquisition module 202 is used to acquire the boundary image corresponding to each of the images to be printed according to the path coordinates of each of the images to be printed, wherein the boundary image is a bitmap;
[0105] The cutting path acquisition module 203 is used to perform region growing on each of the boundary images to obtain a preliminary cutting path;
[0106] The optimization module 204 is used to optimize the preliminary cutting path to obtain the final cutting path.
[0107] In summary, the irregularly shaped layout image cutting path acquisition device provided in this embodiment of the invention acquires layout data of images to be printed, wherein the layout data includes path coordinates of multiple irregularly shaped images to be printed, and wherein the path coordinates are a set of coordinate points constituting the boundaries of the images to be printed; based on the path coordinates of each image to be printed, it acquires a boundary image corresponding to each image to be printed, wherein the boundary image is a bitmap; it performs region growing on each boundary image to obtain a preliminary cutting path; and it optimizes the preliminary cutting path to obtain a final cutting path. This method, based on the layout data of the images to be printed, utilizes a region growing algorithm to generate cutting paths. Using these cutting paths for cutting the printed image can significantly improve cutting speed and increase production efficiency.
[0108] Example 4
[0109] In addition, the method for obtaining the cutting path of irregularly shaped layout images in this embodiment of the invention can be implemented by an irregularly shaped layout image cutting path acquisition device. Figure 9 A schematic diagram of the hardware structure of the irregularly shaped layout image cutting path acquisition device provided in an embodiment of the present invention is shown.
[0110] The device for obtaining the cutting path of irregularly shaped printed images may include a processor 301 and a memory 302 storing computer program instructions.
[0111] Specifically, the processor 301 may include a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of the present invention.
[0112] Memory 302 may include mass storage for data or instructions. For example, and not limitingly, memory 302 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 302 may include removable or non-removable (or fixed) media. Where appropriate, memory 302 may be internal or external to a data processing device. In a particular embodiment, memory 302 is a non-volatile solid-state memory. In a particular embodiment, memory 302 includes read-only memory (ROM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM), or flash memory, or a combination of two or more of these.
[0113] The processor 301 reads and executes computer program instructions stored in the memory 302 to implement any of the irregularly shaped layout image cutting path acquisition methods in the above embodiments.
[0114] In one example, the irregularly shaped layout image cutting path acquisition device may further include a communication interface 303 and a bus 310. For example, Figure 9 As shown, the processor 301, memory 302, and communication interface 303 are connected through bus 310 and complete communication with each other.
[0115] The communication interface 303 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of the present invention.
[0116] Bus 310 includes hardware, software, or both, that couples components of a device for acquiring irregularly shaped image cutting paths together. For example, and not as a limitation, bus 310 may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel 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 other suitable buses, or combinations of two or more of these. Where appropriate, bus 310 may include one or more buses. While specific buses are described and illustrated in embodiments of the invention, the invention contemplates any suitable bus or interconnect.
[0117] Example 5
[0118] Furthermore, in conjunction with the irregularly shaped image cutting path acquisition method in the above embodiments, this invention can be implemented using a computer-readable storage medium. This computer-readable storage medium stores computer program instructions; when these computer program instructions are executed by the processor 301, they implement any of the irregularly shaped image cutting path acquisition methods in the above embodiments.
[0119] In summary, the method, apparatus, device, and storage medium for obtaining cutting paths for irregularly shaped printed images provided in this invention acquire layout data of images to be printed, wherein the layout data includes path coordinates of multiple irregularly shaped images to be printed, and wherein the path coordinates are a set of coordinate points constituting the boundaries of the images to be printed; based on the path coordinates of each image to be printed, obtain boundary images corresponding to each image to be printed, wherein the boundary images are bitmaps; perform region growing on each boundary image to obtain a preliminary cutting path; and optimize the preliminary cutting path to obtain a final cutting path. This invention, based on the layout data of the images to be printed, utilizes a region growing algorithm to generate cutting paths. Using these cutting paths for cutting the printed image can significantly improve cutting speed and increase production efficiency.
[0120] It should be clarified that the present invention is not limited to the specific configurations and processes described above and shown in the figures. 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 invention is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of the present invention.
[0121] The functional blocks shown in the above-described structural diagram 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, function cards, etc. When implemented in software, the elements of this invention are programs or code segments used to perform the required tasks. The programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting 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, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.
[0122] It should also be noted that the exemplary embodiments mentioned in this invention describe methods or systems based on a series of steps or apparatus. However, this invention is not limited to the order of the steps described above; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.
[0123] The above description is merely a specific embodiment of the present invention. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the protection scope of the present invention.
Claims
1. A method for obtaining the cutting path of an irregularly shaped typed image, characterized in that, The method includes: Obtain printable image layout data, wherein the printable image layout data includes path coordinates of multiple printable images with irregular layout, wherein the path coordinates are a set of coordinate points that make up the boundary of the printable image, and the irregular layout means that when the printable image is placed on the canvas, at least one side is not parallel to the edge of the canvas. Based on the path coordinates of each of the images to be printed, obtain the boundary image corresponding to each of the images to be printed, wherein the boundary image is a bitmap; Perform region growing on each of the boundary images to obtain a preliminary cutting path; The initial cutting path is optimized to obtain the final cutting path.
2. The method for obtaining the cutting path of irregularly shaped typesetting images according to claim 1, characterized in that, The layout data of the images to be printed also includes the coordinates of the top left corner, width, and height of the smallest bounding rectangle of each image to be printed.
3. The method for obtaining the cutting path of irregularly shaped typesetting images according to claim 2, characterized in that, Before performing region growing on each of the boundary images to obtain the preliminary cutting path, the following is also included: The boundary images of each image to be printed are sorted according to the coordinates of the upper left corner of the minimum bounding region of each image to be printed, thereby generating an ordered set of boundary images.
4. The method for obtaining the cutting path of irregularly shaped typesetting images according to claim 3, characterized in that, The step of obtaining a preliminary cutting path by performing region growing on each of the boundary images includes: S41: Extract the first boundary image from the ordered boundary image set, and obtain the pixel points in the first boundary image, which are denoted as the first boundary pixel points; S42: Perform a region growth operation on the first boundary pixel point with one pixel as the growth unit; S43: Determine whether the first boundary pixel after completing one region growing cycle overlaps with other boundary image pixels in the ordered boundary image set; S44: If so, mark the first boundary pixel that overlaps with the other boundary image pixels and stop the growth of the first boundary pixel; S45: And so on, perform one region growing operation on the second, ..., Nth boundary images in sequence, where N is the number of images to be printed; S46: Repeat steps S41 to S45 until all pixels of each boundary image stop growing, to obtain an expanded image of each boundary image; S47: Extract the contour paths of each of the extended images to obtain the preliminary cutting paths corresponding to each of the images to be printed.
5. The method for obtaining the cutting path of an irregularly shaped layout image according to claim 4, wherein the step of performing a region growth on the first boundary pixel point with one pixel as the growth unit includes: Select any pixel from the first boundary pixels as the first growth pixel; Determine whether the pixels adjacent to the first growing pixel in the top, bottom, left, and right are within the first boundary image; If not, determine whether the adjacent pixel is a first boundary pixel; If not, mark the adjacent pixels as the first boundary pixels; Similarly, the same operation is performed on all other first boundary pixels except the first grown pixel, thereby completing one region growth of the first boundary pixel.
6. The method for obtaining the cutting path of an irregularly shaped layout image according to claim 1, characterized in that, The step of optimizing the initial cutting path to obtain the final cutting path includes: The initial cutting path is optimized using a straight line fitting algorithm or a Bézier curve algorithm to obtain the final cutting path.
7. An image segmentation method, characterized in that, The method includes: The printing device is controlled to transfer a pre-laid overall image onto a printing medium to obtain a printed image, wherein the pre-laid overall image includes multiple irregularly shaped images to be printed; The method for obtaining the cutting path of an irregularly shaped typesetting image according to claim 1 obtains the final cutting path corresponding to the printed image; The printed image is cut according to the image cutting path.
8. A device for obtaining the cutting path of irregularly shaped typed images, characterized in that, The device includes: The data acquisition module is used to acquire the layout data of the image to be printed, wherein the layout data of the image to be printed includes the path coordinates of multiple images to be printed in an irregular layout, wherein the path coordinates are a set of coordinate points that make up the boundary of the image to be printed, and the irregular layout means that when the image to be printed is placed on the canvas, at least one side is not parallel to the edge of the canvas. A boundary image acquisition module is used to acquire the boundary image corresponding to each of the images to be printed based on the path coordinates of each image to be printed, wherein the boundary image is a bitmap; The cutting path acquisition module is used to perform region growing on each of the boundary images to obtain a preliminary cutting path; The optimization module is used to optimize the initial cutting path to obtain the final cutting path.
9. A device for obtaining the cutting path of irregularly shaped typed images, 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.