Image line feature extraction apparatus and method

By generating an expanded image using multiple preset filter template images and determining the filtered grayscale values ​​of pixels, the problem of straight-line filters failing to accurately extract curve features is solved, achieving higher accuracy in line feature extraction.

CN115661473BActive Publication Date: 2026-01-27HAINING ESWIN IC DESIGN CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211218089.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-30
Publication Date
2026-01-27
Estimated Expiration
2042-09-30

AI Technical Summary

Technical Problem

Existing technologies based on linear filters struggle to accurately extract curve features from images, resulting in low accuracy in line feature extraction.

Method used

Multiple preset filter template images are used. By generating an expanded image and determining multiple filtered gray values ​​for each pixel, a line feature image is generated by selecting the target filtered gray value.

Benefits of technology

It improves the accuracy of line feature extraction in images, especially curve features.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115661473B_ABST
    Figure CN115661473B_ABST
Patent Text Reader

Abstract

The application discloses an image line feature extraction device and method, and relates to the technical field of image processing. The device comprises an acquisition unit, which is used for acquiring an image to be extracted, wherein the image to be extracted contains a plurality of first pixel points; a first generation unit, which is used for generating an expanded image corresponding to the image to be extracted; a determination unit, which is used for determining a plurality of filtered gray values corresponding to each first pixel point according to a plurality of preset filter template images and the expanded image; a selection unit, which is used for selecting a target filtered gray value corresponding to each first pixel point from the plurality of filtered gray values corresponding to each first pixel point according to a preset selection mode; and a second generation unit, which is used for generating a line feature image corresponding to the image to be extracted according to the target filtered gray value corresponding to each first pixel point.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and in particular to an image line feature extraction device and method. Background Technology

[0002] In many scenarios, it is necessary to extract line features from images so that subsequent tasks such as identity recognition, identity authentication, behavior analysis, and pose estimation can be performed based on the extracted line features. For example, in applications that use palm prints or fingerprints for identity verification, it is necessary to extract line features from palm print or fingerprint images. In applications that detect lane lines, it is necessary to extract line features from lane line images, and so on.

[0003] Currently, line features are typically extracted from the image based on line filters to generate a line feature image that highlights these features. However, while line filters can accurately extract straight line features from an image, they cannot accurately extract curved features. Therefore, the accuracy of line feature extraction based on line filters is relatively low. Summary of the Invention

[0004] This application provides an image line feature extraction device and method, the main purpose of which is to improve the accuracy of extracting line features from images.

[0005] To address the aforementioned technical problems, this application provides the following technical solutions:

[0006] In a first aspect, this application provides an image line feature extraction apparatus, the apparatus comprising:

[0007] An acquisition unit is used to acquire an image to be extracted, wherein the image to be extracted contains a plurality of first pixels;

[0008] The first generation unit is used to generate an augmented image corresponding to the image to be extracted;

[0009] The determining unit is used to determine multiple filtered gray values ​​corresponding to each first pixel point based on multiple preset filter template images and the expanded image, wherein, for any preset filter template image, the preset filter template image contains a curve passing through the center pixel point, and any two preset filter template images contain different curves.

[0010] The selection unit is used to select the target filtered gray value corresponding to each first pixel from multiple filtered gray values ​​corresponding to each first pixel according to a preset selection method.

[0011] The second generation unit is used to generate a line feature image corresponding to the image to be extracted based on the target filtered gray value corresponding to each of the first pixels.

[0012] Optionally, the first generation unit is specifically used for:

[0013] The image to be extracted is converted into a grayscale image, wherein the grayscale image contains a plurality of second pixels;

[0014] The grayscale image is expanded by performing image boundary expansion processing based on the grayscale value corresponding to each second pixel and the size of the multiple preset filter template images to generate the expanded image.

[0015] Optionally, the determining unit is specifically used for:

[0016] The expanded image is normalized to obtain a normalized image corresponding to the expanded image. The normalized image includes multiple original third pixels and multiple expanded third pixels, and the multiple original third pixels correspond one-to-one with the multiple first pixels.

[0017] Based on the multiple preset filter template images, the grayscale value corresponding to each original third pixel, and the grayscale value corresponding to each extended third pixel, multiple filtered grayscale values ​​corresponding to each first pixel are determined.

[0018] Optionally, the determining unit is specifically used for:

[0019] Based on the curve contained in the preset filter template image, multiple associated third pixels corresponding to the target original third pixel are selected in the normalized image. The associated third pixels corresponding to the target original third pixel can be either the original third pixel or an extended third pixel.

[0020] The grayscale value corresponding to the original third pixel of the target and the grayscale value corresponding to each associated third pixel are summed to obtain the filtered grayscale value of the first pixel corresponding to the original third pixel of the target.

[0021] Optionally, for any preset filter template image, the curve contained in the preset filter template image is composed of a center pixel and multiple other pixels;

[0022] The determining unit is specifically used for:

[0023] Based on the position of each of the other pixels relative to the center pixel, multiple associated third pixels corresponding to the original target third pixel are selected in the normalized image.

[0024] Optionally, the preset selection method is to determine the maximum filtered gray value among the multiple filtered gray values ​​corresponding to the first pixel as the target filtered gray value corresponding to the first pixel for any given first pixel, or to determine the minimum filtered gray value among the multiple filtered gray values ​​corresponding to the first pixel as the target filtered gray value corresponding to the first pixel for any given first pixel.

[0025] Secondly, this application also provides a method for extracting image line features, the method comprising:

[0026] Obtain the image to be extracted and generate an augmented image corresponding to the image to be extracted, wherein the image to be extracted contains a plurality of first pixels;

[0027] Based on multiple preset filter template images and the expanded image, multiple filtered gray values ​​corresponding to each first pixel are determined. For any preset filter template image, the preset filter template image contains a curve passing through the center pixel, and the curves contained in any two preset filter template images are different.

[0028] According to a preset selection method, the target filtered gray value corresponding to each first pixel is selected from multiple filtered gray values ​​corresponding to each first pixel.

[0029] A line feature image corresponding to the image to be extracted is generated based on the target filtered gray value corresponding to each of the first pixels.

[0030] Optionally, generating the augmented image corresponding to the image to be extracted includes:

[0031] The image to be extracted is converted into a grayscale image, wherein the grayscale image contains a plurality of second pixels;

[0032] The grayscale image is expanded by performing image boundary expansion processing based on the grayscale value corresponding to each second pixel and the size of the multiple preset filter template images to generate the expanded image.

[0033] Optionally, determining multiple filtered grayscale values ​​corresponding to each first pixel based on multiple preset filter template images and the expanded image includes:

[0034] The expanded image is normalized to obtain a normalized image corresponding to the expanded image. The normalized image includes multiple original third pixels and multiple expanded third pixels, and the multiple original third pixels correspond one-to-one with the multiple first pixels.

[0035] Based on the multiple preset filter template images, the grayscale value corresponding to each original third pixel, and the grayscale value corresponding to each extended third pixel, multiple filtered grayscale values ​​corresponding to each first pixel are determined.

[0036] Optionally, determining multiple filtered grayscale values ​​corresponding to each first pixel based on multiple preset filter template images, the grayscale value corresponding to each original third pixel, and the grayscale value corresponding to each expanded third pixel includes:

[0037] Based on the curve contained in the preset filter template image, multiple associated third pixels corresponding to the target original third pixel are selected in the normalized image. The associated third pixels corresponding to the target original third pixel can be either the original third pixel or an extended third pixel.

[0038] The grayscale value corresponding to the original third pixel of the target and the grayscale value corresponding to each associated third pixel are summed to obtain the filtered grayscale value of the first pixel corresponding to the original third pixel of the target.

[0039] Optionally, for any preset filter template image, the curve contained in the preset filter template image is composed of a center pixel and multiple other pixels; the step of selecting multiple associated third pixels corresponding to the target original third pixel in the normalized image based on the curve contained in the preset filter template image includes:

[0040] Based on the position of each of the other pixels relative to the center pixel, multiple associated third pixels corresponding to the original target third pixel are selected in the normalized image.

[0041] Optionally, the preset selection method is to determine the maximum filtered gray value among the multiple filtered gray values ​​corresponding to the first pixel as the target filtered gray value corresponding to the first pixel for any given first pixel, or to determine the minimum filtered gray value among the multiple filtered gray values ​​corresponding to the first pixel as the target filtered gray value corresponding to the first pixel for any given first pixel.

[0042] Thirdly, embodiments of this application provide a storage medium including a stored program, wherein, when the program is executed, it controls the device where the storage medium is located to perform the image line feature extraction method described in the second aspect.

[0043] Fourthly, embodiments of this application provide an image line feature extraction apparatus, the apparatus including a storage medium; and one or more processors, the storage medium being coupled to the processors, the processors being configured to execute program instructions stored in the storage medium; the program instructions, when executed, perform the image line feature extraction method described in the second aspect.

[0044] By employing the above-described technical solution, the technical solution provided in this application has at least the following advantages:

[0045] This application provides an image line feature extraction apparatus and method. The image line feature extraction apparatus provided by this application includes: an acquisition unit, a first generation unit, a determination unit, a selection unit, and a second generation unit. First, the acquisition unit acquires the image to be extracted. Second, the first generation unit generates an expanded image corresponding to the image to be extracted. Third, the determination unit determines multiple filtered gray values ​​corresponding to each first pixel based on multiple preset filter template images and the expanded image. Fourth, the selection unit selects a target filtered gray value corresponding to each first pixel from the multiple filtered gray values ​​corresponding to each first pixel according to a preset selection method. Finally, the second generation unit generates a line feature image corresponding to the image to be extracted based on the target filtered gray value corresponding to each first pixel. Since this application determines multiple filtered gray values ​​corresponding to each pixel in the image to be extracted based on multiple preset filter template images containing different curves, and generates a line feature image corresponding to the image to be extracted based on the multiple filtered gray values ​​corresponding to each pixel in the image to be extracted, it can accurately extract curve features in the image to be extracted, thereby improving the accuracy of line feature extraction in the image to be extracted.

[0046] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description

[0047] The above and other objects, features, and advantages of exemplary embodiments of this application will become readily understood by reading the following detailed description with reference to the accompanying drawings. In the drawings, several embodiments of this application are illustrated by way of example and not limitation, with the same or corresponding reference numerals denoteing the same or corresponding parts, wherein:

[0048] Figure 1 This illustration shows a block diagram of an image line feature extraction device provided in an embodiment of this application;

[0049] Figure 2 A flowchart of an image line feature extraction method provided in an embodiment of this application is shown. Detailed Implementation

[0050] Exemplary embodiments of this application will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of this application are shown in the drawings, it should be understood that this application may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of this application and to fully convey the scope of this application to those skilled in the art.

[0051] It should be noted that, unless otherwise stated, the technical or scientific terms used in this application shall have the ordinary meaning as understood by one of ordinary skill in the art to which this application pertains.

[0052] This application provides an image line feature extraction device, which is applied to a terminal device for extracting line features from an image. The terminal device may be, but is not limited to, a smartphone, tablet computer, computer, etc. Figure 1 As shown, the device specifically includes: an acquisition unit 11, used to acquire an image to be extracted, wherein the image to be extracted contains multiple first pixels; a first generation unit 12, used to generate an expanded image corresponding to the image to be extracted; a determination unit 13, used to determine multiple filtered gray values ​​corresponding to each first pixel based on multiple preset filter template images and the expanded image, wherein for any preset filter template image, the preset filter template image contains a curve passing through the center pixel, and the curves contained in any two preset filter template images are different; a selection unit 14, used to select a target filtered gray value corresponding to each first pixel from the multiple filtered gray values ​​corresponding to each first pixel according to a preset selection method; and a second generation unit 15, used to generate a line feature image corresponding to the image to be extracted based on the target filtered gray value corresponding to each first pixel.

[0053] The following combination Figure 1 The image line feature extraction device shown is illustrated in detail, illustrating the process by which the image line feature extraction device extracts line features from the image to be extracted:

[0054] The image to be extracted is the image from which line features need to be extracted. Specifically, it can be, but is not limited to, images containing user fingerprints, images containing user palm prints, images containing lane lines, etc. The image to be extracted contains multiple first pixels. For any preset filter template image, the size of the preset filter template image can be, but is not limited to, 9 pixels * 9 pixels, 11 pixels * 11 pixels, 13 pixels * 13 pixels, 15 pixels * 15 pixels, etc. The preset filter template image contains a curve passing through the center pixel; that is, the curve contained in the preset filter template image is composed of the center pixel and multiple other pixels. The curves contained in any two preset filter template images are different. The center pixel is the pixel at the center of the image. For example, when the size of the preset filter template image is 9 pixels * 9 pixels, the fifth pixel in the fifth row of the preset filter template image is the center pixel of the preset filter template image. The corresponding expanded image contains multiple original pixels and multiple expanded pixels. The original pixels correspond one-to-one with the multiple first pixels in the image to be extracted. The expanded pixels are obtained by expanding the image boundaries of the image to be extracted (or the grayscale image corresponding to the image to be extracted). The preset selection method is set by the staff according to the actual situation of the image to be extracted. When the line features in the image to be extracted are darker than other features, the staff can set the preset selection method to determine the minimum filtered grayscale value among the multiple filtered grayscale values ​​corresponding to any first pixel as the target filtered grayscale value corresponding to the first pixel. When the line features in the image to be extracted are brighter than other features, the staff can set the preset selection method to determine the maximum filtered grayscale value among the multiple filtered grayscale values ​​corresponding to any first pixel as the target filtered grayscale value corresponding to the first pixel.

[0055] It should be noted that in practical applications, staff can set the width, curvature, and direction of the curves contained in each preset filter template image according to actual needs. For any preset filter template image, this application embodiment does not specifically limit what kind of curves the preset filter template image contains, that is, it does not specifically limit the width, curvature, and direction of the curves contained in the preset filter template image.

[0056] In this embodiment, when a worker needs to extract line features from an image to be extracted, the worker sends a corresponding instruction to the image line feature extraction device via a terminal device. After receiving the instruction, the acquisition unit 11 in the image line feature extraction device acquires the image to be extracted. After the acquisition unit 11 acquires the image to be extracted, the first generation unit 12 needs to generate an expanded image corresponding to the image to be extracted. When the image to be extracted is a color image, the first generation unit 12 needs to first convert the image to be extracted into a grayscale image, and then perform image boundary expansion processing on the converted grayscale image to generate an expanded image corresponding to the image to be extracted. When the image to be extracted is a grayscale image, the first generation unit 12 can directly perform image boundary expansion processing on the image to be extracted to generate an expanded image corresponding to the image to be extracted. After the first generation unit 12 generates the expanded image corresponding to the image to be extracted, the determining unit 13 needs to determine the image based on multiple preset... The filter template image and the expanded image are used to determine multiple filtered gray values ​​corresponding to each first pixel. That is, when the number of multiple preset filter template images is N, the first filtered gray value corresponding to each first pixel is determined based on the gray values ​​corresponding to the multiple pixels contained in the first preset filter template image and the expanded image. Then, the second filtered gray value corresponding to each first pixel is determined based on the gray values ​​corresponding to the multiple pixels contained in the second preset filter template image and the expanded image. Finally, the Nth filtered gray value corresponding to each first pixel is determined based on the gray values ​​corresponding to the multiple pixels contained in the Nth preset filter template image and the expanded image, thus obtaining N filtered gray values ​​corresponding to each first pixel, where N is a positive integer. After the determining unit 13 determines the multiple filtered gray values ​​corresponding to each first pixel, the selecting unit 14 can select the target filtered gray value corresponding to each first pixel from the multiple filtered gray values ​​corresponding to each first pixel according to the preset selection method.After the selection unit 14 selects the target filtered gray value corresponding to each first pixel from multiple filtered gray values ​​corresponding to each first pixel according to a preset selection method, the second generation unit 15 can generate a line feature image corresponding to the image to be extracted based on the target filtered gray value corresponding to each first pixel. Specifically, the target filtered gray value corresponding to the first first pixel in the first row of the image to be extracted is determined as the gray value of the first pixel in the first row of the line feature image; the target filtered gray value corresponding to the second first pixel in the first row of the image to be extracted is determined as the gray value of the second pixel in the first row of the line feature image; the target filtered gray value corresponding to the third first pixel in the first row of the image to be extracted is determined as the gray value of the third pixel in the first row of the line feature image; and so on, until the target filtered gray value corresponding to the last first pixel in the last row of the image to be extracted is determined as the gray value of the last pixel in the last row of the line feature image. Then, a line feature image is generated based on the gray value corresponding to each pixel in the line feature image.

[0057] This application provides an image line feature extraction device, which includes an acquisition unit, a first generation unit, a determination unit, a selection unit, and a second generation unit. First, the acquisition unit acquires an image to be extracted. Second, the first generation unit generates an expanded image corresponding to the image to be extracted. Third, the determination unit determines multiple filtered grayscale values ​​corresponding to each first pixel based on multiple preset filter template images and the expanded image. Fourth, the selection unit selects a target filtered grayscale value corresponding to each first pixel from the multiple filtered grayscale values ​​corresponding to each first pixel according to a preset selection method. Finally, the second generation unit generates a line feature image corresponding to the image to be extracted based on the target filtered grayscale value corresponding to each first pixel. Since this application uses multiple preset filter template images containing different curves to determine multiple filtered grayscale values ​​corresponding to each pixel in the image to be extracted, and generates a line feature image corresponding to the image to be extracted based on these multiple filtered grayscale values, it can accurately extract curve features from the image to be extracted, thereby improving the accuracy of line feature extraction.

[0058] This application also provides another image line feature extraction device, which is applied to a terminal device for extracting line features from an image; such as Figure 2 As shown, the following is combined Figure 2 Explanation:

[0059] Furthermore, such as Figure 1As shown, the first generation unit 12 is specifically used to: convert the image to be extracted into a grayscale image, wherein the grayscale image contains multiple second pixels; and perform image boundary expansion processing on the grayscale image according to the grayscale value corresponding to each second pixel and the size of multiple preset filter template images to generate an expanded image.

[0060] In this embodiment, the specific process of the first generation unit 12 generating the expanded image corresponding to the image to be extracted is as follows: First, the image to be extracted is converted into a grayscale image; second, the grayscale image is expanded according to the grayscale value corresponding to each second pixel in the grayscale image and the size of multiple preset filter template images to generate an expanded image. For example, when the size of the image to be extracted is 128 pixels * 128 pixels, and the size of the largest preset filter template image among the multiple preset filter template images is 11 pixels * 11 pixels, after converting the image to be extracted into a grayscale image, the grayscale value corresponding to each pixel in the first to fifth rows, the grayscale value corresponding to each pixel in the 124th to 128th rows, the grayscale value corresponding to each pixel in the first to fifth columns, and the grayscale value corresponding to each pixel in the 124th to 128th columns, is expanded according to the grayscale value corresponding to each second pixel in the first to fifth columns and the size of the second pixel in the 124th to 128th columns. The grayscale image is expanded by using the grayscale values ​​of each pixel in the 128 columns to generate an expanded image of size 138 pixels * 138 pixels. When the size of the image to be extracted is 128 pixels * 128 pixels, and the size of the largest preset filter template image among multiple preset filter template images is 15 pixels * 15 pixels, after converting the image to be extracted into a grayscale image, the grayscale image is expanded by using the grayscale values ​​of each pixel in the first to seventh rows, the 122nd to 128th rows, the first to seventh columns, and the 122nd to 128th columns to generate an expanded image of size 142 pixels * 142 pixels, but not limited to these.

[0061] It should be noted that when the image to be extracted is a grayscale image, the first generation unit 12 does not need to perform the step of converting the image to be extracted into a grayscale image. Instead, it can directly perform image boundary expansion processing on the grayscale image based on the grayscale value corresponding to each first pixel in the image to be extracted and the size of multiple preset filter template images to generate an expanded image.

[0062] Furthermore, such as Figure 1As shown, the determining unit 13 is specifically used for: performing normalization processing on the expanded image to obtain a normalized image corresponding to the expanded image, wherein the normalized image contains multiple original third pixel points and multiple expanded third pixel points, and the multiple original third pixel points correspond one-to-one with multiple first pixel points; determining multiple filtered gray values ​​corresponding to each first pixel point based on multiple preset filter template images, the gray value corresponding to each original third pixel point and the gray value corresponding to each expanded third pixel point.

[0063] In this embodiment of the application, the specific process by which the determining unit 13 determines multiple filtered grayscale values ​​corresponding to each first pixel based on multiple preset filter template images and expanded images is as follows:

[0064] First, the expanded image is normalized to obtain a normalized image. This involves calculating the average gray value of multiple pixels based on the gray values ​​of each pixel in the expanded image: first, summing the gray values ​​of each pixel in the expanded image, then calculating the ratio of the sum to the number of pixels to obtain the average gray value. Second, based on the gray values ​​of each pixel in the expanded image and the average gray value, the normalized gray value of each pixel is calculated: for any pixel in the expanded image, the difference between the gray value of that pixel and the average gray value is calculated, and this difference is determined as the normalized gray value of that pixel. Finally, based on the normalized grayscale values ​​corresponding to each pixel in the expanded image, a normalized image corresponding to the expanded image is generated: the normalized grayscale value corresponding to the first pixel in the first row of the expanded image is determined as the grayscale value of the first pixel in the first row of the normalized image; the normalized grayscale value corresponding to the second pixel in the first row of the expanded image is determined as the grayscale value of the second pixel in the first row of the normalized image; the normalized grayscale value corresponding to the third pixel in the first row of the expanded image is determined as the grayscale value of the third pixel in the first row of the normalized image; and so on, the normalized grayscale value corresponding to the last pixel in the last row of the expanded image is determined as the grayscale value of the last pixel in the last row of the normalized image, and then a normalized image is generated based on the grayscale values ​​corresponding to each pixel in the normalized image.

[0065] It should be noted that when the normalized gray value corresponding to a certain pixel is a decimal, the normalized gray value corresponding to that pixel needs to be rounded down.

[0066] Secondly, based on multiple preset filter template images, the grayscale value corresponding to each original third pixel, and the grayscale value corresponding to each expanded third pixel, multiple filtered grayscale values ​​corresponding to each first pixel are determined. The specific process for determining the filtered grayscale value corresponding to the target first pixel based on any preset filter template image is as follows:

[0067] First, based on the curve contained in the preset filter template image, multiple associated third pixels corresponding to the target original third pixel are selected in the normalized image. That is, based on the position of each other pixel contained in the curve relative to the center pixel, multiple associated third pixels corresponding to the target original third pixel are selected in the normalized image. For example, when the size of the preset filter template image is 9 pixels * 9 pixels, the center pixel of the preset filter template image is the fifth pixel in the fifth row. If a certain other pixel is the third pixel in the third row of the preset filter template image, and the target original third pixel is the eighteenth pixel in the twelfth row of the normalized image, then an associated third pixel corresponding to the target original third pixel is the sixteenth pixel in the tenth row of the normalized image. Here, the target first pixel is any pixel contained in the image to be extracted, the target original third pixel is the original third pixel corresponding to the target first pixel among the multiple original third pixels contained in the normalized image, and the associated third pixel corresponding to the target original third pixel can be either the original third pixel or an extended third pixel.

[0068] Secondly, the gray values ​​corresponding to the original third pixel of the target and the gray values ​​corresponding to each associated third pixel are summed to obtain the summation result. Then, the summation result is determined as the filtered gray value of the first pixel (i.e., the first pixel of the target) corresponding to the original third pixel of the target.

[0069] Furthermore, as a response to the above Figure 1 In addition to the implementation of the illustrated device, another embodiment of this application provides an image line feature extraction method. This method is applied to a terminal device for extracting line features from an image. The terminal device may be, but is not limited to, a smartphone, tablet computer, computer, etc. This method embodiment corresponds to the aforementioned device embodiment. For ease of reading, this method embodiment will not repeat the details of the aforementioned device embodiments, but it should be understood that the method in this embodiment can implement all the contents of the aforementioned device embodiments. This method is applied to improve the accuracy of extracting line features from an image, specifically as follows: Figure 2 As shown, the method includes:

[0070] 201. Obtain the image to be extracted and generate the corresponding augmented image.

[0071] The image to be extracted contains multiple first pixels.

[0072] 202. Based on multiple preset filter template images and expanded images, determine multiple filtered gray values ​​corresponding to each first pixel.

[0073] For any given preset filter template image, there is a curve passing through the center pixel. The curves contained in any two preset filter template images are different.

[0074] 203. Select the target filtered gray value corresponding to each first pixel from multiple filtered gray values ​​corresponding to each first pixel according to the preset selection method.

[0075] 204. Generate the line feature image corresponding to the image to be extracted based on the target filtered gray value corresponding to each first pixel.

[0076] Furthermore, generating an augmented image corresponding to the image to be extracted includes:

[0077] The image to be extracted is converted into a grayscale image, wherein the grayscale image contains multiple second pixels;

[0078] The grayscale image is expanded by performing image boundary augmentation processing based on the grayscale value corresponding to each second pixel and the size of multiple preset filter template images to generate an augmented image. Further, based on the multiple preset filter template images and the augmented image, multiple filtered grayscale values ​​corresponding to each first pixel are determined, including:

[0079] The expanded image is normalized to obtain the normalized image corresponding to the expanded image. The normalized image contains multiple original third pixels and multiple expanded third pixels, and the multiple original third pixels correspond one-to-one with multiple first pixels.

[0080] Based on multiple preset filter template images, the grayscale value corresponding to each original third pixel, and the grayscale value corresponding to each expanded third pixel, multiple filtered grayscale values ​​corresponding to each first pixel are determined.

[0081] Furthermore, based on multiple preset filter template images, the grayscale value corresponding to each original third pixel, and the grayscale value corresponding to each expanded third pixel, multiple filtered grayscale values ​​corresponding to each first pixel are determined, including:

[0082] Based on the curve contained in the preset filter template image, select multiple associated third pixels corresponding to the original third pixel in the normalized image. The associated third pixels corresponding to the original third pixel can be either the original third pixel or an extended third pixel.

[0083] The grayscale value corresponding to the original third pixel of the target and the grayscale value corresponding to each associated third pixel are summed to obtain the filtered grayscale value of the first pixel corresponding to the original third pixel of the target.

[0084] Furthermore, for any given preset filter template image, the curve contained in the preset filter template image consists of a center pixel and multiple other pixels; based on the curve contained in the preset filter template image, multiple associated third pixels corresponding to the original target third pixel are selected in the normalized image, including:

[0085] Based on the position of each other pixel relative to the center pixel, select multiple associated third pixels corresponding to the original third pixel of the target in the normalized image.

[0086] Furthermore, the preset selection method is to determine the maximum filtered gray value among the multiple filtered gray values ​​corresponding to the first pixel as the target filtered gray value corresponding to the first pixel, or to determine the minimum filtered gray value among the multiple filtered gray values ​​corresponding to the first pixel as the target filtered gray value corresponding to the first pixel.

[0087] This application provides an image line feature extraction device and method. The image line feature extraction device provided in this application includes: an acquisition unit, a first generation unit, a determination unit, a selection unit, and a second generation unit. First, the acquisition unit acquires the image to be extracted. Second, the first generation unit generates an expanded image corresponding to the image to be extracted. Third, the determination unit determines multiple filtered gray values ​​corresponding to each first pixel based on multiple preset filter template images and the expanded image. Fourth, the selection unit selects a target filtered gray value corresponding to each first pixel from the multiple filtered gray values ​​corresponding to each first pixel according to a preset selection method. Finally, the second generation unit generates a line feature image corresponding to the image to be extracted based on the target filtered gray value corresponding to each first pixel. Since, in this application embodiment, multiple filtered gray values ​​corresponding to each pixel in the image to be extracted are determined based on multiple preset filter template images containing different curves, and a line feature image corresponding to the image to be extracted is generated based on the multiple filtered gray values ​​corresponding to each pixel in the image to be extracted, the curve features in the image to be extracted can be accurately extracted, thereby improving the accuracy of line feature extraction in the image to be extracted.

[0088] This application provides a storage medium including a stored program, wherein the program controls the device where the storage medium is located to execute the image line feature extraction method described above when it is running.

[0089] Storage media may include non-permanent memory in the form of computer-readable media, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0090] This application embodiment also provides an image line feature extraction apparatus, the apparatus including a storage medium; and one or more processors, the storage medium being coupled to the processors, the processors being configured to execute program instructions stored in the storage medium; the program instructions, when executed, perform the image line feature extraction method described above.

[0091] This application provides a device, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it performs the following steps:

[0092] Obtain the image to be extracted and generate an augmented image corresponding to the image to be extracted, wherein the image to be extracted contains a plurality of first pixels;

[0093] Based on multiple preset filter template images and the expanded image, multiple filtered gray values ​​corresponding to each first pixel are determined. For any preset filter template image, the preset filter template image contains a curve passing through the center pixel, and the curves contained in any two preset filter template images are different.

[0094] According to a preset selection method, the target filtered gray value corresponding to each first pixel is selected from multiple filtered gray values ​​corresponding to each first pixel.

[0095] A line feature image corresponding to the image to be extracted is generated based on the target filtered gray value corresponding to each of the first pixels.

[0096] Furthermore, generating the augmented image corresponding to the image to be extracted includes:

[0097] The image to be extracted is converted into a grayscale image, wherein the grayscale image contains a plurality of second pixels;

[0098] The grayscale image is expanded by performing image boundary expansion processing based on the grayscale value corresponding to each second pixel and the size of the multiple preset filter template images to generate the expanded image.

[0099] Furthermore, determining multiple filtered grayscale values ​​corresponding to each first pixel based on multiple preset filter template images and the expanded image includes:

[0100] The expanded image is normalized to obtain a normalized image corresponding to the expanded image. The normalized image includes multiple original third pixels and multiple expanded third pixels, and the multiple original third pixels correspond one-to-one with the multiple first pixels.

[0101] Based on the multiple preset filter template images, the grayscale value corresponding to each original third pixel, and the grayscale value corresponding to each extended third pixel, multiple filtered grayscale values ​​corresponding to each first pixel are determined.

[0102] Furthermore, determining multiple filtered grayscale values ​​corresponding to each first pixel based on multiple preset filter template images, the grayscale value corresponding to each original third pixel, and the grayscale value corresponding to each expanded third pixel includes:

[0103] Based on the curve contained in the preset filter template image, multiple associated third pixels corresponding to the target original third pixel are selected in the normalized image. The associated third pixels corresponding to the target original third pixel can be either the original third pixel or an extended third pixel.

[0104] The grayscale value corresponding to the original third pixel of the target and the grayscale value corresponding to each associated third pixel are summed to obtain the filtered grayscale value of the first pixel corresponding to the original third pixel of the target.

[0105] Furthermore, for any preset filter template image, the curve contained in the preset filter template image is composed of a center pixel and multiple other pixels; the step of selecting multiple associated third pixels corresponding to the target original third pixel in the normalized image based on the curve contained in the preset filter template image includes:

[0106] Based on the position of each of the other pixels relative to the center pixel, multiple associated third pixels corresponding to the original target third pixel are selected in the normalized image.

[0107] Furthermore, the preset selection method is to determine the maximum filtered gray value among the multiple filtered gray values ​​corresponding to the first pixel as the target filtered gray value corresponding to the first pixel for any given first pixel, or to determine the minimum filtered gray value among the multiple filtered gray values ​​corresponding to the first pixel as the target filtered gray value corresponding to the first pixel for any given first pixel.

[0108] This application also provides a computer program product, which, when executed on a data processing device, is suitable for executing program code with the following initialization steps: acquiring an image to be extracted and generating an expanded image corresponding to the image to be extracted, wherein the image to be extracted contains a plurality of first pixels; determining a plurality of filtered grayscale values ​​corresponding to each first pixel based on a plurality of preset filter template images and the expanded image, wherein for any preset filter template image, the preset filter template image contains a curve passing through the center pixel, and the curves contained in any two preset filter template images are different; selecting a target filtered grayscale value corresponding to each first pixel from the plurality of filtered grayscale values ​​corresponding to each first pixel according to a preset selection method; and generating a line feature image corresponding to the image to be extracted based on the target filtered grayscale value corresponding to each first pixel.

[0109] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0110] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0111] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0112] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0113] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0114] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0115] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0116] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0117] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0118] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. An image line feature extraction device, characterized in that, The device includes: An acquisition unit is used to acquire an image to be extracted, wherein the image to be extracted contains a plurality of first pixels; The first generation unit is used to generate an augmented image corresponding to the image to be extracted; The determining unit is used to determine multiple filtered gray values ​​corresponding to each first pixel point based on multiple preset filter template images and the expanded image, wherein, for any preset filter template image, the preset filter template image contains a curve passing through the center pixel point, and any two preset filter template images contain different curves. The selection unit is used to select the target filtered gray value corresponding to each first pixel from multiple filtered gray values ​​corresponding to each first pixel according to a preset selection method. The second generation unit is used to generate a line feature image corresponding to the image to be extracted based on the target filtered gray value corresponding to each of the first pixels.

2. The apparatus according to claim 1, characterized in that, The first generation unit is specifically used for: The image to be extracted is converted into a grayscale image, wherein the grayscale image contains a plurality of second pixels; The grayscale image is expanded by performing image boundary expansion processing based on the grayscale value corresponding to each second pixel and the size of the multiple preset filter template images to generate the expanded image.

3. The apparatus according to claim 1, characterized in that, The determining unit is specifically used for: The expanded image is normalized to obtain a normalized image corresponding to the expanded image. The normalized image includes multiple original third pixels and multiple expanded third pixels, and the multiple original third pixels correspond one-to-one with the multiple first pixels. Based on the multiple preset filter template images, the grayscale value corresponding to each original third pixel, and the grayscale value corresponding to each extended third pixel, multiple filtered grayscale values ​​corresponding to each first pixel are determined.

4. The apparatus according to claim 3, characterized in that, The determining unit is specifically used for: Based on the curve contained in the preset filter template image, multiple associated third pixels corresponding to the target original third pixel are selected in the normalized image. The associated third pixels corresponding to the target original third pixel can be either the original third pixel or an extended third pixel. The grayscale value corresponding to the original third pixel of the target and the grayscale value corresponding to each associated third pixel are summed to obtain the filtered grayscale value of the first pixel corresponding to the original third pixel of the target.

5. The apparatus according to claim 4, characterized in that, For any given preset filter template image, the curve contained in the preset filter template image is composed of a center pixel and multiple other pixels; The determining unit is specifically used for: Based on the position of each of the other pixels relative to the center pixel, multiple associated third pixels corresponding to the original target third pixel are selected in the normalized image.

6. The apparatus according to any one of claims 1-5, characterized in that, The preset selection method is to determine the maximum filtered gray value among the multiple filtered gray values ​​corresponding to the first pixel as the target filtered gray value corresponding to the first pixel for any given first pixel, or to determine the minimum filtered gray value among the multiple filtered gray values ​​corresponding to the first pixel as the target filtered gray value corresponding to the first pixel for any given first pixel.

7. A method for extracting line features from an image, characterized in that, The method includes: Obtain the image to be extracted and generate an augmented image corresponding to the image to be extracted, wherein the image to be extracted contains a plurality of first pixels; Based on multiple preset filter template images and the expanded image, multiple filtered gray values ​​corresponding to each first pixel are determined. For any preset filter template image, the preset filter template image contains a curve passing through the center pixel, and the curves contained in any two preset filter template images are different. According to a preset selection method, the target filtered gray value corresponding to each first pixel is selected from multiple filtered gray values ​​corresponding to each first pixel. A line feature image corresponding to the image to be extracted is generated based on the target filtered gray value corresponding to each of the first pixels.

8. The method according to claim 7, characterized in that, The process of generating the augmented image corresponding to the image to be extracted includes: The image to be extracted is converted into a grayscale image, wherein the grayscale image contains a plurality of second pixels; The grayscale image is expanded by performing image boundary expansion processing based on the grayscale value corresponding to each second pixel and the size of the multiple preset filter template images to generate the expanded image.

9. A storage medium, characterized in that, The storage medium includes a stored program, wherein, when the program is executed, it controls the device where the storage medium is located to perform the image line feature extraction method of claim 7 or 8.

10. An image line feature extraction device, characterized in that, The apparatus includes a storage medium; and one or more processors, the storage medium being coupled to the processors, the processors being configured to execute program instructions stored in the storage medium; the program instructions, when executed, perform the image line feature extraction method of claim 7 or 8.

Citation Information

Patent Citations

  • Image recognition method and system based on template matching

    CN112926695A

  • Method and system for filtering image noise out

    US20160196477A1