A method for extracting straight lines from images based on Fourier transform

By using a Fourier transform-based method, utilizing global gradient and histogram statistics, and combining Hough transform, the anti-interference and stability problems of line extraction in existing technologies are solved, achieving fast and reliable line extraction, which is particularly suitable for grayscale or color images and binary images.

CN114723849BActive Publication Date: 2026-03-10CHINA SHIP DEV & DESIGN CENT
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-01
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

Existing line extraction methods suffer from poor anti-interference capabilities and insufficient stability, especially in noisy environments where it is difficult to reliably extract lines.

Method used

A Fourier transform-based method is adopted to obtain spatial spectrum information through two-dimensional Fourier transform. By utilizing the overall gradient of the line, combined with histogram statistics and Hough transform, the direction and distance parameters of the line are extracted, thus achieving fast and accurate line extraction.

Benefits of technology

It improves the anti-interference and stability of line extraction, and significantly accelerates the line extraction process, especially performing well in simple grayscale or color images and binary images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114723849B_ABST
    Figure CN114723849B_ABST
Patent Text Reader

Abstract

This invention discloses a method for extracting straight lines from images based on Fourier transform, comprising the following steps: 1) performing a two-dimensional Fourier transform on the image to obtain spatial spectrum information; 2) obtaining the direction parameters of the straight line based on the spatial spectrum information; 3) searching for the optimal value of the distance parameter based on the direction parameters of the straight line to extract the straight line. This invention's image straight line extraction method based on Fourier transform exhibits strong anti-interference capabilities and good stability. In this invention, the Fourier transform actually solves for and utilizes the overall gradient of the straight line, replacing the original point-by-point gradient, resulting in strong noise resistance and thus enabling stable and reliable extraction of the straight line.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to image processing technology, and more particularly to a method for extracting straight lines from images based on Fourier transform. Background Technology

[0002] Geometric features in an image, such as lines, circles, ellipses, and rectangles, typically provide important information and are the first features to be extracted during image analysis. Based on these extracted geometric features, various important information can be obtained through analysis. Subsequent operations, such as image recognition, measurement, and defect detection, can then be performed based on this information.

[0003] Among image features, straight lines are the most common and frequently occurring geometric features. A straight line has two degrees of freedom; for example, slope and intercept are two parameters that determine a straight line. Straight line extraction methods involve searching for the parameters within a space containing these two parameters to find the optimal solution, thereby determining the two parameters of the line. Traditional straight line extraction methods include least squares fitting and Hough transform. Summary of the Invention

[0004] The technical problem to be solved by the present invention is to provide a method for extracting straight lines from images based on Fourier transform, which addresses the shortcomings of the existing technology.

[0005] The technical solution adopted by this invention to solve its technical problem is: a method for extracting straight lines from images based on Fourier transform, comprising the following steps:

[0006] 1) Perform a two-dimensional Fourier transform on the image to obtain spatial spectrum information;

[0007] 2) Obtain the direction parameters of the line based on the spatial spectrum information; the specific steps are as follows:

[0008] 2.1) The spatial frequencies (u, v) in the spatial spectrum information are listed as statistical objects, where u is the horizontal spatial frequency and v is the vertical spatial frequency;

[0009] 2.2) Solve for the angle α of the normal to the spatial frequency of the statistical object;

[0010] The solution formula is α = atan(v / u), where atan is the arctangent function;

[0011] 2.3) Perform histogram statistics on α. ​​The peak value of each peak is the normal of the line in the image. Determine the direction of the line based on the normal.

[0012] 3) Based on the direction parameter of the line, search for the optimal value of the distance parameter to extract the line.

[0013] According to the above scheme, the spatial sampling rates in the horizontal and vertical directions in step 1) are determined based on the frequency resolution of the spectrum.

[0014] According to the above scheme, in step 2.1), an amplitude threshold A is set, and spatial frequencies (u, v) greater than A are listed as statistical objects.

[0015] According to the above scheme, in step 3), the optimal value is searched for on the distance parameter based on the direction parameter of the line, and the line is extracted by Hough transform.

[0016] According to the above scheme, the image in step 1) is a binary image.

[0017] The beneficial effects of this invention are:

[0018] The method provided by this invention has strong anti-interference capabilities and good stability. In this invention, the Fourier transform actually solves for and utilizes the global gradient of the straight line, replacing the original point-by-point gradient, which has strong anti-noise performance and can reliably extract the straight line. Attached Figure Description

[0019] The present invention will be further described below with reference to the accompanying drawings and embodiments. In the accompanying drawings:

[0020] Figure 1 This is a flowchart of a method according to an embodiment of the present invention;

[0021] Figure 2 This is a schematic diagram of image line extraction according to an embodiment of the present invention;

[0022] Figure 3 This is a schematic diagram of image line extraction according to an embodiment of the present invention;

[0023] Figure 4 This is a schematic diagram of image line extraction according to an embodiment of the present invention. Detailed Implementation

[0024] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0025] like Figure 1 As shown, a method for extracting straight lines from an image based on Fourier transform includes the following steps:

[0026] 1) Perform a two-dimensional Fast Fourier Transform (FFT) on the image to obtain spatial spectral information;

[0027] 2) Obtain the direction parameters of the line based on the spatial amplitude spectrum; the specific steps are as follows:

[0028] 2.1) Set an amplitude threshold A, and list the spatial frequencies (u, v) greater than A as statistical objects, where u is the horizontal spatial frequency and v is the vertical spatial frequency;

[0029] The amplitude threshold A is set according to the complexity of the image, and is generally taken as the peak value of the 5th to 7th peak.

[0030] 2.2) Solve for the angle α of the normal to the spatial frequency of the statistical object;

[0031] The solution formula is α = atan(v / u), where atan is the arctangent function;

[0032] 2.3) Perform histogram statistics on α. ​​The peak value of each peak is the normal of the line in the image. Determine the direction of the line based on the normal.

[0033] 3) Based on the direction parameter of the line, search for the optimal value of the distance parameter to extract the line.

[0034] In this embodiment, the straight line is extracted using traditional methods such as the Hough transform, based on the direction parameter of the straight line.

[0035] A straight line has two degrees of freedom, and extracting a straight line requires extracting two parameters. The Hough transform needs to search for optimal values ​​for both direction and distance parameters. Since the direction of the line was given in the previous step, the search only needs to be performed on the distance. There are also methods to accelerate the distance search, such as the pyramid method. Because the line parameters are searched within a narrowed range, the line extraction process is accelerated.

[0036] This method utilizes the global gradient of a line, while traditional gradient acceleration methods rely on local point gradients. Extracting the global gradient offers significant advantages due to its strong resistance to interference and stable extraction capabilities.

[0037] This method is particularly suitable for the following situations:

[0038] a. Grayscale or color images with relatively simple patterns, mainly consisting of straight lines.

[0039] b. Binary images, especially binary images with many straight lines.

[0040] First, taking a barcode image as an example, the process of the present invention is demonstrated, and the straight line extraction is accelerated.

[0041] 1) Figure 2 (a) is the captured barcode image, which undergoes a Fourier transform. The result is displayed on... Figure 2 In (b), the origin is Figure 2 (b) The center of the image. Figure 2 In (b), there are two straight lines passing through the origin, which reflect... Figure 2(a) The image contains two straight line directions. In the program implementation, these two line directions need to be found using histogram statistics (as described earlier). When extracting lines using the Hough transform later, the search can be performed in both directions. This reduces the search range and accelerates line extraction. Figure 2 (c) shows the straight line obtained by accelerating the extraction process. Compared to the exhaustive method, the extraction time is reduced by 80%.

[0042] 2) To Figure 2 Rotate the image in (a) and then process the rotated image. Figure 3 (a) Demonstrates the process of the present invention, performing linear accelerated extraction. Figure 3 (a) is the captured rotated barcode image. A Fourier transform is performed on it, and the result is displayed. Figure 3 In (b), the origin is Figure 3 (b) The center of the image. Figure 3 In (b), there are two straight lines passing through the origin, which reflect... Figure 3 (a) The image has two straight line directions, which are related to... Figure 2 (b) A rotational relationship exists. (Compare) Figure 3 (b) and Figure 2 (b) It can be found that the spectrum can reflect the rotation of the original image and can accurately determine the direction of the straight line after rotation. Figure 3 (c) shows the straight line obtained by accelerating the extraction process. Compared to the exhaustive method, the extraction time is reduced by 80%.

[0043] 3) Taking an image with multiple rectangular blocks as an example, the process of the present invention is demonstrated, and the straight line extraction is accelerated. Figure 4 (a) is an image containing multiple rectangular blocks. A Fourier transform is performed on it, and the result is displayed. Figure 4 In (b), the origin is Figure 4 (b) The center of the image. Figure 4 In (b), there are six straight lines passing through the origin, which reflects... Figure 4 (a) The image contains six straight lines. In the program implementation, these six straight lines need to be found using histogram statistics (as described earlier). Using Hough transform to search for lines in the six directions can reduce the search range, thereby accelerating the extraction of lines. Figure 4 (c) shows the straight line obtained by accelerating the extraction process. Compared to the exhaustive method, the extraction time is reduced by 70%.

[0044] It should be understood that those skilled in the art can make improvements or modifications based on the above description, and all such improvements and modifications should fall within the protection scope of the appended claims.

Claims

1. A Fourier transform-based image line extraction method, characterized by, The method comprises the following steps: 1) performing two-dimensional Fourier transform on the image to obtain spatial spectrum information; 2) obtaining a direction parameter of a straight line according to the spatial spectrum information; the specific steps are: 2.1) setting an amplitude threshold A, and listing spatial frequencies (u, v) greater than A in the spatial spectrum information as statistical objects, wherein u is a horizontal spatial frequency and v is a vertical spatial frequency; 2.2) solving an angle α of a normal of the spatial frequencies of the statistical objects; the solving formula is α = atan(v / u), wherein atan is an inverse tangent function; 2.3) performing histogram statistics on α, and a peak value of each peak is a normal of a straight line in the image, and a straight line direction is obtained according to the normal; 3) searching for an optimal value on a distance parameter according to the direction parameter of the straight line, and extracting the straight line by using a Hough transform.

2. The Fourier transform-based image straight line extraction method according to claim 1, characterized by, In the step 1), spatial sampling rates in horizontal and vertical directions are determined according to frequency resolution of the spectrum.

3. The Fourier transform-based image straight line extraction method according to claim 1, characterized by, In the step 1), the image is a binary image.

Citation Information

Patent Citations

  • Method for encoding, decoding and measuring encoding close-range photogrammetry marker

    CN109186550A

  • Segment extracting device

    JP1988225881A