Image processing method, device, electronic device and storage medium

By acquiring and mapping feature points in CT image processing and utilizing CPU and GPU collaborative processing, the time-consuming scaling and midline break issues of CT organ masks are resolved, achieving efficient feature edge continuity and image quality improvement.

CN114677265BActive Publication Date: 2025-09-16INFERVISION MEDICAL TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210304856.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-22
Publication Date
2025-09-16
Estimated Expiration
2042-03-22

AI Technical Summary

Technical Problem

The existing technology has the problems of long time consumption and midline break when scaling CT organ masks, especially the processing efficiency of large-size masks is low and the effect is poor.

Method used

By obtaining the original feature points in the source image, determining the candidate feature points based on the target background image and pre-scaled image parameters, and determining the associated feature points within a preset range, the CPU and GPU are used for collaborative processing to perform interpolation and smoothing to generate an image containing the target features.

Benefits of technology

The image processing time is shortened, the continuity of feature edges is guaranteed, the image processing quality is improved and real-time processing is supported.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114677265B_ABST
    Figure CN114677265B_ABST
Patent Text Reader

Abstract

Embodiments of the present invention disclose an image processing method, apparatus, electronic device, and storage medium. The method includes: obtaining original features in a source image and extracting original feature points from the original features; obtaining a target background image and, based on the source image, the target background image, and the original coordinates of each original feature point, determining candidate feature points corresponding to each original feature point in the target background image; for any original feature point, determining at least one original adjacent feature point within a preset range of the current original feature point in the original features, and determining associated feature points corresponding to the current original feature point in the target background image based on the candidate feature points corresponding to the current original feature point and each original adjacent feature point; generating a target image containing the target feature based on the associated feature points in the target background image, thereby ensuring the continuity of feature edges, improving image processing quality, reducing processing time, and achieving real-time image processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of image processing technology, and in particular to an image processing method, device, electronic device, and storage medium. Background Art

[0002] In the field of digital image processing, when extracting features from organ masks in CT scans, it is sometimes necessary to resize the feature curves, such as by scaling them. A prior art approach involves resizing the mask using third-party open-source libraries such as OpenCV and SimpleITK, and then extracting the feature curves from the resized image. Because organ masks in CT scans are often large, this method is extremely time-consuming. A second prior art approach involves directly resizing the centerline, but this often results in a broken centerline during the resizing operation. Summary of the Invention

[0003] The present invention provides an image processing method, device, electronic device and storage medium to ensure the continuity of feature edges, improve image processing quality, reduce processing time and realize real-time processing of images.

[0004] In a first aspect, an embodiment of the present invention provides an image processing method, the method comprising:

[0005] Acquire original features in a source image, and extract original feature points in the original features;

[0006] Acquire a target background image, and determine candidate feature points corresponding to the original feature points in the target background image based on the source image, the target background image, and the original coordinates of the original feature points; wherein target image parameters of the target background image are the same as pre-scaled image parameters of the pre-scaled image of the source image;

[0007] For any original feature point, determine at least one original adjacent feature point within a preset range of the current original feature point from the original features, and determine an associated feature point corresponding to the current original feature point in the target background image based on the candidate feature points corresponding to the current original feature point and each of the original adjacent feature points;

[0008] A target image containing target features is generated based on the associated feature points in the target background image.

[0009] Optionally, obtaining original features in the source image and extracting original feature points in the original features includes:

[0010] Obtaining pixels in the source image and determining the original features based on a preset pixel threshold condition and pixel data corresponding to the pixel points; or performing feature extraction on the source image based on a pre-trained feature extraction model to obtain the original features;

[0011] Pixel coordinates corresponding to pixel points in the original features are extracted, and original feature points in the original features are determined based on the pixel coordinates.

[0012] Optionally, acquiring the target background image and determining, based on the source image, the target background image, and the original coordinates of the original feature points, candidate feature points corresponding to the original feature points in the target background image include:

[0013] acquiring source image parameters of the source image, and determining pre-scaled image parameters of a pre-scaled image of the source image based on the source image parameters and a scaling ratio between the source image and the pre-scaled image;

[0014] generating a target background image having the same image parameters based on the pre-scaled image parameters of the pre-scaled image;

[0015] Based on the target image parameters of the target background, the source image parameters and the original coordinates of the original feature points, candidate feature points corresponding to the original feature points in the target background image are determined.

[0016] Optionally, determining at least one original adjacent feature point within a preset range of the current original feature point in the original features includes:

[0017] Obtaining a preset range threshold, taking the current original coordinates as the coordinate center, and determining at least one original feature point within the preset range threshold among the original feature points;

[0018] Each of the original feature points is determined to be at least one original adjacent feature point of the current original feature point within a preset range in the original feature.

[0019] Optionally, the determining, based on the current original feature point and the candidate feature points corresponding to each of the original adjacent feature points, an associated feature point corresponding to the current original feature point in the target background image includes:

[0020] Among the candidate feature points, respectively determine the current candidate feature point corresponding to the current original feature point, and the adjacent candidate feature points corresponding to the original adjacent feature points;

[0021] The current candidate feature point and each of the adjacent candidate feature points are determined to be associated feature points corresponding to the current original feature point in the target background image.

[0022] Optionally, generating a target image containing target features based on associated feature points in the target background image includes:

[0023] respectively determining an intermediate feature point between any two adjacent associated feature points among the associated feature points;

[0024] A target image including target features is generated based on the associated feature points and the intermediate coordinate points.

[0025] Optionally, after generating the target image containing the target features, the following is further included:

[0026] The feature edge of the target feature is smoothed to obtain a smoothed target feature.

[0027] Optionally, the source image includes a medical image, and the original feature includes a blood vessel centerline in the medical image.

[0028] Optionally, the image processor includes a CPU sub-processor and at least one GPU sub-processor;

[0029] Accordingly, the CPU subprocessor is configured to execute the steps of acquiring original features in a source image and extracting original feature points from the original features; acquiring a target background image, and determining, based on the source image, the target background image, and the original coordinates of each original feature point, candidate feature points corresponding to each original feature point in the target background image; wherein target image parameters of the target background image are the same as pre-scaled image parameters of a pre-scaled image of the source image;

[0030] For any GPU sub-processor, the GPU is configured to determine, from the original features, at least one original adjacent feature point within a preset range of the current original feature point, and determine, based on the current original feature point and the candidate feature points corresponding to each of the original adjacent feature points, an associated feature point corresponding to the current original feature point in the target background image;

[0031] The CPU sub-processor is further configured to generate a target image containing target features based on each associated feature point in the target background image.

[0032] In a second aspect, an embodiment of the present invention further provides an image processing device, the device comprising:

[0033] An original feature point acquisition module is used to acquire original features in a source image and extract original feature points from the original features;

[0034] a candidate feature point determination module, configured to obtain a target background image and determine, based on the source image, the target background image, and the original coordinates of the original feature points, candidate feature points corresponding to the original feature points in the target background image; wherein target image parameters of the target background image are the same as pre-scaled image parameters of the pre-scaled image of the source image;

[0035] an associated feature point determination module, configured to determine, for any original feature point, at least one original adjacent feature point within a preset range of the current original feature point from the original features, and determine an associated feature point corresponding to the current original feature point in the target background image based on the candidate feature points corresponding to the current original feature point and each of the original adjacent feature points;

[0036] The target image generation module is used to generate a target image containing target features based on the associated feature points in the target background image.

[0037] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising:

[0038] one or more processors;

[0039] a storage device for storing one or more programs,

[0040] When the one or more programs are executed by the one or more processors, the one or more processors implement the image processing method provided by any embodiment of the present invention.

[0041] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the image processing method provided by any embodiment of the present invention.

[0042] The technical solution of this embodiment specifically includes: obtaining original features in a source image and extracting original feature points from the original features; obtaining a target background image and determining candidate feature points corresponding to each original feature point in the target background image based on the source image, the target background image, and the original coordinates of each original feature point; wherein the target image parameters of the target background image are the same as the pre-scaled image parameters of the pre-scaled image of the source image; for any original feature point, determining at least one original adjacent feature point within a preset range of the current original feature point in the original features, and determining the associated feature points corresponding to the current original feature point in the target background image based on the candidate feature points corresponding to the current original feature point and each original adjacent feature point; generating a target image containing the target feature based on each associated feature point in the target background image. The above technical solution not only shortens the image processing time by scaling the original features of the source image and interpolating the scaled features, but also ensures the continuity of the feature edges of the scaled image features, thereby improving the image processing quality while reducing the processing time and achieving real-time image processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] To more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings introduced here only illustrate some of the embodiments to be described by the present invention, and are not exhaustive. A person skilled in the art can derive other drawings based on these drawings without inventive effort.

[0044] Figure 1 is a flowchart of an image processing method provided by an embodiment of the present invention;

[0045] Figure 2 is a flowchart of another image processing method involved in an embodiment of the present invention;

[0046] Figure 3 is a flowchart of another image processing method provided by an embodiment of the present invention;

[0047] Figure 4 is a structural diagram of an image processing device provided by an embodiment of the present invention;

[0048] Figure 5 A schematic structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0049] The following describes embodiments of the present disclosure in more detail with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.

[0050] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0051] As used herein, the term "including" and its variations are open-ended, i.e., "including but not limited to." The term "based on" means "based, at least in part, on." The term "one embodiment" means "at least one embodiment," the term "another embodiment" means "at least one additional embodiment," and the term "some embodiments" means "at least some embodiments." Other terms are defined in the following description.

[0052] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0053] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, they should be understood as "one or more".

[0054] In some embodiments, before the image features in the original image are subjected to feature processing or feature display, the image features in the original image are scaled to obtain a target image containing the processed image features, so as to obtain a target image with image features that meet the requirements. In the prior art, the method for scaling image features generally directly scales the original image containing the image features, so as to directly obtain a target image with image features that meet the requirements. However, during the implementation of the above method, due to the large amount of data in the original image, the image scaling process is relatively time-consuming, and a higher computer processing system is required to support the calculation of large amounts of data, thereby increasing the processing time and processing cost. Based on the above embodiment, some technologies adopt the method of directly scaling the image features in the original image in order to shorten the processing time and reduce costs. During the implementation of the above method, it was found that the technical solution of the embodiment of the present disclosure: directly scaling the original features often causes the problem of broken feature edges in the image features after the scaling operation. In response to the above technical problems, in order to ensure the continuity of the feature edges, and to reduce the processing time and realize real-time processing of the image while improving the image processing quality, the technical solution provided by the embodiment of the present invention is described in detail. Figure 1 , Figure 1 This is a flowchart of an image processing method provided by an embodiment of the present invention. This embodiment is applicable to the case of scaling image features in an image. The method can be executed by an image processing device, which can be implemented by software and / or hardware.

[0055] S110 , obtaining original features in the source image, and extracting original feature points in the original features.

[0056] In an embodiment of the present invention, a source image can be interpreted as an original image containing original features, and original features can be understood as local features in the source image, such as local area features, local line features, and other image features in the source image. For example, the source image can be a medical image captured by a medical imaging device, such as a chest CT image. Accordingly, the original features can be understood as the coronary artery region or the coronary artery centerline in the chest CT image. It should be noted that the coronary artery centerline in this embodiment can be interpreted as the line formed by connecting the center points of the current coronary artery by cutting the current coronary artery into several cross-sections. Optionally, the source image can also be a landscape photo or an object photo captured by a camera. Accordingly, the original features can be any scene in the landscape photo or any object in the object photo. Of course, the source image can also be other types of images, and the corresponding original features can also be other features, which are not limited in this embodiment.

[0057] Specifically, the source image can be obtained directly from a camera or by reading the image from a server or database storing the image. Alternatively, the original features of the source image can be obtained by obtaining pixel data of the source image and determining the original features based on a preset pixel threshold and the pixel data; or by extracting features from the source image based on a pre-trained feature extraction model to obtain the original features.

[0058] Specifically, the pixel data of each pixel in the source image is obtained, and the preset pixel threshold condition is obtained, and the pixel data of each pixel in the source image is numerically compared with the preset pixel threshold condition. The pixel data of each pixel in the comparison result that meets the preset pixel threshold condition is obtained, and the original features are determined based on the pixel points corresponding to each pixel data. For example, the area formed by each pixel is determined as the original feature. Among them, the preset pixel threshold condition can be pre-set according to the pixel data value of each pixel in the source image. Optionally, a pre-trained feature extraction model can also be obtained, and the obtained source image is input into the feature extraction model to obtain the original features output by the model. Of course, the above-mentioned method of determining the original features is only an exemplary technical solution in this embodiment. This embodiment can also obtain the original features of the source image based on other methods, which is not limited to this.

[0059] Furthermore, after the original features of the source image are obtained, the pixel coordinates corresponding to the pixel points in the original features are extracted, and the original feature points in the original features are determined based on the pixel coordinates.

[0060] Specifically, the pixel coordinates of each pixel constituting each original feature are determined and extracted, and the original feature points of the original feature are determined based on the pixel coordinates. For example, each pixel can be determined as the original feature point of the original feature.

[0061] S120 , obtaining a target background image, and determining candidate feature points corresponding to the original feature points in the target background image based on the source image, the target background image, and the original coordinates of the original feature points.

[0062] In an embodiment of the present invention, the target background image may be a blank background image or a background image in which the pixel data of each pixel point is unified. Optionally, the target background image may be determined based on an image after scaling the source image, and the target image parameters of the target background image may be the same as the pre-scaled image parameters of the pre-scaled image of the source image. Optionally, the method for obtaining the target background image may include: obtaining source image parameters of the source image, and determining the pre-scaled image of the source image based on the source image parameters and the scaling ratio between the source image and the pre-scaled image; and generating the target background image having the same image parameters based on the pre-scaled image parameters of the pre-scaled image.

[0063] It should be explained that image parameters can be understood as the length and width of an image. Accordingly, source image parameters can be understood as the length and width of the source image; scaled image parameters can be understood as the length and width of the scaled image obtained after pre-scaling the source image; and target image parameters can be understood as the length and width of the target background image. Pre-scaling can be understood as preparation for scaling without actually performing the scaling operation. Accordingly, scaled image parameters can be understood as the image parameters corresponding to the pre-scaling process.

[0064] Specifically, the image length and image width of the source image are obtained, as well as the scaling factor for pre-scaling the source image. Based on the scaling factor, data is calculated for the image length and image width of the source image, and pre-scaled image parameters of the pre-scaled image of the source image are obtained. Furthermore, a blank background image having the same image parameters as the pre-scaled image parameters of the pre-scaled image or a background image with uniform pixel data for each pixel is constructed as the target background image.

[0065] Furthermore, based on the target image parameters of the target background, the source image parameters and the original coordinates of the original feature points, candidate feature points corresponding to the original feature points in the target background image are determined.

[0066] Specifically, each original feature point can be mapped to the target background image based on a preset feature point mapping formula to obtain each candidate feature point corresponding to each original feature point in the target background image. Specifically, the feature point mapping formula can be expressed as:

[0067]

[0068] Among them, POS target Represents the candidate coordinates of the candidate feature points; POS skeleton Indicates the original coordinates of the original feature point; target shape Represents the target image parameters; skeleton shape Represents the source image parameters.

[0069] It should be noted that the candidate coordinates of each candidate feature point are obtained based on the original coordinate mapping of the original feature point, and then each candidate feature point is determined based on the candidate coordinates.

[0070] It is worth noting that the number of candidate feature points is the same as that of original feature points, but the coordinates of the candidate feature points are different from those of the original feature points.

[0071] S130. For any original feature point, determine at least one original adjacent feature point within a preset range of the current original feature point in the original features, and determine an associated feature point corresponding to the current original feature point in the target background image based on the candidate feature points corresponding to the current original feature point and each of the original adjacent feature points.

[0072] In an embodiment of the present invention, the original adjacent feature points are original adjacent feature points of the current original feature point. Optionally, the method for determining the original adjacent feature points may include: obtaining a preset range threshold, taking the current original coordinates as the coordinate center, and determining at least one original feature point within the preset range threshold among the original feature points; and determining each original feature point as at least one original adjacent feature point within the preset range of the current original feature point in the original feature.

[0073] This article uses the current original feature point as an example to illustrate the method for determining the original adjacent feature points of the original feature point. Specifically, the current feature point is used as the feature center point, and a preset range threshold is used as the radius range. The method determines whether there is an original feature point within the range. If so, the original feature point is determined as the original adjacent feature point of the current original feature point. An original feature point includes at least one original adjacent feature point.

[0074] Furthermore, based on the current original feature point and the candidate feature points corresponding to each of the original adjacent feature points, an associated feature point corresponding to the current original feature point in the target background image is determined.

[0075] Optionally, the method for determining associated feature points includes: among each candidate feature point, determining the current candidate feature point corresponding to the current original feature point, and the adjacent candidate feature points corresponding to each original adjacent feature point; determining the current candidate feature point and each adjacent candidate feature point as the associated feature points corresponding to the current original feature point in the target background image.

[0076] Specifically, the current candidate feature point corresponding to the current original feature point in the candidate feature points is determined, and the adjacent candidate feature points corresponding to each original adjacent feature point in the candidate feature points are determined, and the current candidate feature point and each adjacent candidate feature point are used as the associated feature points corresponding to the current original feature point in the target background image.

[0077] For example, Figure 2 As shown, if the current original feature point is A, based on the preset threshold range, the original feature point B is determined to be the original adjacent feature point of the current original feature point A; the current candidate feature point A1 of the current original feature point A in the target background image is determined, and the adjacent candidate feature point B1 of the adjacent feature point B in the target background image is determined; then, A1 and B1 are the associated feature points corresponding to the current original feature point in the target background image.

[0078] S140 : Generate a target image containing target features based on the associated feature points in the target background image.

[0079] In the embodiment of the present invention, the target feature is an image feature generated based on each associated feature point, and thus the target feature is a mapping feature of the original feature in the target image.

[0080] Optionally, the method for generating the target image includes: respectively determining an intermediate feature point between any two adjacent associated feature points among the associated feature points; and generating a target image containing target features based on the associated feature points and the intermediate coordinate points.

[0081] Specifically, an intermediate feature point between the current associated feature point and an associated feature point adjacent to the current associated feature point is determined, an intermediate feature point between each adjacent associated feature point is determined based on the above method, and a target image containing the target feature is generated based on each associated feature point and each intermediate coordinate point. Specifically, if the target background image is a blank image, an arbitrary pixel value is assigned to each associated feature point and each intermediate feature point, thereby generating a target image containing the target feature. Optionally, if the target background image is a background image with uniform pixel values, a pixel value different from the pixel data of the background pixel points is assigned to each associated feature point and each intermediate feature point, thereby generating a target image containing the target feature.

[0082] The technical solution of this embodiment specifically includes: obtaining original features in a source image and extracting original feature points from the original features; obtaining a target background image and determining candidate feature points corresponding to each original feature point in the target background image based on the source image, the target background image, and the original coordinates of each original feature point; wherein the target image parameters of the target background image are the same as the pre-scaled image parameters of the pre-scaled image of the source image; for any original feature point, determining at least one original adjacent feature point within a preset range of the current original feature point in the original features, and determining the associated feature points corresponding to the current original feature point in the target background image based on the candidate feature points corresponding to the current original feature point and each original adjacent feature point; generating a target image containing the target feature based on each associated feature point in the target background image. The above technical solution not only shortens the image processing time by scaling the original features of the source image and interpolating the scaled features, but also ensures the continuity of the feature edges of the scaled image features, thereby improving the image processing quality while reducing the processing time and achieving real-time image processing.

[0083] Figure 3This is a flowchart of another image processing method provided by an embodiment of the present invention. Based on the above embodiments, this embodiment further adds the step of "smoothing the feature edge of the target feature to obtain a smoothed target feature." The explanations of the terms that are the same or corresponding to those in the above embodiments are not repeated here. Figure 3 , the image processing method provided in this embodiment includes:

[0084] S210: Acquire original features in the source image, and extract original feature points in the original features.

[0085] S220 , obtaining a target background image, and determining candidate feature points corresponding to the original feature points in the target background image based on the source image, the target background image, and the original coordinates of the original feature points.

[0086] S230. For any original feature point, determine at least one original adjacent feature point within a preset range of the current original feature point in the original features, and determine an associated feature point corresponding to the current original feature point in the target background image based on the candidate feature points corresponding to the current original feature point and each of the original adjacent feature points.

[0087] S240: Generate a target image containing target features based on the associated feature points in the target background image.

[0088] S250: Smoothing the feature edge of the target feature to obtain a smoothed target feature.

[0089] In an embodiment of the present invention, after obtaining a target image containing a target feature, the technical solution of this embodiment may further smooth the feature edges of the target feature to make the obtained target feature smoother. In this embodiment, the smoothing method may employ Laplace smoothing or other smoothing methods, which are not limited in this embodiment.

[0090] The technical solution of this embodiment scales the original features of the source image, interpolates the scaled features to obtain target features, and smoothes the target features to obtain smoothed target features, thereby further improving the image quality of the target image.

[0091] Based on the above embodiments, this embodiment further provides an application embodiment, wherein the image processing method provided in the above embodiments is applied to an image processor, which includes a CPU sub-processor and at least one GPU sub-processor;

[0092] Accordingly, the CPU subprocessor is configured to execute the steps of acquiring original features in the source image and extracting original feature points from the original features; acquiring a target background image, and determining candidate feature points corresponding to the original feature points in the target background image based on the source image, the target background image, and the original coordinates of the original feature points; wherein target image parameters of the target background image are the same as pre-scaled image parameters of the pre-scaled image of the source image;

[0093] For any GPU sub-processor, the GPU is used to determine at least one original adjacent feature point within a preset range of the current original feature point in the original features, and determine an associated feature point corresponding to the current original feature point in the target background image based on the candidate feature points corresponding to the current original feature point and each of the original adjacent feature points;

[0094] The CPU sub-processor is further configured to generate a target image containing target features based on associated feature points in the target background image.

[0095] Optionally, the CPU sub-processor is also used to execute the acquisition of pixel points in the source image, and determine the original features based on a preset pixel threshold condition and the pixel data corresponding to the pixel points; or, based on a pre-trained feature extraction model, perform feature extraction on the source image to obtain the original features; and extract the pixel coordinates corresponding to the pixel points in the original features, and determine the original feature points in the original features based on the pixel coordinates.

[0096] Optionally, the CPU subprocessor is also used to execute the acquisition of source image parameters of the source image, and determine the pre-scaled image parameters of the pre-scaled image of the source image based on the source image parameters and the scaling ratio between the source image and the pre-scaled image; generate a target background image with the same image parameters based on the pre-scaled image parameters of the pre-scaled image; and determine the candidate feature points corresponding to the original feature points in the target background image based on the target image parameters of the target background, the source image parameters and the original coordinates of the original feature points.

[0097] Optionally, for any GPU sub-processor, the GPU is also used to execute the acquisition of a preset range threshold, taking the current original coordinates as the coordinate center, and determining at least one original feature point within the preset range threshold in the original feature points; and determining each original feature point as at least one original adjacent feature point within the preset range of the current original feature point in the original feature.

[0098] Optionally, for any GPU sub-processor, the GPU is also used to execute, among each candidate feature point, respectively determining the current candidate feature point corresponding to the current original feature point, and the adjacent candidate feature points corresponding to the original adjacent feature points; and determining the current candidate feature point and the adjacent candidate feature points as the associated feature points corresponding to the current original feature point in the target background image.

[0099] Optionally, the CPU sub-processor is further configured to respectively determine an intermediate feature point between any two adjacent associated feature points among the associated feature points; and generate a target image containing target features based on the associated feature points and the intermediate coordinate points.

[0100] Based on the above embodiments, this embodiment also provides a preferred embodiment, which introduces another image processing method. Specifically, the method includes:

[0101] Step 1: Perform the following calculations on the CPU:

[0102] 1. Set the original array to be resized to skeleton array , that is, the original array to be scaled is skeleton array ;

[0103] 2. Set an all-zero array skeleton' that is exactly the same as the original array array ;

[0104] 3. Set the resized array (that is, the result array to be found) result resize is an array of all zeros;

[0105] 4. Record the position coordinates POS of each point that is not 0 skeleton ;

[0106] 5. Calculate the coordinates of the points on the resized midline:

[0107] Among them, POS target with POS' skeleton The length is the same and both are 3-dimensional arrays;

[0108] 6. The number of points (i.e., midlines) where the original data is not 0 is recorded as length skeleton , the number of points on the midline after resize is length target .

[0109] Step 2: Perform the following calculations on the GPU:

[0110] 1. Start length skeleton cuda cores, execute on each cuda core:

[0111] 2. In the index-th cuda core, take POS skeleton The index-th data (that is, the index-th coordinate) is ValuePOS index (This is a 3D coordinate value).

[0112] 3. Execution: skeleton array [ValuePOS index ]=index;(After execution, skeleton′ array That is, the number value of the line point in the original data, the number value ranges from 1 to length skeleton )

[0113] Step 3: Wait for the cuda core to complete execution and synchronize data: cudaDeviceSynchronize();

[0114] Step 4: Perform the following calculations on the GPU:

[0115] 1. Start length skeleton cuda cores, execute on each cuda core:

[0116] 2. In the index-th cuda core, take POS skeleton The index-th data (that is, the index-th coordinate) is ValuePOS index (This is a 3D coordinate value).

[0117] 3. Get the array skeleton' array The middle coordinate is ValuePos index 26 points above, below, front, back, left, and right of the point (also known as skeleton array Traverse the 3*3*3 cube with the center as the center. If there is a non-zero point, record the index of the point as index2, index3... (the length of this array will not exceed 26, otherwise it will be a whole large black dot, which does not meet the definition of the center line);

[0118] 4. Record empty list Points in =[], execute:

[0119] For index i in index2, index3...;

[0120] Position POS p =POS target [index];

[0121] Position POS i =POS target [index i ];

[0122] Get POS p ,POS i Between (including POS p,POS i ) are placed in Points with coordinates pos1, pos2... in middle;

[0123] 5. Filter Points in Repeat the point; resize Points in array in The points in are set to 1.

[0124] The final result resize This is the result after resizing.

[0125] The following is an embodiment of an image processing device provided by an embodiment of the present invention. The device and the image processing methods of the above embodiments belong to the same inventive concept. For details not fully described in the embodiment of the image processing device, please refer to the embodiment of the above image processing method.

[0126] Figure 4 This is a schematic diagram of the structure of an image processing device provided by an embodiment of the present invention. The specific structure of the image processing device includes: an original feature point acquisition module 310, a candidate feature point determination module 320, an associated feature point determination module 330 and a target image generation module 340; wherein,

[0127] The original feature point acquisition module 310 is used to obtain the original features in the source image and extract the original feature points in the original features;

[0128] a candidate feature point determination module 320 configured to obtain a target background image and determine, based on the source image, the target background image, and the original coordinates of the original feature points, candidate feature points corresponding to the original feature points in the target background image; wherein target image parameters of the target background image are the same as pre-scaled image parameters of the pre-scaled image of the source image;

[0129] The associated feature point determination module 330 is configured to determine, for any original feature point, at least one original adjacent feature point within a preset range of the current original feature point in the original features, and determine an associated feature point corresponding to the current original feature point in the target background image based on the candidate feature points corresponding to the current original feature point and each of the original adjacent feature points;

[0130] The target image generation module 340 is configured to generate a target image containing target features based on the associated feature points in the target background image.

[0131] The technical solution of this embodiment specifically includes: obtaining original features in a source image and extracting original feature points from the original features; obtaining a target background image and determining candidate feature points corresponding to each original feature point in the target background image based on the source image, the target background image, and the original coordinates of each original feature point; wherein the target image parameters of the target background image are the same as the pre-scaled image parameters of the pre-scaled image of the source image; for any original feature point, determining at least one original adjacent feature point within a preset range of the current original feature point in the original features, and determining the associated feature point corresponding to the current original feature point in the target background image based on the candidate feature points corresponding to the current original feature point and each of the original adjacent feature points; generating a target image containing the target feature based on the associated feature points in the target background image. The above technical solution not only shortens the image processing time by scaling the original features of the source image and performing interpolation processing on the scaled features, but also ensures the continuity of the feature edges of the scaled image features, thereby improving the image processing quality while reducing the processing time and achieving real-time image processing.

[0132] Based on the above embodiments, the original feature point acquisition module 310 includes:

[0133] an original feature acquisition unit, configured to acquire pixels in the source image and determine the original features based on a preset pixel threshold condition and pixel data corresponding to the pixels; or to extract features from the source image based on a pre-trained feature extraction model to obtain the original features;

[0134] The original feature point determination unit is used to extract pixel coordinates corresponding to pixel points in the original feature, and determine the original feature points in the original feature based on the pixel coordinates.

[0135] Based on the above embodiments, the candidate feature point determination module 320 includes:

[0136] a scaled image determining unit, configured to obtain source image parameters of the source image, and determine pre-scaled image parameters of a pre-scaled image of the source image based on the source image parameters and a scaling ratio between the source image and the pre-scaled image;

[0137] a target background image determining unit, configured to generate a target background image having the same image parameters based on the pre-scaled image parameters of the pre-scaled image;

[0138] The candidate feature point determination unit is configured to determine candidate feature points corresponding to the original feature points in the target background image based on target image parameters of the target background, the source image parameters, and original coordinates of the original feature points.

[0139] Based on the above embodiments, the associated feature point determination module 330 includes:

[0140] an original feature point determination unit, configured to obtain a preset range threshold, take the current original coordinates as the coordinate center, and determine at least one original feature point within the preset range threshold among the original feature points;

[0141] The original adjacent feature point determining unit is configured to determine that each of the original feature points is at least one original adjacent feature point of the current original feature point within a preset range in the original feature.

[0142] Based on the above embodiments, the associated feature point determination module 330 includes:

[0143] an adjacent candidate feature point determination unit, configured to determine, among the candidate feature points, a current candidate feature point corresponding to the current original feature point, and adjacent candidate feature points corresponding to the original adjacent feature points;

[0144] The associated feature point determination module is used to determine that the current candidate feature point and each of the adjacent candidate feature points are associated feature points corresponding to the current original feature point in the target background image.

[0145] Based on the above embodiments, 340 includes:

[0146] an intermediate feature point determining unit, configured to respectively determine an intermediate feature point between any two adjacent associated feature points among the associated feature points;

[0147] A target image generating unit is configured to generate a target image containing target features based on the associated feature points and the intermediate coordinate points.

[0148] Based on the above embodiments, the device includes:

[0149] The smoothing processing module is used to smooth the feature edge of the target feature to obtain a smoothed target feature.

[0150] Based on the above embodiments, the source image includes a medical image, and the original feature includes a blood vessel centerline in the medical image.

[0151] Based on the above embodiments, the image processor includes a CPU sub-processor and at least one GPU sub-processor;

[0152] Accordingly, the CPU subprocessor is configured to execute the steps of acquiring original features in a source image and extracting original feature points from the original features; acquiring a target background image, and determining, based on the source image, the target background image, and the original coordinates of each original feature point, candidate feature points corresponding to each original feature point in the target background image; wherein target image parameters of the target background image are the same as pre-scaled image parameters of a pre-scaled image of the source image;

[0153] For any GPU sub-processor, the GPU is configured to determine, from the original features, at least one original adjacent feature point within a preset range of the current original feature point, and determine, based on the current original feature point and the candidate feature points corresponding to each of the original adjacent feature points, an associated feature point corresponding to the current original feature point in the target background image;

[0154] The CPU sub-processor is further configured to generate a target image containing target features based on each associated feature point in the target background image.

[0155] The image processing device provided by the embodiment of the present invention can execute the image processing method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0156] It is worth noting that in the embodiment of the above-mentioned image processing device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the various functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.

[0157] Figure 5 A schematic structural diagram of an electronic device provided by an embodiment of the present invention. Figure 5 A block diagram of an exemplary electronic device 12 suitable for implementing embodiments of the present invention is shown. Figure 5 The electronic device 12 shown is only an example and should not limit the functionality and scope of use of the embodiments of the present invention.

[0158] like Figure 5 As shown, electronic device 12 is implemented as a general-purpose computing electronic device. Components of electronic device 12 may include, but are not limited to, one or more processors or processing units 16, system memory 28, and a bus 18 connecting various system components (including system memory 28 and processing unit 16).

[0159] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. Examples of these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.

[0160] The electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 12, including volatile and non-volatile media, removable and non-removable media.

[0161] The system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be configured to read and write non-removable, non-volatile magnetic media ( Figure 5 Not shown, often called a "hard drive"). Although Figure 5 Not shown, a magnetic disk drive for reading and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 via one or more data media interfaces. System memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of various embodiments of the present invention.

[0162] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may include an implementation of a network environment. Program modules 42 generally perform the functions and / or methods of the embodiments described herein.

[0163] The electronic device 12 may also communicate with one or more external devices 14 (e.g., a keyboard, a pointing device, a display 24, etc.), one or more devices that enable a user to interact with the electronic device 12, and / or any device that enables the electronic device 12 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). Such communication may be performed through an input / output (I / O) interface 22. Furthermore, the electronic device 12 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 20. Figure 5 As shown, the network adapter 20 communicates with other modules of the electronic device 12 via the bus 18. Figure 5 Not shown, other hardware and / or software modules may be used in conjunction with the electronic device 12, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0164] The processing unit 16 executes various functional applications and sample data acquisition by running programs stored in the system memory 28, for example, implementing an image processing method provided in an embodiment of the present invention. The image processing method includes:

[0165] Acquire original features in a source image, and extract original feature points in the original features;

[0166] Acquire a target background image, and determine candidate feature points corresponding to the original feature points in the target background image based on the source image, the target background image, and the original coordinates of the original feature points; wherein target image parameters of the target background image are the same as pre-scaled image parameters of the pre-scaled image of the source image;

[0167] For any original feature point, determine at least one original adjacent feature point within a preset range of the current original feature point from the original features, and determine an associated feature point corresponding to the current original feature point in the target background image based on the candidate feature points corresponding to the current original feature point and each of the original adjacent feature points;

[0168] A target image containing target features is generated based on the associated feature points in the target background image.

[0169] Of course, those skilled in the art will appreciate that the processor may also implement the technical solution of the sample data acquisition method provided in any embodiment of the present invention.

[0170] This embodiment further provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, for example, the steps of an image processing method provided in this embodiment are implemented. The image processing method includes:

[0171] Acquire original features in a source image, and extract original feature points in the original features;

[0172] Acquire a target background image, and determine candidate feature points corresponding to the original feature points in the target background image based on the source image, the target background image, and the original coordinates of the original feature points; wherein target image parameters of the target background image are the same as pre-scaled image parameters of the pre-scaled image of the source image;

[0173] For any original feature point, determine at least one original adjacent feature point within a preset range of the current original feature point from the original features, and determine an associated feature point corresponding to the current original feature point in the target background image based on the candidate feature points corresponding to the current original feature point and each of the original adjacent feature points;

[0174] A target image containing target features is generated based on the associated feature points in the target background image.

[0175] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device.

[0176] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0177] Program code embodied on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0178] One or more programming languages ​​that support CUDA, such as C++ / Rust / MATLAB, also include conventional procedural "C" and Fortran languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).

[0179] Those skilled in the art will appreciate that the modules or steps of the present invention described above can be implemented using a general-purpose computing device. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Alternatively, they can be implemented using program code executable by a computer device, which can then be stored in a storage device and executed by the computing device. Alternatively, they can be fabricated into separate integrated circuit modules, or multiple modules or steps can be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.

[0180] Note that the above are only preferred embodiments of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments, and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments and may include many other equivalent embodiments without departing from the concept of the present invention. The scope of the present invention is determined by the scope of the appended claims.

Claims

1. An image processing method, characterized in that: Applicable to image processors, including: Acquiring original features in a source image and extracting original feature points in the original features, wherein the source image includes a medical image and the original features include a blood vessel centerline in the medical image; Acquire a target background image, and determine candidate feature points corresponding to the original feature points in the target background image based on the source image, the target background image, and the original coordinates of the original feature points; wherein target image parameters of the target background image are the same as pre-scaled image parameters of the pre-scaled image of the source image; For any original feature point, at least one original adjacent feature point within a preset range of the current original feature point is determined in the original feature, and an associated feature point corresponding to the current original feature point in the target background image is determined based on the current original feature point and the candidate feature points corresponding to each of the original adjacent feature points, including: obtaining a preset range threshold, taking the current original coordinates as the coordinate center, and determining at least one original feature point within the preset range threshold among the original feature points; determining each of the original feature points as at least one original adjacent feature point within a preset range of the current original feature point in the original feature, wherein an original feature point includes at least one original adjacent feature point; determining, among each of the candidate feature points, a current candidate feature point corresponding to the current original feature point and each adjacent candidate feature point corresponding to each of the original adjacent feature points; determining the current candidate feature point and each of the adjacent candidate feature points as each associated feature point corresponding to the current original feature point in the target background image; A target image containing target features is generated based on the associated feature points in the target background image.

2. The method according to claim 1, characterized in that The obtaining of original features in the source image and extracting original feature points in the original features includes: Obtaining pixels in the source image and determining the original features based on a preset pixel threshold condition and pixel data corresponding to the pixel points; or performing feature extraction on the source image based on a pre-trained feature extraction model to obtain the original features; Pixel coordinates corresponding to pixel points in the original features are extracted, and original feature points in the original features are determined based on the pixel coordinates.

3. The method according to claim 1, characterized in that The acquiring of the target background image and determining, based on the source image, the target background image, and the original coordinates of the original feature points, the candidate feature points corresponding to the original feature points in the target background image include: acquiring source image parameters of the source image, and determining pre-scaled image parameters of a pre-scaled image of the source image based on the source image parameters and a scaling ratio between the source image and the pre-scaled image; generating a target background image having the same image parameters based on the pre-scaled image parameters of the pre-scaled image; Based on the target image parameters of the target background, the source image parameters and the original coordinates of the original feature points, candidate feature points corresponding to the original feature points in the target background image are determined.

4. The method according to claim 1, wherein The generating of a target image containing target features based on each associated feature point in the target background image includes: respectively determining an intermediate feature point between any two adjacent associated feature points among the associated feature points; A target image including target features is generated based on the associated feature points and the intermediate feature points.

5. The method according to claim 1, characterized in that After generating the target image containing the target features, it also includes: The feature edge of the target feature is smoothed to obtain a smoothed target feature.

6. The method according to any one of claims 1 to 5, characterized in that: The image processor includes a CPU sub-processor and at least one GPU sub-processor; Accordingly, the CPU subprocessor is configured to execute the steps of acquiring original features in a source image and extracting original feature points from the original features; acquiring a target background image, and determining, based on the source image, the target background image, and the original coordinates of each original feature point, candidate feature points corresponding to each original feature point in the target background image; wherein target image parameters of the target background image are the same as pre-scaled image parameters of a pre-scaled image of the source image; For any GPU sub-processor, the GPU is configured to determine, from the original features, at least one original adjacent feature point within a preset range of the current original feature point, and determine, based on the current original feature point and the candidate feature points corresponding to each of the original adjacent feature points, an associated feature point corresponding to the current original feature point in the target background image; The CPU sub-processor is further configured to generate a target image containing target features based on each associated feature point in the target background image.

7. An image processing device, characterized in that: include: an original feature point acquisition module, configured to acquire original features in a source image and extract original feature points from the original features, wherein the source image comprises a medical image and the original features comprise a blood vessel centerline in the medical image; a candidate feature point determination module, configured to obtain a target background image and determine, based on the source image, the target background image, and the original coordinates of the original feature points, candidate feature points corresponding to the original feature points in the target background image; wherein target image parameters of the target background image are the same as pre-scaled image parameters of the pre-scaled image of the source image; an associated feature point determination module, configured to determine, for any original feature point, at least one original adjacent feature point within a preset range of the current original feature point from the original features, and determine an associated feature point corresponding to the current original feature point in the target background image based on the candidate feature points corresponding to the current original feature point and each of the original adjacent feature points; A target image generation module, configured to generate a target image containing target features based on the associated feature points in the target background image; The associated feature point determination module includes: an original feature point determination unit, configured to obtain a preset range threshold, take the current original coordinates as the coordinate center, and determine at least one original feature point within the preset range threshold among the original feature points; an original adjacent feature point determining unit, configured to determine that each of the original feature points is at least one original adjacent feature point of the current original feature point within a preset range in the original feature, wherein one original feature point includes at least one original adjacent feature point; an adjacent candidate feature point determination unit, configured to determine, among the candidate feature points, a current candidate feature point corresponding to the current original feature point, and adjacent candidate feature points corresponding to the original adjacent feature points; The associated feature point determination module is used to determine that the current candidate feature point and each of the adjacent candidate feature points are associated feature points corresponding to the current original feature point in the target background image.

8. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the image processing method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the image processing method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Image processing method and device, storage medium and electronic equipment

    CN113962856A