Cosmic ray removal method, device, equipment and storage medium

By performing multiple short exposures and superimposing images to identify and remove cosmic rays from specific signal areas, the method improves image quality by enhancing signal strength and accuracy in cosmic ray removal.

CN118297829BActive Publication Date: 2024-12-13张江国家实验室
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311752571.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-18
Publication Date
2024-12-13
Estimated Expiration
2043-12-18

AI Technical Summary

Technical Problem

Existing methods for removing cosmic rays in image processing, such as median filtering and single-frame edge detection, are inadequate as they either misidentify noise or allow cosmic rays to accumulate, leading to reduced signal contrast and visibility.

Method used

Perform multiple short exposures on the object to obtain periodic signal images, superimpose these images to create a global reference image, determine the spot mask distribution, and selectively remove cosmic rays from the effective signal areas while retaining images without cosmic rays.

Benefits of technology

This method enhances signal strength and accuracy by differentially removing cosmic rays, ensuring high-contrast images free from cosmic ray noise.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118297829B_ABST
    Figure CN118297829B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a cosmic ray removal method, device, equipment and storage medium, which relates to the field of information processing technology. The method is: perform multiple short exposures on the object to be measured to obtain multiple first periodic signal images, the first periodic signal image contains multiple periodic units; perform superposition processing on the multiple first periodic signal images to obtain a second periodic signal image and determine the spot mask distribution of each periodic unit in the second periodic signal image; based on the spot mask distribution, determine whether there are cosmic rays in the spot mask in the first periodic signal image, so as to determine whether the first periodic signal image is affected by cosmic rays; superimpose the first periodic signal images that are not affected by cosmic rays to obtain a target periodic signal image for the object to be measured. By performing multiple short exposures on the object to be measured, multiple periodic signal images with weak signals can be obtained, and cosmic ray noise can be easily calibrated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a cosmic ray removal method, device, equipment and storage medium. Background Art

[0002] Cosmic rays are high-energy particle flows (such as protons, alpha particles, gamma rays, etc.), or secondary high-energy particle flows generated when high-energy particle flows enter the atmosphere, which will produce traces when they hit the detector. Cosmic rays will become a kind of random noise in the form of superposition, appearing at any position in the detector signal data, thus affecting the extraction of effective signals, so cosmic rays need to be removed.

[0003] The methods for removing cosmic rays in the prior art include: median filtering method and single-frame removal algorithm of edge detection, but both methods have some problems. For example, the median filtering method cannot distinguish between cosmic ray noise and shot noise, so it will produce misjudgment when using the median filtering method; the single-frame removal algorithm of edge detection removes cosmic rays under long exposure, but cosmic rays will continue to accumulate with the increase of time, so the contrast of the signal will become lower and lower, and the visibility of cosmic rays will decrease. It is difficult to detect cosmic rays using the single-frame removal algorithm of edge detection. Summary of the invention

[0004] The embodiments of the present application provide a cosmic ray removal method, device, equipment and storage medium, which can remove cosmic rays more accurately.

[0005] In a first aspect, an embodiment of the present application provides a cosmic ray removal method, comprising:

[0006] Perform multiple short exposures on the object to be measured to obtain multiple first periodic signal images, where the first periodic signal images include multiple periodic units;

[0007] Performing superposition processing on a plurality of first periodic signal images to obtain a second periodic signal image and determining the distribution of the light spot mask of each periodic unit in the second periodic signal image;

[0008] Based on the spot mask distribution, determining whether cosmic rays exist in the spot mask in the first periodic signal image, thereby determining whether the first periodic signal image is affected by cosmic rays;

[0009] The first periodic signal images not affected by cosmic rays are superimposed to obtain a target periodic signal image for the object to be measured.

[0010] In the embodiment of the present application, by performing multiple short exposures on the object to be measured, multiple periodic signal images of weak signals can be obtained, and cosmic ray noise can be easily calibrated in the multiple periodic signal images of weak signals; by superimposing multiple short-exposure periodic signals, a periodic signal image of strong signals can be obtained, and the spot mask is determined according to the strong signal periodic signal image, so that the position information of the spot mask is more accurate; by judging whether there are cosmic rays in the spot mask, it is determined whether the first periodic signal image is affected by cosmic rays, so that the method of determining cosmic rays is more refined; by superimposing the first periodic signal image that is not affected by cosmic rays, a periodic signal image that neither contains cosmic ray noise nor affects the signal strength can be obtained.

[0011] Optionally, the judging whether there are cosmic rays in the spot mask in the first periodic signal image, thereby determining whether the first periodic signal image is affected by cosmic rays, includes:

[0012] Determining the light spot type corresponding to each light spot mask in the first periodic signal image;

[0013] For the spot mask in the first periodic signal image, determine whether there are cosmic rays in the spot mask according to a detection method corresponding to the spot type;

[0014] If cosmic rays exist in the spot mask, it is determined that the first period signal image is affected by cosmic rays.

[0015] In the embodiment of the present application, by classifying the spot masks in the first period signal image, the cosmic rays in different types of spot masks can be removed differentially in a targeted manner, avoiding the problem of inaccurate removal caused by using the same method to remove spot masks with different signal intensities.

[0016] Optionally, determining the spot type corresponding to each spot mask in the first periodic signal image includes:

[0017] For the spot mask, if the proportion of the number of non-zero pixels in the spot mask is greater than or equal to the preset duty cycle, the spot type of the spot mask is determined to be the first type; if the proportion of the number of non-zero pixels in the spot mask is less than the preset duty cycle, the spot type of the spot mask is determined to be the second type.

[0018] In an embodiment of the present application, the types of spot masks are distinguished by the proportion of non-zero pixels, and the spot masks are classified according to signal strength, so that when cosmic ray removal is subsequently performed on different types of spot masks, the problem of inaccurate cosmic ray removal due to different signal strengths can be reduced.

[0019] Optionally, determining whether cosmic rays exist in the spot mask according to a detection method corresponding to the spot type includes:

[0020] For a spot mask of a first type, generating an annular mask of the spot mask;

[0021] For a connected region in the annular mask, if the connected region satisfies a first set condition, it is determined that cosmic rays exist in the spot mask.

[0022] In the embodiment of the present application, for the first type of spot mask with a stronger signal, since the central brightness is too high, the cosmic ray noise will not have a significant impact, so cosmic rays are only removed from the area around the center, which can increase the speed of removing cosmic rays.

[0023] Optionally, the first setting condition is that the number of non-zero pixels in the connected area is greater than a first threshold and the distance between the connected area and the center of the spot mask is less than a second threshold.

[0024] Optionally, determining whether cosmic rays exist in the spot mask according to a detection method corresponding to the spot type includes:

[0025] For the spot mask of the second type, generating a circular mask of the spot mask;

[0026] For the connected area in the circular mask, if the connected area satisfies a second set condition, it is determined that cosmic rays exist in the spot mask.

[0027] In the embodiment of the present application, for the second type of spot mask with average signal strength, the spot mask and the neighboring area are obtained as the second type of spot mask to determine whether cosmic rays exist in a larger range, thereby improving the accuracy of removing cosmic rays.

[0028] Optionally, if the connected area satisfies a second set condition, determining that cosmic rays exist in the spot mask includes:

[0029] Calculating the perimeter area ratio of the connected region;

[0030] If the ratio of the number of non-zero pixels in the connected region to the perimeter area ratio is greater than a third threshold or less than a fourth threshold, it is determined that cosmic rays exist in the spot mask; and the third threshold is greater than the fourth threshold.

[0031] Optionally, determining the spot mask distribution of each periodic unit in the second periodic signal image includes:

[0032] generating a second logarithmic image of the second periodic signal image;

[0033] According to the period information of the object to be measured, determining the center position and the spot radius of each period unit in the second logarithmic image, and obtaining the spot mask of each period unit;

[0034] Determining whether cosmic rays exist in the spot mask in the first period signal image includes:

[0035] generating a first logarithmic image of the first periodic signal image;

[0036] Based on the position information of the spot mask of each periodic unit in the second logarithmic image, it is determined whether there is a cosmic ray in the spot mask of each periodic unit in the first logarithmic image.

[0037] In an embodiment of the present application, by generating a logarithmic image of the second periodic signal image, the signal strength of the second periodic signal image is enhanced, and the spot mask is determined under the logarithmic image of the second periodic signal image, so that the position of the spot mask is determined more accurately; by generating a logarithmic image of the first periodic signal image, the signal strength of the first periodic signal image is enhanced, and whether cosmic rays exist in the spot mask is determined under the logarithmic image of the first periodic signal image, so that cosmic rays can be determined more accurately.

[0038] In a second aspect, an embodiment of the present application provides a cosmic ray removal device, comprising:

[0039] An acquisition module, used for performing multiple short exposures on the object to be measured to obtain multiple first periodic signal images, wherein the first periodic signal image includes multiple periodic units;

[0040] A superposition module, used for superimposing a plurality of first periodic signal images to obtain a second periodic signal image and determining the distribution of the light spot mask of each periodic unit in the second periodic signal image;

[0041] a judgment module, configured to determine whether cosmic rays exist in the spot mask in the first periodic signal image based on the spot mask distribution, thereby determining whether the first periodic signal image is affected by cosmic rays;

[0042] The superposition module is further used to superimpose the first periodic signal images that are not affected by cosmic rays to obtain a target periodic signal image for the object to be measured.

[0043] Optionally, the judging module is specifically used for:

[0044] Determining the light spot type corresponding to each light spot mask in the first periodic signal image;

[0045] For the spot mask in the first periodic signal image, determine whether there are cosmic rays in the spot mask according to a detection method corresponding to the spot type;

[0046] If cosmic rays exist in the spot mask, it is determined that the first period signal image is affected by cosmic rays.

[0047] Optionally, the judging module is specifically used for:

[0048] For the spot mask, if the proportion of the number of non-zero pixels in the spot mask is greater than or equal to the preset duty cycle, the spot type of the spot mask is determined to be the first type; if the proportion of the number of non-zero pixels in the spot mask is less than the preset duty cycle, the spot type of the spot mask is determined to be the second type.

[0049] Optionally, the judging module is specifically used for:

[0050] For a spot mask of a first type, generating an annular mask of the spot mask;

[0051] For a connected region in the annular mask, if the connected region satisfies a first set condition, it is determined that cosmic rays exist in the spot mask.

[0052] Optionally, the first setting condition is that the number of non-zero pixels in the connected area is greater than a first threshold and the distance between the connected area and the center of the spot mask is less than a second threshold.

[0053] Optionally, the judging module is specifically used for:

[0054] For the spot mask of the second type, generating a circular mask of the spot mask;

[0055] For the connected area in the circular mask, if the connected area satisfies a second set condition, it is determined that cosmic rays exist in the spot mask.

[0056] Optionally, the judging module is specifically used for:

[0057] Calculating the perimeter area ratio of the connected region;

[0058] If the ratio of the number of non-zero pixels in the connected region to the perimeter area ratio is greater than a third threshold or less than a fourth threshold, it is determined that cosmic rays exist in the spot mask; and the third threshold is greater than the fourth threshold.

[0059] Optionally, the superposition module is specifically used for:

[0060] generating a second logarithmic image of the second periodic signal image;

[0061] According to the period information of the object to be measured, determining the center position and the spot radius of each period unit in the second logarithmic image, and obtaining the spot mask of each period unit;

[0062] Determining whether cosmic rays exist in the spot mask in the first period signal image includes:

[0063] generating a first logarithmic image of the first periodic signal image;

[0064] Based on the position information of the spot mask of each periodic unit in the second logarithmic image, it is determined whether there is a cosmic ray in the spot mask of each periodic unit in the first logarithmic image.

[0065] In the embodiment of the present application, by generating a logarithmic image of the first periodic signal image and the second periodic signal image, the contrast of the image can be enhanced, and the accuracy of determining the position information of the spot mask and the cosmic rays can be improved.

[0066] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any of the above-mentioned methods when executing the program.

[0067] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program executable by a computer device, wherein when the program is run on the computer device, the computer device executes the steps of any of the above-described methods. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0069] Figure 1 A system architecture diagram provided for an embodiment of the present application;

[0070] Figure 2 A schematic diagram of a cosmic ray removal method provided in an embodiment of the present application Figure 1 ;

[0071] Figure 3 A schematic diagram of the structure of a periodic unit provided in an embodiment of the present application;

[0072] Figure 4 A schematic structural diagram of a spot mask of a periodic unit provided in an embodiment of the present application;

[0073] Figure 5 A schematic diagram of a process for determining whether there are cosmic rays in a spot mask provided in an embodiment of the present application;

[0074] Figure 6 A schematic diagram of the structure of a ring mask provided in an embodiment of the present application;

[0075] Figure 7 A schematic diagram of the structure of a circular mask provided in an embodiment of the present application;

[0076] Figure 8 A schematic diagram of a cosmic ray removal method provided in an embodiment of the present application Figure 2 ;

[0077] Fig. 9 A schematic diagram of the structure of a cosmic ray removal device provided in an embodiment of the present application;

[0078] Fig.10 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0079] In order to make the purpose, technical solution and beneficial effects of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0080] For ease of understanding, the terms involved in the embodiments of the present invention are explained below.

[0081] Periodic signal images are a type of signal data with significant spatial distribution characteristics, in which effective signal data is periodically distributed in a sparse space, appearing as discrete points or discrete spots in one-dimensional or two-dimensional distributions. They are widely found in the fields of X-ray diffraction (XRD), small-angle X-ray scattering (SAXS), and coherent X-ray diffraction imaging (CXDI).

[0082] To facilitate understanding of this solution, the application scenario of this solution is introduced below.

[0083] Cosmic (ray) rays are high-energy particle flows (such as protons, alpha particles, electrons, gamma rays, etc.) from the universe, or secondary high-energy particle flows generated when high-energy particle flows enter the atmosphere, and the traces produced when they hit the detector. Cosmic rays will become a kind of random noise in the form of superposition, appearing at any position in the detector signal data. If a detector is used to obtain a periodic signal image of a certain object to be measured, there will be cosmic ray noise in the periodic signal image. When it is necessary to extract information about the nanostructure of the object to be measured or measure the key dimensions of the object to be measured, it is necessary to first obtain the periodic signal image of the object to be measured, and obtain the required information by analyzing the periodic signal image of the object to be measured. If there is cosmic ray noise in the periodic signal image of the object to be measured, the signal-to-noise ratio of the periodic signal image will be reduced, and a large error will be generated when extracting information about the nanostructure of the object to be measured or measuring the key dimensions, thereby affecting the accuracy of information extraction or measurement. Therefore, in practical applications, in order to improve the signal-to-noise ratio of the detector, improve the accuracy of information extraction or key dimension measurement of the periodic signal image, the cosmic ray noise should be removed as much as possible.

[0084] In the prior art, there are two methods for removing cosmic rays: 1) Multi-frame median filtering method. This method uses the characteristics of random distribution of cosmic rays to obtain multiple periodic signal images after multiple exposures of the object to be measured, and then uses the median filtering method to remove cosmic ray noise from the multiple periodic signal images. However, periodic signal images generally contain not only cosmic ray noise, but also other noises, such as shot noise. The median filtering method cannot well distinguish whether the noise in the periodic signal image is cosmic ray noise or shot noise. Therefore, misjudgment occurs when removing cosmic ray noise, which not only fails to effectively remove cosmic ray noise, but also affects the clarity of the periodic signal image. 2) Edge detection single frame removal method. This method has good performance in most scenarios, but this method is for removing cosmic rays in periodic signal images obtained under long-term exposure. Since cosmic rays will continue to accumulate with the increase of exposure time, long-term exposure leads to more and more cosmic rays in the periodic signal image. If a large number of cosmic rays accumulate at the edge of the periodic signal image, the edge becomes blurred and the cosmic ray noise cannot be accurately removed.

[0085] Therefore, the embodiment of the present application provides a method for removing cosmic rays, which can more accurately remove cosmic ray noise. The specific operation method is as follows: first, perform multiple short exposures on the object to be measured to obtain multiple short-exposed periodic signal sub-images, and then superimpose the multiple sub-images to obtain a global reference image with high contrast, determine the spot mask from the global reference image, the spot mask is the effective signal area of ​​the periodic signal image, and then remove cosmic ray noise from the effective signal area in each sub-image, and ignore the cosmic rays in the non-effective signal area. If cosmic rays are found in the effective signal area, the sub-image corresponding to the effective signal area is removed, and the sub-image without cosmic ray noise is retained and superimposed, and finally a target periodic signal image with cosmic ray noise removed is obtained. Among them, the effective signal area determined by the global reference pattern is in the same position as the effective signal area of ​​the sub-image.

[0086] See also Figure 1 , is a system architecture diagram provided in an embodiment of the present application, the system comprising: a detector 101 and a server 102. The detector 101 is used to obtain sub-images of a periodic signal image of an object to be measured, and the server 102 is used to superimpose the sub-images of the object to be measured, so as to determine the effective signal area of ​​the periodic signal image, and then remove the cosmic ray noise in the effective signal area of ​​each sub-image, and superimpose the sub-images that do not contain cosmic ray noise in the effective signal area again, so as to obtain the target periodic signal image with cosmic ray noise removed.

[0087] Server 102 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), as well as big data and artificial intelligence platforms.

[0088] See also Figure 2 , is a flow chart of a cosmic ray removal method provided in an embodiment of the present application, comprising the following steps:

[0089] Step 201 : Perform multiple short exposures on the object to be measured to obtain multiple first periodic signal images, where the first periodic signal images include multiple periodic units.

[0090] Specifically, after the object to be tested is detected by the detector, a signal image of the object to be tested is obtained. If the internal structure of the object to be tested is periodically distributed, a periodic signal image is obtained. In an embodiment of the present application, for an object to be tested whose internal structure is periodically distributed, its periodic signal image is obtained. The periodic signal image contains a plurality of periodic units, and these periodic units are periodically distributed in space, that is, they have the same intervals, the same angles, etc. By controlling the detection frequency of the detector, the first periodic signal image of the object to be tested under each short exposure, that is, a sub-image of the object to be tested, is obtained. When the object to be tested is subjected to multiple short exposures, the exposure conditions should be kept the same each time, that is, except for noise, other experimental conditions, such as the distance between the detector and the object to be tested, the temperature environment of exposure, the exposure angle, etc. are the same.

[0091] For example, when using a detector to detect a periodic nanostructure, since the internal structure of the periodic nanostructure is distributed periodically, the signal image of the periodic nanostructure is a periodic signal image. The periodic nanostructure is subjected to multiple short exposures, each of which is performed at the same position, the same angle, and the same temperature environment, to obtain multiple first periodic signal images of the periodic nanostructure, each of which contains multiple periodic units. Generally speaking, an exposure time of 1s is called a short exposure, and an exposure time of 100s is called a long exposure.

[0092] Step 202 : performing superposition processing on a plurality of first periodic signal images to obtain a second periodic signal image and determining the distribution of the light spot mask of each periodic unit in the second periodic signal image.

[0093] Specifically, after obtaining multiple first periodic signal images, the first periodic signal images are superimposed to obtain a second periodic signal image, i.e., a global reference image. When superimposing images, the images can be abstracted as matrices, and the superposition of images is the superposition of corresponding positions of the matrices. Therefore, after superimposing the first periodic signal images, a second periodic signal image is obtained, and the periodic unit position and structure of the second periodic signal image are the same as those of the first periodic signal image. According to each periodic unit in the second periodic image, the spot mask distribution of each periodic unit is determined. The spot mask is the effective signal area of ​​the periodic unit. Multiple first periodic signal images are superimposed to obtain a second periodic signal image as shown in formula (1):

[0094]

[0095] Among them, IMG i is the i-th first periodic signal image, K is the number of first periodic signal images, and GRP is the second periodic signal image.

[0096] For example, suppose that after 10 short exposures of the periodic nanostructure, 10 first periodic signal images are obtained, each of which contains 10 periodic units, and the 10 first periodic signal images are superimposed to obtain a second periodic signal image, which also contains 10 periodic units. The spot mask distribution of each periodic unit is determined based on the 10 periodic units in the second periodic signal image.

[0097] In some embodiments, determining the spot mask distribution of each periodic unit in the second periodic signal image includes the following steps:

[0098] Step 301: Generate a second logarithmic image of a second periodic signal image.

[0099] Specifically, after the first periodic signal image is superimposed, a second periodic signal image is obtained, and a logarithmic transformation with t as the base is performed on the second periodic signal image to obtain a second logarithmic image log t GRP, where t is a set positive real number, t≠1.

[0100] Step 302: According to the period information of the object to be measured, the center position and the spot radius of each period unit are determined in the second logarithmic image to obtain the spot mask distribution of each period unit.

[0101] Specifically, in the second logarithmic image log t In GRP, first determine the center position of the periodic unit. According to the periodic signal index list {M j , N j}, combined with the period information (a, b, α) of the periodic unit, calculate the center position (x j ,y j ), as shown in formula (2):

[0102]

[0103] Among them, a, b are the period intervals of the periodic unit in two directions, α is the angle between the two periodic directions, M j , N j is the index of the periodic unit in both directions.

[0104] Then determine the spot radius. Obtain the maximum value of the distance of the non-zero pixel in the four directions of the center position, and calculate the spot radius, as shown in formula (3):

[0105]

[0106] Among them, d u d d d l dr are the distances of non-zero pixels from the center position in the four directions of up, down, left, and right, respectively, r j is the jth spot radius.

[0107] According to the above method, the spot mask of the periodic unit can be determined. The structural diagram of the periodic unit is as follows: Figure 3 As shown, the spot mask of the periodic unit is as follows Figure 4 shown.

[0108] Step 203: Based on the spot mask distribution, determine whether there are cosmic rays in the spot mask in the first period signal image, so as to determine whether the first period signal image is affected by cosmic rays.

[0109] Specifically, according to the distribution of the spot masks of the second period signal image, it is determined whether the spot mask in the first period signal image is affected by cosmic rays. It can be that if there is a spot mask with cosmic rays, it means that the first period signal image is affected by cosmic rays; if all spot masks do not have cosmic rays, it means that the first period signal image is not affected by cosmic rays. It can also be that in the first period signal image, if the proportion of spot masks with cosmic rays to all spot masks is greater than or equal to a preset threshold, it is considered that the first period signal image is affected by cosmic rays; if the proportion of spot masks with cosmic rays to all spot masks is less than a preset threshold, it is considered that the first period signal image is not affected by cosmic rays, and this application does not limit the comparison. The first period signal image that is not affected by cosmic rays is retained, and the first period signal image that is affected by cosmic rays is eliminated.

[0110] For example, assuming that after 10 short exposures of the periodic nanostructure, 10 first-period signal images are obtained, each of which has 10 spot masks, and for the first first-period signal image, the 10 spot masks are traversed. If one of the spot masks contains cosmic rays, it is considered that the first first-period signal image is affected by cosmic rays; if none of the 10 spot masks contains cosmic rays, it is considered that the first first-period signal image is not affected by cosmic rays.

[0111] In some embodiments, determining whether cosmic rays exist in any spot mask in the first period signal image comprises the following steps:

[0112] Step 401: Generate a first logarithmic image of a first periodic signal image.

[0113] Specifically, for a plurality of first periodic signal images, a first logarithmic image of each first periodic signal image is generated, and a logarithmic transformation with t as the base is performed to obtain the first logarithmic image log t IMG i , where t is a set positive real number, t≠1.

[0114] Step 402: Determine whether there are cosmic rays in the spot mask of each periodic unit in the first logarithmic image based on the position information of the spot mask of each periodic unit in the second logarithmic image.

[0115] Specifically, the first logarithmic image and the second logarithmic image have spot masks in the same position. Therefore, in order to determine whether there are cosmic rays in the spot mask of each periodic unit in the first logarithmic image, the position of the spot mask is first determined through the second logarithmic image, and then it is determined in the first logarithmic image whether there are cosmic rays in each spot mask. If so, there are cosmic rays in the first logarithmic image; if not, there are no cosmic rays in the first logarithmic image.

[0116] Step 204: superimpose the first periodic signal images not affected by cosmic rays to obtain a target periodic signal image for the object to be measured.

[0117] Specifically, the retained first period signal image not affected by cosmic rays is superimposed again to obtain a target period signal image of the object to be measured.

[0118] For example, assuming that among the 10 first-period signal images of the periodic nanostructure, 2 first-period signal images are affected by cosmic rays, and 8 first-period signal images are not affected by cosmic rays, then the 8 first-period signal images that are not affected by cosmic rays are superimposed to obtain the target periodic signal image of the periodic nanostructure.

[0119] In some embodiments, it is determined whether there are cosmic rays in the spot mask in the first period signal image, so as to determine whether the first period signal image is affected by cosmic rays. Figure 5 As shown, the following steps are included:

[0120] Step 501: Determine the light spot type corresponding to each light spot mask in the first period signal image.

[0121] Specifically, in the first periodic signal image, there are multiple periodic units, each periodic unit has its own spot mask, and in the embodiment of the present application, the spot masks are divided into two categories. For example, in 10 first periodic signal images of a periodic nanostructure, each first periodic signal image has 10 spot masks, and the 10 spot masks are divided into Class I and Class II. It is generally believed that there are two types of spot masks, Class I and Class II, in each first periodic signal image.

[0122] Step 502: for the spot mask in the first period signal image, determine whether there are cosmic rays in the spot mask according to the detection method corresponding to the spot type.

[0123] Specifically, the methods for detecting cosmic rays for different types of spot masks are also different. For example, for the first period signal image, if there is a type I spot mask, the detection method corresponding to the type I spot mask is used to detect whether there are cosmic rays in the type I spot mask; if there is a type II spot mask, the detection method corresponding to the type II spot mask is used to detect whether there are cosmic rays in the type II spot mask. The method for detecting the type I spot mask is different from the method for detecting the type II spot mask.

[0124] Step 503: If cosmic rays exist in the spot mask, it is determined that the first period signal image is affected by cosmic rays.

[0125] Specifically, if cosmic rays exist in any of the Type I spot masks or Type II spot masks, it is determined that the first period signal image is affected by cosmic rays. For example, in the first first period signal image, there are 5 Type I spot masks and 5 Type II spot masks. When the Type I spot masks are detected, it is found that cosmic rays exist in one spot mask, so it can be determined that the first first period signal image is affected by cosmic rays.

[0126] In some embodiments, determining the spot type corresponding to each spot mask in the first periodic signal image includes: for the spot mask, if the proportion of the number of non-zero pixels in the spot mask is greater than or equal to a preset duty cycle, determining that the spot type of the spot mask is the first type; if the proportion of the number of non-zero pixels in the spot mask is less than the preset duty cycle, determining that the spot type of the spot mask is the second type.

[0127] Specifically, the method for determining the spot type corresponding to each spot mask in the first period signal image is as follows:

[0128] Traverse the number of non-zero pixels in the spot mask, and for one of the spot masks, compare the proportion of the number of non-zero pixels with the size of the preset duty cycle. If the proportion of the number of non-zero pixels is greater than or equal to the preset duty cycle, the spot mask is determined to be the first type of spot mask, that is, the type I spot mask; if the proportion of the number of non-zero pixels is less than the preset duty cycle, the spot type is determined to be the second type of spot mask, that is, the type II spot mask. The proportion of the number of non-zero pixels in the spot mask is calculated as shown in formula (4):

[0129]

[0130] Among them, N j is the number of non-zero pixels of the j-th spot mask, is the area of ​​the jth spot mask, DR j is the proportion of non-zero pixels in the j-th spot mask.

[0131] Assume that the preset duty cycle is DR th , judge DR j With DRth If DR j ≥DR th , then the jth spot mask is a type I spot mask; if DR j <DR th , then the jth spot mask is a type II spot mask.

[0132] In some embodiments, determining whether there are cosmic rays in the spot mask according to a detection method corresponding to the spot type includes the following steps:

[0133] Step 601: for a first type of spot mask, generate a ring mask of the spot mask.

[0134] Specifically, for the type I spot mask, a ring mask of the type I spot mask is generated. The ring mask and the spot mask have the same center coordinates, but different radii. The inner radius of the ring mask is r j , the outer radius is 2r j ,like Figure 6 Schematic diagram of the annular mask.

[0135] Step 602: For the connected area in the annular mask, if the connected area satisfies the first set condition, it is determined that cosmic rays exist in the spot mask.

[0136] Specifically, there are multiple connected areas in the annular mask, and whether there are cosmic rays in the annular mask can be determined based on the connected areas. If the connected area meets the first set condition, it is determined that there are cosmic rays in the annular mask corresponding to the connected area; if the connected area does not meet the first set condition, it is considered that there are no cosmic rays in the annular mask corresponding to the connected area. If there is one connected area among the multiple connected areas in the annular mask that meets the first set condition, it is considered that there are cosmic rays in the annular mask.

[0137] In some embodiments, the first setting condition is that the number of non-zero pixels in the connected area is greater than a first threshold and the distance between the connected area and the center of the spot mask is less than a second threshold.

[0138] Specifically, the first setting condition is that the number of non-zero pixels in the connected area is greater than a first threshold, and the distance between the pixel closest to the center coordinate in the connected area and the center coordinate is less than a second threshold.

[0139] For example, Figure 6 As shown in FIG. 1 , it is a schematic diagram of the internal structure of any annular mask, wherein the annular mask contains 7 connected regions satisfying the first condition, namely connected regions L1 to L7, and the number of non-zero pixels in each connected region is N. m , the distance between the pixel closest to the center coordinate in the connected area and the center coordinate is d m,L1(N1,d1)=(1,10.58),L2(N2,d2)=(1,10.57),L3(N3,d3)=(1,10.56),L4(N4,d4)=(1,10.57),L5(N5,d5)=(1,10.58),L6(N6,d6)=(1,19.87),L7(N7,d7)=(12,10.58). Assuming that the first threshold is 1 and the second threshold is 11, only the connected area L7(N7,d7)=(12,10.58) meets the first set condition.

[0140] In some embodiments, determining whether cosmic rays exist in the spot mask according to a detection method corresponding to the spot type includes:

[0141] Step 701: For a second type of spot mask, generate a circular mask of the spot mask.

[0142] Specifically, for the type II spot mask, a circular mask of the type II spot mask is generated. The circular mask and the spot mask have the same center coordinates, but different radii. The radius of the circular mask is 1.5r j ,like Figure 7 Shown is a schematic diagram of a circular mask.

[0143] Step 702: For the connected area in the circular mask, if the connected area satisfies the second set condition, it is determined that cosmic rays exist in the spot mask.

[0144] Specifically, there are multiple connected areas in the circular mask, and whether there are cosmic rays in the circular mask can be determined based on the connected areas. If the connected area meets the second setting condition, it is determined that there are cosmic rays in the circular mask corresponding to the connected area; if the connected area does not meet the second setting condition, it is considered that there are no cosmic rays in the circular mask corresponding to the connected area. If there is one connected area among the multiple connected areas in the circular mask that meets the first setting condition, it is considered that there are cosmic rays in the circular mask.

[0145] In some embodiments, if the connected area satisfies the second set condition, it is determined that there are cosmic rays in the spot mask, including: calculating the perimeter area ratio of the connected area; if the number of non-zero pixels in the connected area is greater than a third threshold, and the ratio of the perimeter area ratio is greater than a fourth threshold or less than a fifth threshold, it is determined that there are cosmic rays in the spot mask; the fourth threshold is greater than the fifth threshold.

[0146] Specifically, to determine whether there are cosmic rays in the connected area in the circular mask, first calculate the perimeter area ratio of the connected area, as shown in formula (5):

[0147]

[0148] Among them, Pn is the perimeter of the nth connected region, N n is the number of non-zero pixels in the nth connected region, PAR n is the perimeter-to-area ratio of the nth circular mask.

[0149] For example, Figure 7 As shown in FIG. 1 , it is a schematic diagram of the structure of any circular mask, which includes two connected areas L1' and L2'. The number of pixels of the circular mask L1' is 1, and the perimeter is 4. According to formula (5), the perimeter area ratio PAR1 of L1' is 16; the number of pixels of the circular mask L2' is 10, and the perimeter is 20. According to formula (5), the perimeter area ratio PAR1 of L2' is 40. Assuming that the third threshold is 6, the fourth threshold is 45, and the fifth threshold is 75, there are cosmic rays in the circular mask L2'.

[0150] When detecting whether there are cosmic rays in the spot mask, there are two ways: 1) First, classify all the spot masks in any first-period signal image, use different cosmic ray detection methods for different types, and detect the spot masks one by one until all the spot masks in the first-period signal image are detected. 2) For any first-period signal image, classify the first spot mask and detect it according to the type corresponding to the first spot mask. If there are cosmic rays in the first spot mask, the first-period signal image corresponding to it can be eliminated, and there is no need to classify and detect other spot masks. If there are no cosmic rays in the first spot mask, continue to classify and then detect the second spot mask until the spot mask with cosmic rays is found. The order of detecting the spot masks can be based on the distribution structure of the spot masks, and detect them in order from top to bottom and from left to right. The first method is more careful, but it takes a long time; the second detection method can improve the detection efficiency, but it is not accurate enough. The embodiments of the present application do not limit the detection method.

[0151] In order to further explain the present application, the method for removing cosmic rays is described in detail below using the periodic nanostructure A as a specific implementation scenario, which specifically includes the following steps: Figure 8 As shown:

[0152] Step 801: Use a detector to perform 10 short exposure measurements on the periodic nanostructure A to obtain 10 first periodic signal images, wherein the conditions of the 10 short exposure measurements are the same, and each first periodic signal image contains a plurality of periodic units.

[0153] Step 802: superimpose 10 first periodic signal images to obtain one second periodic signal image, wherein the second periodic signal image also includes a plurality of periodic units.

[0154] Step 803: Generate a second logarithmic image of the second periodic signal image.

[0155] Step 804: Determine the center position of each periodic unit in the second logarithmic image according to the period interval of each periodic unit and the angle between two periodic directions in the second logarithmic image.

[0156] Step 805: Determine the maximum distance between the center position of each periodic unit and the non-zero pixels in the four directions of up, down, left, and right.

[0157] Step 806: taking the average of the farthest distances of non-zero pixels in four directions as the spot radius of the periodic unit.

[0158] Step 807: Determine the spot mask of the periodic unit according to the center position of the periodic unit and the spot radius.

[0159] Step 808: Generate a first logarithmic image of the first periodic signal image.

[0160] Step 809 : In the first logarithmic image, the ratio of the number of non-zero pixels in the spot mask to the area of ​​the spot mask is calculated to obtain the duty cycle of the spot mask.

[0161] Step 810, determine the relationship between the duty cycle of the spot mask and the preset duty cycle. If the duty cycle of the spot mask is greater than or equal to the preset duty cycle, it is a Class I spot mask; if the duty cycle of the spot mask is less than the preset duty cycle, it is a Class II spot mask.

[0162] Step 811: Generate a ring mask of type I spot mask. The center position of the ring mask is the same as the center position of the spot mask, and the inner radius of the ring mask is r j , the outer radius is 2r j .

[0163] Step 812: Determine whether the connected area in the annular mask satisfies the first set condition. If so, execute step 813; otherwise, execute step 814.

[0164] Step 813: Continue to determine the next annular mask until all annular masks satisfy the first set condition, and then retain the first logarithmic image.

[0165] Step 814: remove the first logarithmic image where the annular mask is located.

[0166] Step 815: Generate a circular mask of type II spot mask. The center position of the circular mask is the same as the center position of the spot mask, and the inner radius of the circular mask is 1.5r j .

[0167] Step 816, determine whether the connected area in the circular mask meets the second set condition, if yes, execute step 817; otherwise, execute step 818.

[0168] Step 817, continue to judge the next one until all circular masks meet the second set condition, and then keep the first logarithmic image.

[0169] Step 818: Eliminate the second logarithmic image where the circular mask is located.

[0170] Step 819: superimpose the retained first logarithmic images to obtain a logarithmic image of the first periodic signal image of the periodic nanostructure A that is not affected by cosmic rays.

[0171] Step 820: Perform an inverse logarithmic transformation to obtain a target periodic signal image of the periodic nanostructure A that is not affected by cosmic rays.

[0172] Based on the same technical concept, the embodiment of the present application provides a cosmic ray removal device, such as Fig. 9 As shown, the device 900 includes:

[0173] An acquisition module 901 is used to perform multiple short exposures on the object to be measured to obtain multiple first periodic signal images, where the first periodic signal images include multiple periodic units;

[0174] A superposition module 902 is used to perform superposition processing on a plurality of first periodic signal images to obtain a second periodic signal image and determine the distribution of the spot mask of each periodic unit in the second periodic signal image;

[0175] A judgment module 903 is used to determine whether there are cosmic rays in the spot mask in the first periodic signal image based on the spot mask distribution, so as to determine whether the first periodic signal image is affected by cosmic rays;

[0176] The superposition module 902 is further used to superimpose the first periodic signal images that are not affected by cosmic rays to obtain a target periodic signal image for the object to be detected.

[0177] Optionally, the judging module 903 is specifically configured to:

[0178] Determining the light spot type corresponding to each light spot mask in the first periodic signal image;

[0179] For the spot mask in the first periodic signal image, determine whether there are cosmic rays in the spot mask according to a detection method corresponding to the spot type;

[0180] If cosmic rays exist in the spot mask, it is determined that the first period signal image is affected by cosmic rays.

[0181] Optionally, the judging module 903 is specifically configured to:

[0182] For the spot mask, if the proportion of the number of non-zero pixels in the spot mask is greater than or equal to the preset duty cycle, the spot type of the spot mask is determined to be the first type; if the proportion of the number of non-zero pixels in the spot mask is less than the preset duty cycle, the spot type of the spot mask is determined to be the second type.

[0183] Optionally, the judging module 903 is specifically configured to:

[0184] For a spot mask of a first type, generating an annular mask of the spot mask;

[0185] For a connected region in the annular mask, if the connected region satisfies a first set condition, it is determined that cosmic rays exist in the spot mask.

[0186] Optionally, the first setting condition is that the number of non-zero pixels in the connected area is greater than a first threshold and the distance between the connected area and the center of the spot mask is less than a second threshold.

[0187] Optionally, the judging module 903 is specifically configured to:

[0188] For the spot mask of the second type, generating a circular mask of the spot mask;

[0189] For the connected area in the circular mask, if the connected area satisfies a second set condition, it is determined that cosmic rays exist in the spot mask.

[0190] Optionally, the judging module 903 is specifically configured to:

[0191] Calculating the perimeter area ratio of the connected region;

[0192] If the ratio of the number of non-zero pixels in the connected region to the perimeter area ratio is greater than a third threshold or less than a fourth threshold, it is determined that cosmic rays exist in the spot mask; and the third threshold is greater than the fourth threshold.

[0193] Optionally, the superposition module 902 is specifically used for:

[0194] generating a second logarithmic image of the second periodic signal image;

[0195] According to the period information of the object to be measured, the center position and the spot radius of each period unit are determined in the second logarithmic image to obtain the spot mask distribution of each period unit;

[0196] Determining whether cosmic rays exist in the spot mask in the first period signal image includes:

[0197] generating a first logarithmic image of the first periodic signal image;

[0198] Based on the position information of the spot mask of each periodic unit in the second logarithmic image, it is determined whether there is a cosmic ray in the spot mask of each periodic unit in the first logarithmic image.

[0199] Based on the same technical concept, the embodiment of the present application provides a computer device, which may be a terminal or a server, such as Fig.10 As shown, it includes at least one processor 1001 and a memory 1002 connected to the at least one processor. The specific connection medium between the processor 1001 and the memory 1002 is not limited in the embodiment of the present application. Fig.10 For example, the processor 1001 and the memory 1002 are connected via a bus. The bus can be divided into an address bus, a data bus, a control bus, and the like.

[0200] In an embodiment of the present application, the memory 1002 stores instructions that can be executed by at least one processor 1001. The at least one processor 1001 can execute the steps included in the above-mentioned cosmic ray removal method by executing the instructions stored in the memory 1002.

[0201] Among them, the processor 1001 is the control center of the computer device, and can use various interfaces and lines to connect various parts of the computer device, by running or executing instructions stored in the memory 1002 and calling data stored in the memory 1002. Optionally, the processor 1001 may include one or more processing units, and the processor 1001 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 1001. In some embodiments, the processor 1001 and the memory 1002 may be implemented on the same chip, and in some embodiments, they may also be implemented separately on independent chips.

[0202] Processor 1001 can be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit (ASIC), a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware processor to be executed, or can be executed by a combination of hardware and software modules in the processor.

[0203] The memory 1002 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 1002 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (Random Access Memory, RAM), a static random access memory (Static Random Access Memory, SRAM), a programmable read-only memory (Programmable Read Only Memory, PROM), a read-only memory (Read Only Memory, ROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic memory, a disk, an optical disk, etc. The memory 1002 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 1002 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.

[0204] Based on the same inventive concept, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program executable by a computer device. When the program runs on the computer device, the computer device executes the steps of the above-mentioned cosmic ray removal method.

[0205] Based on the same inventive concept, an embodiment of the present application provides a computer program product, characterized in that the computer program product includes a computer program stored on a computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer device, the computer device executes the steps of the above-mentioned cosmic ray removal method.

[0206] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0207] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0208] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0209] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0210] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A method for removing cosmic rays, characterized in that: include: Perform multiple short exposures on the object to be measured to obtain multiple first periodic signal images, where the first periodic signal images include multiple periodic units; Performing superposition processing on a plurality of first periodic signal images to obtain a second periodic signal image; generating a second logarithmic image of the second periodic signal image; According to the period information of the object to be measured, the center position and the spot radius of each period unit are determined in the second logarithmic image to obtain the spot mask distribution of each period unit; Based on the spot mask distribution, generating a first logarithmic image of the first periodic signal image; Based on the position information of the spot mask of each periodic unit in the second logarithmic image, determining whether the spot mask of each periodic unit has cosmic rays in the first logarithmic image, thereby determining whether the first periodic signal image is affected by cosmic rays; The first periodic signal images not affected by cosmic rays are superimposed to obtain a target periodic signal image for the object to be measured.

2. The method according to claim 1, characterized in that The determining whether the first periodic signal image is affected by cosmic rays comprises: Determining the light spot type corresponding to each light spot mask in the first periodic signal image; For the spot mask in the first periodic signal image, determine whether there are cosmic rays in the spot mask according to a detection method corresponding to the spot type; If cosmic rays exist in the spot mask, it is determined that the first period signal image is affected by cosmic rays.

3. The method according to claim 2, characterized in that The step of determining the light spot type corresponding to each light spot mask in the first periodic signal image includes: For the spot mask, if the proportion of the number of non-zero pixels in the spot mask is greater than or equal to the preset duty cycle, the spot type of the spot mask is determined to be the first type; if the proportion of the number of non-zero pixels in the spot mask is less than the preset duty cycle, the spot type of the spot mask is determined to be the second type.

4. The method according to claim 3, characterized in that Determining whether cosmic rays exist in the light spot mask according to the detection method corresponding to the light spot type includes: For a spot mask of a first type, generating an annular mask of the spot mask; For a connected region in the annular mask, if the connected region satisfies a first set condition, it is determined that cosmic rays exist in the spot mask.

5. The method according to claim 4, characterized in that The first setting condition is that the number of non-zero pixels in the connected area is greater than a first threshold and the distance between the connected area and the center of the spot mask is less than a second threshold.

6. The method according to claim 3, characterized in that Determining whether cosmic rays exist in the light spot mask according to the detection method corresponding to the light spot type includes: For the spot mask of the second type, generating a circular mask of the spot mask; For the connected area in the circular mask, if the connected area satisfies a second set condition, it is determined that cosmic rays exist in the spot mask.

7. The method according to claim 6, characterized in that If the connected area satisfies a second set condition, determining that cosmic rays exist in the spot mask includes: Calculating the perimeter area ratio of the connected region; If the ratio of the number of non-zero pixels in the connected region to the perimeter area ratio is greater than a third threshold or less than a fourth threshold, it is determined that cosmic rays exist in the spot mask; and the third threshold is greater than the fourth threshold.

8. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any one of the methods of claims 1 to 7 when executing the program.

9. A computer-readable storage medium, characterized in that: It stores a computer program executable by a computer device. When the program is run on the computer device, the computer device executes the steps of any method described in claims 1 to 7.

Citation Information

Patent Citations

  • Method for removing cosmic rays in charge-coupled device (CCD) astronomic image

    CN102881003A

  • Method for removing cosmic rays in multi-exposure image superposition

    CN116029917A