An image edge extraction method, device, equipment and medium

CN116228801BActive Publication Date: 2026-09-18ZHEJIANG SCI-TECH UNIV +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310251403.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-08
Publication Date
2026-09-18
Estimated Expiration
2043-03-08

AI Technical Summary

Technical Problem

[0007]边缘检测的方法有基于梯度的边缘检测方法、非导数边缘检测算法等,但存在抗噪性能不佳、识别边缘的准确率不高等问题

Benefits of technology

[0008] The purpose of this invention is to propose an image edge extraction method that makes it possible to solve at least one of the above-mentioned problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116228801B_ABST
    Figure CN116228801B_ABST
Patent Text Reader

Abstract

The application provides an image edge extraction method, comprising: performing feature coding on a preset feature of each pixel point in a preset coding region in an image, each feature coding having an attribute indicating whether the pixel point is an edge point and a direction attribute of the pixel point, and acquiring position information of all pixel points in the preset coding region; traversing a feature coding set of the pixel points, determining edge points in the preset coding region according to the attribute of whether the pixel point is an edge point in the feature coding, and all the determined edge points forming an edge point set; extracting edge points belonging to the same edge from unextracted and unexcluded parts in the edge point set based on the direction attribute, fitting the edge points belonging to the same edge into a line; if all the extracted and excluded edge points are part of the edge point set, repeating the single-edge extraction of the above steps until the edge point set is traversed. Related devices, equipment and storage media are also included. The method has less influence of image noise.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of image processing technology, and in particular relates to an image edge extraction method, apparatus, computer device, and computer-readable storage medium. Background Technology

[0002] The background information related to this invention provided in this section may not all be prior art, and may contain content that does not constitute prior art.

[0003] Images contain most of the information that humans need to perceive the world, and thus understand and transform it.

[0004] Image processing is the manipulation of image information to meet the requirements of human visual psychology and practical applications. Understanding images and recognizing targets in images is the central task of computer vision image processing.

[0005] Edges are significant changes in image intensity levels, and they typically occur between the boundaries of two different objects in an image.

[0006] Edge detection methods refer to the process of finding the boundaries of objects within an image. They are used to detect discontinuities in brightness or sudden changes in pixel intensity, which are used to characterize the boundaries of objects in a scene.

[0007] Edge detection methods include gradient-based edge detection methods and non-derivative edge detection algorithms, but they suffer from problems such as poor noise resistance and low accuracy in edge recognition. Summary of the Invention

[0008] The purpose of this invention is to propose an image edge extraction method that makes it possible to solve at least one of the above-mentioned problems.

[0009] To achieve the above objectives, this invention proposes an image edge extraction method, comprising: A set of pixel feature codes and a set of pixel location information are obtained. Preset features are encoded for each pixel in a preset coding region in the image. Each feature code has an indication of whether the pixel is an edge point and the orientation attribute of the pixel. All the feature codes form the set of pixel feature codes. The location information of all the pixels in the preset coding region is obtained to form the set of pixel location information. Obtain the edge point set, traverse the pixel feature encoding set, and determine the edge points in the preset encoding region based on whether the feature encoding is an edge point. All the determined edge points constitute the edge point set. Extract an edge, and based on the direction attribute, extract all edge points belonging to the same edge from the unextracted and unexcluded portion of the edge point set, and fit all edge points belonging to the same edge into a line; If all the extracted and excluded edge points are part of the edge point set, then repeat the above "extract an edge" step to extract all edge points belonging to another edge, until the edge point set has been traversed.

[0010] In one embodiment, "extracting all edge points belonging to the same edge from the unextracted and unexcluded portion of the edge point set based on the direction attribute" includes: Using one of the unextracted and unexcluded edge points in the edge point set as the previous search origin, a search direction is set according to the direction attribute of the previous search origin. A search range is set using the search direction, a preset search angle, and a preset search step size. An edge point located within the search range whose absolute value of the angle difference between its direction and the direction of the search origin is less than or equal to a preset angle difference threshold is selected as the next search origin. If the next search origin is found, the previous search origin is replaced by the found next search origin, and the aforementioned operations in this step are repeated to form an iteration until the next search origin is one of the aforementioned search origins, at which point the search stops. Otherwise, the search also stops, and the previous search origin is excluded from all the search origins belonging to the same edge that have been searched, and is also excluded from the edge point set.

[0011] In one embodiment, in the step of "extracting all edge points belonging to the same edge from the unextracted portion of the edge point set based on the direction attribute", if the number of edge points found within a search range that satisfy the absolute value of the angle difference between the direction and the direction of the search origin is less than or equal to a preset angle difference threshold is greater than 1, then the edge point whose position is adjacent to the previous search origin is taken as the subsequent search origin.

[0012] In one embodiment, the "pixel feature encoding set acquisition unit and pixel location information set acquisition unit" is further used for: According to the preset scanning template, a scan is performed with a pixel in the unscanned part of the preset scanning area in the image as the scanning origin, and the position information of all the pixels in this scan is stored sequentially according to the scanning order. Based on the stored position information of the pixels in this scan, the values ​​of the preset features of the pixels at each position are obtained sequentially and a time series is formed. The values ​​of the elements in the time series are encoded based on the direction of change between the values ​​of any two adjacent elements in the time series and the comparison relationship between the changes in the values ​​of any two adjacent elements in the time series and a preset element change threshold. Repeat the above steps until there are no unscanned parts in the preset scanning area; Wherein, the preset scanning area is the preset encoding area; The scanning template has multiple circular structures. When it has multiple circular structures, it is composed of multiple circular shapes from small to large from the inside out, and the two ends of each circular shape are set separately.

[0013] In one embodiment, the number of circles in the scanning template is 3.

[0014] In one embodiment, feature extraction is performed on the time series prior to the encoding; The feature extraction includes: Using the time series as input data, the input data is fed into a memory model to obtain multiple memory sequences representing different levels of memory; and Perform a difference operation on all the memory sequences to obtain the final features of the time series, including: Perform a difference operation on any two adjacent pairs in all the memory sequences; and If the number of memory sequences in the result after the above difference operation is greater than 1, then perform the above difference operation step on all memory sequences in the result until the number of memory sequences in the result is 1. At this time, the unique memory sequence in the result is the final feature. The memory model includes a forgetting factor and a memory factor, which are used to characterize the degree of memory. The sum of the values ​​of the forgetting factor and the memory factor in each memory model is equal to 1. The step of inputting the input data into the memory model to obtain multiple memory sequences for representing the degree of memory includes: inputting the input data into multiple memory models that represent different degrees of memory to obtain multiple memory sequences that represent different degrees of memory, wherein the number of memory sequences obtained through the memory model is at least 3; Wherein, the time series used in the encoding is the final feature of the time series; The final feature is a statistical feature.

[0015] In one embodiment, encoding the values ​​of the elements in the time series includes: If the absolute value of the change in two adjacent elements in the time series is less than or equal to the preset element change threshold, it is encoded as a first preset constant. If the absolute value of the change of two adjacent elements in the time series is greater than the preset element change threshold, and the value of the former element is less than the value of the latter element, then it is encoded as a second preset constant. If the absolute value of the change in two adjacent elements in the time series is greater than the preset element change threshold, and the value of the former element is greater than the value of the latter element, then it is encoded as a third preset constant.

[0016] To achieve the above objectives, the present invention also proposes an image edge extraction device, comprising: The pixel feature encoding set and pixel position information set acquisition unit perform feature encoding on the preset features of each pixel in the preset encoding region of the image. Each feature encoding has an indication of whether the pixel is an edge point and the orientation attribute of the pixel. All the feature encodings form the pixel feature encoding set, and the unit acquires the position information of all the pixels in the preset encoding region to form the pixel position information set. The edge point set acquisition unit traverses the pixel feature encoding set and determines the edge points in the preset encoding region based on whether the feature encoding is an edge point. All the determined edge points form the edge point set. The single edge extraction unit extracts all edge points belonging to the same edge from the unextracted and unexcluded portion of the edge point set based on the direction attribute, and fits all edge points belonging to the same edge into a line.

[0017] In view of the above objectives, the present invention also proposes a computer device, including a memory and a processor, wherein the memory stores a computer program, characterized in that the processor executes the computer program to implement the steps of the method described in any of the above claims.

[0018] In view of the above objectives, the present invention also proposes a computer-readable storage medium having a computer program stored thereon, characterized in that the computer program, when executed by a processor, implements the steps of the method described in any of the preceding claims.

[0019] Additional aspects and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description or may be learned by practice of the invention. Attached Figure Description

[0020] 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.

[0021] Figure 1 This is a flowchart illustrating one embodiment of the image edge extraction method of the present invention.

[0022] Figure 2 This is a flowchart illustrating one embodiment of the image feature encoding method in this invention.

[0023] Figure 3 This is a schematic diagram of a spiral template used in one embodiment of the image feature encoding method according to the present invention.

[0024] Figure 4 This is a schematic diagram of an image to be scanned in one embodiment of the image feature encoding method according to the present invention.

[0025] Figure 5 This is a schematic diagram of the neighborhood structure of lateral edge feature points in one embodiment of the image feature encoding method according to the present invention.

[0026] Figure 6 This is a schematic diagram of a pulse signal generated after feature extraction from a time series according to another embodiment of an image feature encoding method of the present invention.

[0027] Figure 7 This is a flowchart illustrating an implementation method for time series feature extraction according to the present invention.

[0028] Figure 8 This is a rectangular coordinate graph of a time series data.

[0029] Figure 9 Instead of using the feature extraction method in this invention, only first-order difference operations were used for extraction. Figure 8 A rectangular coordinate graph of the characteristics of the time series.

[0030] Figure 10 To extract using the extraction method described in Embodiment 1 of this invention. Figure 8 A rectangular coordinate graph of the characteristics of the time series.

[0031] Figure 11 The diagram illustrates the differential operation principle in an implementation of an extraction method of the present invention when the number of generated memory sequences is three.

[0032] Figure 12 The diagram illustrates the differential operation principle in an embodiment of the extraction method of this invention when the number of generated memory sequences is four.

[0033] Figure 13A , 13B Figures 1 and 13C are schematic diagrams of edge points, edge-adjacent points, and non-edge points, respectively.

[0034] Figure 14 This is a flowchart illustrating another embodiment of the image edge extraction method of the present invention.

[0035] Figure 15A , 15B The images are shown in the original order. Figure 15A The image with the edges extracted.

[0036] Figure 16A , 16B The diagrams show a 36-bit spiral scan template, an edge image, a spiral scan template placed on a target image, and a display of mutation locations, respectively.

[0037] Figure 17A , 17B Figures 1 and 17C are schematic diagrams of one example of nonmaximum suppression, another example of nonmaximum suppression, and an example of positive / negative gradient directions in the Canny algorithm, respectively.

[0038] Figure 18 This is a block diagram illustrating one embodiment of the image edge extraction device of the present invention.

[0039] Figure 19 This is a schematic diagram illustrating an embodiment of the image edge extraction method of the present invention, in which two edge points are searched within a search range.

[0040] The accompanying drawings are for illustrative purposes only and are not intended to be drawn to scale. The same reference numerals are used to indicate the same elements in the drawings. For simplicity, not every component is numbered in every drawing. Detailed Implementation

[0041] The present invention will now be described with reference to several examples. It should be understood that these embodiments are described in order to enable those skilled in the art to better understand and implement the present invention, and do not imply any limitation on the scope of the present invention.

[0042] As a type of edge detection method, gradient-based edge detection methods essentially work by using the first derivative of image intensity to find intensity variations. This differentiation is achieved using different types of horizontal and / or vertical masks of the image. Commonly used masks (i.e., edge operators) are Roberts, Prewitt, Sobel, and isotropic as first-order, and the Laplacian and Gaussian Laplacian operators as second-order. Second-order operators are more complex than first-order operators because first-order edge detectors search for points with high gradient values, while second-order edge detectors find edge points at zero-crossings. Among first-order operators, the Sobel operator applies greater stress to diagonal edges than to horizontal and vertical edges. However, they are highly sensitive to noise and exhibit poor performance in noisy or realistic environments. All gradient-based methods require localization via non-maximum suppression and hysteresis thresholding.

[0043] As another edge detection method, unlike gradient-based edge detection algorithms, Smith and Brady proposed a non-derivative edge detection algorithm called SUSAN (Smallest Univalue Segment Assimilating Nucleus). Its basic idea is to associate each pixel of the image with a small region of neighboring pixels with similar brightness, called a USAn (Univalue Segment Assimilating Nucleus). They used a circular mask consisting of 37 pixels, typically with a radius of 3.4 pixels, to perform SUSAN edge detection while searching for USAn regions. Because it is a non-derivative operator, it does not introduce noise in the edge extraction operation. Compared to gradient-based edge detection methods, the SUSAN algorithm has advantages such as better robustness, stronger noise resistance, and higher reliability, but it cannot distinguish the direction and attribute information of the edges.

[0044] As another edge detection method, the Canny edge detection method is also an algorithm involving derivatives. It mainly consists of the following five steps: Step 1: Gaussian filtering. The main purpose of Gaussian filtering is to smooth the image and reduce noise. Step 2: Calculate the image size and gradient direction. The reason for calculating the image gradient is that the gradient is relatively large at the edges of the image. So we only need to select the pixels with larger gradients. For ease of calculation, we can use a matrix to represent it. Next, we perform convolution on the image. If we want to consider the influence of the surrounding pixels of a certain pixel, we can use the Sobel kernel for convolution. Step 3: Non-maximum suppression. The resulting gradient image cannot represent the edges of the image because it contains some pixels with small gradient values. These pixels are not actually edges, and some edges are not one pixel wide. Since we want the edge width to be only one pixel, we need to set the pixel values ​​of these pixels with small gradients to 0 and keep only the largest pixel at the edge. Therefore, the gradient image needs to be subjected to non-maximum suppression. The non-maximum suppression method is to traverse all pixels. If the gradient of a pixel is larger than that of the two pixels along the gradient direction, the gradient value is retained. Conversely, if the gradient value of any one of the two pixels along the gradient direction is greater than its own gradient, its gradient is set to 0. Step 4: Edge screening with double thresholds. After obtaining the image through non-maximum suppression, there are still some pixels in the image that have values ​​but are not edges. Therefore, double threshold screening is required. That is, a large threshold and a small threshold are set. If the gradient value is greater than the large threshold, it is considered to be an edge and is called a strong edge. If it is between the two thresholds, it is considered to be a possible edge and is called a weak edge. If the gradient is lower than the small threshold, it is considered not an edge. Thus, only strong edges and weak edges need to be retained. Step 5: Connect the edges. After the above steps, we have obtained strong edges and weak edges. Next, we select pixels from the weak edges that are more likely to be edges and connect these pixels to the strong edges.

[0045] It should be noted that here we consider weak edges adjacent to strong edge pixels as edge pixels. Therefore, we can iterate through all strong edge pixels and check if there are any weak edge pixels around them; if so, we classify them as strong edges.

[0046] To better illustrate the "non-maximum suppression" step in the Canny edge detection method, further explanation is provided below. After obtaining the magnitude and direction of the gradient, the image is traversed, and all non-edge points are removed. In practice, each pixel is traversed sequentially, determining whether the current pixel is the maximum value with the same gradient direction among its surrounding pixels, and deciding whether to suppress that point based on the result.

[0047] The step described above for determining whether a pixel needs suppression is actually an edge refinement process. For each pixel: 1. If the pixel is a local maximum along the positive / negative gradient direction, then retain the pixel; 2. If the pixel is not a local maximum in the positive / negative gradient direction, then suppress the pixel (i.e. return it to zero).

[0048] like Figure 17AThis is one example of non-maximum suppression in the Canny edge detection method. In the left image, the wider gray block represents the object, and in the right image, the narrower gray block represents an edge of the wider gray block in the left image. Points A, B, and C have the same direction (the gradient direction is perpendicular to the edge). The algorithm determines whether these three points are local maxima: if so, the point is retained; otherwise, it is suppressed. By comparison, point A has the largest local value, so point A is retained (called the edge), and the other two points B and C are suppressed (i.e., reduced to zero).

[0049] like Figure 17B This is the second example of non-maximum suppression in the Canny edge detection method. Points in the black background are local maxima of the gradient in the upward direction (i.e., horizontal edges). Therefore, these points are preserved; the remaining points are suppressed (i.e., zeroed out). This means that these black background points are ultimately treated as edge points, while other points are treated as non-edge points.

[0050] like Figure 17C This example illustrates the positive / negative gradient directions in the Canny edge detection method. "Positive / negative gradient directions" refers to the two opposite directions of the gradient. For example, in... Figure 17B In the image, pixels with a black background are local maxima along the vertical gradient upwards (i.e., at the horizontal edge). These points will ultimately be processed as edge points. And... Figure 17C In the image, pixels with a black background are local maxima of the vertical gradient pointing upwards and downwards (i.e., at the horizontal edge). These points will ultimately be processed as edge points.

[0051] After the above processing, for several edge points in the same direction, basically only one is retained. For example, the black areas represent the edges. From the perspective of image and object composition, the edges of objects are continuous and have significant abrupt changes compared to their surroundings, so the black areas represent the edges.

[0052] While the Canny edge detection method described above may overcome one or more of the problems found in the aforementioned algorithms, its drawback is weak noise resistance, which affects the edge detection performance.

[0053] Therefore, such as Figure 1 As shown, one embodiment of an image edge extraction method of the present invention includes steps S310, S320, S330 and S340.

[0054] S310. Obtain a pixel feature encoding set and a pixel position information set. Perform feature encoding on a preset feature of each pixel in a preset encoding region in the image. Each feature encoding has an indication of whether the pixel is an edge point and the orientation attribute of the pixel. All the feature encodings form the pixel feature encoding set. Obtain the position information of all the pixels in the preset encoding region to form the pixel position information set.

[0055] It should be noted that the attributes (here, the attributes of a pixel refer to edge points, edge-adjacent points, non-edge points, etc.) and orientation attributes can be identified through feature encoding, and these can be used as the basis for subsequent edge extraction.

[0056] It should be noted that this preset feature can be set as needed, such as grayscale features. Additionally, the directional attribute mentioned here refers to the gradient direction of the preset feature for that pixel.

[0057] S320. Obtain the edge point set, traverse the pixel feature encoding set, and determine the edge points in the preset encoding region based on the attribute of whether the feature encoding is an edge point. All the determined edge points constitute the edge point set.

[0058] S330. Extract an edge, and based on the direction attribute, extract all edge points belonging to the same edge from the unextracted and unexcluded part of the edge point set, and fit all edge points belonging to the same edge into a line.

[0059] It should be noted that finding all edge points of the same edge based on the direction attribute of the edge points can effectively prevent the influence of Gaussian noise in the Canny edge detection method on edge extraction.

[0060] S340. If all the extracted and excluded edge points are part of the edge point set, repeat the above "extract an edge" step to extract all edge points belonging to another edge until the edge point set has been traversed.

[0061] This invention can identify feature points in different positions and directions by using different feature codes and pixel location information, thereby achieving edge extraction; in addition, compared with the Canny edge detection method, it is less affected by image noise.

[0062] It should be noted that there are multiple ways to encode the features in step S310 above, which can be set according to the specific situation. To better illustrate this feature encoding, for example... Figure 2As shown, an embodiment for obtaining a set of pixel feature codes and a set of pixel location information is illustrated, including steps S210, S220, S230 and S240, as detailed below.

[0063] Step S210: According to the preset scanning template, a scan is performed with one pixel in the unscanned part of the preset scanning area in the image as the scanning origin, and the position information of all the pixels in this scan is stored sequentially according to the scanning order.

[0064] It should be noted that the preset scanning area is the same as the preset encoding area mentioned above.

[0065] It should be noted that an image may also refer to a frame in a video.

[0066] It should be noted that the scanning template is used by placing it within the scanning area set in the target image. Scanning begins from a pixel in the target image corresponding to the starting point of the scanning template (serving as the scanning origin), and proceeds sequentially along the scanning path set in the template to scan the corresponding pixels in the target image. The construction of this scanning template can be customized as needed and is not subject to any limitations.

[0067] It should also be noted that the preset scanning area can usually be set to the entire target image, but it can also be set to a part of the target image as needed.

[0068] It should also be noted that in electronic devices, the data structure for storing the position information of the pixels can be an array, or other data structures as needed, such as setting multiple corresponding variables and storing the position information of each pixel in a corresponding variable.

[0069] Step S220: Based on the position information of the pixels in this scan stored above, sequentially obtain the preset feature values ​​of the pixels at that position and form a time series.

[0070] It should be noted that time series data is an important high-dimensional data type, consisting of a sequence of data points arranged chronologically. It has wide applications in economics, management, and engineering. Time series data mining can extract useful time-related information from the data, enabling knowledge extraction.

[0071] Step S230: Encode the values ​​of the elements in the time series based on the direction of change between the values ​​of any two adjacent elements in the time series and the comparison relationship between the change of the values ​​of any two adjacent elements in the time series and a preset element change threshold.

[0072] It should be noted that the preset element change threshold setting in this step can filter out subtle changes and retain the pixel position information of drastically changing pixels.

[0073] Specifically, the encoding rules in step S230 are as follows: If the absolute value of the change in two adjacent elements in the time series is less than or equal to the preset element change threshold, it is encoded as a first preset constant. If the absolute value of the change of two adjacent elements in the time series is greater than the preset element change threshold, and the value of the former element is less than the value of the latter element, then it is encoded as a second preset constant. If the absolute value of the change in two adjacent elements in the time series is greater than the preset element change threshold, and the value of the former element is greater than the value of the latter element, then it is encoded as a third preset constant.

[0074] It should be noted that the preset element change threshold can be set based on the overall situation of the absolute values ​​of the changes of all two adjacent elements in the time series.

[0075] It should be noted that the first, second, and third preset constants can be numerical values, characters, or strings.

[0076] It should be noted that the encoding set formed after encoding according to the above encoding rules is a set consisting of the first preset constant, the second preset constant, and the third preset constant.

[0077] Step S240: Repeat the above steps until there are no unscanned parts in the preset scanning area.

[0078] It should be noted that this implementation method extracts features based on pixels, thus enabling accurate extraction of features from any edge pixel target. Furthermore, the relative positional information between these pixels can be preserved during encoding.

[0079] Additionally, it should be noted that the pixel domain within the scanning template range can be considered as a cell (e.g., a 7x7 cell), and several cells form a block (e.g., 2x2 cells = 1 block). Encoding each cell using the above encoding method creates a description of each cell. Concatenating the feature codes of all cells within a block yields the structural feature code of that block. The blocks composed of cells are then scanned and encoded in the target image at a certain step size. Finally, concatenating the structural feature codes of all blocks within the image yields the structural feature code of the image itself. The resulting structural feature vector can then be used for further image processing tasks.

[0080] To better understand the content of this encoding method, the following example is provided. Example

[0081] Step 1: Based on the fact that the human visual system acquires visual information and encodes it to form cognition through visual sensory organs, and that the working principle of the human sensory system is determined by the principle of relative judgment of the observed things, such as... Figure 3 As shown, a spiral scanning template within the range of ω is generated by rounding down the angle step size θ and the radius step size r, enabling it to simultaneously focus on the target pixel and other pixels in its neighborhood. The spiral scanning template is used to scan and determine the target image pixels. Before scanning, the currently scanned pixel is positioned at the center of the spiral template. The index coordinates (i.e., position information) of the pixels traversed by the spiral are stored sequentially in an array (one type of storage structure) according to the template.

[0082] It should be noted that this spiral scanning template is constructed based on the principle of human eye scanning for information acquisition. The angular step size θ, radius step size r, and spiral range ω can all be changed according to actual conditions and are not limited. Preferably, the scanning path of this spiral scanning template is a spiral circle. Of course, in addition to the spiral scanning template, other scanning templates can also be selected as needed, such as scanning templates with polygonal structures, specifically triangular scanning templates, rectangular scanning templates, pentagonal scanning templates, etc.

[0083] Step 2: Based on the index coordinates of the pixels stored in the array above, read the gray values ​​of all pixels within the corresponding spiral scan range (here, gray value is one of the preset features) and store them as a time series that saves the gray values ​​of all pixels in the current template.

[0084] It should be noted that a pulse signal can be generated based on this time series, and the preset element change thresholds described below can be set according to the amplitude of the pulse signal.

[0085] Step 3: Mimicking the retinal nerves of the human eye, each pixel works independently, encoding by sensing changes in grayscale values ​​between pixels.

[0086] The specific encoding rules are as follows: When the absolute value of the difference between the former and the latter of two adjacent elements in the time series is greater than the preset element change threshold, and the former of the two adjacent elements in the time series is less than the latter, the encoding is 1 (i.e., the second preset constant, which here represents a jump from low grayscale value to high grayscale value); when the absolute value of the difference between the former and the latter of two adjacent elements in the time series is greater than the preset element change threshold, and the former of the two adjacent elements in the time series is greater than the latter, the encoding is -1 (i.e., the third preset constant, which here represents a jump from high grayscale value to low grayscale value); when the absolute value of the difference between the former and the latter of two adjacent elements in the time series is less than or equal to the preset element change threshold, the encoding is 0 (i.e., the first preset constant, which here represents that the grayscale value remains unchanged or changes within an approximate range).

[0087] The resulting encoding set for this scan consists of -1, 0, and 1.

[0088] In another embodiment of an image feature encoding method of the present invention, before step S230, the method further includes, as follows: Figure 7 The steps shown for feature extraction from this time series include: Step S110: Using the time series as input data, input the input data into the memory model to obtain multiple memory sequences representing the degree of memory, each memory sequence representing a different degree of memory; and Step S120: Perform a difference operation on all the memory sequences to obtain the final features of the time series; The memory model includes a forgetting factor and a memory factor, which are used to characterize the degree of memory. The sum of the values ​​of the forgetting factor and the memory factor in each memory model is equal to 1. The step of inputting the input data into the memory model to obtain multiple memory sequences for representing the degree of memory includes: inputting the input data into multiple memory models that represent different degrees of memory to obtain multiple memory sequences that represent different degrees of memory, wherein the number of memory sequences obtained through the memory model is at least 3; The time series used in the encoding is the final feature of the time series.

[0089] It should be noted that the above memory model can be configured to include different parameter forms according to specific needs. In one embodiment of this feature extraction method, the memory model includes a forgetting factor and a memory factor, which are used to characterize the degree of memory.

[0090] Additionally, it should be noted that the number of memory sequences generated in steps S110 and S120 can be set according to specific needs, but at least 3, in order to make it possible to implement second-order and higher-order difference operations.

[0091] Specifically, performing a difference operation on all the memory sequences to obtain the final features of the time series includes: Perform a difference operation on any two adjacent pairs in all the memory sequences; and If the number of memory sequences in the result after the above difference operation is greater than 1, then perform the above difference operation step on all memory sequences in the result until the number of memory sequences in the result is 1. At this time, the unique memory sequence in the result is the final feature. The final feature is a statistical feature.

[0092] It should be noted that the feature extraction method for this time series can detect and extract the abrupt change locations of the time series. Inspired by the above, based on the principle of human eye scanning to acquire information, a scanning template is constructed to convert the changes in pixel feature values ​​(such as grayscale, and other pixel features can be set as needed) into a sequence. The features are described by encoding, which can preserve the relative position information between features and accurately extract the features of smooth-edged targets.

[0093] It's important to note that the first step in time series analysis is extracting the deterministic information (such as trend information, seasonal cycle information, and cyclical change information) contained in the series. There are many methods for extracting deterministic information, such as constructing seasonal indices, fitting long-term trend models, moving averages, and exponential smoothing. However, these methods are not always sufficient to extract all the necessary deterministic information, and there is a high probability of significant feature loss after extraction.

[0094] Therefore, in another embodiment of the present invention, the method for feature extraction of the time series introduces a memory model with a standard level of memory and a difference algorithm to reduce the loss during feature extraction and improve the efficiency of deterministic information extraction.

[0095] The aforementioned memory model can generate different memory sequences based on the degree of memory of the input time series data. Then, a difference algorithm is applied to the memory sequences to avoid excessive loss of information when extracting feature information. This model can better match the data change rate of the original time series, improve accuracy, and avoid the influence of noise.

[0096] The aforementioned difference algorithm (also known as difference function or difference operation) refers to the operation of difference corresponding to discrete quantities. It is an operation performed using differences, and the result of the difference reflects a change between discrete quantities, serving as a tool for studying discrete mathematics. In socio-economic activities and natural science research, we often encounter variables related to time t, but people can often only observe or record the values ​​of these variables at discrete times t. For such variables, how to study their interrelationships is inseparable from the tools of difference and difference equations. The tools of differentials and differential equations in calculus, in fact, originate from difference and difference equations. Therefore, difference and difference equations are more original, objective, and vivid materials. One function of the aforementioned difference algorithm is to reduce irregular fluctuations between data, making its fluctuation curve smoother. This is achieved by extracting deterministic information through autoregression. Moreover, the difference algorithm is simple to operate and consumes relatively few resources when implemented on a computer.

[0097] Furthermore, this method introduces multiple levels of memory, each representing the degree of memory of the current and past information of the original time series. Then, by performing multi-level difference operations on the memory sequences generated by different levels of memory, excessive information loss can be avoided, the data change rate of the original time series can be well matched, the accuracy can be improved, and the influence of noise can be avoided.

[0098] To better understand the steps for feature extraction from the time series described above, two examples are provided below, namely Example 2 and Example 3. Example

[0099] Step 1: Extract the first number from the original time series list and store it in the first storage location in L1, L2 and L3 respectively.

[0100] It should be noted that in this example, `list` represents the input data used to input the memory model, and the number of generated memory sequences is three: L1, L2, and L3. In a computer, `list`, L1, L2, and L3 can all be arrays, and they can be arrays of the same dimension and size.

[0101] Step 2: Set parameters f1 and f2 to adjust the fineness of the extracted edge information or feature points. Set different forgetting factors fgr according to different levels of memory. j and memory factor memj Yes, j=1, 2, 3, fgr1=f1-f2, mem1=1-fgr1; fgr2=f1, mem2=1-fgr2; fgr3=f1+f2, mem3=1-fgr3.

[0102] It should be noted that the memory model in this second embodiment introduces a forgetting factor fgr. j (used to indicate the degree of forgetting of information) and memory factor mem j (Used to represent the degree of information retention), and three pairs of different forgetting factors fgr were set. j Memory factor mem j The correct memory models are: Memory Model A includes fgr1 and mem1, Memory Model B includes fgr2 and mem2, and Memory Model C includes fgr3 and mem3.

[0103] It should be noted that each pair of forgetting factors fgr here j and memory factor mem j j=1,2,3 Step 3: Iterate through the time series list, considering its length k, and calculate the degree of memory and forgetting for current and past information using the following formula to ultimately generate the memory sequence L. j L j [i]=mem j *L[i-1]+fgr j *list[i], j=1, 2, 3; i=1, 2, 3...k.

[0104] It should be noted that each of the aforementioned memory models also includes the above calculation formula: L j [i]=mem j *L[i-1]+fgr j *list[i], j=1,2,3; i=2,3,...,k. Memory sequence L j j=1,2,3, representing L1, L2, and L3 above, respectively. In this step, L1, L2, and L3 are responsible for assigning values ​​to the memory sequences L1, L2, and L3. The input data is a time series list. The value assigned to L1 is the value obtained after substituting the input data list into memory model A; the value assigned to L2 is the value obtained after substituting the input data list into memory model B; the value assigned to L3 is the value obtained after substituting the input data list into memory model C.

[0105] According to the forgetting factor fgr j and memory factor mem jThe different values ​​set for memory models A, B, and C can represent different levels of memory retention. For example, by setting the values ​​of parameters f1 and f2, memory model A can be set to have good memory for current information and poor memory for past information; memory model B can be set to have average memory for both current and past information; and memory model C can be set to have poor memory for current information and good memory for past information.

[0106] Step 4: The final feature result is obtained from the formula result = (L2 - L1) - (L3 - L2) = 2 * L2 - L1 - L3; It should be noted that, as Figure 11 As shown, the three memory sequences L1, L2, and L3 are first subjected to first-order difference calculations between adjacent memory sequences L2 and L1, and L3 and L2. After the first-order difference calculation, if the number of remaining memory sequences is greater than 1, a second-order difference calculation can be performed, that is, the difference result between L2 and L1 is further differiated with the difference result between L3 and L2. The final sequence obtained is the final feature, that is, the deterministic information to be extracted.

[0107] like Figure 8 As shown, a time series is presented, representing the monthly sales volume of shampoo from 1900 to 1903, totaling 36 data points. This data was contributed by Makridakis, Wheelwright, and Hyndman (1998). The horizontal axis in the figure represents year-month, and the vertical axis represents shampoo sales volume.

[0108] like Figure 9 As shown, this is the result obtained using existing first-order difference processing (without using the memory model of this invention). The horizontal axis represents year-month, and the vertical axis represents the result after first-order difference processing. (This figure is then compared with...) Figure 8 The comparison clearly shows that the results obtained using first-order difference processing (without using the memory model in this invention) are different from those obtained using the memory model in this invention. Figure 8 The poor consistency of the data change rate indicates that the feature loss extracted using this first-order difference processing (without using the memory model in this invention) is significant.

[0109] like Figure 10 As shown, the results obtained using the extraction method of Embodiment 2 are illustrated. The horizontal axis represents year-month, and the vertical axis represents the processing results obtained using the extraction method of Embodiment 2. This figure is compared with... Figure 8 By comparison, it is clear that the results in this figure are different from those in the others. Figure 8 The data change rate matches better than Figure 9The difference is much higher, indicating that the feature loss extracted using the extraction method of this embodiment two is much smaller than the feature loss extracted using the existing first-order difference processing (without using the memory model in this invention). Example

[0110] Step 1: Extract the first number from the original time series list and store it in L. j In the first storage location, j = 1, 2, ..., n.

[0111] It should be noted that in this example, `list` represents the input data used to input the memory model, and the number of generated memory sequences is `j`. In a computer, `list` and `L` here... j j = 1, 2, ..., n can all be arrays, and can be arrays with the same dimensions and size.

[0112] Forgetting factor fgr j and memory factor mem j Step 2: Set different forgetting factors (fgr) according to different levels of memory. j and memory factor mem j j = 1, 2, ..., n. fgr j =m+f*sin(wt), 0<fgr j <1, mem j =1-fgr j , 0 < mem j <1, m represents the average memory level, f represents the memory fluctuation ratio coefficient, w represents the waveform fluctuation level, and t represents the time series time.

[0113] It should be noted that the memory model in this third embodiment also incorporates the forgetting factor fgr. j (used to indicate the degree of forgetting of information) and memory factor mem j (used to indicate the degree of information retention), but in this third embodiment, the forgetting factor fgr j Memory factor mem j The format used differs from that in Example 2. Different forgetting factors fgr j and memory factor mem j The corresponding memory models represent different levels of memory, j = 1, 2, ..., n.

[0114] Step 3: Iterate through the time series list, considering its length k, and calculate the degree of memory and forgetting for current and past information using the following formula. L j [i]=mem j*L[i-1]+fgr j *list[i], j=1, 2, ,..., n; i=2, 3,..., k.

[0115] It should be noted that each of the aforementioned memory models also includes the above calculation formula: L j [i]=mem j *L[i-1]+fgr j *list[i], j=1,2,...,n; i=2,3,...,k. Substituting the time series list into memory models representing different levels of memory generates different memory sequences L. j j = 1, 2, ..., n.

[0116] The maximum value of j can be set as needed. For example, if deterministic information can be extracted using only first-order differencing, the maximum value of j can be set to 2. Alternatively, if first-order differencing is insufficient to extract deterministic information (e.g., when the time series list contains a significant trend, although first-order differencing can stabilize the trend, it cannot accurately represent the original data trend, leading to excessive information loss, low estimation accuracy, and the introduction of noise), then higher-order differencing can be used to extract deterministic information. In this case, the maximum value of j can be set to 3 (to enable second-order differencing) or greater (to enable even higher-order differencing).

[0117] Step 4: Based on the difference principle, process the time series L obtained in Step 4. j The first-order difference operation is performed on adjacent sequences in (j=1,2,...,n). If the final feature is not obtained, the result of the first-order difference operation is subjected to second-order difference, and so on, until the final feature of the time series, i.e., deterministic information, is finally obtained.

[0118] It should be noted that in practice, the appropriate differencing method can be selected based on the different characteristics of the time series. For example... Figure 12 The diagram shows the calculation principle of first-order, second-order, and third-order differences to obtain the final features of the time series when the maximum value of j is 4.

[0119] Additionally, it should be noted that, besides the two embodiments mentioned above (i.e., Embodiment 2 and Embodiment 3), the forgetting factor fgr in the memory model... j and memory factor mem j The settings can also be configured in different ways depending on the specific circumstances.

[0120] The characteristics of time series include statistical features, fitting features, and classification features. The statistical features mentioned above form the basis for analyzing the fitting and classification features.

[0121] The statistical characteristics of time series can generally be divided into two categories: time domain and frequency domain. Time domain characteristics can be further divided into dimensional characteristics and dimensionless characteristics. Dimensional characteristics include mean, variance, root mean square (RMS), peak value, etc., while dimensionless characteristics include impulse factor, peak value factor, waveform factor, etc. Frequency domain characteristics include mean square frequency, root mean square frequency, frequency variance, frequency standard deviation, etc.

[0122] Because dimensional indices are sensitive to signal characteristics when representing signals, they can also change due to variations in operating conditions (such as load) and are highly susceptible to environmental interference. Existing methods may not detect all of these interferences. Although dimensionless features can eliminate these interferences, they are computationally difficult.

[0123] The implementation of one of the extraction methods in this invention not only makes good use of the property of the difference method to fully extract deterministic information, but also extracts dimensional indicators of time series, such as peak values, thereby perfectly completing feature extraction.

[0124] like Figures 4 to 6 The image shown is a specific example of an image feature coding method that can identify feature points at different locations and in different directions through different pulse coding results. Details are as follows.

[0125] Enter a picture like Figure 4 The images shown have lines with different directions, using, for example Figure 3 The spiral scan template shown scans the image.

[0126] For lateral edge feature points, their neighborhood structure in the spiral template is as follows: Figure 5 As shown, the sequence obtained by scanning at this time is: [255,0,0,255,255,255,255,0,0,0,0,0,0,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255].

[0127] like Figure 6 As shown, this is a pulse signal diagram formed after feature extraction of the time series.

[0128] A preset element change threshold is selected as 1 / 2 of the maximum amplitude of the pulse signal, and encoding is performed according to the encoding method in step three of embodiment one above, resulting in a final output encoding set: 10-1000100000-10000000010000000-10000000000 (40 bits). Changing the target pixel will yield different encoding results, such as: 100-10001000000-100000000100000000-10000000 (Edge feature points in the 45° direction) 0100-100001000000-1000000000100000000-10000 (Vertical edge feature points) The characteristic of this encoding method is that it can accurately extract the structural features of any feature point, while retaining the relative positional information between each feature (which can be known from the template), and can completely restore the image based on memory.

[0129] In step S320 above, "determine the edge point in the preset coding region based on whether it is an edge point in the feature encoding." The attribute of the edge point determines whether the pixel is an edge point, an edge-adjacent point, or a non-edge point. This edge point attribute is determined by the feature encoding. To better illustrate this step, embodiments four and five are listed below.

[0130] The edge point set contains the feature code corresponding to each edge point and the position information of that edge point (which can be obtained from the pixel position information set). When stored in a computer, the feature code and position information of each edge point can be stored together in an element of a matrix data storage structure, or the feature code and position information of each edge point can be stored separately in elements of two different data structures.

[0131] Since edge points are where pixel attributes change abruptly, this characteristic can be used to identify edge points. For example, if a sudden change in the grayscale value, a preset feature of a pixel, is detected, then that pixel is identified as an edge point, and the direction of the attribute change differs for pixels at different locations. Example

[0132] like Figure 13A As shown in the figure, the points marked with coordinates are edge points, such as... Figure 13B As shown in the figure, the points marked with coordinates are the points adjacent to the edge, such as... Figure 13CAs shown, the points marked with coordinates in the figure are non-edge points. The encoding length of the grayscale features of the edge point, the edge neighbor point, and the non-edge point is all 40 (this grayscale feature is a preset feature, and the encoding length is based on the total number of scannable pixels in the scanning template, which is...). Figure 3 The 40-bit spiral scan template shown below are as follows: 100-1001 000000-100000000 10000000000-1000000; 0000000 000000000-101-110 00000000000-1000000; 0000000 00000000000000 00000000000.

[0133] The above encoding rules are described in step three of the above embodiment regarding "specific encoding rules".

[0134] The above three 40-bit codes are each divided into three parts, with the first part including bits 1 to 7 corresponding to the above... Figure 3 The first coil (the innermost coil) of the spiral scanning template shown is divided into three parts: the second part, which includes positions 8 to 22 corresponding to the second coil of the spiral scanning template; and the third part, which includes positions 23 to 40 corresponding to the third coil (the outermost coil) of the spiral scanning template.

[0135] The methods for determining edge points, edge-adjacent points, non-edge points, and interference points (i.e., noise) are shown in the table below. The specific determination of edge points can be made based on the above encoding. For example, if it is the upper edge point of a left-falling stroke in Chinese characters, it will satisfy the following characteristics: starting with 100-10 or 1000-1, direction less than 45°, the 7th bit is 1, direction greater than or equal to 45°, the 8th bit is 1; if it is not an edge point, it will start with 000; if it is not an edge point, its encoding will be all 0s. From the above specific determination, it can be shown that the encoding position can reflect directional information. Example

[0136] like Figure 16A As shown, the scanning template used is a 36-bit spiral scanning template, used for scanning such as... Figure 16B The image shows the edge of an object being scanned. The edge of the object is a 45° diagonal line. After a spiral scan, as shown... Figure 16CAs shown, there are abrupt changes between pixels labeled 1 and 2, 4 and 5, 9 and 10, 16 and 17, 22 and 23, and 33 and 34. Figure 16D As shown, corresponding Figure 16C Among the six pixels exhibiting abrupt changes mentioned above, these six abrupt change locations are, within the 97 points obtained (97 points are chosen because the scanning angle θ is 1 / 16π, and the scanning step size increases by 1 / 32, so 97 measurements are needed to obtain 36 points; this 97 points include the scanning origin), namely point 11 (i.e., the point with X coordinates 11 and Y coordinates 0.005 in the image), point 34 (i.e., the point with X coordinates 34 and Y coordinates -0.005 in the image), point 46 (i.e., the point with X coordinates 46 and Y coordinates 0.005 in the image), point 64 (i.e., the point with X coordinates 64 and Y coordinates -0.005 in the image), point 77 (i.e., the point with X coordinates 77 and Y coordinates 0.005 in the image), and point 95 (i.e., the point with X coordinates 95 and Y coordinates -0.005 in the image). Based on these abrupt change locations, it can be determined that... Figure 16C The position within a 7x7 pixel block is divided into three concentric circles. In a normal image, if a sudden change exists in the first circle, it is an edge point; otherwise, it is not. Once an edge point is found, a fixed direction (i.e., the direction formed by the pixel corresponding to the origin of the scan template to the non-zero point in the outermost third circle; generally, there are two opposite directions, and one of them can be selected as the directional attribute for the pixel's feature encoding) is selected for searching. This step is repeated until the actual edge of the object in the image is obtained.

[0137] Under normal conditions, when the spiral scanning template scans one revolution, it can only determine whether the pixel corresponding to the scanning origin on the scanning template is an edge point, but it cannot determine the direction of the pixel. Only when the scanning template scans two revolutions or more can the direction attribute of the pixel corresponding to the scanning origin on the scanning template (i.e., the direction from the pixel corresponding to the scanning origin on the scanning template to the abrupt change point on the outermost ring) be determined by combining the presence of non-zero codes on the outermost ring of the scanning template.

[0138] It should be noted that the difference between scanning two circles and three circles using the above scanning template is explained in detail below.

[0139] First, the accuracy of edge extraction with two circles is worse than with three circles. This is because the third circle (the outermost circle) in three circles has more points than the second circle (the outermost circle) in two circles, so it can obtain more directions.

[0140] Then, the edge extraction speed in the two-round time is slower than that in the three-round time because the search step size in the two-round time is smaller than that in the three-round time.

[0141] However, more circles are not always better; three circles are a better overall approach. The reason is that more than three circles significantly increase the computational load. Since the step size increases by 1 with each additional circle (i.e., the movement speed increases additively), and with a large image size, the computational load increases exponentially, resulting in a multiplicative increase in computational speed. Furthermore, more circles mean more information is missed in the outermost circle because the angle of movement is fixed each time; a larger radius means a larger arc length, leading to missed points.

[0142] This scheme utilizes the directional attribute in the pixel feature encoding mentioned above to make it possible to extract an edge in the following step S330.

[0143] As an implementation of step S330 above, the method for extracting an edge includes: using one of the edge points in the set of edge points that has not been extracted and has not been excluded as a previous search origin; setting a search direction based on the direction attribute of the previous search origin; setting a search range based on the search direction, a preset search angle, and a preset search step size; finding an edge point within the search range whose absolute value of the angle difference between the direction and the direction of the search origin is less than or equal to a preset angle difference threshold as a subsequent search origin; if the subsequent search origin is found, replacing the previous search origin with the found subsequent search origin and repeating the operations described above in this step to form an iteration until the subsequent search origin is one of all the aforementioned search origins, at which point the search stops; otherwise, the search also stops, and the previous search origin is excluded from all the search origins belonging to the same edge that have been searched, and is also excluded from the set of edge points.

[0144] It should be noted that the preset search angle and preset search step size involved in the above search range can be set according to specific circumstances, and are not limited here.

[0145] It should also be noted that, as Figure 19As shown, in the implementation of extracting an edge in step S330 above, two edge points b and c that are approximately oriented may appear within a search range of the previous search point a, and the directional attribute of point b is more similar to that of point a. If point b is selected, the depression will be excluded. Therefore, point c, which is closer to point a, is used as the similar point (i.e., the aforementioned post-search origin).

[0146] To better illustrate step S330, the extraction of edge points in Example 4 is illustrated. Specifically, using a 40-bit feature code, edge points with directional attributes similar to the previous edge point are searched within the search range. The search direction is determined by using the number of non-zero bits in bits 22-40 (forming the third ring) of the 40-bit feature code to determine the edge direction (i.e., edge gradient). After obtaining the gradient, edge points with similar directional attributes are searched within the search range consisting of the search direction, search angle, and search step size. If found, these two points are connected. Through iteration, all edge points belonging to an edge are found.

[0147] When two or more independent objects of the same type appear in the preset coding area of ​​the image, the situation described in step S340 will occur. At this time, step S330 needs to be called again until the edges of multiple independent objects of the same type in the preset coding area of ​​the image are extracted.

[0148] As mentioned above, the implementation method of this image edge extraction method uses a spiral template to simulate the human eye's processing of image information; the encoding of generated edge features simulates the working memory principle of vision to achieve overall scene cognition and obtain overall image edge information; based on scanning and differential operations on time series with memory, feature information of small pixels is extracted; finally, through feature encoding, the edge information of the image is obtained. This allows the overall image information and detailed pixel features to complement and correct each other, and noise removal is implemented, thereby effectively improving the accuracy and speed of image edge extraction.

[0149] like Figure 14The diagram shows a flowchart of another embodiment of the edge extraction method. This embodiment differs from the one described above in that, during the traversal of all pixels within a preset coding region in the image, not only edge points are identified, but also non-edge points and edge-adjacent points are identified. This allows for the deletion of feature codes for non-edge points and edge-adjacent points from the data structure storing the pixel feature code set during the traversal process, retaining only the feature codes for edge points. Correspondingly, the position information of non-edge points and edge-adjacent points can be deleted from the data structure storing the pixel position information set, retaining only the position information of edge points. Therefore, it eliminates the need for additional storage space to store the feature codes and position information of each edge point in the edge point set, thus saving storage space.

[0150] Of course, it is also possible not to delete the feature codes and location information of non-edge points and edge-adjacent points (this may take into account that the above data will be used in subsequent data processing, such as the feature codes and / or location information of pixels whose query type is non-edge point and / or edge-adjacent point, etc.). After identifying the type of the above pixels, the relevant type label is given to facilitate subsequent data processing operations such as querying.

[0151] Of course, after the above identification, the type of the pixel can be labeled to facilitate subsequent data processing (such as querying pixels of the same type).

[0152] Figure 14 The similarity judgment step for edge points described herein is basically the same as the implementation method for extracting an edge in step S330 above. Figure 14 The edge points and similar points mentioned above correspond to the previous search origin and the subsequent search origin, which are in an iterative relationship, respectively.

[0153] like Figure 15B As shown, this is one embodiment of the edge extraction method used for... Figure 15A The image shows the result of extracting the edges of a rectangular object, i.e., the image that detects horizontal and vertical edges.

[0154] like Figure 18 As shown, this is one embodiment of the image edge extraction device of the present invention, which includes a pixel feature encoding set, a pixel position information set acquisition unit 310, an edge point set acquisition unit 320, and a single edge extraction unit 330.

[0155] The pixel feature encoding set and pixel position information set acquisition unit 310 performs feature encoding on the preset features of each pixel in the preset encoding region of the image. Each feature encoding has an indication of whether the pixel is an edge point and the orientation attribute of the pixel. All the feature encodings form the pixel feature encoding set, and the unit acquires the position information of all the pixels in the preset encoding region to form the pixel position information set. The edge point set acquisition unit 320 traverses the pixel feature encoding set and determines the edge points in the preset encoding region based on whether the feature encoding is an edge point. All the determined edge points form the edge point set. A single edge extraction unit 330 extracts all edge points belonging to the same edge from the unextracted and unexcluded portion of the edge point set based on the direction attribute, and fits all edge points belonging to the same edge into a line.

[0156] The present invention also proposes a computer device, including a memory and a processor, wherein the memory stores a computer program, characterized in that the processor executes the computer program to implement the steps of the above-described edge extraction method.

[0157] The present invention also proposes a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described edge extraction method.

[0158] The present invention also proposes a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described edge extraction method.

[0159] Generally, the described computing systems and / or devices and / or equipment can use any number of computer operating systems, including but not limited to versions and / or variations of the following: applications, application linking / smart device linking middleware, Microsoft operating systems, Unix operating systems, Linux operating systems, Mac OSX, iOS operating systems, BlackBerry OS, Android operating systems, and automotive platforms for infotainment provided by the QNX software system. Examples of computing devices include, but are not limited to, in-vehicle computers, computer workstations, servers, desktop computers, laptops, portable computers, or handheld computers, or some other computing systems and / or devices.

[0160] Computing devices typically include computer-executable instructions, which can be executed by one or more computing devices, such as those listed above. Computer-executable instructions can be compiled or interpreted from computer programs built using various programming languages ​​and / or technologies, including but not limited to one or a combination of Java™, C, C++, Visual Basic, JavaScript, Perl, etc. Some of these applications can be compiled and executed on virtual machines, such as the Java Virtual Machine, Dalvik Virtual Machine, etc. Typically, a processor (e.g., a microprocessor) receives instructions from memory, computer-readable media, etc., and executes these instructions to perform one or more processes, including one or more processes described herein. Such instructions and other data can be stored and transmitted using various computer-readable media.

[0161] Computer-readable storage media (also known as processor-readable media) include any non-transitory (e.g., tangible) medium that participates in providing data (e.g., instructions) readable by a computer (e.g., through the computer's processor). Such media can take many forms, including but not limited to non-volatile and volatile media. Non-volatile media can include, for example, optical discs or magnetic disks, and other persistent memory. Volatile media can include, for example, dynamic random access memory (DRAM), which typically constitutes main memory. Such instructions can be transmitted via one or more transmission media, including coaxial cables, copper wires, and optical fibers, including lines containing a system bus connected to the computer's processor. Common forms of computer-readable media include, for example, floppy disks, flexible disks, hard disks, magnetic tapes, any other magnetic media, CD-ROMs (optical disc read-only memory), DVDs (digital video discs), any other optical media, punched cards, paper tapes, any other physical media with a perforation pattern, RAM (random access memory), PROMs (programmable read-only memory), EPROMs (electrically programmable read-only memory), FLASH-EEPROMs (flash electrically erasable programmable read-only memory), any other memory chips or memory cartridges, or any other computer-readable media.

[0162] Databases, data repositories, or other data storage devices described herein can include various types of mechanisms for storing, accessing, and retrieving diverse data, including hierarchical databases, file sets in file systems, application databases in proprietary formats, relational database management systems (RDBMS), etc. Each such data storage device is typically contained within a computing device using a computer operating system, such as one of those mentioned above, and is accessed via a network in any one or more of various ways. File systems can be accessed from the computer operating system and can include files stored in various formats. RDBMSs typically use Structured Query Language (SQL), such as the procedural SQL (PL / SQL) language mentioned above, in addition to languages ​​used for creating, storing, editing, and executing stored procedures.

[0163] In some examples, system elements may be implemented as computer-readable instructions (e.g., software) on one or more computing devices (e.g., servers, personal computers, etc.) and stored on an associated computer-readable medium (e.g., disks, storage devices, etc.). A computer program product may contain such instructions stored on a computer-readable medium for performing the functions described herein.

[0164] In the claims, the word "comprising" does not exclude other units or steps; the words "a" or "an" do not exclude multiple. The use of ordinal numbers such as "first" or "second" to modify a claim element does not imply that one claim element has priority, order, or chronological sequence of action over another claim element, but is merely for the purpose of distinguishing one claim element from another. Although certain specific technical features are recited in different dependent claims, this does not mean that these specific technical features cannot be combined. Various aspects of the invention can be used individually, in combination, or in various arrangements not specifically discussed in the foregoing embodiments, and their application is not limited to the details and arrangements of the components described above or shown in the drawings. For example, multiple aspects described in one embodiment can be combined in any way with multiple aspects described in other embodiments. Steps, functions, or features recited in multiple modules or units can be performed or satisfied by one module or unit. The steps of the methods disclosed herein are not limited to being performed in any particular order; it is possible to perform some or all of the steps in other orders. Any reference numerals in the claims should not be construed as limiting the scope of the claims.

[0165] Although the invention has been described by way of accompanying drawings and embodiments, such description and illustration should be considered illustrative or exemplary rather than restrictive. Those skilled in the art will recognize that various modifications, additions, and substitutions are possible without departing from the scope and spirit of the invention as disclosed in the appended claims.

Claims

1. An image edge extraction method, characterized in that, The method includes: A set of pixel feature codes and a set of pixel location information are obtained. Preset features are encoded for each pixel in a preset coding region in the image. Each feature code has an indication of whether the pixel is an edge point and the orientation attribute of the pixel. All the feature codes form the set of pixel feature codes. The location information of all the pixels in the preset coding region is obtained to form the set of pixel location information. Obtain the edge point set, traverse the pixel feature encoding set, and determine the edge points in the preset encoding region based on whether the feature encoding is an edge point. All the determined edge points constitute the edge point set. Extract an edge, and based on the direction attribute, extract all edge points belonging to the same edge from the unextracted and unexcluded portion of the edge point set, and fit all edge points belonging to the same edge into a line; If all the extracted and excluded edge points are part of the edge point set, then repeat the above "extract an edge" step to extract all edge points belonging to another edge, until the edge point set has been traversed; The "acquiring of pixel feature encoding set and pixel location information set" includes: According to the preset scanning template, a scan is performed with a pixel in the unscanned part of the preset scanning area in the image as the scanning origin, and the position information of all the pixels in this scan is stored sequentially according to the scanning order. Based on the stored position information of the pixels in this scan, the values ​​of the preset features of the pixels at each position are obtained sequentially and a time series is formed. The values ​​of the elements in the time series are encoded based on the direction of change between the values ​​of any two adjacent elements in the time series and the comparison relationship between the changes in the values ​​of any two adjacent elements in the time series and a preset element change threshold. Repeat the above steps until there are no unscanned parts in the preset scanning area; Wherein, the preset scanning area is the preset encoding area; The scanning template has multiple circular structures. When it has multiple circular structures, it is composed of multiple circular shapes from small to large from the inside to the outside, and the two ends of each circular shape are set separately. Prior to the encoding, feature extraction is performed on the time series; The feature extraction includes: Using the time series as input data, the input data is fed into a memory model to obtain multiple memory sequences representing different levels of memory; and Perform a difference operation on all the memory sequences to obtain the final features of the time series, including: Perform a difference operation on any two adjacent pairs in all the memory sequences; and If the number of memory sequences in the result after the above difference operation is greater than 1, then perform the above difference operation step on all memory sequences in the result until the number of memory sequences in the result is 1. At this time, the unique memory sequence in the result is the final feature.

2. The image edge extraction method according to claim 1, characterized in that, The phrase "extracting all edge points belonging to the same edge from the unextracted and unexcluded portion of the edge point set based on the direction attribute" includes: Using one of the unextracted and unexcluded edge points in the edge point set as the previous search origin, a search direction is set according to the direction attribute of the previous search origin. A search range is set using the search direction, a preset search angle, and a preset search step size. An edge point located within the search range whose absolute value of the angle difference between its direction and the direction of the search origin is less than or equal to a preset angle difference threshold is selected as the next search origin. If the next search origin is found, the previous search origin is replaced by the found next search origin, and the aforementioned operations in this step are repeated to form an iteration until the next search origin is one of the aforementioned search origins, at which point the search stops. Otherwise, the search also stops, and the previous search origin is excluded from all the search origins belonging to the same edge that have been searched, and is also excluded from the edge point set.

3. The image edge extraction method according to claim 2, characterized in that: In the process of "extracting all edge points belonging to the same edge from the unextracted portion of the edge point set based on the direction attribute", if the number of edge points found within a search range that meet the condition that the absolute value of the angle difference between the direction and the direction of the search origin is less than or equal to a preset angle difference threshold is greater than 1, then the edge point whose position is adjacent to the previous search origin is taken as the subsequent search origin.

4. The image edge extraction method according to any one of claims 1 to 3, characterized in that: The number of circles in the scanning template is 3.

5. The image edge extraction method according to any one of claims 1 to 3, characterized in that: in, The memory model includes a forgetting factor and a memory factor, which are used to characterize the degree of memory. The sum of the values ​​of the forgetting factor and the memory factor in each memory model is equal to 1. The step of inputting the input data into the memory model to obtain multiple memory sequences for representing the degree of memory includes: inputting the input data into multiple memory models that represent different degrees of memory to obtain multiple memory sequences that represent different degrees of memory, wherein the number of memory sequences obtained through the memory model is at least 3; Wherein, the time series used in the encoding is the final feature of the time series; The final feature is a statistical feature.

6. The image edge extraction method according to any one of claims 1 to 3, characterized in that, Encoding the values ​​of the elements in the time series includes: If the absolute value of the change in two adjacent elements in the time series is less than or equal to the preset element change threshold, it is encoded as a first preset constant. If the absolute value of the change of two adjacent elements in the time series is greater than the preset element change threshold, and the value of the former element is less than the value of the latter element, then it is encoded as a second preset constant. If the absolute value of the change in two adjacent elements in the time series is greater than the preset element change threshold, and the value of the former element is greater than the value of the latter element, then it is encoded as a third preset constant.

7. An image edge extraction device, characterized in that, The device includes: The pixel feature encoding set and pixel position information set acquisition unit perform feature encoding on the preset features of each pixel in the preset encoding region of the image. Each feature encoding has an indication of whether the pixel is an edge point and the orientation attribute of the pixel. All the feature encodings form the pixel feature encoding set, and the unit acquires the position information of all the pixels in the preset encoding region to form the pixel position information set. The edge point set acquisition unit traverses the pixel feature encoding set and determines the edge points in the preset encoding region based on whether the feature encoding is an edge point. All the determined edge points form the edge point set. A single edge extraction unit extracts all edge points belonging to the same edge from the unextracted and unexcluded portion of the edge point set based on the direction attribute, and fits all edge points belonging to the same edge into a line. The "acquiring pixel feature encoding set and pixel location information set" unit is also used for: According to the preset scanning template, a scan is performed with a pixel in the unscanned part of the preset scanning area in the image as the scanning origin, and the position information of all the pixels in this scan is stored sequentially according to the scanning order. Based on the stored position information of the pixels in this scan, the values ​​of the preset features of the pixels at each position are obtained sequentially and a time series is formed. The values ​​of the elements in the time series are encoded based on the direction of change between the values ​​of any two adjacent elements in the time series and the comparison relationship between the changes in the values ​​of any two adjacent elements in the time series and a preset element change threshold. Repeat the above steps until there are no unscanned parts in the preset scanning area; Wherein, the preset scanning area is the preset encoding area; The scanning template has multiple circular structures. When it has multiple circular structures, it is composed of multiple circular shapes from small to large from the inside to the outside, and the two ends of each circular shape are set separately. Prior to the encoding, feature extraction is performed on the time series; The feature extraction includes: Using the time series as input data, the input data is fed into a memory model to obtain multiple memory sequences representing different levels of memory; and Perform a difference operation on all the memory sequences to obtain the final features of the time series, including: Perform a difference operation on any two adjacent pairs in all the memory sequences; and If the number of memory sequences in the result after the above difference operation is greater than 1, then perform the above difference operation step on all memory sequences in the result until the number of memory sequences in the result is 1. At this time, the unique memory sequence in the result is the final feature.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the 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 computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Circular operator based image edge extraction method and apparatus

    CN105740868A

  • Image edge point acquisition method and device

    CN111968144A