Star point centroid extraction method and system based on optimal background estimation
Through the optimal background estimation method, combined with image preprocessing and improved center of mass method, the problems of grayscale inequality and noise influence in star dot images are solved, and high-precision and real-time spot center of mass positioning are achieved.
Patent Information
- Application Number
- CN202211231029.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-09
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2042-10-09
AI Technical Summary
The uneven grayscale division of the target spot in star dot images and the noise floor of the center of mass positioning and feature recognition are difficult to extract, and the existing methods have shortcomings in positioning accuracy and real-time performance.
The nonlinear center of mass method based on optimal background estimation is adopted, including image preprocessing, Gaussian surface fitting, region preference and distance-weighted nonlinear center of mass method, through median filtering, maximum entropy threshold segmentation, image closing operation and Gaussian surface fitting, combined with the improved center of mass method, the spot center of mass positioning is optimized.
It improves the accuracy and noise resistance of spot center of mass positioning, reduces the positioning error caused by uneven grayscale distribution and irregular spots, and ensures real-time and positioning accuracy.
Smart Images

Figure CN115409831B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a star point centroid extraction method and system based on optimal background estimation, and belongs to the technical field of image processing. Background Art
[0002] The centroid positioning and identification of target light spots in star point images are the core supporting technologies of high-precision astronomical observation systems. Due to the uneven grayscale gradation and background noise of target light spots in star point images observed in deep space, it is difficult to locate the centroid of target light spots and identify their features.
[0003] Existing methods for spot positioning mainly include the centroid method, the centroid method, the Gaussian surface fitting method, the Hough transform method, and deep learning methods. Among them, the centroid method has fewer steps, less computational effort, and high real-time performance. However, because the algorithm does not consider the grayscale value relationship between adjacent pixels, the positioning accuracy is relatively low. The centroid method has a smaller computational effort and higher positioning accuracy, but it has high requirements for the quality of the star image and is greatly affected by the image background noise. At the same time, the positioning accuracy of target spots with uneven grayscale value distribution is poor. The Gaussian surface fitting method can well fit the grayscale distribution characteristics of the spot, but is greatly affected by the specific distribution of the spot grayscale value. The Hough transform method has high requirements for the edge shape of the spot, otherwise its positioning accuracy decreases. The deep learning algorithm can well abstract the centroid coordinates of the spot, but its long inference delay makes it unsuitable for use in real-time systems.
[0004] The above problems are issues that should be considered and solved in the process of star point centroid extraction. Summary of the Invention
[0005] The purpose of the present invention is to provide a star point centroid extraction method and system based on optimal background estimation, so as to solve the problems existing in the prior art such as large background noise in star point images, uneven distribution of target spot grayscale values, low centroid positioning accuracy, and high real-time positioning requirements.
[0006] The technical solution of the present invention is:
[0007] A method for extracting star point centroids based on optimal background estimation includes the following steps:
[0008] S1. Acquire a star point image, perform image preprocessing on the star point image, and obtain a preprocessed image;
[0009] S2. Perform Gaussian surface fitting on the grayscale values of the starlight in the preprocessed image to obtain the preliminary centroid coordinates (x0, y0) of the starlight;
[0010] S3. Using a region optimization method, select a symmetrical circular region with the initial centroid coordinates (x0, y0) and the pixel coordinates (x1, y1) with the maximum grayscale value as the diameter, and use the obtained symmetrical circular region as the preferred region;
[0011] S4. Use the distance-weighted nonlinear centroid method to locate the target light spot image in the preferred area and obtain the centroid coordinates (a, b) of the light spot.
[0012] Furthermore, in step S1, the star point image is preprocessed, specifically,
[0013] S11, removing background noise in the star point image by median filtering;
[0014] S12, using the maximum entropy global automatic threshold segmentation method to perform threshold segmentation on the star point image, segmenting the target spot from the background, and determining the target area;
[0015] S13: Perform an image closing operation to remove the influence of background noise on the target area and obtain a preprocessed image.
[0016] Furthermore, in step S2, Gaussian surface fitting is performed on the grayscale values of the starlight in the preprocessed image to obtain the preliminary centroid coordinates (x0, y0) of the starlight, specifically,
[0017] The Gaussian surface fitting method is used to fit the grayscale value in the preprocessed image using a two-dimensional Gaussian function. Let f(x,y) be the grayscale value at (x,y) in the preprocessed image. The grayscale value of a single light spot is expressed by the following Gaussian model formula:
[0018]
[0019] Among them, A is the intensity of light, x0, y0 are the initial centroid coordinates of the light spot, x, y are the position coordinates of the star point coordinates of the preprocessed image, σ x ,σ y is the standard deviation in the X and Y directions, A,x0,y0,σ x ,σ y are the parameters of the Gaussian function to be fitted, and the values of the parameters are obtained by the least squares method.
[0020] Furthermore, in step S4, a distance-weighted nonlinear centroid method is used to locate the target spot image in the preferred area to obtain the centroid coordinates of the spot, specifically,
[0021] The resolution of the target spot image in the preferred area is m*n. The weight of the pixel points closer to the center of mass of the spot, that is, the pixel points whose distance from the center of mass of the spot is less than or equal to the set Euclidean distance L, is increased. At the same time, the weight function of the inverse of the center of mass distance is selected. The farther the pixel point in the image is from the center of mass of the spot, the smaller the influence on the center of mass point positioning. The coordinates of the center of mass of the spot are (a, b), and the formula is as follows:
[0022]
[0023] Among them, f(i,j) is the gray value of the pixel (i,j) on the target spot image in the preferred area, and d is the Euclidean distance from (i,j) to (x2,y2). Among them, i, j are the horizontal and vertical coordinates of the pixel point on the target spot image in the preferred area, respectively, and (x2, y2) are the geometric midpoint coordinates of the preliminary centroid coordinates (x0, y0) and the pixel coordinates of the maximum grayscale value (x1, y1), that is, x2 = (x0 + x1) / 2, y2 = (y0 + y1) / 2.
[0024] Furthermore, in step S4, the number L is set to 3.
[0025] A system for implementing any of the above-mentioned star point centroid extraction methods based on optimal background estimation comprises an image acquisition module, a centroid extraction module and a display module.
[0026] The image acquisition module acquires multiple frames of continuous star point images through optical instruments and sends them to the centroid extraction module;
[0027] The centroid extraction module adopts any of the above-mentioned star point centroid extraction methods based on optimal background estimation to obtain the centroid coordinates of the target light spot in the star point image;
[0028] Display module: The target light spot centroid coordinates are labeled on the star point image through the open source visual tool library OpenCV, and the target light spot centroid coordinates of multiple consecutive star point images are output and displayed on the smart terminal to complete the detection task.
[0029] The beneficial effects of the present invention are:
[0030] First, this star point centroid extraction method and system based on optimal background estimation uses a positioning algorithm that combines Gaussian surface fitting with an improved centroid method. This method achieves high positioning accuracy for target light spots with uneven grayscale distribution and exhibits strong noise immunity. It can also improve the centroid positioning accuracy for light spots with irregular edges and uneven grayscale distribution, while ensuring real-time performance. It is particularly effective for locating star points with irregular shapes and uneven grayscale distribution in starry sky images.
[0031] 2. This star point centroid extraction method and system based on optimal background estimation adopts a regional optimization method to select a specific symmetrical area for a specific light spot before improving the centroid positioning method. It can reduce the adverse effects of irregular grayscale distribution on positioning, reduce the positioning error caused by irregular target light spots, improve the positioning accuracy of the centroid method, and effectively reduce the amount of calculation. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 1 is a flow chart of a method for extracting the centroid of a star point based on optimal background estimation according to an embodiment of the present invention;
[0033] Figure 2 is a schematic diagram illustrating a light spot image with Gaussian noise in an embodiment;
[0034] Figure 3 is a schematic diagram illustrating a spot image after image preprocessing in an embodiment;
[0035] Figure 4 is a schematic diagram illustrating determining a preferred area in an embodiment;
[0036] Figure 5 is a schematic diagram illustrating determination of the center of mass in an embodiment;
[0037] Among them, 1 is the pixel with the maximum grayscale value in the star image, 2 is the preliminary centroid obtained using the Gaussian fitting method, and 3 is the centroid coordinate of the light spot. DETAILED DESCRIPTION
[0038] The preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0039] Example
[0040] A star point centroid extraction method based on optimal background estimation, such as Figure 1 , including the following steps,
[0041] S1. Acquire a star point image, perform image preprocessing on the star point image, and obtain a preprocessed image;
[0042] In step S1, the star point image is preprocessed, specifically,
[0043] S11, removing background noise in the star point image by median filtering;
[0044] S12, using the maximum entropy global automatic threshold segmentation method to perform threshold segmentation on the star point image, segmenting the target spot from the background, and determining the target area;
[0045] In step S12, a global automatic threshold segmentation method of maximum entropy is adopted. Specifically, the maximum entropy formula is as follows:
[0046] H = -∑P(x)log2P(x)
[0047] where p(x) is the probability of the event occurring.
[0048] Given a specific threshold q (0 ≤ q < K - 1), where K is the upper limit of the image gray value, for the two image regions C0 and C1 segmented by this threshold, the estimated probability density functions are as follows:
[0049]
[0050] where P0(q) and P1(q) respectively represent the cumulative probabilities of the background and foreground pixels segmented by the q threshold, and the sum of the two is 1. The entropies corresponding to the background and foreground are expressed as follows:
[0051]
[0052] Calculate the total entropy of the image for all segmentation thresholds, find the maximum entropy, and use the segmentation threshold corresponding to the maximum entropy as the final threshold. The pixels in the image with gray values greater than this threshold are used as the foreground, otherwise as the background. This method is applicable to the case where the proportion of the foreground in the image is small and can better segment the target spot and the background in the star point image.
[0053] S13. Perform an image closing operation to remove the influence of background noise on the target area and obtain the preprocessed image.
[0054] In step S13, due to the existence of a large amount of radiation and atmospheric interference in the actual working environment of the space target monitoring system, most of the target spots in the star point image will be fragmented, so an image closing operation needs to be performed on the image. First, dilate to fill the small holes in the connected domain, expand the boundary of the connected domain, and connect two adjacent connected domains. Then, through erosion operation, reduce the expansion of the connected domain boundary and the increase in area caused by the dilation operation, and enhance the centroid detection accuracy of the local fragmented spots.
[0055] As Figure 2 and Figure 3 , Figure 2 the white dots in Figure 3 are a large amount of Gaussian noise existing in the image. After preprocessing Figure 3 most of the Gaussian noise in Figure 3 is basically eliminated. By performing image preprocessing on the star point image, it is possible to remove the influence of noise in the image on centroid positioning while retaining the gray value characteristics of the spot.
[0056] S2. Perform Gaussian surface fitting on the starlight gray values in the preprocessed image to obtain the preliminary centroid coordinates (x0, y0) of the starlight; specifically,
[0057] The Gaussian surface fitting method is used to fit the grayscale value in the preprocessed image using a two-dimensional Gaussian function. Let f(x,y) be the grayscale value at (x,y) in the preprocessed image. The grayscale value of a single light spot is expressed by the following Gaussian model formula:
[0058]
[0059] Among them, A is the intensity of light, x0, y0 are the initial centroid coordinates of the light spot, x, y are the star point coordinates of the preprocessed image, σ x ,σ y is the standard deviation in the X and Y directions, A,x0,y0,σ x ,σ y are the parameters of the Gaussian function to be fitted, and the values of the parameters are obtained by the least squares method.
[0060] S3. Use the region optimization method to select a symmetrical circular region with the initial centroid coordinates (x0, y0) and the pixel coordinates of the maximum grayscale value (x1, y1) as the diameter, and use the obtained symmetrical circular region as the preferred region.
[0061] In step S3, by adopting the method of regional optimization, before performing sub-pixel positioning of the target light spot, a suitable area is first selected by the regional optimization algorithm and then positioning is performed, such as Figure 4 and Figure 5 , the symmetrical circular area with the initial centroid 2 coordinates (x0, y0) obtained by the Gaussian fitting method and the coordinates (x1, y1) of the pixel 1 with the maximum grayscale in the star point image as the diameter is selected as the preferred area, and then the centroid coordinates 3 of the light spot are located. This can effectively eliminate the adverse effects caused by the uneven grayscale of the star point, effectively improve the positioning accuracy, and reduce the positioning error and calculation amount caused by the irregularity of the target light spot.
[0062] S4, using the distance-weighted nonlinear centroid method to locate the target spot image in the preferred area and obtain the centroid coordinates 3 of the spot. Specifically,
[0063] The resolution of the target spot image in the preferred area is m*n. The weight of the pixel points closer to the center of mass of the spot, that is, the pixel points whose distance from the center of mass of the spot is less than or equal to the set Euclidean distance L, is increased. At the same time, the weight function of the inverse of the center of mass distance is selected. The farther the pixel point in the image is from the center of mass of the spot, the smaller the influence on the center of mass point positioning. The center of mass coordinates 3 of the spot are (a, b), and the formula is as follows:
[0064]
[0065] Among them, f(i,j) is the gray value of the pixel (i,j) on the target spot image in the preferred area, and d is the Euclidean distance from (i,j) to (x2,y2). Among them, i, j are the horizontal and vertical coordinates of the pixel point on the target spot image in the preferred area, respectively, and (x2, y2) are the geometric midpoint coordinates of the preliminary centroid coordinates (x0, y0) and the pixel coordinates of the maximum grayscale value (x1, y1), that is, x2 = (x0 + x1) / 2, y2 = (y0 + y1) / 2.
[0066] In view of the fact that the maximum entropy threshold segmentation method in step S12 can effectively separate the target light spot from the foreground and has a certain degree of noise resistance, in order to further reduce the impact of noise on the positioning of the light spot centroid, step S4 proposes a distance-weighted nonlinear centroid method, which increases the weight of pixels close to the light spot centroid (such as less than or equal to 3 pixels from the light spot centroid) to improve the positioning accuracy, and at the same time selects a weight function about the inverse of the centroid distance. The farther the pixel point in the image is from the light spot centroid, the smaller the impact on the centroid positioning. This method can effectively separate the target light spot from the background in the image, thereby reducing the impact of distant noise in the light spot image on the positioning of the light spot centroid. The formula is as follows:
[0067]
[0068] Among them, f(i,j) is the gray value of the pixel (i,j) on the target spot image in the preferred area, and d is the Euclidean distance from (i,j) to (x2,y2).
[0069] This star point centroid extraction method based on optimal background estimation has high positioning accuracy for target light spots with uneven grayscale distribution, has strong noise resistance, can reduce the adverse effects of irregular grayscale distribution on positioning, improve the positioning accuracy of the centroid method, effectively reduce the amount of calculation, and ensure real-time performance.
[0070] This star point centroid extraction method based on optimal background estimation first processes the star point image through image preprocessing, using a three-step method of median filtering, threshold segmentation, and closing operation to obtain a clearer star point image, thereby improving the positioning accuracy of the target light spot. Then, the centroid and pixel distribution characteristics of each target light spot are extracted based on a Gaussian surface fitting algorithm. Finally, a symmetrical circular domain is selected within each target light spot, and the distance-weighted centroid method is used to complete the positioning of the target light spot centroid in the star point image. The present invention adopts a method that combines the Gaussian surface fitting method with the centroid method, while improving the centroid method to enhance its noise resistance. This method is effective in locating star point images with irregular shapes and uneven grayscale value distribution in starry sky images.
[0071] This star centroid extraction method, based on optimal background estimation, first removes background noise from the star image using median filtering during image preprocessing. Subsequently, a global automatic threshold segmentation method with maximum entropy is used to segment the star image and determine the target region. Finally, an image closing operation is performed to further remove the influence of background noise on the target region. After image preprocessing, a Gaussian surface fitting and region selection method are used. First, a Gaussian surface is fitted to the starlight grayscale values to obtain the preliminary coordinates (x0, y0) of the starlight. A suitable symmetrical circular region is then selected as the preferred region using the region selection method. A nonlinear centroid method with strongly weighted distance is then applied within the preferred region to further reduce the impact of image noise on the accuracy of star centroid positioning. Ultimately, the sub-pixel coordinates of the star centroid are obtained. This method can accurately locate the star centroid.
[0072] The embodiment further provides a system for implementing any of the above-mentioned star point centroid extraction methods based on optimal background estimation, comprising an image acquisition module, a centroid extraction module, and a display module.
[0073] The image acquisition module acquires multiple frames of continuous star point images through optical instruments and sends them to the centroid extraction module;
[0074] The centroid extraction module adopts any of the above-mentioned star point centroid extraction methods based on optimal background estimation to obtain the centroid coordinates 3 of the target light spot in the star point image;
[0075] Display module: The result label of the centroid coordinate 3 of the target light spot is printed on the star point image through the open source visual tool library OpenCV, and the centroid coordinates of the target light spot of multiple consecutive frames of star point images are output and displayed on the smart terminal to complete the detection task.
[0076] This star point centroid extraction method and system based on optimal background estimation uses a positioning algorithm that combines Gaussian surface fitting with an improved centroid method. This method achieves high positioning accuracy for target light spots with uneven grayscale distribution and exhibits strong noise immunity. It can also improve the centroid positioning accuracy for light spots with irregular edges and uneven grayscale distribution, while ensuring real-time performance. It is particularly effective for locating star points with irregular shapes and uneven grayscale distribution in starry sky images.
[0077] This star point centroid extraction method and system based on optimal background estimation adopts a regional optimization method to select specific symmetrical areas for specific light spots before improving the sub-pixel positioning of the centroid method. It can reduce the adverse effects of irregular grayscale distribution on positioning, reduce the positioning error caused by irregular target light spots, improve the positioning accuracy of the centroid method, and effectively reduce the amount of calculation.
[0078] The above embodiments are only for illustrating the technical concept of the present invention and cannot be used to limit the protection scope of the present invention. Any changes made to the technical solution in accordance with the technical concept proposed by the present invention fall within the protection scope of the present invention.
Claims
1. A method for extracting star point centroids based on optimal background estimation, characterized by: The following steps are included: S1. Acquire a star point image, perform image preprocessing on the star point image, and obtain a preprocessed image; S2. Perform Gaussian surface fitting on the grayscale values of the starlight in the preprocessed image to obtain the preliminary centroid coordinates (x0, y0) of the starlight; S3. Using a region optimization method, select a symmetrical circular region with the initial centroid coordinates (x0, y0) and the pixel coordinates (x1, y1) with the maximum grayscale value as the diameter, and use the obtained symmetrical circular region as the preferred region; S4. Use the distance-weighted nonlinear centroid method to locate the target light spot image in the preferred area and obtain the centroid coordinates (a, b) of the light spot.
2. The method for extracting star point centroids based on optimal background estimation according to claim 1, wherein: In step S1, the star point image is preprocessed, specifically, S11, removing background noise in the star point image by median filtering; S12, using the maximum entropy global automatic threshold segmentation method to perform threshold segmentation on the star point image, segmenting the target spot from the background, and determining the target area; S13: Perform an image closing operation to remove the influence of background noise on the target area and obtain a preprocessed image.
3. The method for extracting star point centroids based on optimal background estimation according to claim 1, wherein: In step S2, Gaussian surface fitting is performed on the grayscale values of the starlight in the preprocessed image to obtain the preliminary centroid coordinates (x0, y0) of the starlight, specifically, The Gaussian surface fitting method is used to fit the grayscale value in the preprocessed image using a two-dimensional Gaussian function. Let f(x,y) be the grayscale value at (x,y) in the preprocessed image. The grayscale value of a single light spot is expressed by the following Gaussian model formula: Among them, A is the intensity of light, x0, y0 are the initial centroid coordinates of the light spot, x, y are the position coordinates of the star point coordinates of the preprocessed image, σ x ,σ y is the standard deviation in the X and Y directions, A,x0,y0,σ x ,σ y are the parameters of the Gaussian function to be fitted, and the values of the parameters are obtained by the least squares method.
4. The method for extracting star point centroids based on optimal background estimation according to any one of claims 1 to 3, wherein: In step S4, the distance-weighted nonlinear centroid method is used to locate the target spot image in the preferred area to obtain the centroid coordinates of the spot, specifically, The resolution of the target spot image in the preferred area is m*n. The weight of the pixel points closer to the center of mass of the spot, that is, the pixel points whose distance from the center of mass of the spot is less than or equal to the set Euclidean distance L, is increased. At the same time, the weight function of the inverse of the center of mass distance is selected. The farther the pixel point in the image is from the center of mass of the spot, the smaller the influence on the center of mass point positioning. The coordinates of the center of mass of the spot are (a, b), and the formula is as follows: Among them, f(i,j) is the gray value of the pixel (i,j) on the target spot image in the preferred area, and d is the Euclidean distance from (i,j) to (x2,y2). Among them, i, j are the horizontal and vertical coordinates of the pixel point on the target spot image in the preferred area, respectively, and (x2, y2) are the geometric midpoint coordinates of the preliminary centroid coordinates (x0, y0) and the pixel coordinates of the maximum grayscale value (x1, y1), that is, x2 = (x0 + x1) / 2, y2 = (y0 + y1) / 2.
5. The method for extracting star point centroids based on optimal background estimation according to claim 4, wherein: In step S4, the number L is set to 3.
6. A system for implementing the method for extracting star point centroids based on optimal background estimation according to any one of claims 1 to 5, characterized in that: Including image acquisition module, centroid extraction module and display module, The image acquisition module acquires multiple frames of continuous star point images through optical instruments and sends them to the centroid extraction module; The centroid extraction module adopts the star point centroid extraction method based on optimal background estimation according to any one of claims 1 to 5 to obtain the centroid coordinates of the target light spot in the star point image; Display module: The target light spot centroid coordinates are labeled on the star point image through the open source visual tool library OpenCV, and the target light spot centroid coordinates of multiple consecutive star point images are output and displayed on the smart terminal to complete the detection task.