Large-volume image automatic cutting method and device based on range line
Through the automatic cropping method of large-volume images based on range line, the problems of large-volume image data consumption and low efficiency during processing of large-volume image data in the prior art are solved, and the precise segmentation and efficient processing of image data are realized, reducing data transmission and storage costs.
Patent Information
- Application Number
- CN202411441798.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-16
- Publication Date
- 2025-02-07
AI Technical Summary
When processing large-volume image data, the computing resources consume more, the efficiency is low, and may lead to the loss or redundancy of important information, affecting subsequent image analysis and understanding.
The automatic cropping method of large-volume images based on range lines is adopted to obtain the optimized sub-region through polygon extraction, boundary range determination, preliminary splitting and intersection line optimization, thereby achieving accurate segmentation of image data.
It effectively reduces the consumption of computing resources, improves processing efficiency, ensures the integrity of important information, improves the accuracy of image segmentation, and reduces data transmission and storage costs.
Smart Images

Figure CN119399222A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a method and device for automatically cutting a large volume image based on a range line. Background Art
[0002] In the field of image processing technology, the processing and analysis of large-volume images is an important task. With the development of science and technology, the resolution of imaging equipment has been continuously improved, and the acquired large-volume image data has become larger and larger. These large-volume image data are widely used in medical imaging, satellite remote sensing imaging, astronomical observation imaging and other fields. However, due to the limitations of computer storage and processing capabilities, it is very difficult to directly process large-volume image data. Therefore, how to effectively process and analyze large-volume image data has become an important research topic. In the field of computer vision technology, image segmentation is a basic task. Image segmentation is the process of dividing an image into several regions with similar features. Through image segmentation, important information in the image can be extracted and provide a basis for subsequent image analysis and understanding.
[0003] Traditional image segmentation methods are mainly based on pixels. These methods often require a lot of computing resources and are easily affected by noise and image quality. In the field of big data processing technology, big data refers to a collection of data that cannot be captured, managed, and processed using conventional database management tools. Big data processing requires efficient data storage and processing technology to achieve rapid access and analysis of large-scale data. Traditional data processing methods can no longer meet the needs of big data processing. Therefore, new data processing technologies and methods need to be developed.
[0004] Existing technologies still have some problems when processing large-volume image data. First, existing image segmentation methods consume large computing resources and have low efficiency when processing large-volume image data. Second, the existing divide-and-conquer method may cause important information to be lost or redundant when dividing large-volume image data, affecting subsequent image analysis and understanding. In addition, existing big data processing technologies also have some shortcomings in processing large-volume image data, such as slow data transmission speed and high data storage cost. Therefore, how to effectively process and analyze large-volume image data is still a problem that needs to be solved urgently. Summary of the invention
[0005] To achieve the above object, the present invention provides the following technical solutions:
[0006] According to a first aspect of the present invention, the present invention claims a method for automatically cropping a large volume image based on a range line, comprising:
[0007] Acquire a large volume image to be cut, perform polygon extraction on the large volume image, and obtain a cutting polygon of the large volume image;
[0008] Traversing the cutting polygon to determine the boundary range of the cutting polygon;
[0009] Preliminarily splitting the cutting polygon according to the boundary range of the cutting polygon and the preset output image size to obtain a plurality of first rectangular areas;
[0010] Obtaining a plurality of intersection lines between the first rectangular area and the cutting polygon, and obtaining an optimized sub-area according to the intersection lines;
[0011] Extracting pixel data within the effective range of the sub-region from the large-volume image to be cropped and saving the pixel data as a sub-region image;
[0012] After traversing all sub-regions, all sub-region images are obtained and formed into a set as the cropping result of the large-volume image.
[0013] Furthermore, the step of acquiring the large volume image to be cropped and performing polygon extraction on the large volume image to obtain a cropping polygon of the large volume image further includes:
[0014] Extracting polygons inside the large volume image, where the distance between the edge of the extracted polygon and the large volume image does not exceed a preset distance threshold;
[0015] The node coordinate information of the clipping polygon is collected.
[0016] Furthermore, the traversing the clipping polygon to determine the boundary range of the clipping polygon further includes:
[0017] Traversing the node coordinate information of the cutting polygon, and determining the upper left corner coordinate point and the lower right corner coordinate point of the cutting polygon according to the node coordinate information;
[0018] The boundary range of the cutting polygon is determined according to the upper left corner coordinate point and the lower right corner coordinate point of the cutting polygon.
[0019] Furthermore, the preliminarily splitting the cutting polygon according to the boundary range of the cutting polygon and the preset output image size to obtain a plurality of first rectangular areas also includes:
[0020] Obtaining a preset output image size, and dividing the rectangular area occupied by the cutting polygon into equal proportions to obtain a plurality of first rectangular areas;
[0021] The number of pixels in each small area is less than or equal to the preset output image size.
[0022] Furthermore, the step of obtaining a plurality of intersection lines between the first rectangular area and the cutting polygon and obtaining an optimized sub-area according to the intersection lines further includes:
[0023] Obtaining common area lines for the plurality of first rectangular areas and the cutting polygon to obtain optimized sub-areas and effective ranges;
[0024] The valid pixel values of each sub-region are within the area of the clipping polygon.
[0025] Furthermore, the step of extracting pixel data within a valid range of the sub-region from the large-volume image to be cropped and saving the pixel data as the sub-region image further includes:
[0026] For each optimized sub-region, pixel data within a valid range of the sub-region is obtained from the large volume image to be cropped, and saved as a sub-region image;
[0027] Each subregion image contains complete pixel values.
[0028] Furthermore, after traversing all the sub-regions, all the obtained sub-region images are formed into a set as the cropping result of the large volume image, which also includes:
[0029] When all optimized sub-regions are traversed, several small images after segmentation are obtained;
[0030] All the obtained sub-region images are formed into a set as the cropping result of the large volume image.
[0031] According to a second aspect of the present invention, the present invention claims protection for a large volume image automatic cutting device based on range lines, comprising:
[0032] one or more processors;
[0033] A memory having one or more programs stored thereon, when the one or more programs are executed by the one or more processors, the one or more processors implement the method for automatic cropping of large-volume images based on range lines.
[0034] The present invention relates to the field of image processing technology, and in particular to a method and device for automatically cutting large-volume images based on range lines, which obtains a boundary range by traversing the nodes of a given polygonal area, and splits the area occupied by a given polygon according to a given image size S to obtain a number of small areas, and then obtains a common area between the given polygonal area and the initially divided small areas to obtain an optimized sub-area, thereby achieving accurate segmentation of image data. The present invention effectively solves the problem of large computing resource consumption and low efficiency in the prior art when processing large-volume image data, and achieves rapid access to and analysis of large-volume image data within the storage capacity and processing capacity of the computer. The present invention reduces the data transmission and storage costs of large-volume images, and achieves rapid transmission and storage of large-volume image data and reduces the space for data transmission and storage under the conditions of limited network bandwidth and storage space. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 A workflow diagram of a method for automatically cutting a large volume image based on range lines as claimed in an embodiment of the present invention;
[0036] Figure 2 A schematic diagram of a large volume image and a cropping polygon of a method for automatic cropping of a large volume image based on range lines claimed in an embodiment of the present invention;
[0037] Figure 3 A schematic diagram of preliminary segmentation of a method for automatic cropping of a large volume image based on range lines claimed in an embodiment of the present invention;
[0038] Figure 4 A schematic diagram of optimized partitioning of a method for automatic cropping of a large volume image based on range lines as claimed in an embodiment of the present invention;
[0039] Figure 5 A first schematic diagram of a sub-region segmentation result of a range line-based large volume image automatic cropping method claimed in an embodiment of the present invention;
[0040] Figure 6 This is a second schematic diagram of a sub-region segmentation result of a range line-based large-volume image automatic cropping method claimed in an embodiment of the present invention. DETAILED DESCRIPTION
[0041] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0042] The terms "first", "second" and "third" in the present invention are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Therefore, the features defined as "first", "second" and "third" can explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "multiple" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined. All directional indications (such as up, down, left, right, front, back...) in the embodiments of the present invention are only used to explain the relative position relationship, movement, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication also changes accordingly. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices.
[0043] Reference to an "embodiment" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiment may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0044] Existing technologies mainly use the divide-and-conquer method to solve the problem of large-volume image processing. Specifically, it is to divide a large-volume image into several small blocks, and then process these small blocks separately. This method can reduce the storage and processing pressure of the computer to a certain extent, but it will also bring some problems. For example, how to effectively determine the division boundary, how to ensure that the small blocks of images after division do not lose important information, etc. In the field of image segmentation, existing methods mainly include segmentation based on edge detection, segmentation based on region growing, and algorithms based on graph segmentation. Although these methods can achieve image segmentation, they require a lot of computing resources, so they are less efficient when processing large-volume images. In the field of big data processing, existing technologies mainly include distributed computing, cloud computing, data mining, etc. These technologies can improve the ability of big data processing to a certain extent, but due to the particularity of large-volume image data, these technologies still have some problems when processing large-volume image data.
[0045] According to the first embodiment of the present invention, the present invention claims a method for automatically cutting a large volume image based on a range line, referring to Figure 1 ,include:
[0046] Acquire a large volume image to be cut, perform polygon extraction on the large volume image, and obtain a cutting polygon of the large volume image;
[0047] Traversing the cutting polygon to determine the boundary range of the cutting polygon;
[0048] Preliminarily splitting the cutting polygon according to the boundary range of the cutting polygon and the preset output image size to obtain a plurality of first rectangular areas;
[0049] Obtaining a plurality of intersection lines between the first rectangular area and the cutting polygon, and obtaining an optimized sub-area according to the intersection lines;
[0050] Extracting pixel data within the effective range of the sub-region from the large-volume image to be cropped and saving the pixel data as a sub-region image;
[0051] After traversing all sub-regions, all sub-region images are obtained and formed into a set as the cropping result of the large-volume image.
[0052] Furthermore, the step of acquiring the large volume image to be cropped and performing polygon extraction on the large volume image to obtain a cropping polygon of the large volume image further includes:
[0053] Extracting polygons inside the large volume image, where the distance between the edge of the extracted polygon and the large volume image does not exceed a preset distance threshold;
[0054] The node coordinate information of the clipping polygon is collected.
[0055] Furthermore, the traversing the clipping polygon to determine the boundary range of the clipping polygon further includes:
[0056] Traversing the node coordinate information of the cutting polygon, and determining the upper left corner coordinate point and the lower right corner coordinate point of the cutting polygon according to the node coordinate information;
[0057] The boundary range of the cutting polygon is determined according to the upper left corner coordinate point and the lower right corner coordinate point of the cutting polygon.
[0058] In this embodiment, the nodes of the polygon are traversed to obtain the coordinates of the upper left corner (minX, minY) and the lower right corner (maxX, maxY) of the polygon, so as to determine the boundary range of the given polygon.
[0059] Furthermore, the preliminarily splitting the cutting polygon according to the boundary range of the cutting polygon and the preset output image size to obtain a plurality of first rectangular areas also includes:
[0060] Obtaining a preset output image size, and dividing the rectangular area occupied by the cutting polygon into equal proportions to obtain a plurality of first rectangular areas;
[0061] The number of pixels in each small area is less than or equal to the preset output image size.
[0062] Furthermore, the step of obtaining a plurality of intersection lines between the first rectangular area and the cutting polygon and obtaining an optimized sub-area according to the intersection lines further includes:
[0063] Obtaining common area lines for the plurality of first rectangular areas and the cutting polygon to obtain optimized sub-areas and effective ranges;
[0064] The valid pixel values of each sub-region are within the area of the clipping polygon.
[0065] Furthermore, the step of extracting pixel data within a valid range of the sub-region from the large-volume image to be cropped and saving the pixel data as the sub-region image further includes:
[0066] For each optimized sub-region, pixel data within a valid range of the sub-region is obtained from the large volume image to be cropped, and saved as a sub-region image;
[0067] Each subregion image contains complete pixel values.
[0068] Furthermore, after traversing all the sub-regions, all the obtained sub-region images are formed into a set as the cropping result of the large volume image, which also includes:
[0069] When all optimized sub-regions are traversed, several small images after segmentation are obtained;
[0070] All the obtained sub-region images are formed into a set as the cropping result of the large volume image.
[0071] This embodiment provides a large volume image cropping method based on range lines and image size, and the specific steps are as follows:
[0072] Reference Figure 2 , obtain a large volume image T and a given polygon P. The size of the large volume image T is 49461×44376 pixels, and the given polygon P can be an irregular polygon.
[0073] Traverse the nodes of the given polygon and get the boundary range minX, maxX, minY, maxY. By traversing the nodes of the given polygon, the coordinates of the upper left corner of the given polygon are (1997, 3785) and the coordinates of the lower right corner are (46850, 40731). Therefore, minX = 1997, maxX = 46850, minY = 3785, maxY = 40731.
[0074] Reference Figure 3 , according to the given image size S, the area occupied by the given polygon is split into several small areas. The given image size S is 20000×20000 pixels. Therefore, the area occupied by the given polygon is divided into 4 small areas of no more than 20000×20000 in equal proportion.
[0075] Reference Figure 4 , find the intersection of the given polygon and the small area initially divided to get the optimized sub-area. By finding the common area between the small area initially divided and the given polygon area, we get the optimized sub-area and its effective range, which is 7 at this time.
[0076] Reference Figure 5 , traverse the optimized sub-regions, obtain the pixel data within the effective range of the sub-region from the large volume image T, and save it as the sub-region image. For each optimized sub-region, obtain the pixel data within the effective range of the sub-region from the large volume image T, and save it as the sub-region image.
[0077] Reference Figure 6 , the sub-region traversal is completed, and several small images after segmentation are obtained. When all optimized sub-regions are traversed, several small images after segmentation are obtained. The size of these small images is no more than 20000×20000 pixels. Through the above steps, a large volume image can be cut into several small images no larger than a given size, thereby reducing the consumption of computing resources and improving processing efficiency. At the same time, by accurately determining the boundary range of a given polygon and performing optimized sub-region segmentation, the integrity of important information is ensured and the accuracy of image segmentation is improved.
[0078] According to a second embodiment of the present invention, the present invention claims protection for a large volume image automatic cropping device based on range lines, comprising:
[0079] one or more processors;
[0080] A memory having one or more programs stored thereon, when the one or more programs are executed by the one or more processors, the one or more processors implement the method for automatic cropping of large-volume images based on range lines.
[0081] Compared with the existing technology, the beneficial effects of this technical solution are as follows:
[0082] 1. Efficient processing of large-volume image data: This technical solution effectively solves the problem of large computing resource consumption and low efficiency in the existing technology when processing large-volume image data by cutting the large-volume image into several small-block images not larger than S and assigning the pixel values outside the given polygonal area to 0. At the same time, since the size of each small-block image is not larger than S, it is possible to quickly access and analyze large-volume image data within the storage and processing capabilities of the computer.
[0083] 2. Accurately segment image data: This technical solution obtains the boundary range minX, maxX, minY, maxY by traversing the nodes of a given polygonal area, and splits the area occupied by a given polygon according to the given image size S to obtain several small areas, and then obtains the common area between the given polygonal area and the initially segmented small area to obtain the optimized sub-area, thereby achieving accurate segmentation of image data. Compared with the existing technology, this technical solution will not lose important information or generate redundancy when segmenting image data, thereby improving the accuracy and quality of segmentation.
[0084] 3. Reduce data transmission and storage costs: This technical solution can reduce the data transmission and storage costs of large-volume images by cutting large-volume images into several small-block images. Since the size of each small-block image is not large, large-volume image data can be quickly transmitted and stored under the condition of limited network bandwidth and storage space. At the same time, since the pixel values outside the given polygon area are assigned to 0, the space for data transmission and storage can be reduced to a certain extent.
[0085] 4. Easy parallel processing: This technical solution cuts a large volume image into several small blocks, so that each small block can be processed independently. Therefore, this technical solution can use distributed computing, cloud computing and other technologies to achieve parallel processing of large volume image data, thereby further improving processing efficiency.
[0086] 5. Widely used in multiple fields: This technical solution can be applied not only to medical imaging, satellite remote sensing imaging, astronomical observation imaging and other fields, but also to other big data processing fields that need to process large-volume image data. Therefore, this technical solution has broad application prospects. For example, for brain CT images, one or more regions of interest (usually key manifestation areas for the occurrence or non-occurrence of a certain disease) can be preset, and the images of these areas can be separately segmented by the method of the present invention, so that doctors can directly obtain key information from the images of these areas and improve the efficiency of medical treatment.
[0087] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0088] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit may be implemented in the form of hardware or in the form of software functional units. The above is only an implementation mode of the present invention, and does not limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by using the contents of the present invention specification and drawings, or directly or indirectly used in other related technical fields, is also included in the patent protection scope of the present invention.
[0089] The specific implementation methods of the invention are described in detail above, but they are only examples, and the invention is not limited to the specific implementation methods described above. For those skilled in the art, any equivalent modification or substitution of the invention is also within the scope of the invention, therefore, the equalization, modification, improvement, etc. made without departing from the spirit and principle of the invention should be included in the scope of the invention.
Claims
1. A method for automatically cropping a large volume image based on range lines, characterized in that: include: Acquire a large volume image to be cut, perform polygon extraction on the large volume image, and obtain a cutting polygon of the large volume image; Traversing the cutting polygon to determine the boundary range of the cutting polygon; Preliminarily splitting the cutting polygon according to the boundary range of the cutting polygon and the preset output image size to obtain a plurality of first rectangular areas; Obtaining a plurality of intersection lines between the first rectangular area and the cutting polygon, and obtaining an optimized sub-area according to the intersection lines; Extracting pixel data within the effective range of the sub-region from the large-volume image to be cropped and saving the pixel data as a sub-region image; After traversing all sub-regions, all sub-region images are obtained and formed into a set as the cropping result of the large-volume image.
2. The method for automatically cropping a large volume image based on range lines according to claim 1, characterized in that: The step of acquiring a large volume image to be cut, performing polygon extraction on the large volume image, and obtaining a cutting polygon of the large volume image further includes: Extracting polygons inside the large volume image, where the distance between the edge of the extracted polygon and the large volume image does not exceed a preset distance threshold; The node coordinate information of the clipping polygon is collected.
3. The method for automatically cropping a large volume image based on range lines according to claim 2, characterized in that: The traversing the cutting polygon to determine the boundary range of the cutting polygon further includes: Traversing the node coordinate information of the cutting polygon, and determining the upper left corner coordinate point and the lower right corner coordinate point of the cutting polygon according to the node coordinate information; The boundary range of the cutting polygon is determined according to the upper left corner coordinate point and the lower right corner coordinate point of the cutting polygon.
4. The method for automatically cropping a large volume image based on range lines according to claim 1, characterized in that: The method of preliminarily splitting the cutting polygon according to the boundary range of the cutting polygon and the preset output image size to obtain a plurality of first rectangular areas further includes: Obtaining a preset output image size, and dividing the rectangular area occupied by the cutting polygon into equal proportions to obtain a plurality of first rectangular areas; The number of pixels in each small area is less than or equal to the preset output image size.
5. The method for automatically cropping a large volume image based on range lines according to claim 1, characterized in that: The step of obtaining a plurality of intersection lines between the first rectangular area and the cutting polygon and obtaining an optimized sub-area according to the intersection lines further includes: Obtaining common area lines for the plurality of first rectangular areas and the cutting polygon to obtain optimized sub-areas and effective ranges; The valid pixel values of each sub-region are within the area of the clipping polygon.
6. The method for automatically cropping a large volume image based on range lines according to claim 1, characterized in that: The step of extracting pixel data within the effective range of the sub-region from the large volume image to be cut and saving the pixel data as the sub-region image also includes: For each optimized sub-region, pixel data within a valid range of the sub-region is obtained from the large volume image to be cropped, and saved as a sub-region image; Each subregion image contains complete pixel values.
7. The method for automatically cropping a large volume image based on range lines according to claim 1, characterized in that: After traversing all the sub-regions, all the obtained sub-region images are formed into a set as the cropping result of the large volume image, and further comprising: When all optimized sub-regions are traversed, several small images after segmentation are obtained; All the obtained sub-region images are formed into a set as the cropping result of the large volume image.
8. A large volume image automatic cutting device based on range lines, characterized in that: include: one or more processors; A memory having one or more programs stored thereon, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement a range line-based large-volume image automatic cropping method according to any one of claims 1 to 7.