System and method for cutting oversized image
By providing modules for image acquisition, parameter acquisition and image cutting, large images are automatically cut into multiple small images, which solves the problem in the existing technology that images larger than 2GB cannot be automatically cut, and improves the efficiency and efficiency of image processing. Accuracy.
Patent Information
- Application Number
- CN202310308240.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-27
- Publication Date
- 2024-09-27
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing image processing software cannot automatically crop images larger than 2GB, causing users to need to operate manually, which is inefficient and error-prone.
Provide a system and method, including an image acquisition module, a parameter acquisition module and a cutting module, which can automatically cut a large image into multiple small images according to the obtained cutting parameters, and optionally perform shape completion, naming and storage Path configuration.
The automated image cropping process is realized, improving the efficiency and accuracy of image processing. Users do not need to manually crop small images, reducing the possibility of errors.
Smart Images

Figure CN118710657A
Abstract
Description
Technical Field
[0001] The present disclosure belongs to the field of image processing, and more specifically, relates to a system and method for slicing an oversized image, an electronic device, and a computer-readable storage medium. Background Art
[0002] Processing large amounts of big image data is an important challenge in many fields, including geographic information systems, meteorology, agriculture, urban planning, etc. For example, satellite images are one type of image data, which are usually very large and require a lot of time and computing resources to process due to their high resolution and wide coverage. In many applications, such as mapping, environmental monitoring, land use, etc., it is a common method to cut large images into smaller ones for easier processing and analysis.
[0003] Traditionally, cutting large images into smaller ones requires manual work, which is a very time-consuming and tedious task. To solve this problem, some automated methods have been proposed. For example, the current well-known image processing software has powerful image processing and editing functions, which can automatically cut images less than or equal to 2GB. However, for larger images (greater than 2GB), the well-known image processing software cannot cut them. At this time, users can only cut large images into smaller ones manually. In this case, not only does it reduce work efficiency, but it is also difficult for users to avoid errors when cutting manually. Summary of the invention
[0004] The present disclosure provides a system and method for slicing an extremely large image, an electronic device, and a computer-readable storage medium to at least solve the problems in the above-mentioned related technologies, or may not solve any of the above-mentioned problems.
[0005] According to a first aspect of the present disclosure, a system for cutting images is provided, and the system may include: an image acquisition module, configured to acquire a first image; a parameter acquisition module, configured to acquire cropping parameters, wherein the cropping parameters may include the number of rows and columns according to which the first image is cropped into multiple second images; and an image cutting module, configured to crop the first image into the multiple second images based on the cropping parameters.
[0006] Optionally, the first image may be an image with a byte size greater than 2 GB.
[0007] Optionally, before cropping the first image into the multiple second images based on the cropping parameters, the system may further include a completion module, configured to: identify whether the shape of the first image is a preset shape, and if the shape of the first image is not the preset shape, complete the first image to the preset shape; wherein the cutting module may be configured to: crop the completed first image into the multiple second images based on the cropping parameters.
[0008] Optionally, the parameter acquisition module can also be configured to: acquire a named quantitative part of the cropped second image, and the image cutting module can also be configured to: name each of the multiple second images based on the named quantitative part, wherein the name of each second image includes the named quantitative part and the named variable part.
[0009] Optionally, the parameter acquisition module may be further configured to: acquire a storage path of the cropped second image, and the image cutting module may be further configured to: store the plurality of second images in the acquired storage path.
[0010] Optionally, the image cutting module can be configured to: determine the total number of reference lines and the reference line positions of the first image according to the cropping parameters, construct multiple selections in the first image according to the total number of reference lines and the reference line positions, and crop the first image into the multiple second images according to the multiple selections.
[0011] Optionally, the cutting module can be configured to: construct multiple column selections of the first image according to the intersection coordinates of the reference lines of the first image and respectively construct a selection among the multiple selections in each of the multiple column selections; or construct multiple row selections of the first image according to the intersection coordinates of the reference lines of the first image and respectively construct a selection among the multiple selections in each of the multiple row selections.
[0012] According to a second aspect of the present disclosure, a method for cutting an image is provided, which may include: acquiring a first image; acquiring cropping parameters, wherein the cropping parameters may include the number of rows and columns according to which the first image is to be cropped into multiple second images; and cropping the first image into the multiple second images based on the cropping parameters.
[0013] Optionally, the first image may be an image with a byte size greater than 2 GB.
[0014] Optionally, before cropping the first image into the multiple second images based on the cropping parameters, the method may include: identifying whether the shape of the first image is a preset shape, and if the shape of the first image is not the preset shape, completing the first image into the preset shape, wherein cropping the first image into the multiple second images based on the cropping parameters may include: cropping the completed first image into the multiple second images based on the cropping parameters.
[0015] Optionally, the method may further include: obtaining a named quantitative part of the cropped second image, and naming each of the multiple second images based on the named quantitative part, wherein the name of each second image may include the named quantitative part and a named variable part.
[0016] Optionally, the method may further include: acquiring a storage path of the cropped second image, and storing the plurality of second images in the acquired storage path.
[0017] Optionally, cropping the first image into the multiple second images based on the cropping parameters may include: determining the total number of reference lines and the positions of the reference lines of the first image according to the cropping parameters, constructing multiple selections in the first image according to the total number of reference lines and the positions of the reference lines, and cropping the first image into the multiple second images according to the multiple selections.
[0018] Optionally, constructing multiple selections in the first image may include: constructing multiple column selections of the first image based on the intersection coordinates of the reference lines of the first image and respectively constructing a selection among the multiple selections in each of the multiple column selections; or constructing multiple row selections of the first image based on the intersection coordinates of the reference lines of the first image and respectively constructing a selection among the multiple selections in each of the multiple row selections.
[0019] According to a third aspect of the present disclosure, an electronic device is provided, which may include: at least one processor; at least one memory storing computer-executable instructions, wherein the computer-executable instructions, when executed by at least one of the processors, prompt at least one of the processors to execute the method for cutting images.
[0020] According to a fourth aspect of the present disclosure, a computer-readable storage medium storing instructions is provided, wherein when the instructions are executed by at least one processor, the at least one processor is prompted to execute the method for cutting images.
[0021] According to the present disclosure, a large image can be automatically cut into multiple small images. Thus, a user can easily process a large amount of image data without having to manually cut out each small image, thereby improving the efficiency and accuracy of image processing.
[0022] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 is a schematic block diagram showing a system for cutting a picture according to an example embodiment of the present disclosure;
[0024] Figure 2 is a schematic diagram illustrating cutting a first image into a plurality of second images according to an exemplary embodiment of the present disclosure;
[0025] Figure 3 is an example schematic diagram showing construction of multiple selection areas in a first image according to an example embodiment of the present disclosure;
[0026] Figure 4 is a flowchart illustrating a method for cutting a graph according to an example embodiment of the present disclosure; and
[0027] Figure 5 is a schematic block diagram illustrating an electronic device 500 according to an example embodiment of the present disclosure. DETAILED DESCRIPTION
[0028] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The implementation methods described in the following examples do not represent all implementation methods consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the attached claims.
[0030] It should be noted that “at least one of the several items” appearing in the present disclosure refers to three types of parallel situations: “any one of the several items”, “a combination of any multiple of the several items”, and “all of the several items”. For example, “including at least one of A and B” includes the following three parallel situations: (1) including A; (2) including B; (3) including A and B. Another example is “executing at least one of step one and step two”, which means the following three parallel situations: (1) executing step one; (2) executing step two; (3) executing step one and step two. “A and / or B” and “A and / or B” appearing in the present disclosure refer to the following three parallel situations: only A; only B; both A and B.
[0031] Figure 1 is a schematic block diagram showing a system 100 for image slicing according to an example embodiment of the present disclosure.
[0032] The system 100 may include an image acquisition module 110, a parameter acquisition module 120, and a picture cutting module 130. The system 100 may be installed in various electronic devices or as a module / plug-in of various image processing software to perform picture cutting, or various modules in the system 100 may implement corresponding functions in a separate manner, or the system 100 may be distributed online or in the cloud for use by users.
[0033] The image acquisition module 110 may acquire a first image. As an example only, the first image may be input through a user interface for the system 100. For example, a user may drag the first image from a folder where the first image is located into the user interface, or a user may select the first image in a corresponding folder through the user interface. Here, the first image may be an image of any size, and may even be an image with a byte count greater than 2GB, for example, the first image may be a 70GB satellite image. Here, the byte count / size of the first image is only limited by the processing power of the image acquisition module 110.
[0034] The parameter acquisition module 120 may acquire cropping parameters. The cropping parameters may include the number of rows and columns by which the first image is cropped into the plurality of second images. For example, the user may input or select the number of rows and columns through a user interface.
[0035] Figure 2 is a schematic diagram illustrating cutting a first image into a plurality of second images according to an exemplary embodiment of the present disclosure.
[0036] The image cutting module 130 may cut the first image into the plurality of second images based on the cutting parameters. Figure 2As shown in FIG. 1 , when the number of rows and the number of columns obtained are 2 and 4 respectively, the first image can be cut into 8 second images. According to an exemplary embodiment of the present disclosure, the image cutting module 130 can determine the total number of reference lines and the positions of the reference lines of the first image according to the cutting parameters, and construct multiple selection areas (such as 4) in the first image according to the total number of reference lines and the positions of the reference lines. Figure 2 ), and cutting the first image into the plurality of second images according to the plurality of selection areas.
[0037] Figure 3 is an exemplary schematic diagram showing construction of a plurality of selected areas in a first image according to an exemplary embodiment of the present disclosure.
[0038] like Figure 3 As shown in (a), the image cutting module 130 can construct multiple column selection areas of the first image according to the intersection coordinates of the reference lines of the first image, and as shown in Figure 3 As shown in (b), a selection area among the multiple selection areas can be constructed in each column selection area of the multiple column selection areas.
[0039] Optionally, the image cutting module 130 may construct a plurality of row selection areas of the first image according to the intersection coordinates of the reference lines of the first image, and construct a selection area of the plurality of selection areas in each of the plurality of row selection areas.
[0040] In addition, the parameter acquisition module 120 can also obtain the named quantitative part of the cropped second image, and the image cutting module 130 can also name each of the multiple second images based on the named quantitative part, wherein the name of each second image includes the named quantitative part and the named variable part. For example, the named quantitative part may include at least one of a letter part, a number part, a symbol part, and a Chinese character. As an example only, the user can input / select the first letter of the name of the second image (for example, S) through the user interface of the system 100, and the name of the second image obtained can be S1, S2, S3...S8 in sequence.
[0041] The parameter acquisition module 120 may also acquire the storage path of the cropped second image, and the image cutting module 130 may also store the plurality of second images in the acquired storage path. For example, the user may input / select the storage path of the second image through the user interface of the system 100, and thus, the plurality of second images may be stored in the storage path.
[0042] In the present disclosure, before the first image is cropped into the plurality of second images based on the cropping parameters, the system 100 may further include a completion module (not shown). The completion module may identify whether the shape of the first image is a preset shape. If the shape of the first image is not the preset shape, the first image is completed into the preset shape. If the shape of the first image is the preset shape, the first image is not completed. The image cutting module 130 may crop the completed first image into the plurality of second images based on the cropping parameters. Here, the preset shape may be a rectangle, a square, a triangle, etc.
[0043] As an example only, this system 100 may be installed on image processing software, and the operation of the system 100 will be described in detail below.
[0044] First, the folder path storing the second image, the first image or the storage path of the first image, the number of rows and columns, and the named quantitative portion of the second image can be obtained through the user interface. After the above information is confirmed, the cropping procedure of the system 100 can be executed.
[0045] For example, a new reference line can be created for the first image based on the number of rows and columns to obtain the total number of reference lines, and the first layer (base map 0) can be activated to calculate the coordinates of the intersection of the reference lines to obtain the first column selection of the first image, which can be cut and pasted in a new layer. Subsequent column selections can be obtained in the same way. In this way, the first image can be cut into vertical strips, and the number of vertical strips is the number of columns obtained. Subsequently, the coordinates of the intersection of the reference lines can be calculated for each column selection to obtain the selection in the column selection. In this way, the vertical strips of the first image can be cut into blocks, and the number of blocks of a vertical strip is the number of rows obtained. In this way, the multiple selections can be constructed to achieve cutting the first image into multiple second images.
[0046] Optionally, multiple row selection areas may be constructed first to cut the first image into horizontal strips, and then the horizontal strips of the first image may be cut into blocks for each of the multiple row selection areas. Thus, the multiple selection areas may be constructed to cut the first image into multiple second images.
[0047] Compared with calculating all the coordinates of the intersections of the reference lines and directly cutting the first image into blocks, the above-mentioned cutting method of first column and then row or first row and then column has a faster processing speed.
[0048] After obtaining multiple second images in the above manner, the image position, size and dimension of each second image in the multiple second images can be determined, and then the layer of each second image can be copied and a new blank file can be created to output each second image.
[0049] Figure 4is a flowchart illustrating a method for cutting a graph according to an example embodiment of the present disclosure.
[0050] At step 410 , a first image may be acquired.
[0051] In step 420 , cropping parameters may be acquired, wherein the cropping parameters may include the number of rows and columns by which the first image is cropped into a plurality of second images.
[0052] In step 430 , the first image may be cropped into the plurality of second images based on the cropping parameters.
[0053] According to an exemplary embodiment of the present disclosure, the first image may be an image having a byte number greater than 2 GB.
[0054] According to an example embodiment of the present disclosure, before cropping the first image into the multiple second images based on the cropping parameters, the method may include: identifying whether the shape of the first image is a preset shape, and if the shape of the first image is not the preset shape, completing the first image into the preset shape, wherein cropping the first image into the multiple second images based on the cropping parameters may include: cropping the completed first image into the multiple second images based on the cropping parameters.
[0055] According to an example embodiment of the present disclosure, the method may further include: obtaining a named quantitative part of the cropped second image, and naming each of the multiple second images based on the named quantitative part, wherein the name of each second image may include the named quantitative part and a named variable part.
[0056] According to an example embodiment of the present disclosure, the method may further include: acquiring a storage path of the cropped second image, and storing the plurality of second images in the acquired storage path.
[0057] According to an example embodiment of the present disclosure, cropping the first image into the multiple second images based on the cropping parameters may include: determining the total number of reference lines and the reference line positions of the first image according to the cropping parameters, constructing multiple selections in the first image according to the total number of reference lines and the reference line positions, and cropping the first image into the multiple second images according to the multiple selections.
[0058] According to an example embodiment of the present disclosure, constructing a plurality of selections in a first image may include: constructing a plurality of column selections of the first image based on the intersection coordinates of reference lines of the first image and respectively constructing a selection among the plurality of selections in each of the plurality of column selections; or constructing a plurality of row selections of the first image based on the intersection coordinates of reference lines of the first image and respectively constructing a selection among the plurality of selections in each of the plurality of row selections.
[0059] Figure 5 is a schematic block diagram illustrating an electronic device 500 according to an example embodiment of the present disclosure.
[0060] According to an exemplary embodiment of the present disclosure, an electronic device 500 may also be provided, and the electronic device 500 may include a processor 510 and a memory 520 storing computer executable instructions. When the computer executable instructions are executed by the processor 510, the processor 510 is prompted to perform the above-mentioned method for cutting images according to the exemplary embodiment of the present disclosure. The number of bytes / size of the first image is only limited by the processing capability of the processor 510.
[0061] The present disclosure provides a method for cutting images, which can automatically cut a large image into multiple small images. Thus, users can easily process a large amount of image data without manually cutting out each small image, thereby improving the efficiency and accuracy of image processing.
[0062] According to an embodiment of the present disclosure, a computer-readable storage medium storing instructions may also be provided, wherein when the instructions are executed by at least one processor, the at least one processor is prompted to execute the method for cutting pictures according to the exemplary embodiment of the present disclosure. Examples of computer-readable storage media here include: read-only memory (ROM), random access programmable read-only memory (PROM), electrically erasable programmable read-only memory (EEPROM), random access memory (RAM), dynamic random access memory (DRAM), static random access memory (SRAM), flash memory, non-volatile memory, CD-ROM, CD-R, CD+R, CD-RW, CD+RW, DVD-ROM, DVD-R, DVD+R, DVD-RW, DVD+RW, DVD-RAM, BD-ROM, BD-R, BD-R LTH, BD-RE, Blu-ray or optical disk storage, hard disk drive (HDD), solid state drive (SSD), card storage (such as, multimedia card, secure digital (SD) card or extreme digital (XD) card), magnetic tape, floppy disk, magneto-optical data storage device, optical data storage device, hard disk, solid state disk and any other device, any other device is configured to store computer programs and any associated data, data files and data structures in a non-transitory manner and provide the computer programs and any associated data, data files and data structures to a processor or computer so that the processor or computer can execute the computer program. The computer program in the above-mentioned computer-readable storage medium can be run in an environment deployed in a computer device such as a client, a host, an agent device, a server, etc. In addition, in one example, the computer program and any associated data, data files and data structures are distributed on a networked computer system, so that the computer program and any associated data, data files and data structures are stored, accessed and executed in a distributed manner by one or more processors or computers.
[0063] According to an embodiment of the present disclosure, a computer program product may also be provided. Instructions in the computer program product may be executed by at least one processor in an electronic device to perform the method according to the exemplary embodiment of the present disclosure.
[0064] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.
[0065] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the claims.
Claims
1. A system for cutting images, including: An image acquisition module, configured to acquire a first image; A parameter acquisition module is configured to acquire cropping parameters, wherein the cropping parameters include the number of rows and columns according to which the first image is cropped into a plurality of second images; as well as The image cutting module is configured to cut the first image into the plurality of second images based on the cutting parameters.
2. The system of claim 1, wherein: The first image is an image whose byte size is greater than 2 GB.
3. The system of claim 1, before cropping the first image into the plurality of second images based on the cropping parameters, the system further comprises a completion module configured to: identifying whether the shape of the first image is a preset shape, If the shape of the first image is not the preset shape, completing the first image into the preset shape; in, The image cutting module is configured to: cut the completed first image into the plurality of second images based on the cutting parameters.
4. The system of claim 1, wherein: The parameter acquisition module is further configured to: acquire the named quantitative portion of the cropped second image, The image cutting module is further configured to: name each second image of the plurality of second images based on the named quantitative part, wherein the name of each second image includes the named quantitative part and the named variable part.
5. The system of claim 1, wherein: The parameter acquisition module is further configured to: acquire the storage path of the cropped second image, The image cutting module is further configured to: store the plurality of second images in the acquired storage path.
6. The system of claim 1, wherein: The image cutting module is configured as follows: Determine the total number of reference lines and reference line positions of the first image according to the cropping parameters, constructing a plurality of selected areas in the first image according to the total number of reference lines and the positions of the reference lines, The first image is cut into the plurality of second images according to the plurality of selected areas.
7. The system of claim 6, wherein: The image cutting module is configured as follows: constructing a plurality of column selection areas of the first image according to the coordinates of the intersection points of the reference lines of the first image and respectively constructing a selection area in the plurality of selection areas in each of the plurality of column selection areas; or According to the coordinates of the intersections of the reference lines of the first image, a plurality of row selection areas of the first image are constructed, and a selection area among the plurality of selection areas is respectively constructed in each of the plurality of row selection areas.
8. Methods for cutting images, including: acquiring a first image; Acquire cropping parameters, wherein the cropping parameters include the number of rows and columns according to which the first image is cropped into a plurality of second images; as well as The first image is cropped into the plurality of second images based on the cropping parameters.
9. The method of claim 8, wherein: The first image is an image whose byte size is greater than 2 GB.
10. The method of claim 8, before cropping the first image into the plurality of second images based on the cropping parameter, the method comprising: identifying whether the shape of the first image is a preset shape, If the shape of the first image is not the preset shape, completing the first image into the preset shape, The step of cropping the first image into the plurality of second images based on the cropping parameters includes: cropping the complemented first image into the plurality of second images based on the cropping parameters.
11. The method of claim 8, further comprising: Get the named quantitative portion of the cropped second image, naming each of the plurality of second images based on the named quantitative portion, respectively; The name of each second image includes the named quantitative part and the named variable part.
12. The method of claim 8, further comprising: Get the storage path of the cropped second image. The plurality of second images are stored in the acquired storage path.
13. The method of claim 8, wherein: Cropping the first image into the plurality of second images based on the cropping parameters, comprising: Determine the total number of reference lines and reference line positions of the first image according to the cropping parameters, constructing a plurality of selected areas in the first image according to the total number of reference lines and the positions of the reference lines, The first image is cut into the plurality of second images according to the plurality of selected areas.
14. The method of claim 13, wherein: Construct multiple selections in the first image, including: constructing a plurality of column selection areas of the first image according to the coordinates of the intersection points of the reference lines of the first image and respectively constructing a selection area in the plurality of selection areas in each of the plurality of column selection areas; or According to the coordinates of the intersections of the reference lines of the first image, a plurality of row selection areas of the first image are constructed, and a selection area among the plurality of selection areas is respectively constructed in each of the plurality of row selection areas.
15. Electronic equipment, including: at least one processor; at least one memory storing computer executable instructions, Wherein, when the computer executable instructions are executed by at least one of the processors, the at least one processor is prompted to perform the method as claimed in any one of claims 8 to 14.
16. A computer-readable storage medium storing instructions, characterized in that: When the instructions are executed by at least one processor, the at least one processor is prompted to perform the method according to any one of claims 8 to 14.
