A method, system, device, and storage medium for target contour extraction.

By processing the gradient and orientation field of the region of interest in the target image, and using the edge response index and greedy algorithm to iteratively extract contour points, the problems of low accuracy and noise interference in traditional methods are solved, and more accurate target contour extraction is achieved.

CN115222759BActive Publication Date: 2026-03-06HEFEI INSTITUTE OF PHYSICAL SCIENCE CHINESE ACADEMY OF SCIENCES
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110418345.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-19
Publication Date
2026-03-06
Estimated Expiration
2041-04-19

AI Technical Summary

Technical Problem

Traditional target contour extraction methods have low accuracy, are easily affected by noise points, and are difficult to accurately extract target contours without prior geometric rules.

Method used

By acquiring and processing the target image to obtain the region of interest, calculating the gradient of the pixels and the gradient intensity field and orientation field, extracting the starting point using the edge response index, and iteratively extracting contour points by combining Gaussian convolution and a greedy algorithm to form the target contour.

Benefits of technology

It improves the accuracy and robustness of target contour extraction, and can stably and completely extract target contours in complex backgrounds, with high flexibility and adaptability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115222759B_ABST
    Figure CN115222759B_ABST
Patent Text Reader

Abstract

This invention provides a target contour extraction method, system, device, and storage medium, relating to the field of image processing technology. The target contour extraction method includes: acquiring a target image and processing it to obtain a region of interest (ROI); within the ROI, processing to obtain the gradient of pixels and the intensity and orientation fields of the gradients; extracting multiple starting points based on the intensity and orientation fields of the pixels; processing multiple contour points based on the starting points; and obtaining the target contour of the target image based on the contour points. This invention effectively avoids the problem in existing methods of failing to achieve good contour detection results without prior geometric constraints. It also considers three diagonally opposite pixels in the gradient's vertical direction, three pixels in the gradient's positive direction, and three pixels in the gradient's negative direction, resulting in a more accurate extracted image contour and greater flexibility and adaptability in use.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to a method, system, device, and storage medium for extracting target contours. Background Technology

[0002] The circumscribed contour of a target, as a fundamental feature of an image, contains the target's geometric attributes and serves as a crucial foundation for technologies such as target detection, shape analysis, target recognition, and target tracking. The traditional contour extraction algorithm generally follows this process: first, the target object is identified in the image, and the contrast relationship between the target object's grayscale and the background grayscale is analyzed. An appropriate threshold is set for the grayscale image to perform binarization. Then, an image edge tracking algorithm is applied to extract the contour edges of the target object. Finally, some compensation algorithms are used to make the image edges smoother and clearer. The most critical part of traditional algorithms lies in defining the contrast relationship of grayscale levels and using the contrast intensity relationship to identify target regions in the image, thereby completing edge detection.

[0003] Then, without knowing the geometric features of the target, such methods have difficulty extracting the closed target contour using geometric relationships. Furthermore, simple gray-level gradients are usually sensitive to noise. Therefore, the traditional edge contour calculation process is often affected by the image background, which affects the final extraction result, and the accuracy of natural edge detection is difficult to guarantee.

[0004] In summary, existing target contour extraction methods suffer from problems such as low accuracy and susceptibility to noise interference. Summary of the Invention

[0005] In view of the shortcomings of the prior art, the purpose of this invention is to provide a target contour extraction method, system, device and storage medium to improve the problems of low accuracy and susceptibility to noise interference in the target contour extraction methods of the prior art.

[0006] To achieve the above and other related objectives, the present invention provides a target contour extraction method, comprising:

[0007] Acquire the target image and process it to obtain the region of interest;

[0008] Within the region of interest, the gradient of the pixel and the intensity and orientation fields of the gradient are obtained.

[0009] Based on the intensity field and orientation field of the pixel, multiple starting points are extracted;

[0010] Based on the starting point, multiple contour points are obtained, and the target contour of the target image is obtained based on the contour points.

[0011] In one embodiment of the present invention, the step of acquiring the target image and processing it to obtain the region of interest includes:

[0012] The target image is binarized, and the target connected component of the target image is extracted;

[0013] Construct a circumscribed rectangle based on the target connected component;

[0014] The region of interest is obtained by extending the outer rectangle outward by a predetermined length.

[0015] In one embodiment of the present invention, the step of processing the region of interest to obtain the gradient of a pixel and the intensity field and orientation field of the gradient includes:

[0016] The gradient of pixels within the region of interest is obtained by processing according to a set calculation template;

[0017] Based on the gradient, the gradient magnitude and gradient angle of the pixel are obtained, and the gradient angle is used as the orientation field of the pixel;

[0018] The intensity field of the pixel is obtained by performing a Gaussian convolution on the gradient magnitude.

[0019] In one embodiment of the present invention, the step of extracting a plurality of starting points based on the intensity field and the orientation field of the pixel includes:

[0020] Pixels with higher gradient magnitudes in the intensity field are designated as edge points;

[0021] The region of interest is divided into multiple segments according to the gradient magnitude of the edge points from high to low.

[0022] The edge response index of the edge points within each segment is calculated using the following formula:

[0023]

[0024] in:

[0025] E represents the edge response index; I represents the grayscale difference. Let be the relative coordinates of the i-th pixel in the positive gradient direction within the 8-neighborhood of the center point x when the principal gradient direction is t. Let be the relative coordinates of the i-th pixel in the opposite direction of the gradient within the 8-neighborhood of the center point x when the principal direction of the gradient is t.

[0026] The starting point is obtained by processing based on the edge response index.

[0027] In one embodiment of the present invention, the step of processing the starting point according to the edge response index includes:

[0028] According to the edge response index, the edge point with the strongest edge response is taken as the first growth contour point, and a circle is drawn with the first growth contour point as the center and a preset step size as the radius to obtain a first region circle.

[0029] The pixel with the strongest response at the upper edge of the first region circle is used as the second growth contour point, and a circle is drawn with the second growth contour point as the center and the step size as the radius to obtain a second region circle.

[0030] The pixel with the strongest response at the upper edge of the second region circle is used as the third growth contour point;

[0031] The first growth contour point, the second growth contour point, and the third growth contour point are used as the starting point.

[0032] In one embodiment of the present invention, the step of processing to obtain a plurality of contour points based on the starting point, and obtaining the target contour of the target image based on the contour points includes:

[0033] Within each segment, based on the starting point, the first observed profile point and the expected change in the orientation angle of the profile point are obtained through processing:

[0034] Based on the first observed profile point, the angle of change of the observed growth direction of the first observed profile point is obtained through processing.

[0035] The observed growth direction change angle and the expected direction angle change are weighted and fused to obtain the direction angle change of the contour point.

[0036] Based on the edge response index, within the eight neighborhoods of the first observation contour point, the neighborhood with the strongest edge response is selected as the second observation contour point.

[0037] Based on the change in direction angle, the first observed contour point and the second observed contour point are fused to obtain the contour point;

[0038] The expected change in the orientation angle of the next contour point is obtained using the following formula, and the next contour point is obtained by processing. The extraction is iterated until a contour point that meets the preset conditions appears.

[0039]

[0040] Where θ - θ represents the expected change in orientation angle; F is the linear transformation matrix of the growth orientation angle; θ is the change in orientation angle; i-1 is the current contour point; i is the next contour point;

[0041] The target contour is obtained by processing the contour points within all the segments.

[0042] In one embodiment of the present invention, the step of iterative extraction until contour points satisfying preset conditions are found further includes:

[0043] Continuously determine the contour points;

[0044] When the contour points meet the preset conditions, the contour points of the next segment are extracted.

[0045] If the contour points do not meet the preset conditions, the iterative extraction of contour points in the current segment continues.

[0046] This invention also discloses a target contour extraction system. Using the above-described target contour extraction method, the target contour extraction system includes:

[0047] The region acquisition module is used to acquire the target image and process it to obtain the region of interest.

[0048] The gradient processing module is used to process the gradient of the pixel and the intensity field and direction field of the gradient within the region of interest.

[0049] The point extraction module is used to extract multiple starting points based on the intensity field and the orientation field of the pixel;

[0050] The contour generation module is used to process multiple contour points based on the starting point, and to obtain the target contour of the target image based on the contour points.

[0051] The present invention also discloses a target contour extraction device, which includes a processor coupled to a memory, the memory storing program instructions, and the target contour extraction method described above is implemented when the program instructions stored in the memory are executed by the processor.

[0052] The present invention also discloses a computer-readable storage medium comprising a program that, when run on a computer, causes the computer to perform the above-described target contour extraction method.

[0053] In summary, the target contour extraction method, system, device, and storage medium provided by this invention have the following beneficial effects:

[0054] It can effectively avoid the problem in existing methods that it is difficult to obtain good contour detection results without prior geometric rules constraints; at the same time, it considers three diagonal pixels in the vertical direction of the gradient, three pixels in the positive direction of the gradient, and three pixels in the opposite direction of the gradient, so that the final extracted image contour is more accurate; it has high flexibility and adaptability in use. Attached Figure Description

[0055] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0056] Figure 1 The diagram shown is a system flowchart of the target contour extraction method of the present invention.

[0057] Figure 2 The flowchart shown is for step S40 of the present invention;

[0058] Figure 3 The diagram shown is a schematic diagram of the target contour extraction system of the present invention.

[0059] Figure 4 The diagram shown is a schematic diagram of the target contour extraction device of the present invention.

[0060] Component designation explanation

[0061] Region acquisition module 100;

[0062] Gradient processing module 200;

[0063] Point extraction module 300;

[0064] Contour generation module 400;

[0065] Target contour extraction device 500;

[0066] Processor 510;

[0067] Memory 520. Detailed Implementation

[0068] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that, unless otherwise specified, the following embodiments and features can be combined with each other. It should also be understood that the terminology used in the embodiments of the present invention is for describing specific implementation schemes and not for limiting the scope of protection of the present invention. Test methods in the following embodiments that do not specify specific conditions are generally performed under conventional conditions or according to the conditions recommended by the respective manufacturers.

[0069] Please see Figures 1 to 4 It should be understood that the structures, proportions, sizes, etc., depicted in the accompanying drawings are merely for illustrative purposes to aid those skilled in the art and to facilitate understanding. They are not intended to limit the scope of the invention and therefore have no substantial technical significance. Any modifications to the structure, changes in proportions, or adjustments to size, without affecting the effectiveness and purpose of the invention, should still fall within the scope of the technical content disclosed herein. Furthermore, the terms such as "upper," "lower," "left," "right," "middle," and "one" used in this specification are merely for clarity and not intended to limit the scope of the invention. Changes or adjustments to their relative relationships, without substantially altering the technical content, should also be considered within the scope of the invention.

[0070] When numerical ranges are given in the embodiments, it should be understood that, unless otherwise stated in the present invention, both endpoints of each numerical range and any value between the two endpoints may be selected. Unless otherwise defined, all technical and scientific terms used in this invention, as well as the prior art known to those skilled in the art and the description of this invention, may be implemented using any prior art methods, devices, and materials similar to or equivalent to those described, used, or made of materials in the embodiments of this invention.

[0071] Contour extraction, also known as edge extraction, refers to the processing of image contours in digital image processing. Areas where grayscale values ​​change drastically at the boundaries of an image are defined as edges.

[0072] Please see Figure 1 This embodiment provides a target contour extraction method, which includes:

[0073] Step S10: Acquire the target image and process it to obtain the region of interest;

[0074] In machine vision and image processing, the target image to be processed is outlined with boxes, circles, ellipses, irregular polygons, etc., to define the area that needs to be processed. This area is called the region of interest.

[0075] Specifically:

[0076] The target image is quickly binarized using the Otsu's method, and the target connected component is extracted based on the prior features of the target. A bounding rectangle is constructed based on the target connected component. The region of interest is obtained by expanding the bounding rectangle outward by a set length.

[0077] The Otsu's method divides a target image into foreground and background images by setting a reasonable threshold. For example, the foreground uses n1, csum, and m1 to represent the number of pixels, quality moment, and average gray level of the foreground under the current threshold, while the background uses n2, sum-csum, and m2 to represent the number of pixels, quality moment, and average gray level of the background under the current threshold. When the set threshold is optimal, the difference between the background and foreground is maximized, thus distinguishing the foreground and background of the target image to the greatest extent. After binarizing the target image, a coarse-grained target connected component is obtained by processing the prior feature map of the target image. To ensure that the final obtained region can stably and completely cover the entire target area in complex lighting environments, the target connected component is expanded outward according to a set length to obtain the final region of interest.

[0078] Step S20: Within the region of interest, process and obtain the gradient of the pixel and the intensity and orientation fields of the gradient;

[0079] If an image is a two-dimensional function, then the gradient of the image is equivalent to taking the derivative of that two-dimensional function. The gradient is used to indicate that the directional derivative of a function at a certain point on the image reaches its maximum value along that direction, that is, the function changes the fastest and has the greatest rate of change along that direction at that point.

[0080] Specifically:

[0081] Based on a predefined calculation template, the gradient of the pixel within the region of interest is obtained; based on the gradient, the gradient magnitude and gradient angle of the pixel are obtained, with the gradient angle serving as the orientation field of the pixel; Gaussian convolution is performed on the gradient magnitude to obtain the intensity field of the pixel.

[0082] To ensure the accuracy of the final extracted target contour, a smaller computational template is used. In a preferred embodiment, a 2×2 computational template can be used. The gradient of the image is calculated using the following formula:

[0083]

[0084] Where (x,y), (x+1,y), (x+1,y+1), and (x,y+1) are the pixel coordinates on the target image, i(x,y), i(x+1,y), i(x+1,y+1), and i(x,y+1) are the gray values ​​of the aforementioned pixels on the grayscale image of the target image, and g(x,y) is the gradient vector of pixel (x,y).

[0085] The gradient magnitude of a pixel is calculated using the following formula:

[0086]

[0087] Where D(x,y) is the gradient magnitude.

[0088] The gradient angle of a pixel is calculated using the following formula:

[0089]

[0090] Where θ is the gradient angle;

[0091] Furthermore, a Gaussian convolution is performed on the gradient angle to remove numerical fluctuations in the field image caused by noise and other interference. The filter function is then calculated using the following formula:

[0092]

[0093] Where h(x,θ) is the filter function, w is the half-side length of the filter with a Gaussian kernel; I is the pixel value, G is the Gaussian function, and k is the pixel value. d (x) is a cumulative constant;

[0094] The specific formula for the Gaussian function G is as follows:

[0095]

[0096] in:

[0097] d(ξ,x)=d(ξ-x)=||ξ-x||

[0098] Cumulative constant k d (x) is used to normalize the filter parameters, and its specific formula is as follows:

[0099]

[0100] Step S30: Extract multiple starting points based on the intensity field and orientation field of the pixel;

[0101] Specifically:

[0102] Pixels with higher gradient magnitudes in the intensity field are designated as edge points. The region of interest is divided into multiple segments according to the gradient magnitudes of the edge points from highest to lowest. The edge response index of the edge points in each segment is calculated. The starting point is obtained based on the edge response index.

[0103] Within the region of interest, pixels with higher gradient magnitudes are extracted to form a set of edge points. In a preferred embodiment, to accelerate the calculation within the region of interest, the gradient magnitudes of all edge points can be mapped to an L-level response segment based on the intensity value. For example, L can be 200.

[0104] Based on the gradient magnitude of the edge points from high to low, the region of interest is divided into multiple segments. A greedy algorithm is used to filter from high-response segments to low-response segments. A greedy algorithm always makes the best choice at the moment when solving the problem, that is, it does not consider the overall optimal solution. The algorithm obtains the local optimal solution for each segment. Then, the pixels in the 8-neighborhood of the edge points are divided based on the gradient angle: including three diagonal pixels in the vertical direction of the gradient, three pixels in the positive direction of the gradient, and three pixels in the opposite direction of the gradient. The difference in gray values ​​in the positive and negative gradient directions is calculated, and the difference results are accumulated to obtain the final edge response index. The specific formula is as follows:

[0105]

[0106] Where E is the edge response index; I is the grayscale difference; Let be the relative coordinates of the i-th pixel in the positive gradient direction within the 8-neighborhood of the center point x when the principal gradient direction is t. Let be the relative coordinates of the i-th pixel in the opposite direction of the gradient within the 8-neighborhood of the center point x, when the principal direction of the gradient is t.

[0107] Based on the edge response index, the steps to obtain the starting point include:

[0108] Using the edge response index E as the evaluation standard, the edge point with the strongest edge response is selected as the first growth contour point C. i-2 and with the first growth contour point C i-2 Centered on the target area, a circle is drawn clockwise with a preset step size r as the radius to obtain a first region circle;

[0109] The pixel with the strongest response at the upper edge of the first region is used as the second growth contour point C. i-1 And with the two growth contour points C i-1 Using a circle centered at a point with a step size r as the radius, a second region circle is obtained;

[0110] The pixel with the strongest response at the upper edge of the second region is used as the third growth contour point C. i ;

[0111] Construct consecutive adjacent first growth profile points C i-2 Second growth contour point C i-1 and the third growth contour point C i These three points serve as the starting points for subsequent contour growth.

[0112] Step S40: Based on the starting point, process to obtain multiple contour points, and obtain the target contour of the target image based on the contour points.

[0113] For details, please refer to Figures 1-2 ,include:

[0114] Step S41: Within each segment, based on the starting point, process and obtain the first observed profile point and the expected change in the profile point's orientation angle:

[0115] Within the current segment, starting from point C i Using the circle as the center, draw a circle clockwise with a step size r as the radius. The point with the strongest response intensity E on the edge of this circle is taken as the first observation profile point. Starting from three points C i-2 C i-1 C i Construct the edge growth direction vector clockwise. and Therefore, the angle of change of the growth direction at the starting point is a vector. sum vector The angle θ in the clockwise direction i-1 The contour point C is obtained by processing it using the following formula. i+1 Expected change in orientation angle:

[0116]

[0117] in, For the contour point C i+1 The expected change in the direction angle, F is the linear transformation matrix of the change in the growth direction angle between adjacent contour points along the growth direction, P is the state distribution of the change in the growth direction angle, which is assumed to satisfy a Gaussian distribution; Q is the uncertainty noise generated by the current change in the growth direction, F T It is the transpose of the linear transformation relation matrix.

[0118] Step S42: Based on the first observed contour point, process to obtain the observed growth direction change angle of the first observed contour point;

[0119] Starting from two points C i-1 C i and the first observation contour point The process yields two growth direction vectors. and vector sum vector Angle in the clockwise direction included angle That is, the first observation contour point The angle of change in the observed growth direction.

[0120] Step S43: The observed growth direction change angle and the expected direction angle change are weighted and fused to obtain the direction angle change of the contour point;

[0121] Using the fusion coefficient K i+1 Observe the angle of change in growth direction and the expected change in direction angle Weighted fusion is performed, with fusion coefficient K. i Taking into account both the noise interference generated during the estimation process and the error interference generated during the contour search calculation, the fusion coefficient K is calculated using the following formula. i :

[0122]

[0123] Where R is the coefficient of the error term generated during the search process, which is calculated using the following formula:

[0124]

[0125] Where γ is the smoothing coefficient for adjusting the noise range, E i The first observation contour point The value of the edge intensity within the 8-neighbor range, μ is the first observed contour point. The mean of the 8-neighborhood range.

[0126] Step S44: Based on the edge response index, within the eight neighborhoods of the first observation contour point, select the neighborhood with the strongest edge response as the second observation contour point.

[0127] Step S45: Based on the change in orientation angle, merge the first and second observed contour points to obtain contour points;

[0128]

[0129] The contour point C is then calculated using the following formula. i+1 Numerical probability distribution of growth direction:

[0130] P i =P i-1 -K i Fi-1 P i-1

[0131] Step S46: Use the following formula to obtain the expected change in the orientation angle of the next contour point, process it to obtain the next contour point, and iterate until a contour point that meets the preset conditions appears.

[0132]

[0133] Where θ - i represents the expected change in orientation angle; i+1 represents the next contour point, based on the current contour point C. i+1 and starting point C i Processing yields contour point C i+2 After obtaining two contour points, the next contour point is obtained based on the current contour point and the previous contour point. That is, steps S41 to S45 are repeated to obtain multiple contour points of the current segment one by one until the latest obtained contour point meets the preset conditions.

[0134] The iterative extraction process until a contour point that meets the preset conditions is found also includes:

[0135] Continuously evaluate the latest obtained contour points;

[0136] When the newly obtained contour points meet the preset conditions, extract the contour points of the next segment.

[0137] If the newly obtained contour points do not meet the preset conditions, the iterative extraction of contour points in the current segment continues.

[0138] During the iterative extraction process, the centroid O of the target connected volume is extracted, and each time a new contour point C is added... i+n Calculate the contour point C i+n The target object's centroid O and the first contour point C i Does the included angle between them satisfy the preset condition η? n If ε < ε, then η is calculated using the following formula. k :

[0139] η n =1-cos(C i OC i+n )

[0140] In a preferred embodiment, ε is set to an empirical threshold of 0.01.

[0141] Step S47: Process the contour points in all segments to obtain the target contour.

[0142] Connect all the contour points in sequence to form a closed geometric shape, which is the target contour.

[0143] Please see Figure 3 This embodiment also provides a target contour extraction system. Using the above-described target contour extraction method, the target contour extraction system includes:

[0144] The region acquisition module 100 is used to acquire the target image and process it to obtain the region of interest.

[0145] The gradient processing module 200 is used to process the gradient of the pixel and the intensity field and orientation field of the gradient within the region of interest.

[0146] The point extraction module 300 is used to extract multiple starting points based on the intensity field and orientation field of the pixel;

[0147] The contour generation module 400 is used to process multiple contour points based on the starting point, and to obtain the target contour of the target image based on the contour points.

[0148] Please see Figure 4This embodiment also proposes a target contour extraction device 500, which includes a processor 510 and a memory 520. The processor 510 and the memory 520 are coupled. The memory 520 stores program instructions. When the program instructions stored in the memory 520 are executed by the processor 510, the above-mentioned target contour extraction method is implemented. The processor 510 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The memory 520 may include random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage device. The memory 520 can also be an internal memory of the Random Access Memory (RAM) type. The processor 510 and the memory 520 can be integrated into one or more independent circuits or hardware, such as Application Specific Integrated Circuits (ASICs). It should be noted that the computer program in the aforementioned memory 520 can be implemented as a software functional unit and, when sold or used as an independent product, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, electronic device, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention.

[0149] This embodiment also proposes a computer-readable storage medium storing computer instructions for instructing a computer to execute the target contour extraction method described above. The storage medium can be an electronic medium, magnetic medium, optical medium, electromagnetic medium, infrared medium, or a semiconductor system or propagation medium. The storage medium may also include semiconductor or solid-state memory, magnetic tape, removable computer disk, random access memory (RAM), read-only memory (ROM), hard disk, and optical disc. Optical discs may include optical disc-read-only memory (CD-ROM), optical disc-read / write (CD-RW), and DVD.

[0150] In summary, the target contour extraction method, system, device, and storage medium provided by this invention effectively avoid the problem in existing methods that it is difficult to obtain good contour detection results without prior geometric rules constraints. At the same time, it considers three diagonal pixels in the vertical direction of the gradient, three pixels in the positive direction of the gradient, and three pixels in the opposite direction of the gradient, so that the finally extracted image contour is more accurate. Moreover, the target contour extraction method, system, device, and storage medium of this invention have high flexibility and adaptability.

[0151] The above embodiments are merely illustrative of the principles and effects of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in the present invention should still be covered by the claims of the present invention.

Claims

1. A target contour extraction method characterized by, The method comprises the following steps: obtaining a target image and processing to obtain a region of interest; in the region of interest, processing to obtain the gradient of pixels and the intensity field and direction field of the gradient; marking the pixel points with high gradient amplitude in the intensity field as edge points; dividing the region of interest into multiple sections according to the gradient amplitude of the edge points from high to low; The edge response index of the edge point in each section is calculated by using the following formula: wherein, is the edge response index; I is a gray value difference; is the relative coordinate of the i-th pixel in the positive direction of the gradient in the 8-neighborhood of the position where the center point is located; and is the relative coordinate of the i-th pixel in the negative direction of the gradient in the 8-neighborhood of the position where the center point is located. according to the edge response index, taking the edge point with the strongest edge response as a first growth contour point, and taking the first growth contour point as the center to draw a first region circle with a preset step length as the radius; taking the pixel point with the strongest edge response on the first region circle as a second growth contour point, and taking the second growth contour point as the center to draw a second region circle with the step length as the radius; taking the pixel point with the strongest edge response on the second region circle as a third growth contour point; taking the first growth contour point, the second growth contour point and the third growth contour point as starting points; processing to obtain multiple contour points according to the starting points, and obtaining a target contour of the target image according to the contour points.

2. The target profile extraction method according to claim 1, characterized by, The step of obtaining a target image and processing to obtain a region of interest comprises the following steps: performing binaryzation on the target image, and extracting a target connected component of the target image; constructing an external rectangle according to the target connected component; extending a set length outward around the external rectangle to obtain the region of interest.

3. The target profile extraction method according to claim 1, characterized by, The step of processing to obtain the gradient of pixels and the intensity field and direction field of the gradient in the region of interest comprises the following steps: processing to obtain the gradient of pixels in the region of interest according to a set calculation template; processing to obtain the gradient amplitude and gradient angle of pixels according to the gradient, wherein the gradient angle is taken as the direction field of the pixels; performing Gaussian convolution on the gradient amplitude to obtain the intensity field of the pixels.

4. The target profile extraction method according to claim 1, characterized by, The step of processing to obtain multiple contour points according to the starting points, and obtaining a target contour of the target image according to the contour points comprises the following steps: in each section, processing to obtain a first observation contour point and a predicted direction angle change amount of the contour point according to the starting points; processing to obtain an observation growth direction change angle of the first observation contour point according to the first observation contour point; performing weighted fusion on the observation growth direction change angle and the predicted direction angle change amount to obtain a direction angle change amount of the contour point; according to the edge response index, taking the neighbor with the strongest edge response in the eight neighbors of the first observation contour point as a second observation contour point; based on the direction angle change amount, performing point fusion on the first observation contour point and the second observation contour point to obtain the contour point; using the following formula to obtain a predicted direction angle change amount of the next contour point, and processing to obtain the next contour point, and iteratively extracting until a contour point satisfying a preset condition appears; ; wherein is a predicted direction angle change amount; is a linear transformation relationship matrix of the growth direction change angle; is a direction angle change amount; i-1 is the current contour point; i is the next contour point; processing to obtain the target contour according to the contour points in all sections.

5. The target profile extraction method according to claim 4, characterized by, The step of iteratively extracting until a contour point satisfying a preset condition appears further comprises the following steps: continuously judging the contour point; when the contour point satisfies the preset condition, extracting the contour point of the next section; When the profile point does not satisfy the preset condition, the iteration extraction of the profile point of the current section is continued.

6. A target profile extraction system characterized by, The target profile extraction system comprises: a region acquisition module, configured to acquire a target image and process a region of interest; a gradient processing module, configured to process a gradient of a pixel, a strength field and a direction field of the gradient in the region of interest; a point extraction module, configured to extract a plurality of starting points according to the strength field and the direction field of the pixel; a profile generation module, configured to process a plurality of profile points according to the starting points, and obtain a target profile of the target image according to the profile points.

7. An object contour extraction apparatus characterized by comprising: A processor is included, the processor and a memory are coupled, the memory stores program instructions, and when the program instructions stored in the memory are executed by the processor, the target profile extraction method in any one of claims 1 to 5 is implemented.

8. A computer readable storage medium, characterized in that, A program is included, when it runs on a computer, so that the computer executes the target profile extraction method in any one of claims 1 to 5.

Citation Information

Patent Citations

  • A method for determining an optimal edge of a given region

    CN109558908A

  • Natural scene target contour extraction method and system based on bionics

    CN112464948A