Image cutting method, electronic device and storage medium

By cutting out the target contrast image in the angiographic image and removing redundant blood vessels, the problems of slow vascular analysis and low accuracy are solved, and the region of interest is quickly determined, which improves the analysis efficiency and accuracy.

CN120013960BActive Publication Date: 2025-08-29UNION STRONG (BEIJING) TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510016616.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-06
Publication Date
2025-08-29
Estimated Expiration
2045-01-06

AI Technical Summary

Technical Problem

In neurosurgery, excessive vascular interference in angiography images interferes with clinical judgment, resulting in slow analysis speed and low accuracy. It is urgent to quickly determine the region of interest to improve analysis efficiency and accuracy.

Method used

By acquiring the angiographic image, the first projected image is determined and the blood vessel direction information and dense gradient curve are extracted, the target contrast image is cut out, redundant blood vessels are eliminated, and the maximum intensity projection and threshold segmentation technology are used to determine the horizontal truncation position to realize automatic selection of the region of interest.

Benefits of technology

Quickly determine the region of interest of blood vessels, reduce the analysis range, speed up the vascular analysis, and improve analysis efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120013960B_ABST
    Figure CN120013960B_ABST
Patent Text Reader

Abstract

The present application discloses an image cropping method, electronic device, and storage medium. The method includes: determining a first projection image based on an angiographic image; determining vascular direction information and a vascular density gradient curve based on the first projection image; determining a height cutoff position and a second projection image based on the vascular direction information and the vascular density gradient curve; determining a first horizontal cutoff position and a second horizontal cutoff position in the second projection image; determining a third projection image based on the angiographic image, the height cutoff position, the first horizontal cutoff position, and the second horizontal cutoff position; determining a third horizontal cutoff position and a fourth horizontal cutoff position in the third projection image; and cropping the target angiographic image based on the height cutoff position, the first horizontal cutoff position, the second horizontal cutoff position, the third horizontal cutoff position, and the fourth horizontal cutoff position. Utilizing the present application solution can accelerate vascular analysis and improve the efficiency and accuracy of vascular analysis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application generally relates to the field of image processing technology. More specifically, the present application relates to an image cropping method, an electronic device, and a storage medium. Background Art

[0002] During neurosurgery, on-site scanning of three-dimensional digital subtraction angiography (3D-DSA) is often required as vascular viewing data to plan the surgery. During the surgical planning process, the lesion area and nearby blood vessels need to be analyzed to ultimately determine the surgical plan. However, too many blood vessels in the angiography image will interfere with clinical judgment. Therefore, for clinical treatment scenarios, automatic selection of regions of interest (ROI) is very important. Redundant blood vessels can be removed, thereby speeding up the analysis and improving analysis efficiency and accuracy.

[0003] In view of this, there is an urgent need to provide an image cropping method so that the region of interest of the blood vessels can be quickly determined in the angiography image, effectively reducing the scope of blood vessel analysis, speeding up blood vessel analysis, and improving the efficiency and accuracy of blood vessel analysis. Summary of the Invention

[0004] To address at least one or more of the above-mentioned technical issues, this application provides, in various aspects, an image cropping method, an electronic device, and a storage medium. This image cropping method can rapidly identify a region of interest (ROI) within a blood vessel in angiographic images, effectively reducing the scope of vessel analysis, accelerating vessel analysis, and improving the efficiency and accuracy of vessel analysis.

[0005] In a first aspect, the present application provides an image cropping method, comprising: acquiring an angiography image, and determining a first projection image based on the angiography image; determining blood vessel direction information and a blood vessel dense gradient curve based on the first projection image; determining a height cutoff position based on the blood vessel direction information and the blood vessel dense gradient curve, and determining a second projection image based on the height cutoff position and the first projection image; determining a first horizontal cutoff position and a second horizontal cutoff position in a first horizontal direction in the second projection image; determining a third projection image based on the angiography image, the height cutoff position, the first horizontal cutoff position, and the second horizontal cutoff position; wherein the projection directions of the first projection image and the third projection image are perpendicular; determining a third horizontal cutoff position and a fourth horizontal cutoff position in the second horizontal direction in the third projection image; and cropping the angiography image to obtain a target angiography image based on the height cutoff position, the first horizontal cutoff position, the second horizontal cutoff position, the third horizontal cutoff position, and the fourth horizontal cutoff position.

[0006] In some embodiments, determining the blood vessel direction information based on the first projection image includes: performing threshold segmentation on the first projection image to obtain a threshold segmented image; determining the largest connected domain in the threshold segmented image, and removing the remaining connected domains except the largest connected domain to obtain a cleaned projection image; extracting a first sampling area and a second sampling area at the top and bottom of the cleaned projection image based on a preset number of sampling pixel rows; and determining the blood vessel direction information based on the first sampling area and the second sampling area.

[0007] In some embodiments, determining the blood vessel direction information based on the first sampling area and the second sampling area includes: determining the blood vessel skeletons in the first sampling area and the second sampling area respectively, obtaining a first blood vessel skeleton map corresponding to the first sampling area and a second blood vessel skeleton map corresponding to the second sampling area; determining the skeleton pixels corresponding to the first blood vessel skeleton map and the skeleton pixel sum corresponding to the second blood vessel skeleton map respectively, obtaining a first blood vessel number parameter corresponding to the first blood vessel skeleton map and a second blood vessel number parameter corresponding to the second blood vessel skeleton map; determining the pixel sum of the first sampling area and the second sampling area respectively, obtaining a first sampling pixel sum corresponding to the first sampling area and a second sampling pixel sum corresponding to the second sampling area; determining the blood vessel direction information based on the first blood vessel number parameter, the second blood vessel number parameter, the first sampling pixel sum, and the second sampling pixel sum.

[0008] In some embodiments, determining the blood vessel direction information based on the first blood vessel number parameter, the second blood vessel number parameter, the first sampling pixel sum, and the second sampling pixel sum includes: determining a first blood vessel ratio parameter based on the first blood vessel number parameter and the first sampling pixel sum; determining a second blood vessel ratio parameter based on the second blood vessel number parameter and the second sampling pixel sum; comparing the first blood vessel ratio parameter and the second blood vessel ratio parameter, and determining the blood vessel direction information based on the comparison result; wherein the blood vessel direction information includes the head end blood vessel direction and the foot end blood vessel direction.

[0009] In some embodiments, determining the blood vessel density gradient curve based on the first projection image includes: performing a blood vessel scan on the first projection image from the foot end blood vessel direction to the head end blood vessel direction to obtain a blood vessel density change curve; and determining the blood vessel density gradient curve based on the blood vessel density change curve.

[0010] In some embodiments, determining the height cutoff position based on the blood vessel direction information and the blood vessel density gradient curve includes: determining the blood vessel density mutation position based on the blood vessel density gradient curve; and moving the blood vessel density mutation position toward the head end blood vessel direction based on a preset offset threshold to obtain the height cutoff position.

[0011] In some embodiments, determining the first horizontal truncation position and the second horizontal truncation position in the first horizontal direction in the second projection image includes: scanning pixel rows one by one from the first vertical boundary to the second vertical boundary in the first horizontal direction until the pixel point corresponding to the blood vessel is scanned, and recording the first scanning distance corresponding to each pixel row; using the minimum first scanning distance among the first scanning distances corresponding to each pixel row as the distance between the first horizontal truncation position and the first vertical boundary; scanning pixel rows one by one from the second vertical boundary to the first vertical boundary in the first horizontal direction until the pixel point corresponding to the blood vessel is scanned, and recording the second scanning distance corresponding to each pixel row; using the minimum second scanning distance among the second scanning distances corresponding to each pixel row as the distance between the second horizontal truncation position and the second vertical boundary.

[0012] In some embodiments, determining the third projection image based on the angiography image, the height cutoff position, the first horizontal cutoff position and the second horizontal cutoff position includes: cutting out the intermediate angiography image from the angiography image based on the height cutoff position, the first horizontal cutoff position and the second horizontal cutoff position; and projecting the intermediate angiography image to obtain the third projection image.

[0013] In a second aspect, the present application provides an electronic device, comprising: a processor; and a memory on which executable code is stored. When the program code is executed by the processor, the electronic device implements the method described above.

[0014] In a third aspect, the present application provides a non-transitory machine-readable storage medium having executable code stored thereon, which, when executed by a processor, enables the method described above to be implemented.

[0015] The technical solution provided by this application may have the following beneficial effects:

[0016] The image cropping method, electronic device, and storage medium provided in this application acquire an angiographic image, determine a first projection image based on the angiographic image, further determine vascular direction information and a vascular density gradient curve based on the first projection image, further determine a height cutoff position based on the vascular direction information and the vascular density gradient curve, and determine a second projection image based on the height cutoff position and the first projection image, thereby removing redundant blood vessels in the height direction. Subsequently, a first horizontal cutoff position and a second horizontal cutoff position in the first horizontal direction are determined in the second projection image, thereby removing redundant blood vessels in the first horizontal direction.

[0017] Furthermore, the present application can determine a third projection image based on the angiographic image, the height cutoff position, the first horizontal cutoff position, and the second horizontal cutoff position, wherein the projection directions of the first and third projection images are perpendicular. Furthermore, the third horizontal cutoff position and the fourth horizontal cutoff position in the second horizontal direction are determined in the third projection image, thereby removing redundant blood vessels in the second horizontal direction. Furthermore, based on the height cutoff position, the first horizontal cutoff position, the second horizontal cutoff position, the third horizontal cutoff position, and the fourth horizontal cutoff position, a target angiographic image is cropped from the angiographic image, thereby cropping the target angiographic image from the original angiographic image and determining a region of interest for vascular analysis.

[0018] In general, this application can quickly determine the region of interest of blood vessels in angiography images, effectively reduce the scope of blood vessel analysis, speed up blood vessel analysis, and improve the efficiency and accuracy of blood vessel analysis. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The above and other objects, features and advantages of the exemplary embodiments of the present application will become readily understood by reading the detailed description below with reference to the accompanying drawings. In the accompanying drawings, several embodiments of the present application are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:

[0020] Figure 1 An exemplary flow chart of an image cropping method according to some embodiments of the present application is shown;

[0021] Figure 2 An exemplary flow chart showing an image cropping method according to some other embodiments of the present application is shown;

[0022] Figure 3 An exemplary flow chart showing an image cropping method according to some further embodiments of the present application is shown;

[0023] Figure 4 A schematic diagram showing a first projected image in the image cropping method according to an embodiment of the present application is shown;

[0024] Figure 5 A schematic diagram showing a threshold value segmentation image in the image cropping method according to an embodiment of the present application is shown;

[0025] Figure 6 A schematic diagram showing a third projected image in the image cropping method according to an embodiment of the present application is shown;

[0026] Figure 7 A schematic diagram showing a first sampling area in the image cropping method according to an embodiment of the present application is shown;

[0027] Figure 8A schematic diagram showing a second sampling area in the image cropping method according to an embodiment of the present application is shown;

[0028] Figure 9 A schematic diagram showing a first blood vessel skeleton image corresponding to a first sampling area in an image cropping method according to an embodiment of the present application is shown;

[0029] Figure 10 A schematic diagram showing a second blood vessel skeleton image corresponding to a second sampling area in the image cropping method according to an embodiment of the present application is shown;

[0030] Figure 11 A schematic diagram showing a blood vessel scan performed on a first projection image in an image cropping method according to an embodiment of the present application is shown;

[0031] Figure 12 A schematic diagram showing a blood vessel density variation curve in an image cropping method according to an embodiment of the present application is shown;

[0032] Figure 13 A schematic diagram of a blood vessel dense gradient curve in an image cropping method according to an embodiment of the present application is shown;

[0033] Figure 14 It is a structural diagram of an electronic device shown in an embodiment of the present application. DETAILED DESCRIPTION

[0034] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. For the sake of simplicity and clarity of explanation, figure marks may be repeated in the drawings to indicate corresponding or similar elements where appropriate. In addition, this application sets forth many specific details in order to provide a thorough understanding of the embodiments described herein. However, those skilled in the art will understand that the embodiments described herein can be practiced without these specific details. In other cases, well-known methods, processes, and components are not described in detail to avoid obscuring the embodiments described herein. Moreover, this description should not be regarded as limiting the scope of the embodiments described herein. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of this application.

[0035] It should be understood that the terms "first" or "second" and the like in the claims, description, and drawings disclosed in this application are used to distinguish different objects rather than to describe a specific order. The terms "include" and "comprising" used in the description and claims of this application indicate the presence of the described features, integers, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or combinations thereof.

[0036] It should also be understood that the terms used in this specification are for the purpose of describing specific embodiments only and are not intended to limit this application. As used in this specification and claims, the singular forms "a," "an," and "the" are intended to include the plural forms unless the context clearly indicates otherwise. It should also be further understood that the term "and / or" as used in this specification and claims refers to any and all possible combinations of one or more of the associated listed items, including and including these combinations.

[0037] As used in this specification and claims, the term "if" can be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.

[0038] During neurosurgery, on-site scanning of three-dimensional digital subtraction angiography (3D-DSA) is often required as vascular viewing data to plan the surgery. During the surgical planning process, the lesion area and nearby blood vessels need to be analyzed to ultimately determine the surgical plan. However, too many blood vessels in the angiography image will interfere with clinical judgment. Therefore, for clinical treatment scenarios, automatic selection of regions of interest (ROI) is very important. Redundant blood vessels can be removed, thereby speeding up the analysis and improving analysis efficiency and accuracy.

[0039] In view of this, there is an urgent need to provide an image cropping method so that the region of interest of the blood vessels can be quickly determined in the angiography image, effectively reducing the scope of blood vessel analysis, speeding up blood vessel analysis, and improving the efficiency and accuracy of blood vessel analysis.

[0040] The specific implementation of the present application will be described in detail below with reference to the accompanying drawings.

[0041] Figure 1 An exemplary flow chart of an image cropping method according to some embodiments of the present application is shown. Figure 4 FIG2 shows a schematic diagram of a first projection image in an image cropping method according to an embodiment of the present application. Figure 6 A schematic diagram showing the third projection image in the image cropping method of an embodiment of the present application is shown. Figure 1 、 Figure 4 and Figure 6The image cropping method shown in the embodiment of the present application may include:

[0042] In step S101, an angiographic image is acquired, and a first projection image is determined based on the angiographic image. In the embodiment of the present application, the angiographic image is a three-dimensional image formed by performing a three-dimensional digital subtraction angiography (3D-DSA) scan. This image can provide more detailed information about the vascular structure, making the observation of the blood vessels more intuitive and detailed, and helping doctors to more accurately diagnose and treat vascular diseases.

[0043] In addition, the embodiment of the present application can use Maximum Intensity Projection (MIP) to perform coronal plane (a term commonly used in medical imaging and anatomy, which refers to a section that cuts the human body into two parts along the left and right directions) projection processing on the angiography image, thereby obtaining the following: Figure 4 The first projection image is shown. Maximum intensity projection processes volume data and projects the pixels with the highest intensity, creating a two-dimensional image. This effectively reflects differences in tissue density and reveals abnormal changes, morphology, and enhanced deformation of blood vessels.

[0044] In step S102, the blood vessel direction information and the blood vessel density gradient curve are determined based on the first projection image. In the embodiment of the present application, the aforementioned blood vessel direction information refers to the direction of the end of the human body to which the blood vessel in the first projection image is close, such as the direction close to the head end or the direction close to the foot end. Figure 4 As shown, through calculation processing, it can be determined that the blood vessels at the top of the first projection image belong to the direction close to the head end, while the blood vessels at the bottom of the first projection image belong to the direction close to the foot end.

[0045] Furthermore, the vascular density gradient curve in the embodiments of the present application is used to reflect the changing trend and magnitude of the vascular density within each pixel row in the first projection image. In the anterior circulation (internal carotid artery system), the location with the maximum gradient in the vascular density gradient curve is generally at the internal carotid artery (ICA) bifurcation, while in the posterior circulation (vertebrobasilar artery system), the location with the maximum gradient in the vascular density gradient curve is generally at the basilar artery apex. It will be appreciated that the location with the maximum gradient in the vascular density gradient curve must be determined based on the actual vascular density gradient curve, and this application does not impose any restrictions on the location of the maximum gradient in the vascular density gradient curve.

[0046] In step S103, a height cutoff position is determined based on the vessel direction information and the vessel density gradient curve, and a second projection image is determined based on the height cutoff position and the first projection image. In this embodiment of the present application, the position with the maximum gradient can be used as a key point, i.e., the location of a sudden change in vessel density. The vessel direction information can then be used to adjust the position based on the key point to determine the height cutoff position.

[0047] For example, if the first projection image is Figure 4 In the image shown, if the current surgical plan requires treatment of a lesion located in the coronary artery, the key point in the first projection image can be used as the starting point and moved toward the head end (i.e., toward the top of the image) by a certain distance, for example, 20 mm, to avoid image information loss due to cropping. The position of the key point after the shift is the height cutoff position. After determining the height cutoff position, the image from the height cutoff position to the top of the image can be cropped from the first projection image to obtain the second projection image.

[0048] For example, the first projection image is Figure 4 The image shown is opposite to the above exemplary description. In the current surgical plan, treatment is required for a lesion located in the head and neck. Starting from the key point in the first projection image, the key point can be moved a certain distance, for example, 30 mm, toward the foot (i.e., toward the bottom of the image). The position of the key point after the movement is the height cutoff position. Once the height cutoff position is determined, the image from the height cutoff position to the bottom of the image can be cropped from the first projection image to obtain the second projection image.

[0049] In step S104, a first horizontal truncation position and a second horizontal truncation position are determined in the second projection image in the first horizontal direction. In the embodiment of the present application, the aforementioned first horizontal direction refers to the horizontal direction in the projection direction of the first projection image. For example, if the projection direction of the first projection image is the coronal plane projection direction, the first horizontal direction is the left-right horizontal direction of the human body. Furthermore, the first horizontal truncation position and the second horizontal truncation position can be determined by detecting the boundary of the blood vessel range.

[0050] In step S105, the third projection image is determined based on the angiography image, the height cutoff position, the first horizontal cutoff position and the second horizontal cutoff position. In an embodiment of the present application, the projection directions of the first projection image and the third projection image are perpendicular. Assuming that the projection direction of the first projection image is the coronal plane projection direction, the projection direction of the third projection image can be the sagittal plane (Sagittal plane, a term commonly used in medical imaging and anatomy, refers to the anatomical plane that divides the human body into two left and right parts along the front-back direction of the human body) projection. In this case, when the height cutoff position, the first horizontal cutoff position and the second horizontal cutoff position are determined, a rectangular stereoscopic image can be cut out from the angiography image. The length of the rectangular stereoscopic image is the distance in the front-back direction of the human body, the width is the distance between the first horizontal cutoff position and the second horizontal cutoff position, and the height is the distance from the height cutoff position to the top or bottom of the image of the first projection image. The rectangular stereoscopic image can then be projected in the sagittal plane, and the projection method can also use maximum intensity projection to obtain the following: Figure 6 The third projection image is shown.

[0051] In step S106, a third horizontal truncation position and a fourth horizontal truncation position are determined in the third projection image along the second horizontal direction. In this embodiment of the present application, the second horizontal direction refers to a horizontal direction relative to the projection direction of the third projection image. For example, if the projection direction of the third projection image is a sagittal plane, the second horizontal direction is the front-back horizontal direction of the human body. Furthermore, the third and fourth horizontal truncation positions can be determined by detecting the boundaries of the vascular range.

[0052] In step S107, a target angiographic image is cropped from the angiographic image based on the height cutoff position, the first horizontal cutoff position, the second horizontal cutoff position, the third horizontal cutoff position, and the fourth horizontal cutoff position. Once the height cutoff position, the first horizontal cutoff position, the second horizontal cutoff position, the third horizontal cutoff position, and the fourth horizontal cutoff position are determined, a stereoscopic image can be cropped from the angiographic image. The length of this rectangular stereoscopic image is the distance between the third and fourth horizontal cutoff positions, the width is the distance between the first and second horizontal cutoff positions, and the height is the distance from the height cutoff position to the top or bottom of the first projection image. This stereoscopic image can be used as the target angiographic image for subsequent vascular analysis.

[0053] The embodiment of the present application obtains an angiographic image and determines a first projection image based on the angiographic image, then determines vascular direction information and a vascular density gradient curve based on the first projection image, then determines a height cutoff position based on the vascular direction information and the vascular density gradient curve, and determines a second projection image based on the height cutoff position and the first projection image, thereby removing some redundant blood vessels in the height direction. Then, a first horizontal cutoff position and a second horizontal cutoff position in the first horizontal direction are determined in the second projection image, thereby removing some redundant blood vessels in the first horizontal direction. Furthermore, the present application can determine a third projection image based on the angiographic image, the height cutoff position, the first horizontal cutoff position, and the second horizontal cutoff position, wherein the projection directions of the first and third projection images are perpendicular, and then determine a third horizontal cutoff position and a fourth horizontal cutoff position in the second horizontal direction in the third projection image, thereby removing some redundant blood vessels in the second horizontal direction. Then, based on the height cutoff position, the first horizontal cutoff position, the second horizontal cutoff position, the third horizontal cutoff position, and the fourth horizontal cutoff position, a target angiographic image is cropped from the angiographic image, thereby cropping the target angiographic image from the original angiographic image and determining the region of interest for vascular analysis. In general, this application can quickly determine the region of interest of a blood vessel in an angiographic image, effectively reducing the scope of vascular analysis, accelerating vascular analysis, and improving the efficiency and accuracy of vascular analysis.

[0054] In some embodiments, the process of determining the blood vessel direction information and the blood vessel density gradient curve can be further designed. Figure 2 、 Figures 5 to 13 The process of determining the vascular direction information and vascular density gradient curve is described in detail. Figure 2 、 Figures 5 to 13 The image cropping method shown in the embodiment of the present application may include:

[0055] In step S201, the first projection image is subjected to threshold segmentation to obtain a threshold segmented image. In the embodiment of the present application, the first projection image can be subjected to threshold segmentation by using a fixed threshold or automatic threshold segmentation using the Otsu method, thereby obtaining the following: Figure 5 The threshold segmentation image shown in the figure. Using a fixed threshold requires presetting the segmentation threshold. The Otsu's Method, also known as the Maximum Inter-Class Variance Method, is an adaptive image threshold segmentation method. Its core concept is to automatically segment the image into background and foreground (target) based on the image's grayscale distribution, maximizing the inter-class variance between the segmented foreground and background to achieve optimal edge segmentation.

[0056] It is understandable that there are various ways of threshold segmentation. In practical applications, it is necessary to determine the appropriate threshold segmentation method based on the actual application situation. This application does not impose any restrictions in this regard.

[0057] In step S202, the largest connected domain is determined in the threshold segmented image, and the remaining connected domains except the largest connected domain are removed to obtain a cleaned projection image. In an embodiment of the present application, the connectedComponents function in the OpenCV library can be used, for example, to mark the connected domains of the threshold segmented image, and a unique label can be assigned to each connected domain. Furthermore, the connectedComponentsWithStats function in the OpenCV library can be used, for example, to obtain statistical information of each connected domain, including the area of ​​each connected domain, so that the remaining connected domains except the largest connected domain can be removed based on the area of ​​each connected domain to obtain a cleaned projection image.

[0058] In step S203, a first sampling area and a second sampling area are extracted at the top and bottom of the cleaned projection image based on a preset number of sampling pixel rows. Figure 7 and Figure 8 As shown, M rows of pixels can be extracted from the top of the cleaned projection image to the bottom of the image, thereby obtaining a first sampling area. Similarly, M rows of pixels can be extracted from the bottom of the cleaned projection image to the top of the image, thereby obtaining a second sampling area. Wherein, M is a positive integer. In the embodiment of the present application, the preset number of sampling pixel rows M can be set to 20 rows by way of example. In actual applications, the preset number of sampling pixel rows M should be reasonably set according to the actual application situation. The present application does not impose any restrictions in this regard.

[0059] In step S204, the blood vessel direction information is determined based on the first sampling area and the second sampling area. In the embodiment of the present application, the blood vessel skeletons in the first sampling area and the second sampling area can be determined respectively, and the following is obtained: Figure 9 and Figure 10 The first vascular skeleton image corresponding to the first sampling area and the second vascular skeleton image corresponding to the second sampling area are shown. Thinning can be used to determine the vascular skeletons in the first and second sampling areas. The thinning operation aims to reduce the object boundary pixels in the binary image to a single pixel width while maintaining the object's shape features. Exemplarily, thinning can be achieved using erosion and dilation operations, iteratively eroding the image and then performing an XOR operation with the original image to gradually thin the image.

[0060] Then, the skeleton pixels corresponding to the first blood vessel skeleton image and the skeleton pixel sum corresponding to the second blood vessel skeleton image can be determined respectively to obtain a first blood vessel quantity parameter corresponding to the first blood vessel skeleton image and a second blood vessel quantity parameter corresponding to the second blood vessel skeleton image. The skeleton pixel sum corresponding to the first blood vessel skeleton image can be calculated as the first blood vessel quantity parameter corresponding to the first blood vessel skeleton image, and the skeleton pixel sum corresponding to the second blood vessel skeleton image can be calculated as the second blood vessel quantity parameter corresponding to the second blood vessel skeleton image.

[0061] Next, the pixel sums of the first sampling area and the second sampling area are determined respectively to obtain a first sampling pixel sum corresponding to the first sampling area and a second sampling pixel sum corresponding to the second sampling area.

[0062] Furthermore, the vessel direction information is determined based on the first vessel number parameter, the second vessel number parameter, the first sampled pixel sum, and the second sampled pixel sum. In an embodiment of the present application, a first vessel ratio parameter can be determined based on the first vessel number parameter and the first sampled pixel sum. Specifically, the first vessel ratio parameter can be calculated using the following formula 1:

[0063]

[0064] Wherein, ratio1 is the first blood vessel ratio parameter, S1 is the first sampled pixel sum, and N1 is the first blood vessel number parameter.

[0065] Similarly, the second blood vessel ratio parameter can be determined based on the second blood vessel number parameter and the second sampled pixel sum. Specifically, the second blood vessel ratio parameter can be calculated using the following formula 2:

[0066]

[0067] Wherein, ratio2 is the second blood vessel ratio parameter, S2 is the second sampled pixel sum, and N2 is the second blood vessel number parameter.

[0068] Furthermore, the first blood vessel ratio parameter and the second blood vessel ratio parameter can be compared, and the blood vessel direction information can be determined based on the comparison result. The blood vessel direction information includes the head end blood vessel direction and the foot end blood vessel direction. It can be understood that if the first blood vessel ratio parameter is smaller than the second blood vessel ratio parameter, when the first sampling pixel sum is the same as the second sampling pixel sum (because the number of pixel row sampling rows in the first sampling area and the second sampling area is the same), then it means that the first blood vessel ratio parameter is greater than the second blood vessel number parameter, that is, the number of blood vessels in the first sampling area is greater than the number of blood vessels in the second sampling area, then it can be said that the first sampling area is the head end blood vessel direction (because there are more branch blood vessels near the head and neck), and the second sampling area is the foot end blood vessel direction (because the blood vessels near the heart are mostly thick trunk blood vessels).

[0069] In step S205, a blood vessel density gradient curve is determined based on the first projection image. Figure 11 As shown, the blood vessels of the first projection image can be scanned from the foot end blood vessels to the head end blood vessels, and the blood vessel pixels corresponding to all pixel rows are counted, so as to generate the following: Figure 12 The blood vessel density change curve shown in FIG. 1 has a horizontal axis representing the pixel row number and a vertical axis representing the sum of blood vessel pixels, thereby reflecting the change in blood vessel density from the foot end blood vessel direction to the head end blood vessel direction.

[0070] Furthermore, a blood vessel density gradient curve can be determined based on the blood vessel density variation curve. The blood vessel density variation curve is converted into a blood vessel density gradient curve, thereby reflecting the variation trend and variation range of the blood vessel density from the foot end blood vessel direction to the head end blood vessel direction.

[0071] In some embodiments, the determination process of the target angiography image can be further designed. Figure 3 The process of determining the target angiography image is described in detail. Figure 3 An exemplary flow chart showing an image cropping method according to some other embodiments of the present application is shown. Figure 3 The image cropping method shown in the embodiment of the present application may include:

[0072] In step S301, the location of a sudden change in vessel density is determined based on the vessel density gradient curve. In this embodiment, the pixel row corresponding to the location with the maximum gradient in the vessel density gradient curve is used as the key point location, and the location of the vessel in this pixel row is the location of the sudden change in vessel density. It is understood that this sudden change in vessel density can serve as the dividing line between the direction of vessels at the foot and the direction of vessels at the head.

[0073] In step S302, the location of the sudden change in vascular density is shifted toward the head end of the vessel based on a preset offset threshold to obtain a height cutoff position. A second projection image is then determined based on the height cutoff position and the first projection image. In applications involving treatment of lesions located in cardiac arteries, the location of the sudden change in vascular density in the clean projection image can be used as a starting point and shifted a certain distance, for example, 20 mm, toward the head end (i.e., toward the top of the clean projection image) to avoid image information loss due to cropping. The shifted location of the sudden change in vascular density can serve as the height cutoff position. Once the height cutoff position is determined, the image from the height cutoff position to the top of the clean projection image can be cropped to obtain the second projection image.

[0074] In step S303, a first horizontal truncation position and a second horizontal truncation position in the first horizontal direction are determined in the second projection image. In an embodiment of the present application, a pixel row scan can be performed one by one in the first horizontal direction from the first vertical boundary to the second vertical boundary until a pixel point corresponding to a blood vessel is scanned, and a first scanning distance corresponding to each pixel row is recorded. The minimum first scanning distance among the first scanning distances corresponding to each pixel row is then used as the distance between the first horizontal truncation position and the first vertical boundary, wherein the first vertical boundary is a vertical image edge of the second projection image. In other words, the position at which the distance from the first vertical boundary is the minimum first scanning distance is the first horizontal truncation position. Then, pixel rows can be scanned one by one in the first horizontal direction from the second vertical boundary to the first vertical boundary until the pixel point corresponding to the blood vessel is scanned, and the second scanning distance corresponding to each pixel row is recorded. Then, the minimum second scanning distance among the second scanning distances corresponding to each pixel row is used as the distance between the second horizontal truncation position and the second vertical boundary, wherein the second vertical boundary is another vertical image edge of the second projection image. In other words, the position with the minimum second scanning distance from the second vertical boundary is the second horizontal truncation position.

[0075] In step S304, a third projection image is determined based on the angiography image, the height cutoff position, the first horizontal cutoff position, and the second horizontal cutoff position. In an embodiment of the present application, an intermediate angiography image can be obtained by cutting out the angiography image based on the height cutoff position, the first horizontal cutoff position, and the second horizontal cutoff position. It can be understood that when the height cutoff position, the first horizontal cutoff position, and the second horizontal cutoff position are determined, a rectangular stereoscopic image can be cut out from the angiography image, and the rectangular stereoscopic image is the intermediate angiography image. The length of the intermediate angiography image is the distance in the front-to-back direction of the human body, the width is the distance between the first horizontal cutoff position and the second horizontal cutoff position, and the height is the distance from the height cutoff position to the top or bottom of the image of the first projection image. The intermediate angiography image can then be projected, and the projection method can also adopt maximum intensity projection, so as to obtain the following. Figure 6 The third projection image is shown.

[0076] In step S305, a third horizontal truncation position and a fourth horizontal truncation position in the second horizontal direction are determined in the third projection image. Similar to step S303, pixel rows can be scanned one by one in the second horizontal direction from the third vertical boundary toward the fourth vertical boundary until a pixel corresponding to a blood vessel is scanned. The third scanning distance corresponding to each pixel row is recorded, and the minimum third scanning distance among the third scanning distances corresponding to each pixel row is used as the distance between the third horizontal truncation position and the third vertical boundary. The third vertical boundary is a vertical image edge of the third projection image. In other words, the position at the minimum third scanning distance from the third vertical boundary is the third horizontal truncation position. Then, pixel rows can be scanned one by one in the second horizontal direction from the fourth vertical boundary to the third vertical boundary until the pixel point corresponding to the blood vessel is scanned, and the fourth scanning distance corresponding to each pixel row is recorded. Then, the smallest fourth scanning distance among the fourth scanning distances corresponding to each pixel row is used as the distance between the fourth horizontal truncation position and the fourth vertical boundary, wherein the fourth vertical boundary is another vertical image edge of the third projection image. In other words, the position with the smallest fourth scanning distance from the fourth vertical boundary is the fourth horizontal truncation position.

[0077] In step S306, a target angiographic image is cropped from the angiographic image based on the height cutoff position, the first horizontal cutoff position, the second horizontal cutoff position, the third horizontal cutoff position, and the fourth horizontal cutoff position. In the embodiment of the present application, the contents of step S306 are substantially the same as those of step S107 and are not further described here.

[0078] Corresponding to the aforementioned embodiment of the method for realizing application functions, the present application also provides an electronic device for executing an image cropping method and corresponding embodiments.

[0079] Figure 14 FIG. 1 is a block diagram showing the hardware configuration of an electronic device 1400 that can implement the image cropping method according to an embodiment of the present application. Figure 14 As shown, the electronic device 1400 may include a processor 1410 and a memory 1420. Figure 14 In the electronic device 1400, only the components related to this embodiment are shown. Therefore, it is obvious to those skilled in the art that the electronic device 1400 may also include components related to the embodiment. Figure 14 The components shown in the figure are different from the common components. For example: fixed-point arithmetic units.

[0080] The electronic device 1400 may correspond to a computing device having various processing functions, such as functions for generating a neural network, training or learning a neural network, quantizing a floating-point neural network to a fixed-point neural network, or retraining a neural network. For example, the electronic device 1400 may be implemented as various types of devices, such as a personal computer (PC), a server device, a mobile device, etc.

[0081] The processor 1410 controls all functions of the electronic device 1400. For example, the processor 1410 controls all functions of the electronic device 1400 by executing a program stored in the memory 1420 on the electronic device 1400. The processor 1410 can be implemented by a central processing unit (CPU), a graphics processing unit (GPU), an application processor (AP), an artificial intelligence processor chip (IPU), etc. provided in the electronic device 1400. However, the present application is not limited thereto.

[0082] In some embodiments, the processor 1410 may include an input / output (I / O) unit 1411 and a computing unit 1412. The I / O unit 1411 may be used to receive various data, such as angiography images. For example, the calculation unit 1412 may be configured to determine a first projection image based on an angiographic image received via the I / O unit 1411; determine vessel direction information and a vessel density gradient curve based on the first projection image; determine a height cutoff position based on the vessel direction information and the vessel density gradient curve, and determine a second projection image based on the height cutoff position and the first projection image; determine a first horizontal cutoff position and a second horizontal cutoff position in a first horizontal direction in the second projection image; determine a third projection image based on the angiographic image, the height cutoff position, the first horizontal cutoff position, and the second horizontal cutoff position; wherein the projection directions of the first and third projection images are perpendicular; determine a third horizontal cutoff position and a fourth horizontal cutoff position in a second horizontal direction in the third projection image; and crop the angiographic image based on the height cutoff position, the first horizontal cutoff position, the second horizontal cutoff position, the third horizontal cutoff position, and the fourth horizontal cutoff position to obtain a target angiographic image. This target angiographic image may, for example, be output by the I / O unit 1411. The output data may be provided to the memory 1420 for reading and use by other devices (not shown), or may be directly provided to other devices for use.

[0083] Memory 1420 is hardware used to store various data processed by electronic device 1400. For example, memory 1420 can store processed data and data to be processed by electronic device 1400. Memory 1420 can also store data sets involved in the image cropping method, such as angiographic images, that have been processed or are to be processed by processor 1410. Furthermore, memory 1420 can store applications, drivers, and the like to be driven by electronic device 1400. For example, memory 1420 can store various programs related to the image cropping method to be executed by processor 1410. Memory 1420 can be DRAM, but the present application is not limited thereto. Memory 1420 can include at least one of volatile memory and non-volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), flash memory, phase-change RAM (PRAM), magnetic RAM (MRAM), resistive RAM (RRAM), ferroelectric RAM (FRAM), and the like. The volatile memory may include dynamic RAM (DRAM), static RAM (SRAM), synchronous DRAM (SDRAM), PRAM, MRAM, RRAM, ferroelectric RAM (FeRAM), etc. In an embodiment, the memory 1420 may include at least one of a hard disk drive (HDD), a solid-state drive (SSD), a high-density flash memory (CF), a secure digital (SD) card, a micro secure digital (Micro-SD) card, a mini secure digital (Mini-SD) card, an extreme digital (xD) card, a cache, or a memory stick.

[0084] In summary, the specific functions implemented by the memory 1420 and the processor 1410 of the electronic device 1400 provided in the embodiments of this specification can be interpreted in comparison with the aforementioned embodiments in this specification, and can achieve the technical effects of the aforementioned embodiments, so they will not be repeated here.

[0085] In this embodiment, the processor 1410 may be implemented in any suitable manner. For example, the processor 1410 may take the form of a microprocessor or a processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, an application-specific integrated circuit (ASIC), a programmable logic controller, an embedded microcontroller, and the like.

[0086] It should also be understood that any module, unit, component, server, computer, terminal, or device that executes instructions as exemplified herein may include or otherwise access computer-readable media, such as storage media, computer storage media, or data storage devices (removable and / or non-removable) such as magnetic disks, optical disks, or tapes. Computer storage media may include volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information, such as computer-readable instructions, data structures, program modules, or other data.

[0087] Although multiple embodiments of the present application have been shown and described herein, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art can conceive of many changes, modifications, and alternatives without departing from the thought and spirit of the present application. It should be understood that in the process of practicing the present application, various alternatives to the embodiments of the present application described herein can be adopted. The accompanying claims are intended to define the scope of protection of the present application and therefore cover equivalents or alternatives within the scope of these claims.

Claims

1. An image cropping method, characterized in that: include: acquiring an angiographic image, and determining a first projection image based on the angiographic image; determining blood vessel direction information and a blood vessel density gradient curve based on the first projection image; determining a height cutoff position based on the blood vessel direction information and the blood vessel dense gradient curve, and determining a second projection image based on the height cutoff position and the first projection image; determining a first horizontal truncation position and a second horizontal truncation position in a first horizontal direction in the second projection image; Determining a third projection image based on the angiography image, the height cutoff position, the first horizontal cutoff position, and the second horizontal cutoff position; wherein projection directions of the first projection image and the third projection image are perpendicular; determining a third horizontal truncation position and a fourth horizontal truncation position in the second horizontal direction in the third projection image; Cutting out a target angiography image from the angiography image based on the height cutoff position, the first horizontal cutoff position, the second horizontal cutoff position, the third horizontal cutoff position, and the fourth horizontal cutoff position; Wherein, determining the blood vessel direction information based on the first projection image includes: performing threshold segmentation on the first projection image to obtain a threshold segmented image; Determining a maximum connected domain in the threshold segmented image, and removing other connected domains except the maximum connected domain to obtain a cleaned projection image; extracting a first sampling area and a second sampling area at the top and bottom of the cleaning projection image respectively based on a preset number of sampling pixel rows; The blood vessel direction information is determined based on the first sampling area and the second sampling area.

2. The image cropping method according to claim 1, wherein: The determining the blood vessel direction information based on the first sampling area and the second sampling area includes: Determining the blood vessel skeletons in the first sampling area and the second sampling area respectively, and obtaining a first blood vessel skeleton image corresponding to the first sampling area and a second blood vessel skeleton image corresponding to the second sampling area; respectively determining the skeleton pixels corresponding to the first blood vessel skeleton image and the sum of the skeleton pixels corresponding to the second blood vessel skeleton image, and obtaining a first blood vessel quantity parameter corresponding to the first blood vessel skeleton image and a second blood vessel quantity parameter corresponding to the second blood vessel skeleton image; Determine pixel sums of the first sampling area and the second sampling area respectively, and obtain a first sampling pixel sum corresponding to the first sampling area and a second sampling pixel sum corresponding to the second sampling area; The blood vessel direction information is determined based on the first blood vessel number parameter, the second blood vessel number parameter, the first sampling pixel sum, and the second sampling pixel sum.

3. The image cropping method according to claim 2, wherein: The determining the blood vessel direction information based on the first blood vessel number parameter, the second blood vessel number parameter, the first sampling pixel sum, and the second sampling pixel sum includes: determining a first blood vessel ratio parameter based on the first blood vessel number parameter and the first sampling pixel sum; determining a second blood vessel ratio parameter based on the second blood vessel number parameter and the second sampling pixel sum; The first blood vessel ratio parameter and the second blood vessel ratio parameter are compared, and the blood vessel direction information is determined based on the comparison result; wherein the blood vessel direction information includes the head end blood vessel direction and the foot end blood vessel direction.

4. The image cropping method according to claim 3, wherein: Determining a blood vessel density gradient curve based on the first projection image includes: Performing a blood vessel scan on the first projection image from the direction of the blood vessels at the foot end to the direction of the blood vessels at the head end to obtain a blood vessel density change curve; The blood vessel density gradient curve is determined based on the blood vessel density variation curve.

5. The image cropping method according to claim 3, wherein: The determining of the height cutoff position based on the blood vessel direction information and the blood vessel dense gradient curve comprises: determining a position of a sudden change in blood vessel density based on the blood vessel density gradient curve; The blood vessel density mutation position is moved toward the head end blood vessel based on a preset offset threshold to obtain the height cutoff position.

6. The image cropping method according to claim 1, wherein: The determining of the first horizontal truncation position and the second horizontal truncation position in the first horizontal direction in the second projection image includes: Scanning pixel rows one by one from the first vertical boundary to the second vertical boundary in the first horizontal direction until a pixel point corresponding to a blood vessel is scanned, and recording a first scanning distance corresponding to each pixel row; Using the smallest first scanning distance among the first scanning distances corresponding to each pixel row as the distance between the first horizontal truncation position and the first vertical boundary; Scanning pixel rows one by one from the second vertical boundary to the first vertical boundary in the first horizontal direction until a pixel point corresponding to a blood vessel is scanned, and recording a second scanning distance corresponding to each pixel row; The smallest second scanning distance among the second scanning distances corresponding to each pixel row is used as the distance between the second horizontal truncation position and the second vertical boundary.

7. The image cropping method according to claim 1, wherein: The determining of the third projection image based on the angiography image, the height cutoff position, the first horizontal cutoff position, and the second horizontal cutoff position comprises: Cutting the angiography image based on the height cutoff position, the first horizontal cutoff position, and the second horizontal cutoff position to obtain an intermediate angiography image; The intermediate angiography image is projected to obtain the third projected image.

8. An electronic device, characterized in that: include: processor; as well as A memory having executable codes stored thereon, which, when executed by the processor, causes the processor to execute the method according to any one of claims 1 to 7.

9. A non-transitory machine-readable storage medium having executable code stored thereon, wherein when the executable code is executed by a processor of an electronic device, the processor is caused to perform the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Cerebrovascular atlas construction method

    CN111986101A

  • Systems and methods for displaying region of interest on multi-plane reconstruction image

    US20210201066A1