An astronomical image background extraction method and system

By using window-adaptive bidirectional one-dimensional median filtering and adaptive inter-frame difference method, the problems of background inhomogeneity and background stars in astronomical images are solved, thereby improving the accuracy and efficiency of target detection.

CN115294149BActive Publication Date: 2025-11-25HANGZHOU DIANZI UNIV +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210402834.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-18
Publication Date
2025-11-25
Estimated Expiration
2042-04-18

AI Technical Summary

Technical Problem

Astronomical images contain light leakage caused by uneven background intensity, smear effect, and blooming effect, which affects the accuracy of target detection. Furthermore, it is difficult to distinguish between background stars and small targets, thus reducing detection efficiency.

Method used

A window-adaptive bidirectional one-dimensional median filtering method is used to extract the background, combined with an adaptive inter-frame difference method to filter out background stars, and morphological filtering is used to segment the target region.

Benefits of technology

While ensuring that no targets are lost, the number of false targets is reduced, thereby lowering the computational burden on subsequent detection and improving detection efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115294149B_ABST
    Figure CN115294149B_ABST
Patent Text Reader

Abstract

The present application relates to a kind of astronomical image background extraction method and system, mainly for the processing of starry sky background in space small target detection process;Extraction method includes the following steps: S1, according to the gray characteristic of the astronomical image to be processed, the size of the largest star in astronomical image is detected, to set the window length of one-dimensional median filtering;S2, the background of astronomical image is extracted using the method of bidirectional one-dimensional median filtering, to obtain the image after background correction;S3, the background of the image after background correction is extracted using adaptive interframe difference method.The part outside target area is regarded as the background of astronomical image in the present application, and the effect of suppressing complex background interference in star map and filtering background star can be achieved by extracting and subtracting the background of astronomical image, which creates favorable conditions for subsequent detection of space small target.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of astronomical image processing technology, and specifically relates to a method and system for extracting background from astronomical images, specifically for processing the background of the starry sky during the detection of small targets in space. Background Technology

[0002] In astronomical images, due to the limitations of the imaging system itself and the influence of the complex observation environment composed of external stray light, there is often an uneven distribution of background intensity. At the same time, considering the influence of bright stars on the CCD (Charge-Coupled Device) sensor, there is also light leakage caused by smear and blooming effects in the image. These factors will reduce image quality and signal-to-noise ratio, thus affecting the accuracy of target detection.

[0003] There are also a large number of background stars in astronomical images. They are very similar to small targets in space and are approximate point targets. It is difficult to distinguish the target from the background stars using visual features such as grayscale, shape, and size. The presence of background stars will directly affect the processing efficiency of the detection system.

[0004] Therefore, before performing small target detection in space, the star map needs to be processed. By extracting and subtracting the background of the astronomical image, the complex background interference in the star map can be suppressed and background stars can be filtered out. Summary of the Invention

[0005] Based on the aforementioned shortcomings of existing technologies, the purpose of this invention is to provide a method and system for extracting background from astronomical images, thereby extracting non-uniform backgrounds and background stars in star charts. First, a window-adaptive bidirectional one-dimensional median filtering method is proposed. (1) Based on the grayscale characteristics of the input image, the size of the largest star in the image is detected, and the window length of the one-dimensional median filtering is set accordingly; (2) The background of the image is extracted using the bidirectional one-dimensional median filtering method, resulting in a star chart background that effectively reflects the non-uniformity of the star chart and the smear and blooming effects; (3) By subtracting the star chart background, the influence of non-uniform background on the detection of small spatial targets is eliminated. Second, an adaptive inter-frame difference method is proposed. (1) Background stars are initially filtered out using the frame difference method; (2) A threshold is designed based on the pixel values ​​greater than zero in the frame difference image to further filter out false targets; (3) Noise is removed by morphological filtering, and the target region is segmented. After the above two processes, the background extraction of the astronomical image is completed, that is, the part outside the target region. By subtracting the astronomical image background before target detection, the purpose of suppressing interference can be achieved.

[0006] To achieve the above-mentioned objectives, the present invention adopts the following technical solution:

[0007] A method for extracting background from astronomical images includes the following steps:

[0008] S1. Based on the grayscale characteristics of the astronomical image to be processed, detect the size of the largest star in the astronomical image to set the window length for one-dimensional median filtering;

[0009] S2. Use a bidirectional one-dimensional median filtering method to extract the background of the astronomical image and obtain the background-corrected image.

[0010] S3. Use an adaptive inter-frame difference method to extract the background from the background-corrected image.

[0011] As a preferred embodiment, step S1 includes the following steps:

[0012] S11. Calculate the pixel sum of each column of the astronomical image and sort them to obtain the top N columns with the largest pixel sum;

[0013] Using the pixel with the largest pixel value (x0, y0) in the previous N columns as the center, a local area of ​​a rectangular window of size m×m in the astronomical image is extracted, as shown in Equation (1):

[0014] im_temp(i,j)=f(x,y), (x,y)∈W(i,j) (1)

[0015] Where im_temp(i,j) represents the local region of the rectangular window, f(x,y) represents the gray value of the input astronomical image at position (x,y), and W(i,j) represents the rectangular window centered at (x0,y0).

[0016] S12. Calculate the mean μ and standard deviation σ of all pixels within the rectangular window according to formula (2), set the threshold TH = μ + a × σ to perform binarization, and obtain the binarized local image. a is a constant coefficient. The binarization expression is shown in formula (3).

[0017]

[0018]

[0019]

[0020] Where im_bw(i,j) represents the gray value of the binarized image at (i,j);

[0021] S13. Use the structuring element se to perform a morphological opening operation on the binarized local image. The opening operation expression is shown in equation (4):

[0022]

[0023] Where im_open represents the image after the opening operation. This represents the opening operator in morphology;

[0024] S14. Perform connected component processing on the local image after the opening operation, and determine the largest length or width size in the connected component of the local region. n Equation (5) states that 1 ≤ n ≤ N, and the largest size among all N local regions is the size of the largest star in the astronomical image. max As shown in equation (6);

[0025]

[0026] Size max =max{{Size}},Size n ∈{Size}, 1≤n≤N (6)

[0027] Among them, W k L k Let represent the width and length of the k-th connected component within the local region, respectively. Let Size represent the x and y coordinates of the k-th connected component within the local region, respectively. n Let {W} represent the size of the target star in the nth local region. n}、{L n} represent the set of widths and the set of lengths of all connected components in the nth local region, respectively. max That is, the size of the largest star in the estimated astronomical image, where {Size} represents the set of sizes of the target stars;

[0028] S15, By estimating the maximum stellar size Size max To achieve this, the window length L = b × Size of the one-dimensional median filter is set. max +1, where b is the multiplier.

[0029] As a preferred embodiment, in step S13, the structural element se is:

[0030]

[0031] As a preferred embodiment, step S2 includes the following steps:

[0032] S21. The image background is extracted using the median filtering method. The window length of the one-dimensional median filter in the horizontal direction is set to L. The image is extended outward by (L-1) / 2 pixels from the left and right edges of the astronomical image im_org. The extended pixel value is obtained by translating the corresponding position of the astronomical image im_org. The extended image is denoted as im_extend1, and the expression is shown in the following formula (7):

[0033] Where im_extend1(i,j) represents the gray value of the extended image at (i,j), X and Y represent the number of pixels in the row and column of the astronomical image, respectively, and im_org(x,y) represents the gray value of the astronomical image at (x,y).

[0034] S22. The position of each pixel in the astronomical image is replaced by the window value, which is denoted as the background Y1 extracted by the first median filter, and is represented by Equation (8). The astronomical image im_org is subtracted from the background Y1 to obtain the image im_rem after the first background is filtered out, which is represented by Equation (9).

[0035]

[0036] im_rem(x,y)=im_org(x,y)-Y1(x,y) (9)

[0037] Where W1(x,y) represents a horizontal one-dimensional window of the astronomical image centered at (x,y), and Y1(x,y) and im_rem(x,y) represent the background median extracted at the corresponding position in the astronomical image, i.e., position (x,y) and the pixel value after the first background filtering, respectively.

[0038] S23. Process the image im_rem, set the length of the one-dimensional median filter window in the vertical direction to L, and extend it outward by (L-1) / 2 pixels from the upper and lower edges of the image im_rem. The extended pixel value is obtained by translating the corresponding position of im_rem. The extended image is denoted as im_extend2, and the expression is shown in the following formula (10):

[0039]

[0040] Where im_extend2(i,j) represents the gray value of the extended image at (i,j);

[0041] S24. The position of each pixel in the image im_rem is replaced by the window value, which is denoted as the background Y2 extracted by the second median filter, and is represented by Equation (11). The background-corrected image Y is obtained by subtracting the background Y2 from the image im_rem after the first background filtering, and is represented by Equation (12).

[0042]

[0043] Y(x,y)=im_rem(x,y)-Y2(x,y) (12)

[0044] Where W2(x,y) represents a vertical one-dimensional window of the image im_rem centered at (x,y), and Y2(x,y) and Y(x,y) represent the extracted background median and the background-corrected pixel value at position (x,y), respectively.

[0045] As a preferred embodiment, step S3 includes the following steps:

[0046] S31. Process the background-corrected image Y by using two consecutive background-corrected images, the first frame being the background frame im_bg and the second frame being the target frame im_obj; perform morphological dilation on the background frame im_bg using the structuring element SE1, as shown in equation (13):

[0047]

[0048] Here, im_dilate represents the background frame after dilation. This represents the dilation operator in morphology;

[0049] S32. As shown in equation (14), the target frame im_obj is subtracted from the morphologically dilated background image im_dilate to obtain the image I after the background stars are initially filtered out.

[0050] I = im_obj - im_dilate (14).

[0051] As a preferred embodiment, in step S31, the structural element SE1 is:

[0052]

[0053] As a preferred embodiment, step S3 further includes the following steps:

[0054] S33. Extract pixels g that are greater than 0 from image I. i The mean value Mean and standard deviation Std of the extracted pixel points are calculated according to formula (15). The threshold th = Mean + c × Std is set, where c is the standard deviation coefficient. The image I is binarized, and the expression is shown in formula (16) to obtain the image Ibw after threshold segmentation.

[0055]

[0056]

[0057] Where {G} represents the set of all pixels in the frame-differenced image I with a value greater than 0, I(x,y) represents the pixel value at position (x,y) in the frame-differenced image, Num represents the number of points in the set {G}, and Ibw(x,y) represents the gray value at position (x,y) in the binarized image.

[0058] As a preferred embodiment, step S3 further includes the following steps:

[0059] S34. The binarized image Ibw is processed by morphological opening operation using the structuring element SE2, as shown in equation (17):

[0060]

[0061] Where P represents the image after the opening operation. This represents the opening operator in morphology;

[0062] Let im_star be the final extracted astronomical image background. The astronomical image background template is obtained by subtracting the all-1 matrix from the image P. im_star is obtained by multiplying the astronomical image im_org with the astronomical image background template.

[0063] As a preferred embodiment, step S3...

[0064]

[0065] The present invention also provides an astronomical image background extraction system, which applies the extraction method described in any of the above schemes, the extraction system comprising:

[0066] The setting module is used to detect the size of the largest star in the astronomical image based on the grayscale characteristics of the image to be processed, so as to set the window length of the one-dimensional median filter.

[0067] The bidirectional one-dimensional median filtering module is used to extract the background of astronomical images using the bidirectional one-dimensional median filtering method, and obtain the background-corrected image.

[0068] The inter-frame difference module is used to extract the background from the background-corrected image using an adaptive inter-frame difference method.

[0069] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0070] This invention proposes a method for background extraction from astronomical images, addressing the preprocessing steps before space target detection. The method comprises two main parts: First, it extracts the background from the non-uniform starry sky and smear effects in the astronomical image. This is achieved by using a window-adaptive bidirectional one-dimensional median filtering method to analyze the input image features, adaptively selecting the median filtering window size, and combining horizontal and vertical one-dimensional median filtering to extract the background. Second, it extracts the numerous background stars from the astronomical image. This is done by using an adaptive inter-frame difference method to analyze the features of the frame difference image, designing a threshold based on the pixel values ​​greater than zero in the frame difference image, and combining this with morphological filtering to segment the target region. The portion outside the target region constitutes the extracted stellar background.

[0071] The background extraction method and system of the present invention can reduce the number of false targets while ensuring that no spatial targets are lost, thereby reducing the computational burden of subsequent target detection. Attached Figure Description

[0072] Figure 1 This is a flowchart of the astronomical image background extraction method according to an embodiment of the present invention;

[0073] Figure 2 In the image, (a) shows the position of the largest star in the first frame, and (b) shows the processed shape of the target star.

[0074] Figure 3 The non-uniform background extracted in the first frame of this embodiment of the invention;

[0075] Figure 4 The effect diagram of each step obtained by applying the adaptive inter-frame difference method to the second frame of this embodiment of the invention;

[0076] Figure 5 The background of the astronomical image finally extracted in the second frame of this embodiment of the invention;

[0077] Figure 6 This is the result of target region segmentation in the second frame of this embodiment of the invention;

[0078] Figure 7 This is the result of target region segmentation in the fourth frame of this embodiment of the invention. Detailed Implementation

[0079] To more clearly illustrate the embodiments of the present invention, specific implementation methods will be described below with reference to the accompanying drawings. Obviously, the drawings described below are merely some embodiments of the present invention. For those skilled in the art, other drawings and other implementation methods can be obtained based on these drawings without any creative effort.

[0080] like Figure 1 As shown, the astronomical image background extraction method of this invention includes the following steps:

[0081] S1. Based on the grayscale characteristics of the astronomical image to be processed, detect the size of the largest star in the astronomical image to set the window length for one-dimensional median filtering;

[0082] S2. Use a bidirectional one-dimensional median filtering method to extract the background of the astronomical image and obtain the background-corrected image.

[0083] S3. Use an adaptive inter-frame difference method to extract the background from the background-corrected image.

[0084] Specifically, the processing flow for each step is explained in detail below:

[0085] (I) Window-Adaptive Two-Way One-Dimensional Median Filtering Method

[0086] Step 1: Adaptively set the median filter window size

[0087] S1-1.1 Calculate the sum of pixels in each column of the original astronomical image to be processed and sort them. Take out the top N columns with the largest sum of pixels. Here, N is 10. Record the position (x0, y0) of the pixel with the largest pixel value in these N columns. Then, take this as the center and cut out a rectangular window of size m×m of the original image (i.e., the original astronomical image). The expression is shown in Equation (1). In this way, the position of the largest target star in the image is found.

[0088] im_temp(i,j)=f(x,y), (x,y)∈W(i,j) (1)

[0089] Here, im_temp(i,j) represents the local region of the rectangular window, f(x,y) represents the gray value of the input astronomical image at position (x,y), and W(i,j) represents the rectangular window centered at (x0,y0) of the original image. The length m of the rectangular window is 81.

[0090] S1-1.2 Calculate the mean μ and standard deviation σ of all pixels in the rectangular window according to formula (2), set the threshold TH=μ+a×σ, and binarize the image. The binarization expression is shown in formula (3). Here, a is 1.5. By sacrificing the edge of the target star, the light leakage of other small stars and bright stars in the local area can be effectively eliminated.

[0091]

[0092]

[0093] Here, im_bw(i,j) represents the gray value of the binarized image at (i,j).

[0094] S1-1.3. Use the circular structuring element se in equation (4) to perform morphological opening operation on the local image after binarization to eliminate discrete noise and "spiking" caused by residual light leakage tails after thresholding in the image after binarization. The opening operation expression is shown in equation (5).

[0095]

[0096]

[0097] Here, im_open represents the image after the opening operation. This represents the opening operator in morphology.

[0098] S1-1.4. Perform 8-connected component processing on the local image after the opening operation, and determine the largest length or width size in the connected component of this local region. n Equation (6) states that for all N local regions, the largest size is the size of the largest star in the original image, where 1 ≤ n ≤ N. max As shown in equation (7).

[0099]

[0100]

[0101] Size n =max{{W n}, {L n}},1≤n≤N,W k ∈{W n}, L k ∈{L n} (6)

[0102] Size max =max{{Size}}, Size n ∈{Size}, 1≤n≤N (7)

[0103] Among them, W k L k Let represent the width and length of the k-th connected component within the local region, respectively. Let Size represent the x and y coordinates of the k-th connected component within the local region, respectively. n Let {W} represent the size of the target star in the nth local region. n}、{L n} represent the set of widths and the set of lengths of all connected components in the nth local region, respectively.max That is, the estimated size of the largest star in the original image, where {Size} represents the set of sizes of the target stars.

[0104] Figure 2 (a) shows the location of the largest star in the image found using the first frame of the dataset as input; the target star is indicated by the solid box. Figure 2 (b) shows the processed shape of the target star, with an actual maximum star size of 15 and an estimated maximum star size of 8.

[0105] S1-1.5. Because threshold segmentation was performed on the stellar region during processing, the edges of the stars were eliminated. Therefore, the actual size of the largest star is larger than the estimated size. This can be corrected by adjusting the estimated maximum star size (Size). max To achieve this, the one-dimensional median filter window length L = 4 × Size is set. max +1.

[0106] Step 2: Two-way one-dimensional median filtering to extract background.

[0107] S1-2.1 Extracting the image background using median filtering: Set the length of the horizontal one-dimensional median filter window to L. The original image im_org needs to be extended outwards by (L-1) / 2 pixels from its left and right edges. The extended pixel value is obtained by shifting the corresponding position of im_org. The extended image is denoted as im_extend1, and the expression is as follows:

[0108]

[0109] Where im_extend1(i,j) represents the gray value of the extended image at (i,j), X and Y represent the number of pixels in the row and column of the original image, respectively, and im_org(x,y) represents the gray value of the original image at (x,y).

[0110] S1-2.2. The position of each pixel in the original image is replaced by the window value, which is denoted as the background Y1 extracted by the first median filter and expressed by Equation (9). The original image im_org is subtracted from the background Y1 to obtain the image im_rem after the first background is filtered out, expressed by Equation (10). Through this process, the non-uniform background in the star map background and the star map background pollution caused by non-vertical light leakage due to the blooming effect can be eliminated.

[0111]

[0112] im_rem(x,y)=im_org(x,y)-Y1(x,y) (10)

[0113] Where W1(x,y) represents a horizontal one-dimensional window of the original image centered at (x,y), and Y1(x,y) and im_rem(x,y) represent the median of the background extracted at the corresponding position in the original image, i.e., position (x,y) and the pixel value after the first background filtering, respectively.

[0114] S1-2.3. Process im_rem by setting the length of the one-dimensional median filter window in the vertical direction to L. Similarly, it is necessary to extend (L-1) / 2 pixels outward from the top and bottom edges of im_rem. The extended pixel value is obtained by shifting the corresponding position of im_rem. The extended image is denoted as im_extend2, and the expression is as follows:

[0115]

[0116] Here, im_extend2(i,j) represents the gray value of the extended image at (i,j).

[0117] S1-2.4. The position of each pixel in im_rem is replaced by the window value, which is denoted as the background Y2 extracted by the second median filter, and is expressed by Equation (12). The background-corrected image Y is obtained by subtracting the background Y2 from the image im_rem after the first background filtering, and is expressed by Equation (13). Through this process, the vertical bright lines on the image caused by the smear effect can be eliminated.

[0118]

[0119] Y(x,y)=im_rem(x,y)-Y2(x,y) (13)

[0120] Where W2(x,y) represents a vertical one-dimensional window of im_rem centered at (x,y), and Y2(x,y) and Y(x,y) represent the extracted background median and the background-corrected pixel value at position (x,y), respectively.

[0121] Let im_nubg be the extracted non-uniform background, which is obtained by subtracting the background-corrected image Y from the original image org. Figure 3 This shows a comparison between the non-uniform background extracted from the first frame of the dataset and the original image.

[0122] S1-2.5 If the current astronomical image is the first frame of the continuous image dataset, return to S1-1.1 and repeat the following steps; otherwise, execute step S2-1.1.

[0123] (II) Adaptive Inter-Frame Difference Method

[0124] Step 1: Preliminary filtering of background stars

[0125] S2-1.1 Process the background-corrected image Y. Use two consecutive background-corrected images, the first frame is called the background frame im_bg and the second frame is the target frame im_obj. Before doing the frame difference, morphological dilation is performed on the background image and im_bg, as shown in Equation (15). This can reduce the star remnants after the frame difference. Here, the circular structuring element SE1 with a radius of 3 in Equation (14) is used. This can effectively expand the size of the stars in the background frame, so that the relative displacement and deformation range of the background stars in the target frame all fall within the expanded star size of the background frame image, and the star remnants after the frame difference are minimized.

[0126]

[0127]

[0128] Here, im_dilate represents the background frame after dilation. This represents the dilation operator in morphology.

[0129] S2-1.2 As shown in Equation (16), the target frame im_obj is subtracted from the morphologically dilated background image im_dilate to obtain the image I after the background stars are initially filtered out.

[0130] I = im_obj - im_dilate (16)

[0131] Step 2: Adaptive threshold removal of false targets

[0132] S2-2, Extract pixels g with a value greater than 0 from the frame difference image I. i The mean (Mean) and standard deviation (Std) of the pixel values ​​of these points are calculated according to equation (17). The threshold th = Mean + 2 × Std is set, and the image after frame difference is binarized as shown in equation (18), resulting in the image Ibw after threshold segmentation. The pixels with a value greater than 0 after frame difference mainly include noise, targets, and suspected targets (bright line remnants, star edge remnants). Their gray values ​​are different, and some suspected targets can be eliminated by threshold segmentation.

[0133] {G}=I(x,y),I(x,y)>0

[0134]

[0135]

[0136]

[0137] Where {G} represents the set of all pixels in the frame-differenced image I with a value greater than 0, I(x,y) represents the pixel value at position (x,y) in the frame-differenced image, Num represents the number of points in the set {G}, and Ibw(x,y) represents the gray value at position (x,y) in the binarized image.

[0138] Figure 4 (a), (b), and (c) show the target frame after background correction, the image after initial filtering of background stars, and the image after adaptive thresholding to remove false targets, respectively. The real targets are shown in the solid box.

[0139] Step 3: Morphological filtering for noise reduction

[0140] S2-3. As shown in equation (20), morphological opening operation is performed on the binarized image Ibw to remove discrete noise in the image. Here, a circular structuring element SE2 with a radius of 2 in equation (19) is used to prevent the small targets in the star map from being eliminated as discrete points due to the large radius of the structuring element.

[0141]

[0142]

[0143] Where P represents the image after the opening operation. This represents the opening operator in morphology.

[0144] Let im_star be the final extracted astronomical image background. The astronomical image background template is obtained by subtracting the all-one matrix P. im_star is obtained by multiplying the original image org with the astronomical image background template. Figure 5 The image shows a comparison between the background of the astronomical image finally extracted from the second frame of the dataset and the original image, where the part within the solid box is the segmented target region.

[0145] S2-4. After the image undergoes opening operation, it generally contains multiple regions, including real target regions and false target regions. Subsequently, the motion characteristics of the target can be used to detect spatial targets.

[0146] S2-5. If the current astronomical image is the last frame of the continuous image dataset, the algorithm ends; otherwise, return to S1-1.1 and repeat the following steps.

[0147] Figure 6 , Figure 7The results show the single-frame target region segmentation of the original image dataset in frames 2 and 4. One target region was obtained in frame 2 and two target regions were obtained in frame 4. The real targets are within the solid boxes and the false targets are within the dashed boxes. The experimental results show that the background extraction method of the present invention can reduce the number of false targets while ensuring that spatial targets are not lost, thereby reducing the computational pressure of subsequent target detection.

[0148] This invention also provides an astronomical image background extraction system that applies the above-described astronomical image background extraction method.

[0149] Specifically, the astronomical image background extraction system includes:

[0150] The setting module is used to detect the size of the largest star in the astronomical image based on the grayscale characteristics of the image to be processed, so as to set the window length of the one-dimensional median filter; the specific calculation process can be referred to the detailed description in the above extraction method, and will not be repeated here.

[0151] The bidirectional one-dimensional median filtering module is used to extract the background of astronomical images using the bidirectional one-dimensional median filtering method, and obtain the background-corrected image; the specific extraction process can be referred to the detailed description in the extraction method above, and will not be repeated here.

[0152] The inter-frame differencing module is used to extract the background from the background-corrected image using an adaptive inter-frame differencing method. The specific background extraction process can be found in the detailed explanation of the extraction method described above, and will not be repeated here.

[0153] The above description is merely a detailed explanation of preferred embodiments and principles of the present invention. For those skilled in the art, there may be changes in specific implementation methods based on the ideas provided by the present invention, and these changes should also be considered within the scope of protection of the present invention.

Claims

1. A method for extracting background from astronomical images, characterized in that, Includes the following steps: S1. Based on the grayscale characteristics of the astronomical image to be processed, detect the size of the largest star in the astronomical image to set the window length for one-dimensional median filtering; S2. Use a bidirectional one-dimensional median filtering method to extract the background of the astronomical image and obtain the background-corrected image. S3. Use an adaptive inter-frame difference method to extract the background from the background-corrected image; Step S1 includes the following steps: S11. Calculate the pixel sum of each column of the astronomical image and sort them to obtain the top N columns with the largest pixel sum; Using the pixel with the largest pixel value (x0, y0) in each of the previous N columns as the center, a rectangular window of size m×m is extracted from the astronomical image, as shown in Equation (1): im_temp(i,j)=f(x,y), (x,y)∈W(i,j) (1) Where im_temp(i,j) represents the local region of the rectangular window, f(x,y) represents the gray value of the input astronomical image at position (x,y), and W(i,j) represents the rectangular window centered at (x0,y0). S12. Calculate the mean μ and standard deviation σ of all pixels within the rectangular window according to formula (2), set the threshold TH = μ + a × σ to perform binarization, and obtain the binarized local image. a is a constant coefficient. The binarization expression is shown in formula (3). Where im_bw(i,j) represents the gray value of the binarized image at (i,j); S13. Use the structuring element se to perform a morphological opening operation on the binarized local image. The opening operation expression is shown in equation (4): Where im_open represents the image after the opening operation. This represents the opening operator in morphology; S14. Perform connected component processing on the local image after the opening operation, and determine the largest length or width size in the connected component of the local region. n Equation (5) states that 1 ≤ n ≤ N, and the largest size among all N local regions is the size of the largest star in the astronomical image. max As shown in equation (6); Size n =max{{W n },{L n }},1≤n≤N,W k ∈{W n },L k ∈{L n }Size max =max{{Size}},Size n ∈{Size},1≤n≤N (6) Among them, W k L k Let represent the width and length of the k-th connected component within the local region, respectively. Let Size represent the x and y coordinates of the k-th connected component within the local region, respectively. n Let {W} represent the size of the target star in the nth local region. n }、{L n } represent the set of widths and the set of lengths of all connected components in the nth local region, respectively. max That is, the size of the largest star in the estimated astronomical image, where {Size} represents the set of sizes of the target stars; S15, By estimating the maximum stellar size Size max To achieve this, the window length L = b × Size of the one-dimensional median filter is set. max +1, b is the multiplier coefficient; Step S2 includes the following steps: S21. The image background is extracted using the median filtering method. The window length of the one-dimensional median filter in the horizontal direction is set to L. The image is extended outward by (L-1) / 2 pixels from the left and right edges of the astronomical image im_org. The extended pixel value is obtained by translating the corresponding position of the astronomical image im_org. The extended image is denoted as im_extend1, and the expression is shown in the following formula (7): Where im_extend1(i,j) represents the gray value of the extended image at (i,j), X and Y represent the number of pixels in the row and column of the astronomical image, respectively, and im_org(x,y) represents the gray value of the astronomical image at (x,y). S22. The position of each pixel in the astronomical image is replaced by the window value, which is denoted as the background Y1 extracted by the first median filter, and is represented by Equation (8). The astronomical image im_org is subtracted from the background Y1 to obtain the image im_rem after the first background is filtered out, which is represented by Equation (9). im_rem(x,y)=im_org(x,y)-Y1(x,y) (9) Where W1(x,y) represents a horizontal one-dimensional window of the astronomical image centered at (x,y), and Y1(x,y) and im_rem(x,y) represent the background median extracted at the corresponding position in the astronomical image, i.e., position (x,y) and the pixel value after the first background filtering, respectively. S23. Process the image im_rem, set the length of the one-dimensional median filter window in the vertical direction to L, and extend it outward by (L-1) / 2 pixels from the upper and lower edges of the image im_rem. The extended pixel value is obtained by translating the corresponding position of im_rem. The extended image is denoted as im_extend2, and the expression is shown in the following formula (10): Where im_extend2(i,j) represents the gray value of the extended image at (i,j); S24. The position of each pixel in the image im_rem is replaced by the window value, which is denoted as the background Y2 extracted by the second median filter, and is represented by Equation (11). The background-corrected image Y is obtained by subtracting the background Y2 from the image im_rem after the first background filtering, and is represented by Equation (12). Y(x,y)=im_rem(x,y)-Y2(x,y) (12) Where W2(x,y) represents a vertical one-dimensional window of the image im_rem centered at (x,y), and Y2(x,y) and Y(x,y) represent the extracted background median and the background-corrected pixel value at position (x,y), respectively. Step S3 includes the following steps: S31. Process the background-corrected image Y by using two consecutive background-corrected images, the first frame being the background frame im_bg and the second frame being the target frame im_obj; perform morphological dilation on the background frame im_bg using the structuring element SE1, as shown in equation (13): Here, im_dilate represents the background frame after dilation. This represents the dilation operator in morphology; S32. As shown in equation (14), the target frame im_obj is subtracted from the morphologically dilated background image im_dilate to obtain the image I after the background stars are initially filtered out. I = im_obj - im_dilate (14).

2. The method for extracting background from astronomical images according to claim 1, characterized in that, In step S13, the structural element se is:

3. The method for extracting background from astronomical images according to claim 1, characterized in that, In step S31, the structural element SE1 is:

4. The method for extracting background from astronomical images according to claim 1, characterized in that, Step S3 further includes the following steps: S33. Extract pixels g that are greater than 0 from image I. i The mean value Mean and standard deviation Std of the extracted pixel points are calculated according to formula (15). The threshold th = Mean + c × Std is set, where c is the standard deviation coefficient. The image I is binarized, and the expression is shown in formula (16) to obtain the image Ibw after threshold segmentation. Where {G} represents the set of all pixels in the frame-differenced image I with a value greater than 0, I(x,y) represents the pixel value at position (x,y) in the frame-differenced image, Num represents the number of points in the set {G}, and Ibw(x,y) represents the gray value at position (x,y) in the binarized image.

5. The method for extracting background from astronomical images according to claim 4, characterized in that, Step S3 further includes the following steps: S34. The binarized image Ibw is processed by morphological opening operation using the structuring element SE2, as shown in equation (17): P = IbwoSE2 (17) Where P represents the image after the opening operation. This represents the opening operator in morphology; Let im_star be the final extracted astronomical image background. The astronomical image background template is obtained by subtracting the all-1 matrix from the image P. im_star is obtained by multiplying the astronomical image im_org with the astronomical image background template.

6. The method for extracting background from astronomical images according to claim 5, characterized in that, Step S3 7. An astronomical image background extraction system, employing the extraction method as described in any one of claims 1-6, characterized in that, The extraction system includes: The setting module is used to detect the size of the largest star in the astronomical image based on the grayscale characteristics of the image to be processed, so as to set the window length of the one-dimensional median filter. The bidirectional one-dimensional median filtering module is used to extract the background of astronomical images using the bidirectional one-dimensional median filtering method, and obtain the background-corrected image. The inter-frame difference module is used to extract the background from the background-corrected image using an adaptive inter-frame difference method.

Citation Information

Patent Citations

  • Infrared moving small target detection method of a complex scene

    CN109345472A

  • Target colony feature automatic identification method

    CN113256580A

  • Infrared weak and small target detection method and device under complex background, equipment and medium

    CN113962900A